Sha256: cc930e9178c1d16f67720d608ce10ac2a8abceb77ef448dd3b5b659f9151d4aa

Contents?: true

Size: 705 Bytes

Versions: 6

Compression:

Stored size: 705 Bytes

Contents

require 'bloops'

# the song object
b = Bloops.new
b.tempo = 320

# an instrument
saw = b.sound Bloops::SAWTOOTH
saw.test

# assign a track to the song
b.tune saw, "c5 c6 b4 b5 d5 d6 e5 e6"

# make it go
b.play
sleep 1 while !b.stopped?

# a percussion
beat = b.sound Bloops::NOISE
beat.repeat = 0.6
beat2 = b.sound Bloops::NOISE
beat2.repeat = 0.2
beat3 = b.sound Bloops::SQUARE
beat3.sustain = 0.25
beat3.decay = 0.2
beat3.slide = 0.2
beat3.square = 0.3
beat3.vibe = 0.25
beat3.vspeed = 0.25

# assign a track to the song
b.tune beat, "4 4 4 b4 4 d5 4 e5"
b.tune beat2, "c2 4 c2 4 c2 4 c2 4"
b.tune beat3, "4 4 4 4 4 c2 c5 4"

# make it go
loop do
  b.play
  saw.test
  sleep 0.02 while !b.stopped?
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
scarpe-0.4.0 examples/bloopsaphone/working/bloops_test.rb
scarpe-0.3.0 examples/bloopsaphone/working/bloops_test.rb
scarpe-0.2.2 examples/bloopsaphone/working/bloops_test.rb
lacci-0.2.1 examples/bloopsaphone/working/bloops_test.rb
scarpe-0.2.1 examples/bloopsaphone/working/bloops_test.rb
scarpe-0.2.0 examples/bloopsaphone/working/bloops_test.rb