Csound Csound-dev Csound-tekno Search About

Re: Realtime MIDI Csound: New midi OUT opcodes

Date1997-04-07 03:37
FromRobin Whittle
SubjectRe: Realtime MIDI Csound: New midi OUT opcodes
Regarding MIDI Out in real-time from Csound,

I think this would be useful - for instance using Csound to generate
MIDI commands to a MIDI-CV interface to drive some analogue synthesis 
gear (I am thinking specifically of my Devil Fish - see my WWW site) 
which could then be recorded on DAT and fed back into Csound for 
processing in (typically) non-real-time.  

This way, a composition algorithm and/or score based in Csound could 
be used to generate analogue and software generated sounds, and then 
be used to process both of them for a final output file.

Perhaps there is a work-around for doing this without having to touch 
the source code.  (I have not tried real-time or looked at how it 
works . . .)  Generate a single orc/sco pair, but use it in two ways.

One way is to generate real-time MIDI Out based on whatever the 
orc/sco is doing.  Set a global variable which all .orc code looks at 
and which disables all a rate processing - so as to make the 
computation of Csound definitely happen in real-time.  

Nonetheless, have Csound put out one or two channels of (typically 
silent) audio. Maybe this could start with a beep which could go to 
DAT as well and be used to synchronise the process later of bringing 
the recording back into Csound.  Now, make the playback buffers very 
short - can this be done without recompiling Csound?  Maybe this 
can't be done, since perhaps the OS audio drivers have long buffers.  
Anyway, make them as short as possible so as to make the computation 
part of Csound run in short runs, just before the sound goes out to 
the speaker.

There is probably a better way of expressing this, but I think this 
is understandable.

Another step might be to make an artificially low sample rate for 
this phase of operation - say 11.025 kHz - maybe this makes life 
easier for the OS sound driver and for Csound in general.  However 
keep the K rate up to allow relatively fine resolution of MIDI output 
timing.

When the desired MIDI output has been created, then use the orc/sco 
in the usual way.  Have a global variable which disables all MIDI out 
and all processing which was intended to drive it.  Then run the 
piece, with all its internal structures doing whatever else you want 
to do, such as generating and processing sound, including sound files 
brought onto disk previously from the DAT recording. 

If this approach is infeasible, then I would be very interested in
any approach to writing a special version of Csound for Win95 or
Linux, enabling it to output MIDI with good timing resolution.

This is primarily because I am interested in using "generative" 
"compositional" approaches, and because I want to do this from Csound 
and use analogue synthesiser sounds too.

- Robin


. Robin Whittle                                               .
. http://www.ozemail.com.au/~firstpr   firstpr@ozemail.com.au .
. 11 Miller St. Heidelberg Heights 3081 Melbourne Australia   .
. Ph +61-3-9459-2889    Fax +61-3-9458-1736                   .
. Consumer advocacy in telecommunications, especially privacy .
.                                                             .
. First Principles      - Research and expression - music,    .
.                         music industry, telecommunications  .
.                         human factors in technology adoption.
.                                                             .
. Real World Interfaces - Hardware and software, especially   .
.                         for music                           .