Csound Csound-dev Csound-tekno Search About

RE: timout exasperation

Date1999-07-22 02:53
FromGrant Covell
SubjectRE: timout exasperation
I've figured out my own timout exasperation. I guess it's not used much by
the group, as I got back no comments!
Here's a simple orc/sco that demonstrates using timout without reinit and
rireturn

;;sample.orc

sr   = 44100
kr   = 44100
ksmps  = 1
nchnls  = 1 

instr 2
 ;; locations to start snip
 idur   = p3 - 4
 imid  unirand idur
 iloc1  unirand imid
 iloc2  unirand idur - imid
 iloc2  = iloc2 + imid + 2
 irem  = p3 - iloc2
 print  imid, iloc1, iloc2, irem

 ;; the work
 timout 0, iloc1, end 
 timout 0, 2, do
 timout 0, iloc2, end
 timout 0, 2, do
 timout 0, irem, end
 
 do:   
   asig  oscil 5000, 400, 10
   out   asig  

 end:
endin


;; sample.sco

f10 0 8192 10 1
i2 0 15

====

> -----Original Message-----
> From: Grant Covell [mailto:GCovell@c-bridge.com]
> Sent: Tuesday, July 13, 1999 10:09 PM
> To: Csound (E-mail)
> Subject: timout exasperation
> 
> 
> Hello--
> 
> I'm trying to use multiple timout calls within the same 
> orchestra, and am
> frustrated by the somewhat inconsistent results and cryptic 
> documentation.
> 
> The sco/orc pair below is very simplified from what I am 
> hoping to do: given
> a simple one line call in the score, trigger the playback of 
> a given sound
> twice at random times within the p3. I've taken out the 
> creation of the
> random start points and the reading of the existing file, 
> just to focus on
> getting timout to work.
> 
> The documentation specifies that timout (timout istart, idur, 
> label) will
> occur at istart, last for idur and accomplish the event(s) at 
> the label.
> What I have below is the most logical use of timout (without 
> reinit, and
> rireturn) I've figured out so far (timout with the reinit and 
> rireturn work
> best when the dur in timout is repeatable and not random--if 
> someone has a
> solution for a non-periodic use of timout, I'd love to see 
> it!). I see how
> timout can be reinitialized at endin, but still think that 
> istart restting
> to 0 is somewhat odd. Also, the call to the last event 
> appears to continue
> beyond 13 secs. extending itself to the full p3.
> 
> Thanks for the help and advice!
> 
> Grant.
> gcovell@c-bridge.com
> 
> 
> ===
> ;;score:
> 
> f10 0 8192 10 1
> i1 0 14 1
> e
> ;; end of score
> 
> 
> ;;orchestra:
> 
> sr 		= 44100
> kr 		= 441
> ksmps 	= 100
> nchnls 	= 2
> 
> 
> instr 1
> 	
> timout	0, 3, end		;; ends at 3
> timout	3, 2, do		;; start at 3, end at 
> 5, reset to 0
> timout	0, 5, end		;; start at 5 end at 10
> timout	5, 2, do		;; start at 10 end at 
> 12, reset to 0
> timout	0, 1, end		;; start at 12 and at 13
> 		
> do:	
> asig 	oscil 5000, 400, 10
> outs  	asig, asig
> 		
> end:
> endin	
> ;; end of orchestra