Csound Csound-dev Csound-tekno Search About

Instrument won't do what I want.

Date1998-05-11 13:59
FromPaul Winkler
SubjectInstrument won't do what I want.
Here's what looks like an interesting instrument from Charles Dodge's 
"Computer Music," second edition, p. 186-187.  Unfortunately I can't get 
it to do anything like what it's described as.  Any suggestions would be 
most welcome.

(bad ascii art follows)

 amp       peak   BW
  |         BW  open&close 
  |          |    |
+------+     |    |
| rand |    +------+
+------+    | f1   |
     |       \    /
     |        \__/ 
   +-------+    |
0->| filter|<---+
   +-------+
       |
       |
     (output)

It says here, "The center frequency is set to 0, thus converting the 
filter to a low pass. The instrument produces sound only when the 
bandwidth is sufficiently wide to allow noise in the audio range. The 
cutoff frequency is changed continuously by the controlling oscillator. 
The amplitude of the oscillator sets the maximum cutoff frequency, and 
the frequency of the oscillator determines the rate of interruption of 
noise. The results fall within a range of sounds described as 
'rustling,' 'thumping,' and 'scurrying.'"

Sounds cool to me. Here's how I think this is done in csound:

;orchestra
; sr = 44100 (commented by Cecilia)
; kr = 4410 (commented by Cecilia)
; ksmps = 10 (commented by Cecilia)
; nchnls = 1 (commented by Cecilia)

	instr 1
idb= ampdb(p4)
kbw oscil p5, p6, 1  ; set peak freq and rate of filter open/close, use 
f1
a1 rand idb			; random signal
afilt reson a1, 0, kbw		; lopass filter random signal
out afilt

	endin

And here's a sample score:

f1	0	1024	9	0.5	1	0	;	half-sine
;     2=at    3=dur	4=db 5=peak freq  6=bw rate
i1	0	1	10	10000	  1
i1	1	.	.	100	  1
i1	2	.	.	10000	  40
i1	3	.	.	100	  40
i1	4	.	.	10000	  1000
i1	5	.	.	100	  1000

e


I can't seem to come up with any useful values of the various pfields. 
Either that or something's wrong with my interpretation of the 
flowchart.  The instrument either produces boring non-scurrying noise or 
it's silent.  Notice that I've set p4 to 10 decibels, yet this still 
produces a few samples out of range. That doesn't seem right.

Ideas?


thanks for any responses,

PW


P.S. Here's a simple instrument from the same book that DOES work 
nicely. Have fun with it.

; sr = 44100 (commented by Cecilia)
; kr = 4410 (commented by Cecilia)
; ksmps = 10 (commented by Cecilia)
; nchnls = 1 (commented by Cecilia)

	instr 1 ; variably noisy pitched ringmodulator
; by PW based on C. Dodge (2nd ed.) p. 103

;set up an envelope
idur = p3 - p4 -p5
iamp = ampdb (p6)
kenv expseg 1, p4, iamp, p5, iamp, idur, 1

; set up note freq & noise bandwidth
ipit=cpspch(p8)
ibw = .01 * p7 * ipit; p7 sets noise bandwidth as percent of ipitch

;feed amplitude kenv into a random number generator
amp randi kenv, ibw

; random number modulates amp. of oscillator
aout oscil amp, ipit, 1 ; use table 1 
out aout
	endin

;sample score by PW
f1 0 512 10 1; sine
t 0 30
;p2=time 3=dur 4=atck 5=sus 6=dB 7=bw% 8=pch 
i1   0    1.3    .1   0.001 76   10     7.00
i1   1    .5    .05   .     79   12   7.02
i1   1.5  .7    .02   .1    81   8    7.03
i1   1.9  .8    .2    0.001 83   7    6.09
i1   2.6  1     .01    .    66   10    8.09
i1   3.2  1.8   .005   .    73   15    8.10
i1   4    5     .005   .1   78   30   8.07
i1   6    5      1      1   90   80    5.06
i1  8.3  .5    .3    0.001  60   10    10.09
i1  7.4   5     1.5     2   37   60    11.05
i1  7.8   7     1      2.5    33   60    11.08
e


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

