how to fix this error?

835 views
Skip to first unread message

gracea...@gmail.com

unread,
Dec 22, 2017, 9:44:03 PM12/22/17
to Mozzi-users
Hi! I'm new to arduino and I'm trying to make the synth from this: http://www.instructables.com/id/Using-Mozzi-Library-with-5-potentiometers/

I know I have to relocate folders maybe? and I've tried a bunch of stuff and did a lot of research but can't get anything to work. If anything could help me out I'd greatly appreciate it!

my error message: 

Arduino: 1.8.3 (Mac OS X), Board: "Arduino/Genuino Uno"

WARNING: Category '' in library Mozzi is not valid. Setting to 'Uncategorized'
In file included from /var/folders/d0/j7pjgj7s3x17kpbwh6vvv_br0000gn/T/arduino_modified_sketch_897980/synth.ino:36:0:
/Users/myname/Documents/Arduino/libraries/Mozzi/MozziGuts.h:150:2: warning: #warning "AUDIO_MODE is set to STANDARD_PLUS in mozzi_config.h.  If things sound wrong, check if STANDARD_PLUS is the correct AUDIO_MODE for your sketch." [-Wcpp]
 #warning "AUDIO_MODE is set to STANDARD_PLUS in mozzi_config.h.  If things sound wrong, check if STANDARD_PLUS is the correct AUDIO_MODE for your sketch."
  ^
/var/folders/d0/j7pjgj7s3x17kpbwh6vvv_br0000gn/T/arduino_modified_sketch_897980/synth.ino: In function 'void updateControl()':
synth:117: error: expected ';' before 'int'
   int LDR1_value= mozziAnalogRead(LDR1_PIN); // value is 0-1023
   ^
synth:120: error: 'LDR1_value' was not declared in this scope
   Serial.print(LDR1_value);
                ^
exit status 1
expected ';' before 'int'
Invalid library found in /Users/myname/Documents/Arduino/libraries/Keypad: /Users/myname/Documents/Arduino/libraries/Keypad
Invalid version found: version 2013-07-07-17:51
Invalid library found in /Users/myname/Documents/Arduino/libraries/Keypad: /Users/myname/Documents/Arduino/libraries/Keypad
Invalid version found: version 2013-07-07-17:51

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.



the code im using:


 /* 
  Example using 2 light dependent resistors (LDRs) to change 
  FM synthesis parameters, and a knob for fundamental frequency,
  using Mozzi sonification library.

  Demonstrates analog input, audio and control oscillators, phase modulation
  and smoothing a control signal at audio rate to avoid clicks.
  Also demonstrates AutoMap, which maps unpredictable inputs to a set range.
  
  This example goes with a tutorial on the Mozzi site:
  
  The circuit:
     Audio output on digital pin 9 (on a Uno or similar), or 
     check the README or http://sensorium.github.com/Mozzi/

     Potentiometer connected to analog pin 0.
       Center pin of the potentiometer goes to the analog pin.
       Side pins of the potentiometer go to +5V and ground
  
     Light dependent resistor (LDR) and 5.1k resistor on analog pin 1:
       LDR from analog pin to +5V
       5.1k resistor from analog pin to ground
     
     Light dependent resistor (LDR) and 5.1k resistor on analog pin 2:
       LDR from analog pin to +5V
       5.1k resistor from analog pin to ground
  
  Mozzi help/discussion/announcements:

  Tim Barrass 2013.
  This example code is in the public domain.
*/

#include <MozziGuts.h>
#include <Oscil.h> // oscillator 
#include <tables/cos2048_int8.h> // table for Oscils to play
#include <Smooth.h>
#include <AutoMap.h> // maps unpredictable inputs to a range
 
// int freqVal;
 
// desired carrier frequency max and min, for AutoMap
const int MIN_CARRIER_FREQ = 22;
const int MAX_CARRIER_FREQ = 440;

const int MIN = 1;
const int MAX = 10;

const int MIN_2 = 1;
const int MAX_2 = 15;

// desired intensity max and min, for AutoMap, note they're inverted for reverse dynamics
const int MIN_INTENSITY = 700;
const int MAX_INTENSITY = 10;

// desired mod speed max and min, for AutoMap, note they're inverted for reverse dynamics
const int MIN_MOD_SPEED = 10000;
const int MAX_MOD_SPEED = 1;

