[RTcmix-discuss] Using Python Bindings to RTcmix without PYCMIX?
simeon.fitch at mseedsoft.com
Thu Jan 19 10:54:32 EST 2006
Thank you for your fantastically detailed response!
I am probably using RTcmix in a much simpler manner than most, and actually
don't need the "real-time" aspects of the software. I'm pre-generating a
random set of sound files for use in perceptual psycology experiments, and
will be sufficiently served by forking off processes after programatic
determination of the needed waveforms.
I'd eventually be interested in having a dynamically loadable python module,
if architecturally feasible, but in the mean time I'll probably just package
up the RTcmix executables with the rest of my application. At some point
I'll be interested in checking out Dave Topper's GAIA source code, if it is
available, and your pyRTcmix.o solution. My main goal is to make it as easy
as possible for research staff integrate RTcmix's facilities into new
On 1/18/06, John Gibson <johgibso at indiana.edu> wrote:
> Hi Simeon,
> The way Python (and Perl) support for RTcmix is done now is
> similar to the way Minc (the RTcmix C-like parser) is done.
> You invoke one of the binary names -- CMIX, PCMIX, PYCMIX --
> and you then get RTcmix built with the appropriate parser
> embedded. Each parser is equipped with some extra code
> that lets it understand RTcmix function names and gives
> it a way to pass these off to the RTcmix guts. Basically,
> this is what you describe below.
> So the parser is embedded in RTcmix, and a parser extension
> is used (for Perl and Python) to send score data into RTcmix.
> For Python, this extension is called "rtcmixmodule.o" and is
> imported into the score as "rtcmix." This works fine for
> batch mode processing (non-interactive use), in which the
> whole score is parsed, everything is scheduled, and then the
> job is run, producing/consuming real-time or file input/outout.
> I did it this way because of the parallelism with Minc, but
> I'm pretty sure there was some reason why this was preferable
> for batch mode use. (But I can't remember...)
> BTW, you should be able to use the Python libraries you mentioned.
> Does this not work?
> Anyway, some people -- like you, some other person who wrote the
> list earlier, and me -- would like to write an application that
> lets you control RTcmix using Python code. Actually, I have one
> that does this, but it's completely non-interactive, and works
> by running PYCMIX as a new process everytime you play a score.
> Another way would be for the application to link to a shared
> library that includes the RTcmix guts and the parser. We have
> this working for Minc and Perl. I believe this is the way that
> Dave Topper's GAIA works. (Correct me if I'm wrong, DT.) The
> Gtk GUI links to pRTcmix.o and is then able to send Perl code
> snippets to the Perl parser that is embedded in pRTcmix.o.
> This is not batch mode -- RTcmix is running in interactive mode,
> so that you can parse Perl snippets at any time and have new
> notes scheduled.
> Recently, I made a Python variant of this library, called
> pyRTcmix.o. I have not yet tested whether this does what it's
> supposed to do. One option for you would be to try linking to
> pyRTcmix.o and seeing how far you get.
> The other way to handle all this, which you mention, is for
> the parser to embed RTcmix, rather than the other way around.
> So that the "rtcmix" extension would contain not just the
> glue that bridges the parser and the RTcmix kernel, but also
> all of the RTcmix kernel. Unfortunately, such an extension
> does not exist now. I *think* this would require interactive
> use, but I'm not sure.
> Keep in mind that Python may not be an ideal choice for a
> language that's controlling a synthesizer in real time.
> Dannenberg writes about this in one of his Serpent articles.
> (His Serpent is a Python-like parser that is set up to work
> in a real-time context, including a fast garbage collector,
> for example.)
> Hope some of this makes sense. Write back if you have more
> On Jan 18, 2006, at 1:56 PM, Simeon Fitch wrote:
> > RTcmix users,
> > I'm working on a Python application (for UVa) from which I'd like to
> > use RTcmix, and I'm a little confused about the role of PYCMIX and its
> > relationship to the natively installed Python distribution. I'm
> > working on MacOS 10.4.
> >> From reading the Python RTcmix tutorial, it appears that PYCMIX is a
> > "special" Python interpreter with RTcmix support statically
> > "built-in". If you want to use RTcmix from Python, your application
> > has to be invoked with the PYCMIX interpreter, and not from the
> > platform native interpreter. Is my understanding correct?
> > If so, is there any way to have RTcmix support installed as a standard
> > Python module, allowing the platform native interpreter to be used,
> > and thereby allowing development tools such as py2app and py2exe, in
> > addition to IDEs which expect to use the native interpreter to work?
> > IOW, I'd like to use RTcmix as with other 3rd party libraries, such s
> > pyOpenGL, Numeric, PIL, etc.
> > My apologies if I'm just confused over a simple issue, or if this has
> > been covered by previous postings (I was unable to find a search
> > feature for the mailing list).
> > Many thanks,
> > Simeon
> > --
> > Simeon H.K. Fitch, Owner
> > Mustard Seed Software
> > Charlottesville, VA 22901
> RTcmix-discuss mailing list
> RTcmix-discuss at music.columbia.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the RTcmix-discuss