Paia Fatman/Fatduino code question/expected class-name before '{' token

Hello –

I am making the Paia Fatman/Fatduino that is described on Nibblernibbles’ site: Nibbler-nibbles

I have been trying to compile the Nibblernibbles code, and I keep getting the error:
error: expected class-name before ‘{’ token

for the following line:

class MyMidi : public Midi {

I understand this to mean that the compiler is not recognizing the library Midi.h that I have installed in Arduino/libraries/MIDI/MIDI.h, which this derived class MyMidi is inheriting from. However, other things I have done suggest that the compiler recognizes MIDI.h, located in location I mentioned.

I’m really confused about how to fix this error. I have included the full code in an attachment to this post. I have a suspicion that the error is in regards to how my files are located, or perhaps some type of case-sensitive file name error. In my libraries, I have MIDI.h, even though the code includes Midi.h; but I have tried including both variants and it doesn’t solve the problem.

Also, in MIDI.h, the base class is:

class MidiInterface {

So I have tried re-writing the above to:

class MyMidi : public MidiInterface {

so that it inherits from MidiInterface, but this doesn’t work either.

I am doing my work on a 2009 Mac Pro, if perhaps this is relevant.

Thanks for any suggestions.

Fatman3_9.pde (19.3 KB)

Class definitions belong in their own files. Class implementations belong in their own files.

You are wasting your time trying to define a class in a sketch.

xiphocoleon:
Hello –

I am making the Paia Fatman/Fatduino that is described on Nibblernibbles’ site: Nibbler-nibbles

I have been trying to compile the Nibblernibbles code, and I keep getting the error:
error: expected class-name before ‘{’ token

Hello,

did you solve that problem? I run into the same with fatman3_25.pde. Also the IDE complains about a missing “MIDI.hpp”, although the file is present in the sketch Directory…

Boerge

Also the IDE complains about a missing "MIDI.hpp", although the file is present in the sketch Directory...

The latest version of the IDE is restricted in what kinds of files it can include. hpp is NOT one of the types.

PaulS: The latest version of the IDE is restricted in what kinds of files it can include. hpp is NOT one of the types.

Hi Paul,

thank you for your answer. I think I will look for an older IDE, which can deal with the code...

oerge

boerge: Hi Paul,

thank you for your answer. I think I will look for an older IDE, which can deal with the code...

oerge

Or rename the file. Whichever is easier.

PaulS:
Or rename the file. Whichever is easier.

Rename to .h? Ok, It’s worth a try, as older versions (tried 0013, 0015 and 0022) did not compile either. I’m not a programmer, rather into synth diy. Sad, that the original author doesn’t reply on emails :frowning:

I ended up writing code with libraries and functions from here: https://github.com/FortySevenEffects/arduino_midi_library and this worked well for me

xiphocoleon: I ended up writing code with libraries and functions from here: https://github.com/FortySevenEffects/arduino_midi_library and this worked well for me

Hey there,

i am encountering the exact same problem compiling the code. Would you mind sharing your solution regarding the use of the FortySevenEffects MIDI library?

Thanks a lot! merlin