[Gambas-user] Developing MIDI app with Gambas

Rob sourceforge-raindog2 at ...94...
Fri Apr 22 16:04:55 CEST 2005


On Friday 22 April 2005 01:37, Jean-Francois Perreault wrote:
> so do what we do and use SHELL and just make a frontend to a couple
> C apps , but while your there , why not just SHELL EXEC  one of the
> ready-made midi suites

I assume that Juan is looking for a way to capture MIDI data and use 
it as input for his program, not merely play or compose songs.  
Sometimes programs that accept MIDI input have nothing to do with 
music.... have a look at the GIMP, for example.

  http://www.gimp.org/unix/howtos/gimp-midi.html

But, until such time as someone writes a gb.midi component, I agree 
with the strategy of writing a C or perl helper app that grabs the 
raw MIDI data and transforms it into some format that's easily parsed 
by Gambas (e.g. "$timestamp/$controller/$value\n", if you were 
writing it in perl.)  That was how I played sounds via SDL before the 
gb.sdl component existed.... opened a perl program on a pipe and sent 
it pathnames of wav files and trigger commands to sound them.

I've been working on a POSIX component off and on.... maybe I need to
make a "Linux" component to wrap things like ioctl as well, though I 
don't think it needs to be part of the Gambas base package.  Despite 
the arguments in favor of direct arbitrary API access, I think that
the facts that VB programmers use ActiveX controls vastly more than
direct API calls, and that the most common interpreted languages 
under Linux (perl, python and php) are so successful despite no 
direct API access, demonstrates that a consistent, non-C-like
component interface is always preferable.  Most of the API calls VB
programmers do can be replaced with running a program over a pipe and 
receiving its data, since that option is not available to them under 
Windows (except, again, using API calls.)

Nonetheless, I hope to see an eventual "direct API access" equivalent 
in Gambas, because I am lazy :)  

Rob








More information about the User mailing list