Arduino organ project - compile fail

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

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?

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

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.

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.

No, that fails.
Any other thoughts or ideas?

Thanks again.

const int16_t* const FarfWaves[] PROGMEM = {

seems to compile OK.

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!

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

sparx266:
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.

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

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!

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.

MidiVox_Healer_v2.zip (13.3 KB)

Midi.zip (25.6 KB)

Hi Sparx,

I did as you suggested, and while I got more errors (mostly relating to "unused parameter" I DID get a white text

Sketch uses 10380 bytes (32%) of program storage space. Maximum is 32256 bytes.
Global variables use 642 bytes (31%) of dynamic memory, leaving 1406 bytes for local variables. Maximum is 2048 bytes.

at the end.

However, when I tried "Upload" I got

Invalid library found in C:\Program Files\Arduino\libraries\Midi: C:\Program Files\Arduino\libraries\Midi
Invalid library found in C:\Program Files\Arduino\libraries\Midi: C:\Program Files\Arduino\libraries\Midi

and I don't get any audio.

I tried the ComboOrgan with 1.0.5, 1.0.6 and 1.8.3 with no great success.

I suspect

(a) That these sketches require a Midi controller with controls that the sketch can interpret as a drawbar, and that you can't expect any sound until this happens,

(b) That I've got the wrong libraries, and

(c) That I am actually trying to get things to work that I am not competent to understand.

I really appreciate the help that everybody has offered, but I kind of feel that I am beginning to waste everyone's time; it is not simple to resurrect code that the authors wrote a relatively long time ago, and no longer have an interest in. If they would only reply it would have been great.

For an Arduino dummy like myself, it is probably impossible to get these sketches working, especially as you need either a shield, or a scope to check whether the SCK is toggling. I think I'll have to stick to one-note-at-a-time until I can master enough "C" to go polyphonic.

In addition, I've only got a 1MB connection here which makes surfing a nightmare.

I'll attach the error file in case anyone wants a look. Sorry to be so negative!

Cheers

Jim

Combo_compile_errors.txt (8.76 KB)

Hi All,

I just saw Sparx's mention that "Healer uses a different Midi library than the FortySeven effects one" and my heart sank.

I had a feeling this might be the case, because other sketches I have that use "Midi.h" , were working until I changed to the 47 library. Then they threw up (errors).

Isn't this a bit daft?

I don't have enough understanding to write these sophisticated audio sketches, but I do know daft when I see it.

I couldn't have different versions of libraries side-by-side on my PC with the SAME FILE NAME - I'd get lost! And you can't have more than one, otherwise the compiler gets cross.

As I said before I think I'll have to go and learn Arduino and C++ and write polyphonic organ sketches that don't require a Midi library.

Time for a nice glass of Merlot, I suspect.

Who needs libraries anyway?

Thanks to Sparx for all the effort. I have a horrible feeling that I've picked up something horrible like the "wrong" Midi.h file, or perhaps there's something in this PC which hates libraries.

I have all the Arduino source files and libraries on my C: drive, and all the sketches on a separate hard drive, which I've heard is a fairly normal way to arrange the Arduino world.

Otherwise, I am in the lap of the gods, and it is not a good place to be. I've got all the upper- and lower-case issues out of the way, and there is no spitting back about missing any of the libraries.

Is there an official Midi library that comes with the IDE? I only ask, because the errors, in my head, seem to point to this library as being the weakest link, and I seemed to get directed to a gihub repository for it; who knows what sort of mashing it has had in there?

Well, full marks to Sparx ( ! ) for getting me in possession of a working copy of the Littlebits / Drongowski MidiOrgan. I can now play 5 notes at a time i.e. a full chord on the piano, which is just magic.

I don't know precisely how he achieved it, that's perhaps a story for another day. The Midi library definitely had a hand in it, assuming libraries have hands.

For me it calls the so-called Arduino Libraries into question, because it seems from the Github site that there is more than one "Midi" library, and the one the works is labelled "Development" which to my mind says that it could be changed.

Wouldn't it be better for the sales of Arduino products to control the libraries so that they don't become backwards-incompatible?

Perhaps I'd better retract that question.

But it does seem that other midi-dependent sketches such as Roto and Healer all suffer from the same blight, although I can't prove it. Grumpy Mike wouldn't put up with it!!

If anyone wants, I'll poke out the working file set & attach it in this thread.

What a happy ending to a months futile poking!

I had a look at Roto, which is now toggling my three SPI pins quite nicely. Heck, I'm getting good.

(My shield uses pin 10 for SPI SS per the Atmel datasheet & I altered the SPI PortB instructions to suit:

(were PORTB &= ~(1<<1); PORTB |= (1<<1);
now PORTB &= ~(1<<2); PORTB |= (1<<2); )

Still no audio . . .

Pat-The-Pirate:
Well, full marks to Sparx ( ! ) for getting me in possession of a working copy of the Littlebits / Drongowski MidiOrgan. I can now play 5 notes at a time i.e. a full chord on the piano, which is just magic.

The organ kept stalling so I started grubbling around looking for possible causes.

Well, I found that the code reads A0 but the project doesn't add any hardware to actually set A0. A0 is floating if you follow the project instructions. Not good practice.

If A0 is at zero volts, a Farfisa organ sound is selected. In theory, if you raise A0 above 2.5V, you get a Vox sound. However, there is no sound at A0 >= 2.5V because of some other perhaps code- or UNO-related problem. (The project is geared toward Leonardo).

This caused endless grief for me although I didn't realise it at the time: my unconnected A0 tended to fly above 2.5V when powering up the board, in addition to any static effects, so half the time I wasn't getting any sound, but not for reasons connected with the libraries etc.

Fixed in minutes with a 1K resistor and a SPST switch to 3.3V.

The other thing he doesn't say in the description is that it can only play 5 octaves, which is Ok once you know what's happening, but leads to paranioa if everything else has gone wrong in the meantime.

:frowning: