Skip to content

Commit

Permalink
fix midi note resolution with octaves
Browse files Browse the repository at this point in the history
  • Loading branch information
samaaron committed Jun 6, 2014
1 parent 5525ae9 commit abd2fe7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/server/sonicpi/note.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ def self.resolve_midi_note_without_octave(n)
end

def self.resolve_midi_note(n, o=nil)
n = resolve_midi_note_without_octave(n)
n = NOTES_TO_INTERVALS[n.to_sym]
raise "Invalid note without octave #{n.inspect}, expected something of the form :c, :Bb, Fs" unless n
o = o.to_i * 12
n + o
n + o + 12
end

def self.resolve_note_name(n, o=nil)
Expand Down

0 comments on commit abd2fe7

Please sign in to comment.