Class: Snd
Overview
a consecutave sequence of morphable tones (TonePart) of varying lengths, and rate of morphs, played without gaps.
Instance Method Summary collapse
-
#count ⇒ Object
number of tones.
-
#fade ⇒ Object
ensure all tones fade out to 0 as the final volume.
-
#initialize ⇒ Snd
constructor
A new instance of Snd.
-
#length ⇒ Object
get length.
-
#length=(val) ⇒ Object
set length.
-
#tone(i = 0, j = 0) ⇒ Object
return its TonePart at j and thats Tone at i.
-
#tonepart(i = 0) ⇒ Object
return its TonePart.
-
#toneseq ⇒ Object
return my ToneSeq.
Methods inherited from Api
Constructor Details
Instance Method Details
#count ⇒ Object
number of tones
30 31 32 |
# File 'lib/api/snd.rb', line 30 def count toneseq.toneparts.count end |
#fade ⇒ Object
ensure all tones fade out to 0 as the final volume. note: re-run after changing amp.
35 36 37 |
# File 'lib/api/snd.rb', line 35 def fade toneseq.fade end |
#length=(val) ⇒ Object
set length
22 23 24 25 |
# File 'lib/api/snd.rb', line 22 def length= val @snd.frames=val self end |
#tone(i = 0, j = 0) ⇒ Object
return its TonePart at j and thats Tone at i.
18 19 20 |
# File 'lib/api/snd.rb', line 18 def tone i=0, j=0 @snd.tonepart(j).tone(i) end |
#tonepart(i = 0) ⇒ Object
return its TonePart.
10 11 12 13 14 15 |
# File 'lib/api/snd.rb', line 10 def tonepart i=0 child = @snd.tonepart i raise "This Snd has no tone at index #{i}. " + "It has #{count} tones." if child.nil? child end |