Module: Musa::MIDIVoices
- Included in:
- All
- Defined in:
- lib/musa-dsl/midi/midi-voices.rb
Overview
High-level MIDI channel management synchronized with sequencer timeline.
Provides voice abstraction for controlling MIDI channels with sequencer-aware note scheduling, duration tracking, sustain pedal management, and fast-forward support for silent timeline catch-up.
Each voice represents the state of a MIDI channel (active notes, controllers, sustain pedal) and ties all musical events to the sequencer clock. This ensures correct timing even when running in fast-forward mode or with quantization.
What an output has to be
Anything that answers puts with a MIDI event. In production that is a
MIDICommunications::Output; for the per-method examples below it is a
collector, which is also the shortest way to see what a voice emits:
sequencer = Musa::Sequencer::Sequencer.new(4, 24)
output = [].tap { |sent| def sent.puts() = self << }
voices = Musa::MIDIVoices::MIDIVoices.new(
sequencer: sequencer, output: output, channels: 0..3)
voice = voices.voices.first
Defined Under Namespace
Classes: MIDIVoice, MIDIVoices