Go Down

Topic: Arduino organ project - compile fail (Read 3586 times) previous topic - next topic

Pat-The-Pirate

Feb 17, 2017, 08:58 pm Last Edit: Feb 17, 2017, 09:13 pm by Pat-The-Pirate
Hi All,

Tonights search brought up:

http://littlebits.cc/projects/get-your-bach-on-with-the-arduino-midi-organ

http://sandsoftwaresound.net/source/arduino-project-source/combo-organ/midivox-organ-comboorgan-ino/

both by Paul Drongowski.

I get compile errors even though the compile SEEMS to have found all the library files called up on my PC.

Code: [Select]
In file included from E:\My Documents\Arduino\MidiOrgan\MidiOrgan.ino:110:0:

Farf.h:25: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM Farf_C3[] = {

 ^

Farf.h:70: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM Farf_Db3[] = {

 ^

Farf.h:112: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM Farf_D3[] = {

 ^

Farf.h:152: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM Farf_Eb3[] = {

 ^

Farf.h:190: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM Farf_E3[] = {

 ^

Farf.h:226: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM Farf_F3[] = {

 ^

Farf.h:260: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM Farf_Gb3[] = {

 ^

Farf.h:292: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM Farf_G3[] = {

 ^

Farf.h:323: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM Farf_Ab3[] = {

 ^

Farf.h:352: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM Farf_A3[] = {

 ^

Farf.h:379: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM Farf_Bb3[] = {

 ^

Farf.h:405: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM Farf_B3[] = {

 ^

In file included from E:\My Documents\Arduino\MidiOrgan\MidiOrgan.ino:112:0:

Vox.h:24: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM Vox_C3[] = {

 ^

Vox.h:68: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM Vox_Db3[] = {

 ^

Vox.h:110: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM Vox_D3[] = {

 ^

Vox.h:150: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM Vox_Eb3[] = {

 ^

Vox.h:188: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM Vox_E3[] = {

 ^

Vox.h:224: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM Vox_F3[] = {

 ^

Vox.h:258: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM Vox_Gb3[] = {

 ^

Vox.h:290: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM Vox_G3[] = {

 ^

Vox.h:321: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM Vox_Ab3[] = {

 ^

Vox.h:350: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM Vox_A3[] = {

 ^

Vox.h:377: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM Vox_Bb3[] = {

 ^

Vox.h:403: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM Vox_B3[] = {

 ^

In file included from E:\My Documents\Arduino\MidiOrgan\MidiOrgan.ino:114:0:

Tables.h:27: error: 'prog_uchar' does not name a type

 prog_uchar PROGMEM MidiNotes[] = {

 ^

Tables.h:71: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM FarfNumOfSamples[] = {

 ^

Tables.h:87: error: 'prog_int16_t' does not name a type

 PROGMEM const prog_int16_t* FarfWaves[] = {

               ^

Tables.h:106: error: 'prog_int16_t' does not name a type

 prog_int16_t PROGMEM VoxNumOfSamples[] = {

 ^

Tables.h:122: error: 'prog_int16_t' does not name a type

 PROGMEM const prog_int16_t* VoxWaves[] = {

               ^

MidiOrgan:288: error: expected unqualified-id before 'if'

   if (genNote[I]) { \

   ^

MidiOrgan:318: error: expected declaration before end of line

 #pragma GCC optimize ("-O2")

                             ^

Multiple libraries were found for "MIDI.h"
 Used: E:\My Documents\Arduino\libraries\MIDI
 Not used: C:\Program Files\Arduino\libraries\Midi
exit status 1
'prog_int16_t' does not name a type


I'm obviously missing something here but do not have the wisdom, intuition or ability in C++ programming to understand what is not happening.

Neither website offers much in after-sales service. Mind you, I didn't have to pay, either.

Can anyone help?

Cheers!

Jim

PS I will collect all the libraries and attach them if necessary; I'm hoping that someone will point out the obvious which is currently not mine to discern.

jaholmes

Old code, methinks.  Those 'prog_' types are all deprecated.  You should be able to replace 'prog_int16_t' with 'const int16_t' and be good to go.  Use of the 'prog_' type was redundant here to begin with, since PROGMEM was also given.

sparx266

Or use an older IDE.
The sandandsoftware one compiles on Arduino IDE V1.0.5 r2.


sparx266

And I posted the above without actually testing it or thinking properly about what I will need to do in the near future.

Took jaholmes advice and changed all prog_inst to const_inst but its still failing to compile in IDE 1.6.13 with a problem in Tables.h, same error.

PROGMEM const const_int16_t* VoxWaves[] = {

Anyone got it to compile and test it yet?

jaholmes

Is there such a thing as const_int16_t?  I was suggesting 'const int16_t' (with a space).

sparx266

Thank you, that helped a lot, but now:

PROGMEM const int16_t* FarfWaves[] = {


variable 'FarfWaves' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

Your help has been great so far.

jaholmes

Hmmm.  That seems like that should work.  Maybe PROGMEM needs to go after const?  I usually stick it after everything else (after the []), but the docs make it seem non-picky.

sparx266

No, that fails.
Any other thoughts or ideas?

Thanks again.

sparx266

const int16_t* const FarfWaves[] PROGMEM = {

seems to compile OK.

jaholmes

Ah!  I'd missed the * in this one. I was still seeing the original issue.  What you've got there looks like goodness.  Glad it works now!

Pat-The-Pirate

Hi folks,

Back at the ranch again. Thanks for all the interest & suggestions.

Looking at the comments about "old" software, the website:

http://littlebits.cc/projects/get-your-bach-on-with-the-arduino-midi-organ#comment_11171

says it published the sketch on Feb 13th 2017, and someone called f.j2 commented that the code was great. (I've asked him how he did it). (I'll let the question go for a few hours; the guy might live in Hawaii, or Auckland NZ).

I'll try the suggestion "const int16_t* const FarfWaves[] PROGMEM = {" in the morning (I'm a bit knackered tonight!).

Thanks again all

Jim

Pat-The-Pirate

const int16_t* const FarfWaves[] PROGMEM = {

seems to compile OK.
This has got embarassing.

If I don't reply, you will all (correctly) think I am a rude and ungrateful person. So I have to reply with whatever state I find myself in.

Trouble is, I don't know which code has to be replaced by Sparx's suggestion, or even which file! which is worse.

I found plenty of instances of "const int16_t* const FarfWaves[] PROGMEM = " in Tables.h.

I tried a suggestion in Littlebits that the code was written for a Leonardo, but changing the board in the IDE did not help.

Given that folk said they were already using the code as-is sucessfully, I think I'll try the suggestion of an older IDE version for the moment.

We are talking about a Genuino Dummio here, you know. Next I'll be bleating about not being able to find an older IDE.


Pat-The-Pirate

So, replaced Midi library (again) with 4.2 to be sure (I hope) that I used the "right" one -  no joy, still various compile errors.

Sparx, when you say "const int16_t* const FarfWaves[] PROGMEM = {

seems to compile OK."

are you saying it does compile (and work)?

I seem to be going around in circles!

I think it might be best to wait until he replies to my help request on

http://littlebits.cc/projects/get-your-bach-on-with-the-arduino-midi-organ#comment_11171

(if ever).

Thanks for all the interest & comments

Cheers

Jim

Pat-The-Pirate

Well, I think I've got to the bottom of the problem.

On http://littlebits.cc/projects/get-your-bach-on-with-the-arduino-midi-organ
the guy admits

(a) His blog Arduino sketch no longer compiles after some considerable period. Nothing in the blog to warn the unwary.

(b) He now says it is coded for the Leonardo, despite the fact the the word "UNO" is splashed all over the sketch. ("Leonardo" turns up as a footnote in a comment about 80 lines fown the code).

(c) He says "I tried compiling the code with the board "littleBits w6 Arduino Module (Leonardo)" and got an error in the build process itself, i.e., the tool chain has a bug. I've had problems like this with UNO, too. Board definitions don't always seem to be in sync with the tool chain."

To me, this has all the hallmarks of a disastrously unstable environment. As I've said elsewhere, Atmel ought to take the situation by the scruff of the neck if they want to avoid adverse reaction. It's a fantastic product, but so frustrating when sketches fail to compile, even when the post is only 2 weeks old!!! I am beginning to wonder if I should go back to Zilog . . . .

Having had a good moan, is there any chance that the code could be re-written for an UNO? I see Sparx having some success but don't know what edits he did. The chance of having 5 notes playable is very tantalising!


sparx266

I think there may be some progress.

I have attached a revised Healer program.
Healer uses a different MIDI library than the fortyseven effects one, so this has been attached too.

Remove any other library called MIDI and put this one in the libraries folder.  Restart the IDE and it should pick it up. Load the sketch in and hit compile as per normal.

Jim or anyone want to give this a go in a later IDE and post back?

Jim, have sent you a PM.

Regards.

Go Up