# New Mac, Unable to Use Sound Library!

**URL:** <https://discourse.processing.org/t/new-mac-unable-to-use-sound-library/8695>\
**Category:** Libraries\
**Created:** [February 24, 2019, 7:48pm UTC](https://discourse.processing.org/t/new-mac-unable-to-use-sound-library/8695 "2019-02-24T19:48:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![storchzr](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@storchzr](https://discourse.processing.org/u/storchzr)\
**Post date:** [February 24, 2019, 7:48pm UTC](https://discourse.processing.org/t/new-mac-unable-to-use-sound-library/8695/1 "2019-02-24T19:48:15Z")

</div>

Can anyone help me with this? I have a piece of code that uses input from the mic to create graphics. It worked on my old computer but won’t work on the new mac with touchbar for some reason.

```auto
// Example 20-5: Live Input with Sonia
PImage shape1;
PImage shape2;
PImage shape3;
PImage shape4;
PImage shape5;
PImage shape6;
PImage D;
PImage A1;
PImage A2;
PImage P;
PImage grid;

float shape1Height;
float shape1Width;

float shape2Height;
float shape2Width;

float shape3Height;
float shape3Width;

float shape4Height;
float shape4Width;

float shape5Height;
float shape5Width;

float shape6Height;
float shape6Width;

float DHeight;
float DWidth;

float A1Height;
float A1Width;

float A2Height;
float A2Width;

float PHeight;
float PWidth;

float gridHeight;
float gridWidth;

import processing.sound.*;

AudioIn input;
Amplitude analyzer;

void setup() {
  size(500, 700);
  
  
 
  shape1 = loadImage("shape1.png");
  shape1Height = 300;
  shape1Width = 300;
  
  shape2 = loadImage("shape2.png");
  shape1Height = 30;
  shape1Width = 30;
  
  shape3 = loadImage("shape3.png");
  shape1Height = 80;
  shape1Width = 80;
  
  shape4 = loadImage("shape4.png");
  shape1Height = 100;
  shape1Width = 100;
  
  shape5 = loadImage("shape5.png");
  shape1Height = 150;
  shape1Width = 150;
 
  shape6 = loadImage("shape6.png");
  shape1Height = 30;
  shape1Width = 30;
 
  D = loadImage("D.png");
  DHeight = 15;
  DWidth = 15;
  
  A1 = loadImage("A1.png");
  A1Height = 60;
  A1Width = 60;
  
  A2 = loadImage("A2.png");
  A2Height = 20;
  A2Width = 60;
  
  P = loadImage("P.png");
  PHeight = 200;
  PWidth = 200;
  
  grid = loadImage("grid.png");
  gridHeight = 200;
  gridWidth = 200;
  
  // Start listening to the microphone
  // Create an Audio input and grab the 1st channel
  input = new AudioIn(this, 0);

  // start the Audio Input
  input.start();

  // create a new Amplitude analyzer
  analyzer = new Amplitude(this);

  // Patch the input to an volume analyzer
  analyzer.input(input);
}

void draw() {
  background(255);
 
  // Get the overall volume (between 0 and 1.0)
  float vol = analyzer.analyze();
  fill(127);
  stroke(0);
  
  //Draw grid
  rotate(vol* 5); 
  image(grid, -18, 20, 300 +vol*3000, 300 +vol*3000);
  
  
  //Draw shape1
  image(shape1, 250, -10, 300 +vol*2000, 300 +vol*2000);
  
  //Draw shape3
  image(shape3, 50, 60, 80 +vol*2000, 80 +vol*2000);
  
  //Draw shape4
  image(shape4, 100 , 100, 100 +vol*2000, 100 +vol*2000);
  
  //Draw shape5
  image(shape5, 100, 400, 70 +vol*2000, 70 +vol*2000);
  
  //Draw shape6
  image(shape6, 85, 200, 30 +vol*2000, 30 +vol*2000);
  
  rotate(vol* 5); 
  //Draw shape2
  image(shape2, -70, 450, 300 +vol*2000, 300 +vol*2000);

 
  rotate(vol*10); 
 
  image(D, 270, 220, DHeight+ vol*800, DWidth + vol*800);
  
  image(A1, 290, 240, A1Height+ vol*800, A1Width + vol*800);
  
  image(A2, 190, 310, A2Height+ vol*800, A2Width + vol*800);
  
  image(P, 340, 400, PHeight+ vol*800, PWidth + vol*800);
  
  rotate(vol* -10);
  image(D, 270, 220, DHeight+ vol*2000, DWidth + vol*2000);
 
  rotate(vol* -10);
  image(A1, 290, 240, A1Height+ vol*2000, A1Width + vol*2000);
  
  rotate(vol* -10);
  image(A2, 190, 310, A2Height+ vol*2000, A2Width + vol*2000);
 
  rotate(vol* -10);
  image(P, 340, 400, PHeight+ vol*2000, PWidth + vol*2000);

}

```

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [February 25, 2019, 12:50am UTC](https://discourse.processing.org/t/new-mac-unable-to-use-sound-library/8695/2 "2019-02-25T00:50:02Z")

</div>

pls format your code using

```auto
</>

```

code tag and  
paste your code into it.

> [@storchzr](#):
>
> It worked on my old computer but won’t work on the new mac with touchbar for some reason.

no idea what is a touch bar, but if it is a input device like a mouseWheel you  
test it in a extra 5 line code and show us, if it works with mouse but not with the new device.

if you have a question about the  
processing sound lib  
you pls. test it with a example from the library and report back.
