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.

Examples:

Basic voice setup

require 'musa-dsl'
require 'midi-communications'

clock = Musa::Clock::TimerClock.new bpm: 120
transport = Musa::Transport::Transport.new clock
output = MIDICommunications::Output.all.first

voices = Musa::MIDIVoices::MIDIVoices.new(
  sequencer: transport.sequencer,
  output: output,
  channels: 0..3
)

voice = voices.voices.first
voice.note pitch: 60, velocity: 90, duration: 1r/4

See Also:

Defined Under Namespace

Classes: MIDIVoice, MIDIVoices