AutoMap kMapCarrierFreq(0,1023,MIN_CARRIER_FREQ,MAX_CARRIER_FREQ);
AutoMap kMapIntensity(0,1023,MIN_INTENSITY,MAX_INTENSITY);
AutoMap kMapModSpeed(0,1023,MIN_MOD_SPEED,MAX_MOD_SPEED);
AutoMap mapThis(0,1023,MIN,MAX);
AutoMap mapThisToo(0,1023,MIN_2,MAX_2);

const int KNOB_PIN = 0; // set the input for the knob to analog pin 0
const int LDR1_PIN=1; // set the analog input for fm_intensity to pin 1
const int LDR2_PIN=2; // set the analog input for mod rate to pin 2
const int LDR3_PIN=4;
const int LDR4_PIN=3;

Oscil<COS2048_NUM_CELLS, AUDIO_RATE> aCarrier(COS2048_DATA);
Oscil<COS2048_NUM_CELLS, AUDIO_RATE> aModulator(COS2048_DATA);
Oscil<COS2048_NUM_CELLS, CONTROL_RATE> kIntensityMod(COS2048_DATA);

int mod_ratio = 5; // brightness (harmonics)
long fm_intensity; // carries control info from updateControl to updateAudio

// smoothing for intensity to remove clicks on transitions
float smoothness = 0.95f;
Smooth <long> aSmoothIntensity(smoothness);


void setup(){
  Serial.begin(115200); // set up the Serial output so we can look at the light level
  startMozzi(); // :))
}


void updateControl(){
  
//  freqVal = map(LDR3_PIN, 0, 1023, 1, 100);
  
   int freqVal = mozziAnalogRead(LDR3_PIN); // value is 0-1023
   int FRQ = mapThis(freqVal);
   
   int knob2 = mozziAnalogRead(LDR4_PIN); // value is 0-1023
   int knob2Val = mapThis(knob2);
  
  // read the knob
  int knob_value = mozziAnalogRead(KNOB_PIN); // value is 0-1023
  
  // map the knob to carrier frequency
  int carrier_freq = kMapCarrierFreq(knob_value);
  
  //calculate the modulation frequency to stay in ratio
  int mod_freq = carrier_freq * mod_ratio * FRQ;
  
  // set the FM oscillator frequencies
  aCarrier.setFreq(carrier_freq); 
  aModulator.setFreq(mod_freq);
  1
  
  // read the light dependent resistor on the width Analog input pin
  int LDR1_value= mozziAnalogRead(LDR1_PIN); // value is 0-1023
  // print the value to the Serial monitor for debugging
  Serial.print("LDR1 = "); 
  Serial.print(LDR1_value);
  Serial.print("\t"); // prints a tab

  int LDR1_calibrated = kMapIntensity(LDR1_value);
  Serial.print("LDR1_calibrated = ");
  Serial.print(LDR1_calibrated);
  Serial.print("\t"); // prints a tab
  
 // calculate the fm_intensity
  fm_intensity = ((long)LDR1_calibrated * knob2Val * (kIntensityMod.next()+128))>>8; // shift back to range after 8 bit multiply
  Serial.print("fm_intensity = ");
  Serial.print(fm_intensity);
  Serial.print("\t"); // prints a tab
  
  // read the light dependent resistor on the speed Analog input pin
  int LDR2_value= mozziAnalogRead(LDR2_PIN); // value is 0-1023
  Serial.print("LDR2 = "); 
  Serial.print(LDR2_value);
  Serial.print("\t"); // prints a tab
  
  // use a float here for low frequencies
  float mod_speed = (float)kMapModSpeed(LDR2_value)/1000;
  Serial.print("   mod_speed = ");
  Serial.print(mod_speed);
  kIntensityMod.setFreq(mod_speed);
  
  Serial.println(); // finally, print a carraige return for the next line of debugging info
}


int updateAudio(){
  long modulation = aSmoothIntensity.next(fm_intensity) * aModulator.next();
  return aCarrier.phMod(modulation);
}


void loop(){
  audioHook();
}



Tim Barrass

unread,
Dec 26, 2017, 5:33:05 PM12/26/17
to 'Ian C.' via Mozzi-users
Hi Grace,
there is a stray "1" on a line, which is stopping the sketch from compiling:

it's here:

  // set the FM oscillator frequencies
  aCarrier.setFreq(carrier_freq); 
  aModulator.setFreq(mod_freq);
  1




On 23 Dec 2017, at 11:44 am, gracea...@gmail.com wrote:

LDR1_value

gracea...@gmail.com

