SDL and MIDI keyboards

Just out of strangeness - there’s at least a couple of musical-minded
people on this list so - has anyone tried to pipe a MIDI keyboard in
through the SDL event system? (or have any suggestions? :slight_smile:

Later!
- Teunis

Just out of strangeness - there’s at least a couple of musical-minded
people on this list so - has anyone tried to pipe a MIDI keyboard in
through the SDL event system? (or have any suggestions? :slight_smile:

I’ve implemented a C object structure which incorporates a midi handling
system. It ends up creating a SDL_USEREVENT for each midi message. This
works fantastically, and I have it working under Win32, Macintosh and
Linux. I think an SDL_Midi package could be in the works.

Is anyone interested?

David–
David Mansfield (718) 963-2020
@david_at_ultramaster
Ultramaster Group, LLC www.ultramaster.com

I’ve implemented a C object structure which incorporates a midi
handling
system. It ends up creating a SDL_USEREVENT for each midi message.
This
works fantastically, and I have it working under Win32, Macintosh and
Linux. I think an SDL_Midi package could be in the works.

Is anyone interested?

Sounds like a fun thing to play with :wink:

KlaasjanOn 2001.07.08 07:21 david at ultramaster.com wrote:

Yeah, why not? :slight_smile:

However, I’m suspecting that SDL wouldn’t like running the event
system as SCHED_FIFO (for “hard” real time on Linux/lowlatency), so
it wouldn’t help much for serious real time synths. There’s also an
inherent problem with mixing the MIDI data (high timing accuracy
requirements) with other types of events on the same queue, at least
if all events are going to be fetched and handled in the same thread.

The simplest and probably most portable solution would be to poll for
MIDI events in the audio callback. That’s where the MIDI data is
normally going to be used (if nothing else, to handle the real time
response before passing the events on to some subsystem with more
buffering), and that’s where you’re most likely to have the best
timing accuracy, at least on “normal” platforms.

Finally, MIDI events should of course be timestamped with the highest
possible accuracy, preferably inside the driver, where supported.
That wouldn’t help MIDI->MIDI or MIDI->audio latency, but it would
make it possible to implement accurate MIDI recording without putting
the code in a “real time” thread or callback.

//David

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------> http://www.linuxaudiodev.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |--------------------------------------> david at linuxdj.com -'On Sunday 08 July 2001 07:21, david at ultramaster.com wrote:

Just out of strangeness - there’s at least a couple of
musical-minded people on this list so - has anyone tried to pipe
a MIDI keyboard in through the SDL event system? (or have any
suggestions? :slight_smile:

I’ve implemented a C object structure which incorporates a midi
handling system. It ends up creating a SDL_USEREVENT for each midi
message. This works fantastically, and I have it working under
Win32, Macintosh and Linux. I think an SDL_Midi package could be
in the works.

Is anyone interested?

david at ultramaster.com writes:

Just out of strangeness - there’s at least a couple of musical-minded
people on this list so - has anyone tried to pipe a MIDI keyboard in
through the SDL event system? (or have any suggestions? :slight_smile:

I’ve implemented a C object structure which incorporates a midi handling
system. It ends up creating a SDL_USEREVENT for each midi message. This
works fantastically, and I have it working under Win32, Macintosh and
Linux. I think an SDL_Midi package could be in the works.

Is anyone interested?

Yes, I’m interested.

I’d also love to see this available thru python, pygame perhaps.> David


David Mansfield (718) 963-2020
david at ultramaster.com
Ultramaster Group, LLC www.ultramaster.com


Lee Morgan