[plt-scheme] OS X Core MIDI and DrScheme

From: John Clements (clements at brinckerhoff.org)
Date: Tue Feb 28 16:09:01 EST 2006

On Feb 28, 2006, at 11:21 AM, Paul C. Fisher wrote:

> First some background:
> I teach a high school CS course using HtDP. I also teach a computer  
> music
> course which has a component on algorithmic composition. Recently I
> stumble upon a Scheme based tool for OS X called impromptu which  
> provides
> direct access to the Core MIDI drivers (specifically one has access  
> to the
> audio units). It is a nifty little tool but the Scheme environment  
> is far
> inferior to what is available in DrScheme and I would like to be  
> able to
> cross-fertilize between the CS course and the music course.
> So here are my questions:
> * Is anyone familiar with impromptu?


> *How hard would it be to incorporate such capabilities into  
> DrScheme? (or
> are such things already available and I haven't looked in the correct
> places?)

<see later>

> *Is this the correct list for asking such a question? (the HtDP list
> didn't seem like the correct place)


> *Are there any audio and/or music capabilities/libraries for DrScheme,
> specifically something which can interface with MIDI and/or Core  
> Audio,
> beyond the Teachpacks which are already bundled?

DrScheme has a rich FFI library which would allow you to link  
existing libraries into a teachpack.

I added support for a library (libsndfile) that could read & write  
sound files.  I believe this has been superseded by the FFI library,  
in the sense that the interface to this library is an "example" in  
the FFI directory.

However, barring some substantial implementation work on your part, I  
think your best bet might simply be to leverage DrScheme's  
programming environment directly by, for instance, adding an  
"Impromptu" button to DrScheme that takes the text in the definitions  
window and invokes impromptu on it directly.  This could be as little  
as 50-100 lines of code.  Of course, it really depends on what kind  
of interface impromptu provides.  For instance, does Impromptu allow  
command-line invocation?

All the best,

John Clements

Posted on the users mailing list.