Date1998-05-11 22:42
FromErik Spjut
SubjectRe: Instrument won't do what I want.
At 1:59 PM -0700 5/11/98, Paul Winkler wrote:
>Here's what looks like an interesting instrument from Charles Dodge's
>"Computer Music," second edition, p. 186-187.  Unfortunately I can't get
>it to do anything like what it's described as.  Any suggestions would be
>most welcome.

Try the following:

;orchestra
 sr = 44100
 kr = 44100
 ksmps = 1
 nchnls = 1

	instr 1
idb= ampdb(p4)
kbw oscil p5, p6, 1  ;set peak freq and rate of filter open/close, use f1
a1 rand idb			; random signal
afilt reson a1, 0, kbw,1		; lopass filter random signal
out afilt

	endin

f1	0	1024	9	0.5	1	0	;	half-sine
;     2=at    3=dur	4=db 5=peak freq  6=bw rate
i1	0	1	60	10000	  1
i1	1	.	.	500	  1
i1	2	.	.	10000	  5
i1	3	.	.	500	  5
i1	4	.	.	10000	  20
i1	5	.	.	500	  20

I set the iscl variable in reson to 1 instead of 0. With iscl the filter
gain doesnt change with bandwidth, and you can use a more realistic dB
value. Also kr=sr usually works better. I also changed the 100 Hz to 500 Hz
(It's hard to hear just the bass). I also slowed the rates from 40 and 1000
to 5 and 20. Enjoy.

-------------------------------------------------------------------------------
Erik Spjut (rhymes with cute) - Acting Director,The Center for Design Education
and/or Associate Professor of Engineering
Harvey Mudd College, Claremont, CA 91711  USA
Erik_Spjut@hmc.edu      Ph & Voice mail (909) 607-3890      Fax (909) 621-8967


Date1998-05-12 03:06
FromCharles Starrett
SubjectEthnography of Csound
Hello fellow Csounders!

I am a second-year graduate student in Ethnomusicology at who is
particularly interested (as a performer, composer as well as scholar) in
Music Technology. For a seminar in "The Transmission of Musical Tradition"
this semester I am doing a term project on CSound. Although I began by
looking at Csound as the latest stage in a generation of Computer Music
Composition--tracing its heritage back through the Music "N" series to Max
Mathews at Bell Labs, I am now trying to look at other issues of
"transmission" which surround Csound. I am particularly interested in how
CSound as a tool relates to the transmissions of attitudes aesthetics and
compositional style. (I'm sure there are interesting issues related to the
influence of attitudes on CSound and perhaps vice-versa as well!)

Most of my colleagues are studying "World Music" topics, but I have always
had a great interest in electronic and computer composition. I have chosen
CSound for my project mostly because I am already familiar with it through
my attempts to compose with it (and I am making headway, albeit slowly) and
because I have been on the Csound mailing list for over a year now.

Anything you could share of your own experience with Csound and its
predecessors would be great help to me in my project! Some examples might
be:

*As a student
*As a teacher
*As a composer
*As a researcher/engineer
*From a technical perspective
*From an artistic perspective
*Csound as a continuation of the past
*Csound as a continuation into the future
*Compare/Contrast with Music III/IV/V/360/11/
*Compare/Contrast with Cmusic, CLM, etc...

I am particularly interested in issues pertaining to MUSIC and the
TRANSMISSION of MUSICAL TRADITION through Csound (and Music 11, Music 360,
etc.)...

...but, as I said, anything would be helpful! It may be best if you email
me directly at:
starrett@fas.harvard.edu

Thank you in advance for your help.  Although the paper is due soon, I hope
to have an expanded and revised copy up on the web by the end of the
summer.  To that end, please be sure to tell me if you would prefer to be
referred to by a pseudonym.

Thanks again!
~~Charles


/----Charles D. Starrett-----\   "I do not feel that
|     /  | ____ | |  ____    |    my research suffered unduly
|    /\--| |    |-|  |       |    from the fact that I enjoyed it."
|   /  \ | |____| |  |___    |
|        |      | | ___|___  |  --Daniel Miller,
\--starrett@fas.harvard.edu--/    Modernity--an Ethnographic Approach