marcel-licence / ml_synth_basic_example

Arduino polyphonic synthesizer project (not a Moog) for ESP32 - STM32 - Teensy and more
GNU General Public License v3.0
31 stars 8 forks source link

CC midi messages ? #1

Open Aggebitter opened 1 year ago

Aggebitter commented 1 year ago

I have tweaked your code a bit to run on my TTGO T9 and I'm using a Novation Launchkey MINI as keyboard and controller. When I look into your midi mapping _" zconf.ino " I cant find any possible mapping to Control Change (CC) or Program Change (PC) messages. Could you provide an example on how to do that ?

when debugging MIDI on the ESP I can se that the messages are handled ControlChange(rx): CH: 8 | number: 21, value: 61

Thanks for an awesome synth ( it is going to be my first euro rack module )

// David

marcel-licence commented 1 year ago

Hi David,

I've added a prototype to the ml_basic_synth_example. Please feel free to test it. The callback handler should be added to z_config.ino. I've added a comment at the place where the function should be placed. Hope this helps.

Aggebitter commented 1 year ago

Trying to get the controls (rotary) working I noticed a bug. I'm at the moment using MIDI BLE My controller ( Launchkey mini) uses default MIDI channel 1 for notes and CC messages it also uses MIDI channel 10 for the pads (notes). Using MIDIberry to monitor and enable use of MIDE BLE on Windows confirms the output from my Launchpad.

The debug output from the ESP32 gives me: (Serial Montor MIDIberry monitor <-- "Function used")

ControlChange(rx): CH: 0 | number: 21, value: 75 ControlChange, Ch: 1, Controller: 21, value 75 <-- "Rotary 1" NoteOn(rx): CH: 0 | 48, 52 NoteON, Ch: 1, Note 48, Velocity 52 <-- "Key C On" NoteOff(rx): CH: 0 | 48 NoteOff, Ch: 1, Note 48, Velocity 0 <-- "Key C Off" NoteOn(rx): CH: 9 | 40, 107 NoteON, Ch: 10, Note 40, Velocity 107 <--"Pad 1 On" NoteOff(rx): CH: 9 | 40 NoteOff, Ch: 10, Note 40, Velocity 0 <-- "Pad 1 Off"

Reg // David

marcel-licence commented 1 year ago

Hi @Aggebitter is there any issue left to be fixed?

Aggebitter commented 1 year ago

Got it to work kind of. But this is a very hard way to adapt the code for different MIDI devices. Especially if you aren't a half skilled C programmer. It took a while to get it as you used DEC 0 - 15 for channel number 1 - 16 ;-). Regarding MIDI mapping I would prefer to have a common midi_map.h file for a user to map what ever controller to the right input on the synth by just define it.

A Novation launchkey mini as an example has 8 rotary, 16 pads an 2 octave keyboard as a base mapped all around the place. My sons Novation launchkey 49 has 8 rotary, 9 sliders, pitch, modulation, 16 pads and 4 octave keyboard.

If I could define what to map where in one .h file that would doit for others as well

Thanks for a very interesting project. I thing this still will be a base line for my euro rack build. A lot of digital euro rack modules uses the "bluepill" STM32F103C8T6 or equivalent but the 240MHz power of the ESP32 could do magic