unread,
Dec 29, 2017, 12:40:18 AM12/29/17
to Mozzi-users
thanks so much for the help! I'm still getting this error :( :


WARNING: Category '' in library Mozzi is not valid. Setting to 'Uncategorized'
In file included from /var/folders/d0/j7pjgj7s3x17kpbwh6vvv_br0000gn/T/arduino_modified_sketch_759563/isthisthesynth.ino:36:0:
/Users/myname/Documents/Arduino/libraries/Mozzi/MozziGuts.h:150:2: warning: #warning "AUDIO_MODE is set to STANDARD_PLUS in mozzi_config.h.  If things sound wrong, check if STANDARD_PLUS is the correct AUDIO_MODE for your sketch." [-Wcpp]
 #warning "AUDIO_MODE is set to STANDARD_PLUS in mozzi_config.h.  If things sound wrong, check if STANDARD_PLUS is the correct AUDIO_MODE for your sketch."
  ^
Sketch uses 8698 bytes (26%) of program storage space. Maximum is 32256 bytes.
Global variables use 968 bytes (47%) of dynamic memory, leaving 1080 bytes for local variables. Maximum is 2048 bytes.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
Invalid library found in /Users/myname/Documents/Arduino/libraries/Keypad: /Users/myname/Documents/Arduino/libraries/Keypad
Invalid version found: version 2013-07-07-17:51
Invalid library found in /Users/myname/Documents/Arduino/libraries/Keypad: /Users/myname/Documents/Arduino/libraries/Keypad
Invalid version found: version 2013-07-07-17:51

Tim Barrass

unread,
Dec 29, 2017, 12:53:09 AM12/29/17
to mozzi...@googlegroups.com
Are you able to upload a standard Arduino sketch, like "Blink"?  It looks like the sort of thing that sometimes works after re-starting your computer...

--
You received this message because you are subscribed to the Google Groups "Mozzi-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mozzi-users...@googlegroups.com.
To post to this group, send email to mozzi...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/mozzi-users/dd1fe87a-8759-4dd1-9a93-3a8f9a7616fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

gracea...@gmail.com

unread,
Jan 1, 2018, 6:18:34 PM1/1/18
to Mozzi-users
I reinstalled Arduino and Mozzi as well as restarting my computer. With the synth code I get this warning now:

WARNING: Category '' in library Mozzi is not valid. Setting to 'Uncategorized'
In file included from /Users/jenniferhoran/Documents/Arduino/libraries/Mozzi/examples/03.Sensors/Knob_LightLevel_x2_FMsynth/Knob_LightLevel_x2_FMsynth.ino:37:0:
/Users/jenniferhoran/Documents/Arduino/libraries/Mozzi/MozziGuts.h:150:2: warning: #warning "AUDIO_MODE is set to STANDARD_PLUS in mozzi_config.h.  If things sound wrong, check if STANDARD_PLUS is the correct AUDIO_MODE for your sketch." [-Wcpp]
 #warning "AUDIO_MODE is set to STANDARD_PLUS in mozzi_config.h.  If things sound wrong, check if STANDARD_PLUS is the correct AUDIO_MODE for your sketch."
  ^
Sketch uses 8626 bytes (26%) of program storage space. Maximum is 32256 bytes.
Global variables use 948 bytes (46%) of dynamic memory, leaving 1100 bytes for local variables. Maximum is 2048 bytes.
Invalid version found: version 2013-07-07-17:51
Invalid version found: version 2013-07-07-17:51

and when I upload blink I just get this:

WARNING: Category '' in library Mozzi is not valid. Setting to 'Uncategorized'
Sketch uses 928 bytes (2%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
Invalid version found: version 2013-07-07-17:51
Invalid version found: version 2013-07-07-17:51

Not sure what exactly the problem is.

Tim Barrass

unread,
Jan 2, 2018, 6:06:57 AM1/2/18
to mozzi...@googlegroups.com
Hi,

Not sure what exactly the problem is.

Me neither...

Which versions of Mozzi and Arduino are you using?  I just tried Blink with a fresh Arduino 1.8.5 and the latest Mozzi from github (the zip under "clone or download" here: https://github.com/sensorium/Mozzi), on osx.  I haven't been able to duplicate those messages...

You could try deleting Mozzi/extras/NEWS.txt, which contains the line "version 2013-07-07-17:51".  It's weird that the library category is not being recognised (though it won't stop anything working)... you could check Mozzi/ library.properties for this line: 
category=Signal Input/Output

puzzling...

Reply all
Reply to author
Forward
0 new messages