Last chance! 50% off unlimited learning
Sale ends in
duration(s)
duration(s) <- value
setDuration(s,value)
duration
, the duration of the sample in seconds.
For setDuration
, a Sample object with the new duration.sampleLength
s <- Sine(440,3)
duration(s) # 3
duration(s) <-.5 # sample is now .5 sec long
play(setDuration(s,1)) # plays a .5 sec sine wave and then .5 sec silence
Run the code above in your browser using DataLab