Hallo
I'd be very grateful if anyone could help out here.
I downloaded csound (I have an osx 10.5.6), opened all the packeges, and tried out a first file which is the simple example given by Michael Gogins that looks like this (I know about the < & > bracket-space):
< CsoundSynthesizer >
< CsOptions >
-W -f -R .o tutorial2.wav
< /CsOptions >
< CsInstruments >
sr = 44100
ksmps = 1
nchnls = 2
gisine ftgen 0, 0, 65537, 10, 1
instr 1
ikey = p4
ivelocity = p5
ioctave = ikey / 12 + 3
idb = ivelocity / 127 * 84
ifrequency = cpsoct(ioctave)
iamplitude = ampdb(idb)
asignal poscil iamplitude, ifrequency, gisine
outs asignal, asignal
endin
< /CsInstruments >
< CsScore >
i 1 1 3 60 100
< /CsScore >
< CsoundSynthesizer >
Only on switching on the csound5 gui I don't hear anything, I hear a really crackly sound (similar to when 2 sample rates don't match) if I click on the Realtime I/O. Furthermore the message I get on the console is:
"
orch now loaded
audio buffered in 8192 sample-frame blocks
reading 65536-byte blks of floats from /Users/path/to/OtraOrilla's/folder/tutorial2.csd (RAW)
sfinit: cannot open tutorial2.wav
inactive allocs returned to freespace
end of score. overall amps: 0 0
1 errors in performance
Elapsed time at end of performance: real: 0.012s, CPU: 0.010s
"
From one of the packages understand I have to create directory in Terminal & type in mkdir MacOSX
which I did, (although it's impossible to find the .MacOSX directory I created, so I just opted to drop the . at the beginning) and copy & paste the code in a text-file called "environment" that includes the path to future sound-files I might like to invent. I then downloaded Jack & run JackPilot seperately, but still to no avail. Regardless of the RealTime Audio module I choose (from the Options/Csound button), I still get the same result. Anyone know what might be going wrong here ?



Mainly just a typo...
I took a quick peek at the version of the code you posted, and found a couple of things that stop it working on my system. The one that gives the error you're experiencing is a typo in the CsOptions -- it should be "-o", not ".o". (It's supposed to output to that file, so it normally shouldn't exist!)
However when I fixed that, it still wouldn't run. I happened to have a copy of "tut2.csd" that does run, and checking the differences, I found that it was the spaces you inserted in the tags that caused the hangup. You say you know about "bracket-space" -- not sure what you mean here, but I don't think XML likes spaces between the left-bracket and the tag-name.
There's another point about the options line. It has the "-f" flag, which will result in a "floating-point WAV" file. Some systems will play such files (probably including the Mac) but they're not exactly standard. You can leave it out and get a perfectly good universally-playable WAV.
Finally, there's one convention in Csound that I consider silly... The CsOptions override command-line options, so trying to get audio output from the CSD as provided won't work -- it'll always generate the audio file. You need to edit the options line. In fact, the simplest and best choice is probably to delete it altogether if you want to provide your own options.
Hi Pete, thanks a lot for
Hi Pete,
thanks a lot for taking a look at this, I'm sorry I wasn't clear when I wrote the brackets+spaces sentence (I typed in the example on here, then previewed the post & noticed that the brackets plus the "CsInstruments" had disappeared, so I put spaces inside the brackets just for forum-visibility (there's probably a better solution to this, but I could't find it) - so, to begin with my code didn't have spaces in the brackets !!!)
I tried out your suggestions, but still to no avail, & I get the same errors I describe above :
"sfinit: cannot open tutorial2.wav"
As for the float option, in the .pdf, Gogins writes that I should :
"Type tutorial2.wav in the Output file field. Open the Options menu, Csound...
item, and set the options in the Csound performance settings dialog, for wav
File type, float Sample format, Enable dither, and Rewrite header.
Click on the Edit button next to the Orchestra/CSD field, which will re-open
the file for editing. Click on the Play/Pause button to render the piece. When rendering has completed, click on the Output file field Edit button to hear the
piece"
However, I copied Gogin's file wrong, his file also doesn't include
-W -R -o tutorial2.wav
between the options brackets, but still even omitting that line failed... Maybe the answer will reveal itself during a later tutorial ...
...
Does Csound 5 work on a MacOSX & if not , does one merely trash everything to uninstall Cs5, with the later purpose of installing MacCsound ?
Duhh, I'm flummoxed then.
I think a Mac user is going to have to take it from here. (I don't even have the GUI front-end on my machines (Linux & BeOS).)
It turns out -- when I looked at the source -- that the error you're seeing does result from being unable to find a writeable location. (I wish they'd have said "Cannot write to..." or "Cannot create...", as "open" to me more indicates an existing file.)
I'd guess that the way the GUI runs Csound, its 'current directory' is a system directory, protected from writing. You do need either to be running from a writeable directory or to set the environment variable 'SFDIR' to a suitable path. Dunno how you do that on a Mac (and I can't comment on what you described, as I'm not familiar).
One possibility that should work [I think!] is to use a full path to the output file -- maybe in your home directory, but somewhere you know is writeable.
Good luck!
Thanks for your help ,
Thanks for your help , support and comment. Would it be possible to report this particular error as a bug ? I tried following recent post written on here as a blog:
"How I Built Csound on Mac OS X 10.5 "Leopard" "
which can be accessed from here; in general it's interesting but was impossible for me to follow and really get much from as I'm simply not an expert in things unix & terminal to make the code provided work specifically for this computer. etc, etc !! I'm sure that problem has been encountered a few times... !
Did you get it to work?
Did you try the full file pathname?
Sorry that I'm the only one to reply yet, as I only know Mac from afar (:-). (I like what I've seen, but what I have works well enough for me, so I'm not keen on forking out...)
As for reporting a bug, I think if possible you should check with a Mac user, who might have a better idea if any steps were missed out or undocumented. Maybe you can 'ping' Anthony Kozar who did the Leopard stuff? Or start a new topic, with a title specific to the problem -- might get more attention.
(As an aside, I always think it's worth getting familiar with the Terminal and the command-line. (:-) I often find it much more flexible than point-and-click...)
Using Csound 5 GUI on Mac OS X
Hello,
Sorry to not see this sooner. Pete's hunch is correct. On Mac OS X, due to an unfortunate default behavior in applications launched from the Finder, csound5GUI will try to write the output sound file to the top-level of your hard drive unless you specify a full path name or set the SFDIR environment variable. If you are not an admin user, the file cannot be created.
The simplest solution in csound5GUI is to click the button with "..." on it that is to the left of the space for "Output file/device" in the main window. Then choose a location to save the output such as your user Documents folder or Desktop.
Another way to set the output directory is to click on "Options" then "Csound..." and in the "performance settings" window that appears, click on "Environment" near the top. Then click on the "..." button to the right of where it says SFDIR. You can save configuration settings by going to "Options" -> "GUI".
You can email me for more Mac help or try joining the Csound mailing list which is full of helpful and knowledgable people.
- Anthony
Hi Anthony, thanks very
Hi Anthony,
thanks very much for that piece of advice, I had almost given up on csound as I simply couldn't figure it out. I also read your "How I built CSound ...etc" but I'm simply not skilled enough in bash/Terminal to follow all that through (especially what to do if mistakes occur).
The part of your post that ended up working was where I find a space in the computer to put the sound file and where I define this using the Options/Csound/Environment/SFDIR. Strangely enough, what happens now is that although I don't hear anything immediately, it saves a "plain text" file onto the folder I specified: I only get to hear it if I open this file in Audacity. This doesn't bother me that much (now that I have a method), I just found it a little odd.
Also thanks for all the other advice, I feel more motivated to carry on !!
Re: Csound 5 GUI on OS X
OtraOrilla wrote:
"I also read your "How I built CSound... etc"
but I'm simply not skilled enough in bash/Terminal to follow all
that through (especially what to do if mistakes occur)."
No problem. Those instructions are for developers or very advanced users who need to rebuild Csound for whatever reason. It is really not necessary to follow them just to use Csound. You should always be able to install one of the packages from Sourceforge.net to get a working Csound environment.
"The part of your post that ended up working was where I find a space in the
computer to put the sound file and where I define this using the
Options/Csound/Environment/SFDIR. Strangely enough, what happens now is that
although I don't hear anything immediately, it saves a "plain text" file
onto the folder I specified: I only get to hear it if I open this file in
Audacity. This doesn't bother me that much (now that I have a method), I
just found it a little odd."
You output file may appear as "plain text" in the Finder if you do not give it an appropriate filename extension. Make sure that you are using ".wav" at the end of the filename if csound5GUI is set to create a Wave file or ".aif" if it is set to create an AIFF file.
As I am sure you've noticed, csound5GUI is not the easiest program to use, but it is perhaps better than using Csound from the Terminal (for new users). Csound can work in one of two modes: real-time or "offline" (non-real-time). When you enter a filename for the output, csound5GUI will use the offline rendering mode of Csound which means it creates the sound file but does not play it immediately. There are a several possible ways to get csound5GUI to play the sound (or to at least open the sound file for you).
1) Configure real-time audio mode by checking the "Realtime I/O" box in the main window and then pressing the "Configure" button which should take you to Options->Csound->Real time audio. Choose "CoreAudio" in the box labeled "Real time audio module". Output device should say "dac" and input device "adc". Click "OK". Now when you press the play button near the bottom of the main window, you will hopefully hear the sound immediately.
2) Configure a sound player by going to Options->GUI and try pasting the following into the "Sound player" box:
/Applications/QuickTime Player.app/Contents/MacOS/QuickTime Player
Back in the main window, when "Reatime I/O" is UNchecked, after rendering a Csound file (the lower play button renders), you can then click the play button in the "Output file/device" area of the window to open the file in QuickTime Player. Unfortunately, this launches a new copy of QuickTime every time you press play.
3) Configure a sound editor by going to Options->GUI and try pasting the following into the "Sound editor" box:
/Applications/Audacity 1.2.5/Audacity.app/Contents/MacOS/audacity
(replace /Applications/Audacity 1.2.5/ with the actual path to your Audacity
application if different)
Then check the "Edit output sound file after performance box". Now csound5GUI should immediately try to open the output sound file in Audacity after rendering. I'm not positive that this will work with Audacity. If it doesn't, you could paste the path for QuickTime Player into the "editor" box too.
A completely different approach to using Csound would be to download the MacCsound application from http://www.csounds.com/matt/MacCsound/ which has a nice built-in editor and excellent real-time audio. It has not been updated in a couple of years but many people swear by it. You still must have installed an OS X Csound package from http://csound.sourceforge.net/ in order to use MacCsound. In fact, you must specifically install a version for PowerPC (PPC) Macs even if you have an Intel Mac. See that web page for more details.
"Also thanks for all the other advice, I feel more motivated to carry on !!"
You are very welcome! I hope that you stick with Csound. It has a steep learning curve but is well worth it!
Re: a good GUI for Csound
I mentioned MacCsound above, but I just had a chance to try out the relatively new front end from Andres Cabrera called QuteCsound. QuteCsound is very similar to MacCsound but cross-platform and "up-to-date". It seems very stable to me and has great features like an integrated manual browser and error highlighting. I strongly recommend giving it a try!
http://qutecsound.sourceforge.net/
- Anthony
P.S. QuteCsound is also open source -- cheers to Andres!!
canadian rx
canadian rx