arpruss / USBComposite_stm32f1

USB Composite library for STM32F1 (HID, Serial, MIDI and XBox360 controller)
Other
382 stars 76 forks source link

Add midi sysex implementation #35

Closed 203Null closed 4 years ago

203Null commented 4 years ago

Experimental but tested. Ported some code from https://github.com/madias123/Arduino_STM32_MIDI_project

arpruss commented 4 years ago

Does this increase binary sizes for the example sketches that don't use sysex?

203Null commented 4 years ago

Does this increase binary sizes for the example sketches that don't use sysex?

Around 2KB for midiin/ midiout. Same for non-midi.

arpruss commented 4 years ago

That's too much. It would be good if you could find a way of incorporating it so there is no size hit if it's not used.

madias123 commented 4 years ago

Beside 2kB it also uses 256 Byte RAM sysex buffer. It's long ago I played with that (I think this was a super old conversation of mine of the libmaple forum...). I used it successfully importing Waldorf Wavetables in the past. So maybe there is a possibility to archive it or append it as ZIP?

arpruss commented 4 years ago

I think the code should be written in such a way that it doesn't use any memory when it's not used. The problem is with the virtual method, I think. I've had trouble with virtual methods before: they force unused code to get included or something like that.

madias123 commented 4 years ago

I've had trouble with virtual methods before: they force unused code to get included or something like that. Isn't that AVR related only? I've to check this in a free moment.

Edit: Ok, it's all about the vtables, if I'm right.

203Null commented 4 years ago

Maybe just add a macro to enable sysex feature?

arpruss commented 4 years ago

Maybe, but then the users will have to modify the library to use it. It would be better to rework it so the issue doesn't come up.

M0n7y5 commented 4 years ago

What we are waiting for? This is actually something what i need ... Pls merge :)

arpruss commented 4 years ago

I will only merge if it's written so that it uses no additional memory when the sysex functions are not called.

arpruss commented 4 years ago

I might be willing to merge if it uses more memory when midi is linked, as long as it makes no difference for profiles other than midi.

arpruss commented 4 years ago

A different sysex implementation was just merged.