Class: SoundPlayer
- Inherits:
-
Object
- Object
- SoundPlayer
- Defined in:
- lib/musical_spec/bloops.rb
Instance Method Summary collapse
-
#initialize ⇒ SoundPlayer
constructor
A new instance of SoundPlayer.
- #start ⇒ Object
Constructor Details
#initialize ⇒ SoundPlayer
Returns a new instance of SoundPlayer.
3 4 5 6 7 8 9 |
# File 'lib/musical_spec/bloops.rb', line 3 def initialize @bloopsaphone = Bloops.new @sound = @bloopsaphone.sound(Bloops::SQUARE) @sound.sustain = 1 @note = Note.new end |
Instance Method Details
#start ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/musical_spec/bloops.rb', line 11 def start 200.times do @bloopsaphone.clear if success? @note.next! else @note.next! # @note.prev! end @bloopsaphone.tune(@sound, @note.note) @bloopsaphone.play sleep 0.1 #while [email protected]? end end |