Csound Csound-dev Csound-tekno Search About

timout, reinit & rireturn

Date1998-07-05 12:11
FromPaul Winkler
Subjecttimout, reinit & rireturn
Just experimenting with basic stochastic stuff for the first time and I
have two questions:

1. I'm trying to use timout, reinit & rireturn to generate a certain
number of random notes over the duration of one score "note". I've never
used these before and I don't seem to correctly understand how to get 
the
behavior I want.

I expected the following orc/sco to produce 5 random notes in the first 
10
seconds and 10 random notes in the second 10 seconds, but instead I only
get one random note that sustains for the dur of each score note.

2. Is there a way to seed the x-class noise generators? Or is there
another i-rate random generator that can be seeded? I don't want to hear
the same stuff every time...  I found an old mailing-list mention of
rnd(x) which is presumably in the value converters, but it's not in the
3.48 HTML manual.

orc & sco follow...

regards,

PW

; orc
sr = 22050
kr = 2205
ksmps = 10
nchnls = 1

	instr 1 ; very basic random notes, only upper & lower bound set

ilbound = 6.04    ; these bounds are set for guitar.
iubound = 9.09   ; for bass, use 5.04 to 8.00 and change the offset in 
ifreq

reset: timout 0, p3 / p4, notepick
	reinit reset
notepick: ioct ilinrand 3 ; octave range
ipch ilinrand 11 ; 12 semitones
ifreq = ioct + 6 + (ipch * 0.01)
if ifreq > iubound igoto notepick  ; test limits
if ifreq < ilbound igoto notepick
ivol ilinrand p6
rireturn
a1 oscil ampdb(ivol + p5), cpspch(ifreq), 1
out a1
	endin






;sco

f1 0 8192 8 0 4080 1 32 -1 4080 0

; 
;i	at	dur 	notes	amp-av	amp-dev
i1  	0 	10	5	50      20
i1  	10      10   	10	70      20
e


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