Re: [AD] Allegro 5 MIDI addon

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Fri, 12 Oct 2012 13:45:59 +0200
Tobias Hansen <tobias.han@xxxxxxxxxx> wrote:

> Hi,
> 
> I'm thinking about writing a MIDI addon for Allegro 5. Since my
> intention is to get it included into Allegro, I check with you first.
> 
> I think it's a good choice to use libfluidsynth. The Allegro addon has
> to do the same things with libfluidsynth as Alure [1], so I intend to
> reuse some of Alures code. That means the addon would be partly under
> Alures license X11/MIT.

Allegro's zlib license is basically identical. Guess it depends on the
amount of code whether you'd even need a special license section
mentioning Alure (as opposed to just a code comment about the origin).
Could just ask the Alure author what he prefers I guess.

> There are free soundfonts available (I don't
> mean that Allegro must include one, but it's good to know). A
> reasonable one is [2] I think. It's GPL licensed. If you want to test
> libfluidsynth, you can use the alurestream program bundled with alure:

I don't know if we can re-distribute a GPL file, even if it's marked
separately as GPL licensed. I guess it would be nice to have an
example/test for .mid playback though. Maybe could use some special
soundfont with just a few piano keys for that, if one exists with a
not-share-alike license.
 
> FLUID_SOUNDFONT=<soundfont> alurestream <midifile>
> 
> My questions are:
> 
> 1. Is that something you would like to include into Allegro 5 if it
> works well? Do you see any problems with my plan?

Yes. We even include a mod player (depending on libdumb) in acodec.

> 2. Would that go into the acodec addon or should I create a new addon
> to avoid a dependency of the acodec addon on libfluidsynth? (My
> preference would be including it in acodec.)
> 

Up to you I'd say. Both would make sense to me.

If you include it in acodec, the advantage would be that we
could play .mid files just like other music files. But I'm not
sure how you could specify the sound font to use, the API
basically is just:

al_load_audio_stream(const char *filename, size_t buffer_count, unsigned int samples)

With an extra midi addon it would be easy to have a function to specify
the sound font and also have ways to re-act to various midi commands and
do more meaningful looping/jumping than just the time position.




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/