Csound Csound-dev Csound-tekno Search About

Re: timout, reinit & rireturn

Date1998-07-05 23:18
FromHans Mikelson
SubjectRe: timout, reinit & rireturn
Hi,

Paul Winkler wrote:

>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.


Try making the following changes:

 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, next1
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
       reinit   reset
next1:
a1 oscil ampdb(ivol + p5), cpspch(ifreq), 1
out a1
 endin

Bye,
Hans Mikelson