Re: simple Csound, was Re: [Csnd] [OT] Linux references at csounds.com
Date | 2005-12-13 16:17 |
From | Wally Lepore |
Subject | Re: simple Csound, was Re: [Csnd] [OT] Linux references at csounds.com |
Hi Dave Phillips, and all list members
Dave said.....
>Voila, you have
a 3-second sine wave playing at 400 Hz. Clear as mud, as
we say here in NW Ohio. ;-) "Clear as mud". well now........ isn't that the
truth! I never heard that phrase before. I got a chuckle out of that
one!
Thanks so much for helping me with getting started
in csound. In combination with John ffitch's tutorial at http://www.csounds.com/toots/Toot01.html and your help I actually created the frequency of 440 Hz and
"heard it".
Just a quick background before I ask a few
questions.
I've toyed with csound back in 2002 with the help
of Dan Gutwein
Dan was excellent and taught me some basics but
unfortunately I never wrote down any of his teachings. As time passed I forgot
what I learned. I lost contact with him as he is no longer teaching at The
College of William and Mary http://www.wm.edu/
I've also tinkered with programming in "C" with the
excellent help of Robert Waker who is the creator of "Fractal Tune Smithy"
http://www.tunesmithy.connectfree.co.uk/
thus I'm not a total stranger to this medium of
expression. Just been away from it too long.
I've been playing guitar since 1973 and absolutely
enjoy studying music theory and tuning theory.
I have learned alittle HTML and have created a
humble web site that I offer to anyone who wants to learn to play slide
guitar via "The Allman Brothers" style. Free! These samples are my version
of how Dickey Betts and Duane Allman of "The Allman Brothers Band" played their
slide and lead guitar parts. Its still under construction (when I have
time).
However, in reference to csound, whatever I
learn I'm writing it down so I won't forget.
Questions please........
I have winsound interface opened and I created all
the necessary sub-files inside my csound directory (folder).
Although I've seen various links which recommend
different folder names,
in time I will understand what files are
really needed but for now, this is what I was told to create.
My sub-files are labeled as follows:
1) Analysis
2) Bin
3) Sounds
4) Samples
5) Csound manual
6) Orc & Sco (should these be seperate
files/folders ?)
7) Rendered
8) Winsound
Looking at the winsound interface I have the word
"test" sitting in the output file box. Why I don't know.
My output device box reads: M-Audio Delta AP192 1/2
(which of course is my sound card).
Under Format, "WAV" is selected. I guess this is
what I want. To create a .wav file correct?
Under "Size" 16 bit is the default.
under "Graphics", "Full" is the
default.
"Peak Chunks is selected by default.
And everything else is not selected. Is this
default set-up listed above okay to begin learning csound?
If so then my next question please
is.....
I use a basic windows editor called "notepad" to
create my score and orchestra files.
I pasted the selected values from John's ffitch's
web site http://www.csounds.com/toots/Toot01.html into my text editor called "notepad" (Notepad comes
with Windows). I used John's tutorial because its winsound am I'm using a
windows operating system.
For the .orc file, I copied and pasted the
following code.....
instr 1
a1 oscil 10000, 440, 1 out a1 endin For the .sco file, I copied and pasted the
following code.....
f1 0 4096 10 1 ; use GEN10 to compute a sine wave ;ins strt dur i1 0 4 e ; indicates the end of the score I saved these files as Toot01.orc and
Toot01.sco ---- When I went to File-Save As (in Notepad),
the "Save As" dialog box popped up and Notepad wanted to save the file as a
.txt extension by default. In the "save as type" box, I clicked the down arrow
and chose "All files" (instead of the default called "text documents .txt")
which allowed me to save the files I created as a .orc file or .sco file. If I
want to edit this Toor01.orc file in the future, I have to change the "Files of
type" from "Text Documents .txt to "All files" in order for the Toot01.orc to
load into my text editor called "Notepad". Also in the "Save As" dialog box,
there is a drop down box next to encoding. "ANSI" is selected by default so I
simply left this as is. Sorry to be explaining such a basic procedure but I'm
not sure if Linux users have the same interface as windows.
I loaded both the .orc and .sco files into their
respected places in winsound and clicked "Render". I assumed "Render" was the
equivalent of what the tutorial said, "Run this with its corresponding score
file, toot1.sco : So I guessed that "Render" equals "Run". I checked my
desktop for the resulting product called test.wav file and found nothing. I then
searched the csound directory and there I found it. Apparently the .wav
file was placed there automatically. I opened my windows media player and
opened the test.wav file and it played the 440Hz frequency. it was kinda like
that magic moment when Edison created the first lightbulb or Alexander Bell with
the telephone. Real interesting.
That's what I did and winsound created the .wav file of 440Hz. If I
did anything wrong or need to make corrections, please let me know.
I'm very happy that I now remember the most fundamental basics of Csound
and how to create, save, load and render files.
Where do I go from here without getting lost? Thanks so much
Walter Lepore
----- Original Message -----
From: "Dave Phillips" <dlphillips@woh.rr.com>
To: <csound@lists.bath.ac.uk>
Sent: Sunday, December 11, 2005 9:56
AM
Subject: [Csnd] simple Csound, was Re: [Csnd] [OT]
Linux references at csounds.com > > >... I do absolutely take that into consideration as I search for a > >user friendly tutorial. I understand alittle but as far as trying to create > >the sound of a basic 440 Hz pitch...forget it. I'ts still a blur to me. I > >keep reading over and over again hoping I'll pick something up I missed > >earlier. > > > > > In classic Csound you would create two files, an orc and a sco file, > something like the following: > > ;;; whatsyoursine.orc > > instr 1 > asig oscil 10000, 440, 1 > out asig > endin > > ;;; whatsyoursine.sco > > f1 0 8192 10 1 ; this is a stored function table that holds what is > called a single-cycle sine wave > i1 0 3 ; this line plays your 440 sine wave for 3 > seconds, starting at time 0 > e > > The relevant instrument design translates to: > > "Create an audio signal (asig) by using an oscillator opcode (oscil) > with an absolute value of 10000 for its amplitude (a fairly loud > volume), a frequency of 440 Hz, and using a stored function table > represented by f1 (the 1 at the end of the opcode declaration) in my sco > file." > > Process at a command prompt (in Linux) with something like: > > csound -o mysine.wav whatsyoursine.* > > Voila, you have a 3-second sine wave playing at 400 Hz. Clear as mud, as > we say here in NW Ohio. ;-) > > >If there was ever a term to describe learning csound, to me.... it would > >certainly be called "rocket science". And rocket science is cool stuff > >indeed! > > > > > I got into Csound when it was a lot less involved than it is now. Maybe > it was easier to learn then, but as the folks who know me will agree, > I'm no rocket scientist or computer whiz. I'm a career musician who > figured that if I could learn how to play and write music then I could > certainly learn how to use Csound. And with a lot of help from the true > gurus on this list, I've learned at least a little bit of it. > > I highly recommend the book "Virtual Sound" for Csound beginners, moving > on to the most excellent Csound Book by Dr. B when you feel ready for > the next step. Of course, this way of doing things is merely my way, > others will suggest other approaches that may work better for you. I > don't use Windows at all and can offer no useful advice wrt Csound on > that platform, sorry. > > Best, > > dp > > -- > Send bugs reports to this list. > To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk |