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

Port to Teensy / Arduino #2

Open
raphael303 opened this issue Feb 7, 2020 · 2 comments
Open

Port to Teensy / Arduino #2

raphael303 opened this issue Feb 7, 2020 · 2 comments

Comments

@raphael303
Copy link

Hi Stan
Sorry to write you up like this, but I really didn't find any "proper" way to contact you.
Your MidiLibrary looks very promising to me, for my project, a MidiSequencer based on a Teensy.

Before I commit into testing and trying to understand and adapt your classes I'd be very grateful for your opinion of the usability of your classes for my project. To save your time I ask Yes/No questions with an optional how questions. :)

  1. Do you think it will be portable to teensy / arduino (it's using C++)? If so, how would you estimate the workload for adapting to that?
  2. My Sequencer is supposed to play midi data WHILE editing that data and also record from MidiKeyboard. Do you think that is going to be possible based on your classes? If so, how would you estimate the workload for adapting to that?
  3. Would you in my shoes use your classes to create a midi sequencer on a teensy?

A short description of the sequencer:
in principle step sequencer with 16 buttons and 16 rotaries. Buttons turn notes on/off, rotaries control Volume, Note Number, MidiCC, Pitchbend, Note length, Note position (forwards backwards for "groove". Each note furthermore can be "connected" to the next one, thus creating from 1/16 a 1/8 with the follwing note. The sequencer has 64 or more simultaneous tracks which will be sent over 16 virtual MidiPorts via USB to the computer. The sequencer is not limited to one bar of 16 steps (pattern), but has as many "banks" of 16 steps next to each other, as needed (sequence). Furthermore it will have as many sequences as needed.

In a nutshell.
:)
Thank you for your time and open source anyways. I've learned already a lot looking at your code. Best wishes
Raphael

@5tan
Copy link
Owner

5tan commented Feb 7, 2020

Hi Raphael!

  1. Do you think it will be portable to teensy / arduino (it's using C++)? If so, how would you estimate the workload for adapting to that?

I believe this shouldn't be that much effort, since I am using -pedantic flag to compile it. Also I use types with explicit size (e.g. std::uint8_t instead of unsigned char).

Also you don't need to port everything. Some components are OS specific (e.g. outputs), and some may not be required by your project (asynchronous player? MIDI file?). Just don't include them.

  1. My Sequencer is supposed to play midi data WHILE editing that data and also record from MidiKeyboard. Do you think that is going to be possible based on your classes? If so, how would you estimate the workload for adapting to that?

Yes. Don't use cxxmidi::File as your main container. This is rather for files from disk, so it's not "on-fly editable".

  1. Would you in my shoes use your classes to create a midi sequencer on a teensy?

If you know MIDI protocol well, you don't need any library to achieve goal you have presented.

On the other hand if you use this library, your code might become more readable to others (does it matter?). E.g. instead checking for SysEx messages like this: (msg_buff[0] == 0xf0), you can do: msg.isSysex(), etc.

I have added a lot of "to string converters" in my library. E.g. https://github.com/5tan/cxxmidi/blob/dev/include/cxxmidi/message.hpp#L181
These (probably not required by your project) might be a binary size overhead for small embedded device like yours. But this should be fixable with a few preprocessor directives (I can help with this).

Another thing is that there was no 1.0.0 release of my library yet. This means that things (API) might change, and will change. If you decide to use my project, please checkout dev branch. This is how master will look like very soon.

If you decide to use this library, feel free to open issues if you see any potential improvements or bugs. I would be happy to make this project more usable and embedded-friendly.

Good luck with your project!

@raphael303
Copy link
Author

Thank you very much for your detailed response! I appreciate it!
I learned even more but also see, that I will have to learn a lot more :)

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