twistedelectrons / MEGAfm

This is the Atmega1284 firmware for the MEGAfm synthesizer.
https://www.twistedelectrons.com/megafm
Other
27 stars 3 forks source link

Alternative MIDI note off recognition: note on, velocity=0 #41

Open SpaLox1 opened 2 months ago

SpaLox1 commented 2 months ago

I want to use my Yamaha PSS-A50 as MIDI master keyboard to control the MEGAFM. The problem is that MIDI note off is implemented in a different way. The Yamaha sends a "note on, velocity=0" message for note off.

ps-a50.txt

The MegaFM obviously doesn't support this messages for note=off and gets "stuffed" when all voices are triggered. My other synths, like the Blofeld, don't have this issue and support the "note=on, velocity=0" messages. They can be played with the Yamaha PSS-A50. This behaviour is part of the MIDI standard, according to http://midi.teragonaudio.com/tech/midispec/noteon.htm

So I ask you to support this on the MEGAFM.

beau-seidon commented 2 months ago

The code to handle zero-velocity note_on as note_off is already there.

Line 312 of /src/midi.cpp is an if (velocity) { statement, which does note_on stuff if the velocity is non-zero. If it IS zero, the program falls thru to the } else { handleNoteOff(channel, note); } down on Line 467.

It may need to be tweaked a little, perhaps it needs an explicit check for (velocity != 0) ?

I know Cakewalk also sends note_off messages as (note_on & vel=0), and I have a MIDI keyboard I built and wrote the firmware for so I can change the note output message type.

I will test the latest MEGAfm build in my synth soon and see if I have the same issue.

beau-seidon commented 1 month ago

I just tested my MEGAfm with Cakewalk and my MIDI keyboard, and cannot recreate your issue. It behaves as desired; it responds to (note_on & vel=0) the same way as it does to note_off.

I monitored the messages being passed to the MEGAfm by routing the MIDI signal through loopMIDI into MIDI-OX and then out through my hardware interface to the synth.

All MIDI note output from Cakewalk is Status byte 0x90 (note_on) with Data 2 byte (velocity) of 0x00 specifically for note_off.

My keyboard used to send proper note_off messages, which the monitor showed as Status byte 0x80, then I changed it to send (note_on & vel=0), and tested again. The monitor now displays Status = 0x90, Data2 = 0x00, but I noticed no change in behavior from the synth.

I also tried the different synth modes, poly12, wide6, etc., and fed it different patterns of notes: monophonic legato, fast arps, big fat cluster chords, and so on, but I never could make them stick like you are reporting. It does do some unexpected (but not particularly undesirable) things in unison mode when I hold multiple notes and release one at a time, but that's unrelated to this issue, and not a bug IMO.

Mine handles note on/off messages correctly. Make sure you have the latest firmware release installed. The build I am using is v4.1.

beau-seidon commented 1 month ago

I just noticed that the release on this github repo is not the latest build. The 4.1 firmware can be downloaded from their official download page.