[…interactive music…]
So I’d like to do one of the following things, and wondering if
anyone else knows which would be easiest, or if any of them have
already been done:
- Add additional notification features to SDL_mixer so that I could
move around within a single mod with speed and accuracy.
That would probably be the easiest way. Basically just add an optional
callback that the “song” code calls if present, instead of just picking
the next pattern. I haven’t studied the actual code of SDL_mixer, but
this would be a pretty trivial thing to do in any module player I did
read the source of.
- Add the ability to load a mod without samples (is that a midi
file?)
Nope, a MIDI file is basically just one or more tracks, that consist of
normal MIDI events (same format as on the cable, even!), meta events and
"delay values". Trackers generally use multitrack patterns that are fixed
size arrays with a “fixed” number of rows/notes.
that would reuse samples from a different mod.
Anyway, that would be possible, of course, but I think it would be more
work than 1). It would require hacking SDL_mixer to support modules using
samples from other modules (API for that…?), and it would also make it
more complicated to compose the modules. (A tracker with a “save module
without samples”, or a tool that strips the samples from a module, would
help a great deal.)
- Load my own sample set (in some format?)
IIRC, SDL_mixer uses Timidity, and so should support GUS banks and
possibly SoundFonts… (Just read the docs!
and play midi files
instead.
Yeah, that could work, but you still have to hack the MIDI sequencer to
get it to do what you want. Because MIDI files have nothing in the data
structure that helps you in any way, this would probably be slightly more
complicated to do than doing the corresponding hack in a module player.
That said, I’m actually working on that kind of features in the new audio
engine of Kobo Deluxe. Eventually, I’ll use the EEL scripting language
(which is currently used only for rendering waveforms and setting up
patch/instrument parameters) together with a “native” sequencer to do
this kind of stuff (the MIDI code will be converted into a loader).
For now, I’m going to use text meta events (“markers”) that can be placed
in MIDI files by any serious sequencer. These markers show up in the
tracks just like any other events, so one just has to save their
positions somewhere (depending on their text; “LOOP_START”, "LOOP_END"
and the like), and then force the player to the stored positions when
required.
My snooping around the source leads me to think the notification
stuff might not be too bad, but would it work?
Not sure. Is it based on callbacks that run directly from the player? If
so, there’s at least a chance it could work. (Timing would suck
otherwise.)
Modifying mikmod seems
pretty scary – I don’t have the domain knowledge to poke around in
there comfortably.
What’s so scary about it? (I guess I should go and have a look at what
seems to scare the h*ll out of so many hackers…
Anybody have any ideas or suggestions? Alternate solutions?
Unfortunately, there’s quite some hacking left to do on my engine before
it’s seriously usable, so that’s not of much help… (Besides, you
probably need two computers - one Linux box with the engine, and one
Windoze box with a usable sequencer app - to compose any serious music
for it. Maybe if someone bothers to make a VSTi or DXi version
eventually…)
I’d say, go for the “single module + song callback hack” solution.
//David Olofson — Programmer, Reologica Instruments AB
.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |
-------------------------------------> http://olofson.net -'On Wednesday 17 April 2002 06:37, Kent Quirk wrote: