Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to change the maximum sysex message length? #9

Open
levicole opened this issue May 6, 2021 · 5 comments
Open

Is it possible to change the maximum sysex message length? #9

levicole opened this issue May 6, 2021 · 5 comments

Comments

@levicole
Copy link
Contributor

levicole commented May 6, 2021

I 've been experimenting with this library along with the FortySevenEffects library. I was attempting to use an Arduino as a USB -> DIN midi interface so I could send DX7 patches from Dexed to a VolcaFM. It seems as if the SysexMaxSize is not customizable in the same way that it is for say serial midi (snippet below).

I'm OK with C, but when it comes to C++ templates and macros, I get completely lost. It seems like it might be possible and my limited knowledge might be keeping me from seeing it.

Custom settings subclass and instantiation for serial midi:

struct MySettings : public midi::DefaultSerialSettings
{
   static const unsigned SysExMaxSize = 1024; // Accept SysEx messages up to 1024 bytes long.
};

MIDI_CREATE_CUSTOM_INSTANCE(HardwareSerial, Serial1, MIDI_S, MySettings);
@levicole
Copy link
Contributor Author

levicole commented May 6, 2021

I think I might have a solution and will submit a pull request :)

@lathoub
Copy link
Owner

lathoub commented May 6, 2021

Check out https://github.com/FortySevenEffects/arduino_midi_library/wiki/Using-custom-Settings for custom settings (This USB transport layer does not touch the SysEx length, this is set in the underlying lib)

@levicole
Copy link
Contributor Author

levicole commented May 6, 2021

Thanks for the response. I think it just wasn't immediately obvious to me how to handle it (due to my lack of understanding of C++ templates). I actually created a macro that is similar to the MIDI_CREATE_CUSTOM_INSTANCE macro that you linked to. I'll submit a PR for it, it won't hurt my feelings if it's not something you'd like to add, but it was definitely helpful for me. :)

@lathoub
Copy link
Owner

lathoub commented May 9, 2021

Hi @levicole - thanks, looks good. Would you mind adding an example using the custom settings based on the SysExReceive example?

@levicole
Copy link
Contributor Author

@lathoub yes! I should have some time to do this today. Work was fairly busy this week!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants