Tracks are the fundamental building blocks of your project in Lumix. Each track can contain multiple clips and has its own audio processing chain, controls, and properties.
Track Types
Lumix supports three types of tracks:
Audio Tracks For recording and playing back audio files like WAV, MP3, and other audio formats
MIDI Tracks For MIDI data, virtual instruments, and sequencing
Group Tracks For organizing and processing multiple tracks together
Track Type Enum
public enum TrackType
{
Audio ,
Midi ,
Group
}
Core Properties
Every track in Lumix has the following core properties:
Identity & Naming
public string Id { get ; set ; } = Guid . NewGuid (). ToString ();
public string Name { get ; protected set ; }
Each track has a unique identifier and a user-customizable name.
Audio Properties
public float Volume { get ; private set ; }
public float Pan { get ; private set ; }
public bool Enabled { get ; private set ; } = true ;
public bool Solo { get ; private set ; }
public bool RecordOnStart { get ; private set ; }
Volume ranges from -90dB to +6dB and is converted to linear gain using the formula: Math.Pow(10, volume / 20)
Visual Properties
public Vector4 Color { get ; protected set ; }
Each track has a customizable color that can be applied to all its clips.
Clips Collection
/// < summary >
/// The clips of this track
/// </ summary >
public List < Clip > Clips = new ();
Tracks contain a collection of clips that are arranged on the timeline.
Audio Engine
Each track has its own audio processing engine:
public TrackEngine Engine { get ; protected set ; }
The engine handles:
Audio/MIDI playback
Plugin processing chain
Recording
Volume metering
Stereo panning
Time Selection
Tracks support time-based selection for editing operations:
/// < summary >
/// Selected time of the track in musical time
/// </ summary >
public TimeSelection TimeSelectionArea { get ; protected set ; } = new ();
Start Selection
Click on the track to begin a time selection
Drag to Extend
Drag to extend the selection area across the timeline
Create Clip
Use Ctrl+Shift+M (MIDI tracks) to create a clip from the selected area
Track Controls
Tracks provide several control methods:
Volume Control
Volume is controlled via a drag slider that ranges from -90dB to +6dB:
if ( UiElement . DragSlider ( $" { FontAwesome6 . VolumeHigh } ##track_volume" , 105 , ref _volume , 0.1f , - 90f , 6f , "%.1f" , ImGuiSliderFlags . AlwaysClamp | ImGuiSliderFlags . NoInput ))
{
float linearVolume = ( float ) Math . Pow ( 10 , _volume / 20 );
Engine . StereoSampleProvider . SetGain ( linearVolume );
}
Double-click the volume slider to reset to 0dB (unity gain).
Panning Control
Pan ranges from -50 (full left) to +50 (full right):
if ( UiElement . DragSlider ( $" { FontAwesome6 . RightLeft } ##track_pan" , 105 , ref _pan , 0.1f , - 50f , 50f , "%.0f" , ImGuiSliderFlags . AlwaysClamp | ImGuiSliderFlags . NoInput ))
{
float mappedPan = _pan / 50f ;
Engine . StereoSampleProvider . Pan = mappedPan ;
}
Double-click the pan slider to reset to center (0).
Solo Behavior
if ( UiElement . Toggle ( $" { Fontaudio . Solo } ##track_solo" , _solo , new Vector4 ( 0.17f , 0.49f , 0.85f , 1f ), new ( 35 , 25 )))
{
_solo = ! _solo ;
ArrangementView . Tracks . ToList (). ForEach ( track =>
{
if ( track == this )
{
if ( ImGui . IsKeyDown ( ImGuiKey . ModCtrl ))
_enabled = ! _enabled ;
else
_enabled = true ;
}
if ( track != this )
{
if ( ! ImGui . IsKeyDown ( ImGuiKey . ModCtrl ))
{
track . _enabled = ! _solo ;
track . _solo = false ;
}
}
});
}
Holding Ctrl while clicking solo allows multiple tracks to be soloed simultaneously.
Audio-Specific Tracks
Audio tracks handle audio file playback:
Lumix/Tracks/AudioTracks/AudioTrack.cs
public class AudioTrack : Track
{
public override TrackType TrackType => TrackType . Audio ;
public AudioTrack ( string name )
{
Name = name ;
Vector4 trackCol = ImGuiTheme . GetRandomColor ();
Color = trackCol ;
Engine = new TrackAudioEngine ( this , AudioSettings . SampleRate );
Engine . VolumeMeasured += ( sender , e ) =>
{
_leftChannelGain = e . MaxSampleValues [ 0 ];
_rightChannelGain = e . MaxSampleValues [ 1 ];
};
ArrangementView . MasterTrack . AudioEngine . AddTrack ( Engine );
}
}
MIDI-Specific Tracks
MIDI tracks handle MIDI data and virtual instruments:
Lumix/Tracks/MidiTracks/MidiTrack.cs
public class MidiTrack : Track
{
public override TrackType TrackType => TrackType . Midi ;
public MidiTrack ( string name = "" )
{
Name = name ;
Vector4 trackCol = ImGuiTheme . GetRandomColor ();
Color = trackCol ;
Engine = new TrackMidiEngine ( this , AudioSettings . SampleRate );
Engine . VolumeMeasured += ( sender , e ) =>
{
_leftChannelGain = e . MaxSampleValues [ 0 ];
_rightChannelGain = e . MaxSampleValues [ 1 ];
};
ArrangementView . MasterTrack . AudioEngine . AddTrack ( Engine );
}
}
Creating MIDI Clips
MIDI tracks can create clips programmatically:
Lumix/Tracks/MidiTracks/MidiTrack.cs
public void CreateMidiClip ( long time )
{
var clip = new MidiClip ( this , time );
Clips . Add ( clip );
}
public void CreateMidiClip ( TimeSelection time )
{
var clip = new MidiClip ( this , time );
Clips . Add ( clip );
}
Double-clicking on an empty area of a MIDI track automatically creates a new clip at that position.
Track Operations
Duplicating Tracks
Tracks can be duplicated with all their settings and clips:
if ( ImGui . MenuItem ( "Duplicate" , "Ctrl+D" ))
{
if ( this is AudioTrack )
{
// Create new track and copy data
var track = ArrangementView . NewAudioTrack ( this . Name , ArrangementView . Tracks . IndexOf ( this ) + 1 );
foreach ( AudioClip clip in Clips . Cast < AudioClip >())
{
var copy_clip = new AudioClip ( track , clip . Clip , clip . StartTick ) {
Enabled = clip . Enabled ,
Color = clip . Color
};
track . Clips . Add ( copy_clip );
}
track . _enabled = this . Enabled ;
track . _volume = this . Volume ;
// ... additional properties copied
}
}
Reordering Tracks
Tracks can be moved up or down in the arrangement:
if ( UiElement . Button ( $" { FontAwesome6 . ArrowUp } " , new ( 22 , 25 )))
{
var copy = this ;
int idx = ArrangementView . Tracks . IndexOf ( this );
if ( idx > 0 )
{
var target = ArrangementView . Tracks [ idx - 1 ];
ArrangementView . Tracks [ idx ] = target ;
ArrangementView . Tracks [ idx - 1 ] = copy ;
}
}
Volume Metering
Each track displays real-time audio level metering:
// Smooth gain variables (adjusted for smoother transitions)
_smoothLeftChannelGain = Lerp ( _smoothLeftChannelGain , _leftChannelGain , smoothingFactor );
_smoothRightChannelGain = Lerp ( _smoothRightChannelGain , _rightChannelGain , smoothingFactor );
The meters show stereo levels with smoothing applied for visual stability.
Keyboard Shortcuts
Shortcut Action Ctrl+T Insert Audio Track Ctrl+Shift+T Insert MIDI Track Ctrl+D Duplicate Track Ctrl+R Rename Track Del Delete Track Ctrl+Shift+M Create MIDI Clip from Selection
See Also
Clips Learn about clip management and editing
Timeline Understand the timeline and arrangement system