About playing sequence of notes and multiple threads #412
Replies: 5 comments
-
I'm happy to hear you're enjoying Mido! This is very encouraging for me. :) This is just the kind of thing I had in mind when I made Mido. Early on I used it to make little arpeggiators and live sequencers. I also mapped my sustain pedal to trigger notes which was great fun. To answer your questions: a) The current version of Mido is not thread safe, but you're in luck! I am just about to release a 1.1.15 where this is fixed. (See issue #49.) I hope to get it out tonight, or if not later this week. For now b) You're sending chords the right way. MIDI can only do one note at a time, but if you send them close enough together it will sound like they start at the same time. |
Beta Was this translation helpful? Give feedback.
-
Cool that's good to know - I'll wait for the next release and do more experimentation using threads then! |
Beta Was this translation helpful? Give feedback.
-
Sounds good! I'll let you know when it's out. |
Beta Was this translation helpful? Give feedback.
-
I've released 1.1.15. |
Beta Was this translation helpful? Give feedback.
-
Can I suggest to take a look at It has an abstraction for chords (ok, it would be easy to replicate in mido) and it also deals with "out of order" messages, which could be handy for this type of application (maybe others). From the docstring: "midiBuffer is a wrapper around pyPortMidi, which is itself a wrapper for portmidi, a cross-platform abstraction over native midi drivers. midi drivers require that you send events in this is especially an issue because the NOTE-OFF message for a |
Beta Was this translation helpful? Give feedback.
-
Hello
I've been having a lot of fun exploring Mido, and was thinking to use it as the foundation of an API for real time musical livecoding.
Here's where I got to:
So I was wondering
a) are threads the right way to go about playing multiple notes simultaneously (so that each note is independently defined)? PS I guess ThreadPools could be used to reuse old threads..
b) is there a standard 'MIDI' way of playing a chord? Eg above I try to do that by grouping all
on
andoff
messages. Does that guarantee that notes are played at the same time?Thanks in advance for the help - and keep up the good work :-)
Beta Was this translation helpful? Give feedback.
All reactions