Csound Csound-dev Csound-tekno Search About

Re: Newbie read FAQ and tutorial, but still needs answers to a few questions..

Date1997-12-03 23:21
FromRichard Dobson
SubjectRe: Newbie read FAQ and tutorial, but still needs answers to a few questions..
I have posted this reply to the list, because there seem to be gaps in
the Csound FAQ (a little too Unix-biased?). 

Graham (Visionary) wrote:
> 
> I have a Pentium-200 running windows'95, with a SB Awe64. I downloaded
> the file:
> 
>                 ftp://ftp.maths.bath.ac.uk/pub/dream/platforms/pc/Csound 3.47beta.zip
> 
>         and read the tutorial. I read the FAQ too. What I read seemed straight
> forward, but it still
> left some unanswered questions. I made the files "intro.orc" and
> "intro.sco". I copied from the
> tutorial, so for "intro.orc" I have:
> 
>                 sr = 20000               ; audio sampling rate is 20 kHz

problem: this sr is incompatible with standard soundcards, and hence
with WAV files:
use one of: 22050, 44100, 48000. some also suppoprt 32000

I am curious: are people still using srates such as 20000?

>                 kr = 500                 ; control rate is 500 Hz
>                 ksmps = 40               ; number of samples in a control
> period (sr/kr)

hence these also need to be changed: 
try: sr = 44100
	kr = 1470
	ksmps = 30


 
>         With these files in the same directory as my csound exe's, I do a:
> 
>                 csound intro.orc intro.sco
> 
>         and for output I get:
> 
>                 SFDIR undefined. using current directory

you don't especially need to worry about this - I don't use SFDIR
myself.
This is an optional environment variable (set in AUTOEXEC.BAT) in which
Csound will look for input files (for soundin).

> 
>         Then it prompts me to view the graph, and then displays that ok. Then
> it says
> something like:
> 
>                 0 errors in performance
>                 49 2048-byte soundblks of shorts written to test.
> 
>         I check, and there is indeed a new file named "Test", but without an
> extension.

1) 'test' is the default outfile name if you do not supply one.
	to set an outfile name, use the -o flag, and write the .wav extension;
	csound -o myname.wav intro.orc  intro.sco

It is a fair point, that the PC versions should add the correct
extension, depending on the format flag used, in the default case....

2)  to make Csound write a file in WAV format, you need to add the -W
flag,

so the whole command becomes
	csound -W -o myname.wav intro.orc intro.sco

though if you write to devaudio (given it works...), in fact you then
don't need to use the -W flag. 

> The next instructions in the tutorial say to do this to hear the output:
> 
>                 play test
> 
>         That gives me:
> 
>                 Bad command or file name
> 
>         To verify, I see there is no "play.exe" or anything of the sort in 
> any of my directories.

Yup - there is no 'play' command, as such, in Windows/DOS. You can run a
standard Windows program such as MediaPlayer, Cool, or whatever came
with the AWE32.
If you like the commandline, you can call mediaplayer by using the
command
	mplayer /play /close intro.wav
this will automatically play the file, and remove itself afterwards,
unless you click on Pause or Stop.


> 
>         The command:
> 
>                 csound  -o  devaudio  intro.orc  intro.sco
> 
>         writes it to a file "devaudio" instead of directly to my soundcard. I
> read that
> my Csound module has to include user access to the audio output device.
> Anyone know how
> this works on a PC with a sound card?

'User access' is unix-speak - does not apply, as such, to Win95. You can
set Windows up with password access for different users, though the
security facilities are negligible compared to NT, and since the
soundcard is a system resource, probably you couldn't lock it out anyway
(anyone out there know differently?).

It looks as though your command-line version of csound doesn't have the
rt playback implemented, though there is no technical reason for it not
to.  I have it working in my commandline build of 3.45; I will check
with John Fitch about this (needs RTAUDIO etc defining for the
commandline build).

> 
>         Here are my questions:
> 
>         1) Is there an install procedure for the PC, assuming I want to run
>	it from  the command prompt in my DOS window? 

No  - not needed. Install programs are only needed for VERY clever
Windows applications that use dlls, write to the registry, change all
your file associations, disable Netscape, and automatically dial up
microsoft.com :-) .

>Do I have to set path, environment  variables, etc?
You will need to add the path to csound.exe in the main PATH statement
in
AUTOEXEC.BAT

for example, if you put csound.exe in c:\csound\bin, then the line in
AUTOEXEC.BAT might read

PATH C:\WINDOWS;C:\WINDOWS\COMMAND;C:\DOS;C:\CSOUND\BIN [etc;etc]

Then, if you create anopther folder c:\csound\sounds
you could add the line
SET SFDIR = C:\CSOUND\SOUNDS

Despite the wonders of Windows, the DOS prompt is still a very good way
of working; any reasonably good book on DOS will tell you how to use it.

> 
>         5) Why does running csound.exe at the command prompt make my monitor
> screen  go about 50% dimmer until I reboot my machine?

!!!!????  Have you been watering it regularly? 

> 
>        CSound looks really awesome and powerful from what I have read so far.

No arguments there!

> I am willing to go through the effort of learning it, as I'm sure it will be
> worthwhile.
> If anyone can help me by answering some or all of these questions, it
> will be greatly
> appreciated.
> 

Done my best,
                                                                
Richard Dobson