class Music::Performance::NoteLinker

Public Class Methods

find_unlinked_pitches(note) click to toggle source
# File lib/music-performance/util/note_linker.rb, line 5
def self.find_unlinked_pitches note
  linked = Set.new(note.pitches) & note.links.keys
  (Set.new(note.pitches) - linked).to_a
end
find_untargeted_pitches(note, next_note) click to toggle source
# File lib/music-performance/util/note_linker.rb, line 10
def self.find_untargeted_pitches note, next_note
  linked = Set.new(note.pitches) & note.links.keys
  targeted = Set.new(linked.map {|p| note.links[p].target_pitch })
  (Set.new(next_note.pitches) - targeted).to_a
end