RedSFPlayer plays soundfiles (from memory)
based on PlayBuf
see also RedSFPlayerDisk for playing back soundfiles from disk.
*new(server)
*read(path, server)
create a new player on a Server. if server is nil it will use Server.default.
read(path)
path should be a String pointing to a soundfile.
the server should be booted before reading.
loop(out, rate, fadeTime)
play(out, rate, fadeTime)
starts playing the soundfile.
out - out bus. default is 0.
rate - playback rate. default is 1.
fadeTime - in seconds. default is 0.
stop(fadeTime)
fadeTime - in seconds. default is 0.
free
stop playing and free internal buffer.
amp
gets the amplitude. default is 1.
amp_(val)
sets the amplitude.
isPlaying
boolean
<>server
<buffer
<synth
<duration
length of the soundfile in seconds. updated after reading.
<channels
number of channels of the soundfile. updated after reading.
//--
s.boot;
a= RedSFPlayer.new
a.read("sounds/a11wlk01-44_1.aiff")
a.play //default is play out on bus 0 with rate 1 and 0 fadeTime
a.stop
a.loop(0, 3, 4) //start looping with long fadeTime and high rate
a.loop(0, -2, 8) //crossfade to backwards rate
a.stop(4) //fadeout
a.free