MIDI-Input in SDL?

Has anyone played with Midi-input in SDL? Is it
supported? I’m looking at it in the context of an
edu-tainment title to teach kids music.

Any advice welcome.

Thanks,

-Loren__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup

SDL doesnt have midi input… sdl really doesnt have midi anything.
sdl_mixer has a half-assed software midi engine (a very hacked up timidity)

However, I would like to see a real sdl midi module that is multiplatform,
and uses real hardware when possible. (And on nix systems, doesnt require
that blasted /dev/sequencer which is a pain in the ass for people that
have soundcards that have oss drivers that dont supply a sequencer, only a raw
/dev/midi
)

Maybe you could coordinate an effort to build such a library?On 21-Jun-2002, Loren Osborn wrote:

Has anyone played with Midi-input in SDL? Is it
supported? I’m looking at it in the context of an
edu-tainment title to teach kids music.

Any advice welcome.

Thanks,

-Loren


Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Patrick “Diablo-D3” McFarland || unknown at panax.com
"Computer games don’t affect kids; I mean if Pac-Man affected us as kids, we’d
all be running around in darkened rooms, munching magic pills and listening to
repetitive electronic music." --Kristian Wilson, Nintendo, Inc, 1989

No support in the official SDL, but I remember someone announcing a patch that allowed SDL/Win32 apps to receive MIDI input through the event system.

For Linux, there’s some code in the new audio engine of Kobo Deluxe that might be of interest. It’s a simple call driven/polling “MIDI driver” (meant to be used from the audio thread with low latency configurations) that reads from OSS or ALSA. Events are decoded and passed to your application through a set of callbacks. I’d say MIDI input doesn’t get much easier than that.

One could port it to Win32 (and probably most other platforms) rather easilly, but I haven’t bothered, as I can’t really use it on a platform that refuses to work with less than some 60 ms audio latency… (I’m using the engine running on a Linux box as a h/w synth together with a Win32 sequencer.)

//David

.---------------------------------------
| David Olofson
| Programmer

david.olofson at reologica.se
Address:
REOLOGICA Instruments AB
Scheelev?gen 30
223 63 LUND
Sweden
---------------------------------------
Phone: 046-12 77 60
Fax: 046-12 50 57
Mobil:
E-mail: david.olofson at reologica.se
WWW: http://www.reologica.se

`-----> We Make Rheology RealOn Fri, 21/06/2002 01:00:30 , Loren Osborn <linux_dr at yahoo.com> wrote:

Has anyone played with Midi-input in SDL? Is it
supported? I’m looking at it in the context of an
edu-tainment title to teach kids music.

SDL doesnt have midi input… sdl really doesnt have midi anything.
sdl_mixer has a half-assed software midi engine (a very hacked up timidity)

However, I would like to see a real sdl midi module that is multiplatform,
and uses real hardware when possible. (And on nix systems, doesnt require
that blasted /dev/sequencer which is a pain in the ass for people that
have soundcards that have oss drivers that dont supply a sequencer, only a raw
/dev/midi
)

Maybe you could coordinate an effort to build such a library?

I’m just getting in on the end of this, and have no time to implement
it, but whoever does look into may need to look no further than the
PortMidi, which is part of the PortMusic project:

http://www-2.cs.cmu.edu/~music/portmusic/

good luck!

jamie

i am currently working on a project that involves the use of midi input from
a 49 key keyboard. I am using a library called Midishare that is found at
www.grame.fr/MidiShare i think. it works on linux/win/mac and a few others.
I am using it on mac and win right now. i have been working with it for the
last few months, it’s great. the only thing you need to do it set up two new
event types for sdl.

-Keith

SDL doesnt have midi input… sdl really doesnt have midi anything.
sdl_mixer has a half-assed software midi engine (a very hacked up timidity)

However, I would like to see a real sdl midi module

I might have something to offer, eventually…

that is multiplatform,

Should be easy to fix.

and uses real hardware when possible.

Does input - I just haven’t had any reason to add MIDI output so far.

(And on nix systems, doesnt require
that blasted /dev/sequencer which is a pain in the ass for people that
have soundcards that have oss drivers that dont supply a sequencer, only a raw
/dev/midi
)

Trivial (ie “fits well into my design”) - although some systems simply require something like the sequencer API for reliable timing.

Maybe you could coordinate an effort to build such a library?

Well, I have an LGPL MIDI loader/player that might be useful as a starting point. (I found it in an LGPLed FM/OPL player for old games music, and had to rewrite most of it. Might as well have rolled my own from scratch, but now it’s done anyway…)

It’s in Kobo Deluxe 0.4pre8, if you’d like to have a look. Expect a major rewrite soon, though. (I don’t think it’s a great idea to play directly from the raw MIDI data, and I would like the output in the form of timestamped events rather than callbacks, for example…)

//David

.---------------------------------------
| David Olofson
| Programmer

david.olofson at reologica.se
Address:
REOLOGICA Instruments AB
Scheelev?gen 30
223 63 LUND
Sweden
---------------------------------------
Phone: 046-12 77 60
Fax: 046-12 50 57
Mobil:
E-mail: david.olofson at reologica.se
WWW: http://www.reologica.se

`-----> We Make Rheology RealOn Fri, 21/06/2002 14:28:55 , Patrick McFarland wrote: