Skip to content
Newer
Older
100644 31 lines (26 sloc) 680 Bytes
2ad3b50 Rcov integration. Helper functions for constructing music objects. Se…
Jeremy Voorhis authored Jul 9, 2008
1 require File.join( File.dirname(__FILE__), 'spec_helper')
2 require 'rational'
05b8385 Implemented diatonic transposition that respects enharmonics.
Jeremy Voorhis authored Sep 19, 2008
3 require 'music/midi_time'
2ad3b50 Rcov integration. Helper functions for constructing music objects. Se…
Jeremy Voorhis authored Jul 9, 2008
4
5 include Music
6
7 describe Music, "midi interface" do
8
9 describe MidiTime do
10 it "should convert qn to ppqn" do
11 t = MidiTime.new(480)
12 { 1 => 480,
13 1.0 => 480,
14 2 => 960,
15 2.0 => 960,
16 2.quo(1) => 960,
17 0.5 => 240,
18 1.quo(2) => 240,
19 1.quo(3) => 160,
20 1.quo(7) => 69
21 }.each do |dur,ppqn|
22 x = t.ppqn(dur)
23 x.should be_kind_of(Integer)
24 x.should == ppqn
25 end
26
27 proc { t.ppqn(".5") }.should raise_error(ArgumentError)
28 end
29 end
30 end
Something went wrong with that request. Please try again.