Step 3: a little tweak to the example program

As mentioned in Step 2, you might experience some break-up/crackling in trying to play xanadu.csd in the csound5gui program due apparently to high CPU use.

There are a couple things you can do at this point. If you want to hear what the piece sounds like, you can render it to a file, and play it in your favorite audio player (such as Windows Media Player, QuickTime, Nero ShowTime, etc.) To do that, just uncheck the Real-time I/O button on csound5gui and enter the name of a file you want to write the piece to. Then hit Play/Pause again. You’ll notice that the piece may take longer than 48 seconds to create, since now csound5gui lets the CPU take as much time as needed to make the needed computations.

But by making a small change to the xanadu.csd program to reduce the CPU usage we can go back to listening to it in real time.

Referring to Step 2 where we opened xanadu.csd in csound5gui, this time click on the button to the right of the filename called “Edit”. This brings up a convenient Csound editor. The first few lines of the file should be:

<CsoundSynthesizer> 
<CsOptions> 
csound -R -W -s -o Xanadu.wav temp.orc temp.sco 
</CsOptions> 
<CsInstruments> 
sr          =           44100 
ksmps       =           1 
nchnls      =           2

The problem is the ksmps = 1 line. That means that the Csound program should recompute synthesis values for each sample, at the sample rate (sr) of 44100 per second. Reasonably fast PCs might not have a problem with that but mine gets pretty sluggish. So let’s change it to computing every 10 samples. It won’t make much difference in the sound (if any) but it will decrease the CPU load substantially.

<CsoundSynthesizer> 
<CsOptions> 
csound -R -W -s temp.orc temp.sco 
</CsOptions> 
<CsInstruments> 
sr          =           44100 
ksmps       =           10 
nchnls      =           2

(I took out the -o xanadu.wav part, but that wasn’t really necessary as the csound5gui options override it.) Save this file, re-enable the Real-time I/O switch on csound5gui and hit Play/Pause again. In this case the piece plays smoothly on my system.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: