# Error — Missing operator, semicolon, or ‘}’ near ‘setup’?

**URL:** <https://discourse.processing.org/t/error-missing-operator-semicolon-or-near-setup/39845>\
**Category:** Beginners\
**Tags:** homework\
**Created:** [November 24, 2022, 9:18am UTC](https://discourse.processing.org/t/error-missing-operator-semicolon-or-near-setup/39845 "2022-11-24T09:18:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![vrtx](https://avatars.discourse-cdn.com/v4/letter/v/e99b99/32.png) [@vrtx](https://discourse.processing.org/u/vrtx)\
**Post date:** [November 24, 2022, 9:18am UTC](https://discourse.processing.org/t/error-missing-operator-semicolon-or-near-setup/39845/1 "2022-11-24T09:18:03Z")

</div>

i’ve being days trying to solve this error…  
Erro - Missing operator, semicolon, or ‘}’ near ‘setup’?  
.Any help, please?!

```auto
import ddf.minim.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*;
import ddf.minim.signals.*;
import ddf.minim.spi.*;
import ddf.minim.ugens.*;

import peasy.*;
float a = 8;

PeasyCam cam;

Minim minim;
AudioPlayer player;
player. play;

void setup() {
  size(800, 800, P3D);
  smooth(8);
  cam = new PeasyCam(this, 180);
  cam = setMinimumDistance(50);
  cam = setMaximumDistance(500);
  minim = new Minim(this);
  player = minin.loadFile("bethaPD.mp3");
}

void draw() {

  
  background(0);
  rotateY(.5);
  rotateZ(.5);

  for (int i = 0; i < player.bufferSize () - 1; i++) {

    rotateX(50+player.right, get(i)/100);

    pushMatrix();
    fill(#F20F0F, 100);

    popMatrix();
    strokeWeight(1 + player, right, get(i));

    stroke(0);
    box(10, 10, 55 + player, right, get(i)*200);

    box(55 + player.right, get(i)*50, 10, 10);

    box(10, 55, + player.right.get(i)*50, 10);
  }
}

```

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [November 24, 2022, 9:26am UTC](https://discourse.processing.org/t/error-missing-operator-semicolon-or-near-setup/39845/2 "2022-11-24T09:26:57Z")

</div>

> [@vrtx](#):
>
> `player. play;`

This line should be inside setup after you have initialised player e.g.

```auto
void setup() {
  size(800, 800, P3D);
  smooth(8);
  cam = new PeasyCam(this, 180);
  cam = setMinimumDistance(50);
  cam = setMaximumDistance(500);
  minim = new Minim(this);
  player = minin.loadFile("bethaPD.mp3");
  player. play();
}

```

---

<div class="post-metadata">

**Author:** ![vrtx](https://avatars.discourse-cdn.com/v4/letter/v/e99b99/32.png) [@vrtx](https://discourse.processing.org/u/vrtx)\
**Post date:** [November 24, 2022, 10:49am UTC](https://discourse.processing.org/t/error-missing-operator-semicolon-or-near-setup/39845/3 "2022-11-24T10:49:26Z")

</div>

Hi there, @quark ; tks for help…  
I did the changes but stiil the same:  
setup and draw with red underline:  
“Erro - Missing operator, semicolon, or ‘}’ near ‘setup’?”

```auto
void setup() {
  size(800, 800, P3D);
  smooth(8);
  cam = new PeasyCam(this, 180);
  cam = setMinimumDistance(50);
  cam = setMaximumDistance(500);
  minim = new Minim(this);
  player = minin .loadFile("bethaPD.mp3");
  player.play();
}

void draw() {

  

```

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [November 24, 2022, 10:54am UTC](https://discourse.processing.org/t/error-missing-operator-semicolon-or-near-setup/39845/4 "2022-11-24T10:54:16Z")

</div>

The changes I made worked for me although I got other errors because I don’t have minim or peasy installed. Here is your code with my changes.

```auto
import ddf.minim.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*;
import ddf.minim.signals.*;
import ddf.minim.spi.*;
import ddf.minim.ugens.*;

import peasy.*;
float a = 8;

PeasyCam cam;

Minim minim;
AudioPlayer player;

void setup() {
  size(800, 800, P3D);
  smooth(8);
  cam = new PeasyCam(this, 180);
  cam = setMinimumDistance(50);
  cam = setMaximumDistance(500);
  minim = new Minim(this);
  player = minin.loadFile("bethaPD.mp3");
  player.play();
}

void draw() {

  
  background(0);
  rotateY(.5);
  rotateZ(.5);

  for (int i = 0; i < player.bufferSize () - 1; i++) {

    rotateX(50+player.right, get(i)/100);

    pushMatrix();
    fill(#F20F0F, 100);

    popMatrix();
    strokeWeight(1 + player, right, get(i));

    stroke(0);
    box(10, 10, 55 + player, right, get(i)*200);

    box(55 + player.right, get(i)*50, 10, 10);

    box(10, 55, + player.right.get(i)*50, 10);
  }
}

```

---

<div class="post-metadata">

**Author:** ![mnse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mnse/32/16520_2.png) [@mnse](https://discourse.processing.org/u/mnse)\
**Post date:** [November 24, 2022, 11:14am UTC](https://discourse.processing.org/t/error-missing-operator-semicolon-or-near-setup/39845/5 "2022-11-24T11:14:58Z")

</div>

Hi @vrtx,

Aa a first I would recommend to study the documentation for both …

PeasyCam:

> **[peasycam](https://mrfeinberg.com/peasycam/)**
>
> a library for the programming environment processing

Minim:  
[https://code.compartmental.net/minim/](https://code.compartmental.net/minim/)

… and afterwards check if your code is applied that way the documentation says…

Things to check for …

> [@vrtx](#):
>
> ```auto
> cam = new PeasyCam(this, 180);
> cam = setMinimumDistance(50);
> cam = setMaximumDistance(500);
> 
> ```

> [@vrtx](#):
>
> ```auto
> strokeWeight(1 + player, right, get(i));
> //...
> rotateX(50+player.right, get(i)/100);`
> //...
> box(10, 10, 55 + player, right, get(i)*200);
> 
> box(55 + player.right, get(i)*50, 10, 10);
> 
> ```

Cheers  
— mnse

---

<div class="post-metadata">

**Author:** ![vrtx](https://avatars.discourse-cdn.com/v4/letter/v/e99b99/32.png) [@vrtx](https://discourse.processing.org/u/vrtx)\
**Post date:** [November 24, 2022, 12:24pm UTC](https://discourse.processing.org/t/error-missing-operator-semicolon-or-near-setup/39845/6 "2022-11-24T12:24:28Z")

</div>

@mnse tks… I did so… i read and thats the same as i’ve done. I did tryed change thing from a place to another, the symblos… Nothing… Keep with the same error…  
“Erro - Missing operator, semicolon, or ‘}’ near ‘setup’?”  
Red underline setup and draw.

When i just write “Minim minim” and “AudioPlayer player”… Things get worse…

```auto
import processing.sound.*;

import ddf.minim.*;

import peasy.*;
float a = 8;

PeasyCam cam;

Minim minim;
AudioPlayer player;

void setup() {
  size(800, 800, P3D);
  smooth(8);
  cam = new PeasyCam(this, 180);
  cam . setMinimumDistance(50);
  cam . setMaximumDistance(500);
  minim = new Minim(this);
  player = minin .loadFile("bethaPD.mp3");
  player. play();
}

void draw() {
  
  background(0);
  rotateY(-.5);
  rotateZ(-.5);

  for (int i = 0; i < player.bufferSize () - 1; i++) {

    rotateX(50+player.right, get(i)/100);
  

    pushMatrix();
    fill(#F20F0F,100);

    popMatrix();
    strokeWeight(1 + player, right, get(i));
  
    stroke(0);
    box(10, 10, 55 + player, right, get(i)*200);
    stroke(#570FF5);

    box(55 + player.right, get(i)*50, 10, 10);
//stroke(#4C1CB7);

    box(10, 55, + player.right.get(i)*50, 10);
     }
}

```

---

<div class="post-metadata">

**Author:** ![mnse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mnse/32/16520_2.png) [@mnse](https://discourse.processing.org/u/mnse)\
**Post date:** [November 24, 2022, 1:08pm UTC](https://discourse.processing.org/t/error-missing-operator-semicolon-or-near-setup/39845/7 "2022-11-24T13:08:10Z")

</div>

Hi @vrtx,

commented based on you code

> [@vrtx](#):
>
> ```auto
> import processing.sound.*;
> 
> import ddf.minim.*;
> 
> import peasy.*;
> float a = 8;
> 
> PeasyCam cam;
> 
> Minim minim;
> AudioPlayer player;
> 
> void setup() {
> size(800, 800, P3D);
> smooth(8);
> cam = new PeasyCam(this, 180);
> cam . setMinimumDistance(50);
> cam . setMaximumDistance(500);
> minim = new Minim(this);
> // this is not minin but rather minim
> player = minin .loadFile("bethaPD.mp3");
> player. play();
> }
> 
> void draw() {
> 
> background(0);
> rotateY(-.5);
> rotateZ(-.5);
> 
> for (int i = 0; i < player.bufferSize () - 1; i++) {
> 
> // this should be no comma, rather a dot
> rotateX(50+player.right, get(i)/100);
> 
> pushMatrix();
> fill(#F20F0F, 100);
> 
> popMatrix();
> // this should be no comma, rather a dot
> strokeWeight(1 + player, right, get(i));
> 
> stroke(0);
> // this should be no comma, rather a dot
> box(10, 10, 55 + player, right, get(i)*200);
> stroke(#570FF5);
> 
> // this should be no comma, rather a dot
> box(55 + player.right, get(i)*50, 10, 10);
> //stroke(#4C1CB7);
> 
> // too much parameter
> box(10, 55, + player.right.get(i)*50, 10);
> }
> }
> 
> ```

Cheers  
— mnse

---

<div class="post-metadata">

**Author:** ![vrtx](https://avatars.discourse-cdn.com/v4/letter/v/e99b99/32.png) [@vrtx](https://discourse.processing.org/u/vrtx)\
**Post date:** [November 24, 2022, 5:30pm UTC](https://discourse.processing.org/t/error-missing-operator-semicolon-or-near-setup/39845/8 "2022-11-24T17:30:58Z")

</div>

beatyfull!!! wow!!! LUV U…  
I don’t really know how to thank you for it.  
36hrs to find out, 4 days changing code to get in this. Also the sound i built in Pure Data.  
I will finish it and send it here as a video, with both codes, audio and processing…  
Thanks a LOT!!! 🤩
