Writing code for fluxamasynth in 1.03 arduino

Hi

I am working on a project with fluxamasynth, I have books on c++ and arduino.
some ression i do not have the right librarys for this code.
When I try to compile my code it says, "can not find Wprogram.h" and "byte not declared".

I am trying code like this to fix it.

#include <Fluxamasynth.h>
#include <NewSoftSerial.h>
#include <PgmChange.h>

#include <fluxamasynth_nss.h>
#include <newsoftserial.h>

#if (ARDUINO >= 100)
#include <Arduino.h>
#else
#include <WProgram.h>
#endif


Fluxamasynth synth;

#define byte uint8_t 

#define c3 48          // define our notes to their midi values
#define e3 52
#define g3 55
#define c4 60

void setup()
{
  Serial.begin(9600);
  synth.setMasterVolume(100);
}

void loop()
{
  byte i=0,n=0,z=0;

  for (n=0;n<=1;n++)
  {
    for(i=0;i<=127;i++)
    {
      synth.programChange(n*127,0, i);

      Serial.print("Bank: ");
      Serial.print(n,DEC);
      Serial.print(" Sound: ");
      Serial.println(i,DEC);

      z=random(0,12);

      synth.noteOn(0, c3+z, 107);
      delay(100);
      synth.noteOn(0, e3+z, 107);
      delay(100);
      synth.noteOn(0, g3+z, 107);
      delay(100);
      synth.noteOn(0, c4+z, 107);

      delay(200);
      synth.noteOff(0, c3+z);
      synth.noteOff(0, e3+z);
      synth.noteOff(0, g3+z);
      synth.noteOff(0, c4+z);
      delay(200);
    }
  }
}

Do I need Wprogram.h at all?
I used the code

#if (ARDUINO >= 100)
#include <Arduino.h>
#else
#include <WProgram.h>
#endif

Do I need Wprogram.h at all?

That depends on which version of the IDE you are using.

It came with arduino 1.0.3

Where do I get a ide that will work?

Once arduino released 1.0 Wprogram.h was renamed as arduino.h.

I am trying code like this to fix it.

I'm going to guess that the problem isn't your sketch, but one of the libraries has not been updated for 1.0+ use. If you posted the real error messages, we could probably help.

c:\arduino\arduino-1.0.3\libraries\Fluxamasynth/NewSoftSerial.h:7
0: error: conflicting return type specified for 'virual void
NewSoftSerial:write(uint8_t)'
C:\arduino\arduino-1.0.3\hardware\arduino\cores\arduino/Print.h:4
8: error: overriding 'virual size_t Print::wite(uint8_t'
in file included from newtest2.ino:1:
C:\arduino\arduino-1.0.3\libraries\Fluxamasynth\Fluxamasynth.h:32
: error: 'byte' does not name a type

NewSoftSerial is not appropriate for use with 1.0+. Change that to SoftwareSerial, instead.

Where did you get the fluxowhatever library?

#include <SoftwareSerial.h>

#include <Fluxamasynth.h>

#include <PgmChange.h>

#include <fluxamasynth_nss.h>


#if (ARDUINO >= 100)
#include <Arduino.h>
#else
#include <WProgram.h>
#endif


Fluxamasynth synth;

#define byte uint8_t

C:\arduino\arduino-1.0.3\libraries\Fluxamasynth/Fluxamasynth.h:21
:22: error: WProgram.h: No such file or directory
in file included from
C:\arduino\arduino-1.0.3\libraries\Fluxamasynth/Fluxamasynth.h:22
,

conflicting return type specifed for 'virtual void
NewSoftSerial::write(uint8_t)'

I got the Fluxamasynth libraries from
http://wiki.moderndevice.com/pmwiki.php?n=MD.ListMethods
i couldn't get the libraries from github, no download link just printed.

Please help! =( =( =( =( =( =(

i couldn't get the libraries from github, no download link just printed.

I could. I don't like how they "upgraded" to 1.0+, but the latest version does compile on 1.0.1, at least.

Can you send me an link to the latest versions? $)

Can you send me an link to the latest versions?

You posted it, earlier. Scroll down on that page until you see Clone in Windows followed by ZIP. Pick ZIP.

Problem solved, it compiled :slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile:
And uploaded!!! :slight_smile:
Thank you Paul! I feel so dumb. :stuck_out_tongue:
Hey does anyone have code for fluxamasynth to make it an instrument? I need to know where to start. :grin: