Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: e52de7604a
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 41 lines (32 sloc) 0.727 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
require "test/unit"
require "radspberry"

class TestRadspberry < Test::Unit::TestCase
  include DSP

  # def test_phasor
  # p = Phasor.new
  # assert_equal 0.0, p.tick
  # end
  
  def test_speaker
    Speaker[ Phasor.new ]
    sleep 1

    puts "changing frequency"
    Speaker.synth.freq /= 2
    sleep 1

    puts "changing frequency"
    Speaker.synth.freq /= 2
    sleep 1

    puts "starting crossfader (supersaw with rpmnoise)"
    chain = XFader[ o1=SuperSaw.new, o2=RpmNoise.new ]
    Speaker[ chain ]
    o1.spread = 0.8
    chain.fade = 0
    sleep 5
    10.times do
      puts "crossfade to noise... (#{chain.fade += 0.1})"
      sleep 0.5
    end

    puts "muting"
    Speaker.mute
    sleep 1
  end

end
Something went wrong with that request. Please try again.