Module: Musa::Sequencer::BaseSequencer::TicklessBasedTiming Private
- Defined in:
- lib/musa-dsl/sequencer/base-sequencer-tickless-based.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Tickless (continuous) timing implementation for BaseSequencer.
TicklessBasedTiming provides continuous, non-quantized time progression where events can be scheduled at any Rational position without rounding to a tick grid. Time advances by jumping directly to the next scheduled event, enabling precise timing for complex musical structures and avoiding quantization artifacts.
Tickless Time Model
- No quantization: Positions are exact Rational values
- Event-driven: Time jumps to next scheduled event
- Infinite resolution: ticks_per_bar = Float::INFINITY
- Zero tick duration: tick_duration = 0r
- Continuous time: No discrete grid or rounding
Time Progression
Unlike tick-based mode that advances in fixed increments, tickless mode advances position directly to the next scheduled event. If events are at positions [1r, 1.25r, 1.5r, 2r], calling #tick jumps through these exact positions without intermediate steps.
- Forward only: Position cannot decrease (enforced)
- Event jumping: #tick moves to next scheduled position
- Fast-forward: #position= executes events up to target
- No rounding: Positions preserved exactly
Comparison with Tick-Based Mode
| Aspect | Tick-Based | Tickless |
|---|---|---|
| Time grid | Quantized to ticks | Continuous |
| Resolution | ticks_per_beat | Infinite (Rational) |
| Advancement | Fixed tick_duration | Jump to next event |
| Rounding | Yes (with warning) | No |
| Use case | Traditional sequencing | Complex timing, microtiming |
Musical Applications
- Complex polyrhythms without quantization loss
- Precise microtiming and groove timing
- Non-isochronous meters and irregular divisions
- Algorithmic composition with exact ratios
- Avoiding rounding errors in long sequences
Instance Attribute Summary collapse
-
#position ⇒ Rational?
private
Current playback position in bars (Rational or nil).
Instance Method Summary collapse
-
#tick ⇒ void
Advances sequencer to next scheduled event.
-
#tick_duration ⇒ Rational
Returns zero tick duration for tickless mode.
-
#ticks_per_bar ⇒ Float
Returns infinite ticks per bar for tickless mode.
Instance Attribute Details
#position ⇒ Rational?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Current playback position in bars (Rational or nil).
Position is nil before first event, then becomes the exact Rational position of the current event. No quantization or rounding occurs.
83 84 85 |
# File 'lib/musa-dsl/sequencer/base-sequencer-tickless-based.rb', line 83 def position @position end |
Instance Method Details
#tick ⇒ void
This method returns an undefined value.
Advances sequencer to next scheduled event.
Jumps position directly to the next event in the timeslots, skipping any intermediate positions. Executes all handlers scheduled at that position. This is the primary time progression method for tickless sequencers.
Unlike tick-based mode with fixed increments, tickless tick jumps to wherever the next event is scheduled, enabling precise event-driven timing without quantization.
136 137 138 |
# File 'lib/musa-dsl/sequencer/base-sequencer-tickless-based.rb', line 136 def tick _tick @position_mutex.synchronize { @position = @timeslots.first_after(@position) } end |
#tick_duration ⇒ Rational
Returns zero tick duration for tickless mode.
Indicates infinitesimal tick duration (continuous time).
103 104 105 |
# File 'lib/musa-dsl/sequencer/base-sequencer-tickless-based.rb', line 103 def tick_duration 0r end |
#ticks_per_bar ⇒ Float
Returns infinite ticks per bar for tickless mode.
Indicates unlimited timing resolution (no tick grid).
92 93 94 |
# File 'lib/musa-dsl/sequencer/base-sequencer-tickless-based.rb', line 92 def Float::INFINITY end |