Configuration Guide
mtrack uses YAML configuration files (or other formats supported by config-rs) to define player behavior, audio routing, MIDI control, and more.
Configuration File Structure
A complete mtrack configuration file looks like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
# The directory where all of your songs are located
songs: /mnt/song-storage
# The path to the playlist file
playlist: /mnt/playlist.yaml
# Audio configuration
audio:
device: UltraLite-mk5
buffer_size: 1024
buffer_threshold: 256
sample_rate: 44100
sample_format: int
bits_per_sample: 32
playback_delay: 500ms
# MIDI configuration
midi:
device: UltraLite-mk5
playback_delay: 500ms
midi_to_dmx:
- midi_channel: 15
universe: light-show
transformers:
- type: note_mapper
input_note: 0
convert_to_notes: [0, 1, 2, 4, 5, 6]
# DMX configuration
dmx:
dim_speed_modifier: 0.25
playback_delay: 500ms
universes:
- universe: 1
name: light-show
# Status events (for controller feedback)
status_events:
off_events:
- type: control_change
channel: 16
controller: 3
value: 2
idling_events:
- type: control_change
channel: 16
controller: 2
value: 2
playing_events:
- type: control_change
channel: 16
controller: 2
value: 2
# Controllers (gRPC, OSC, MIDI)
controllers:
- kind: grpc
port: 43234
- kind: osc
port: 43235
broadcast_addresses:
- 127.0.0.1:43236
- kind: midi
play:
type: control_change
channel: 16
controller: 100
value: 0
prev:
type: control_change
channel: 16
controller: 100
value: 1
next:
type: control_change
channel: 16
controller: 100
value: 2
stop:
type: control_change
channel: 16
controller: 100
value: 3
# Track name to output channel mappings
track_mappings:
click:
- 1
cue:
- 2
backing-track-l:
- 3
backing-track-r:
- 4
|
Song Repository
The songs field specifies the directory containing your song definitions and audio files. This can be an absolute path or relative to the configuration file location.
1
|
songs: /mnt/song-storage
|
Playlist
The playlist field points to your playlist YAML file:
1
|
playlist: /mnt/playlist.yaml
|
Audio Configuration
Required Fields
device: The name of your audio device (use mtrack devices to list available devices)
Optional Fields
buffer_size: Background read buffer size in samples (default: 1024)
buffer_threshold: Threshold for triggering background reads (default: 256)
sample_rate: Sample rate in Hz (default: 44100)
sample_format: Sample format - int or float (default: int)
bits_per_sample: Bit depth (default: 32)
playback_delay: Delay before starting audio playback (default: 500ms)
MIDI Configuration
Required Fields
device: The name of your MIDI device (use mtrack midi-devices to list available devices)
Optional Fields
playback_delay: Delay before starting MIDI playback (default: 500ms)
midi_to_dmx: Configuration for routing live MIDI events to DMX
DMX Configuration
Required Fields
universes: List of DMX universe mappings
Optional Fields
dim_speed_modifier: Multiplier for dimming speed (default: 0.25)
playback_delay: Delay before starting DMX playback (default: 500ms)
Controllers
mtrack supports three types of controllers:
gRPC Controller
1
2
3
|
controllers:
- kind: grpc
port: 43234 # Optional, defaults to 43234
|
OSC Controller
1
2
3
4
5
6
7
8
9
|
controllers:
- kind: osc
port: 43235
broadcast_addresses:
- 127.0.0.1:43236
play: /mtrack/play
prev: /mtrack/prev
next: /mtrack/next
stop: /mtrack/stop
|
MIDI Controller
1
2
3
4
5
6
7
8
|
controllers:
- kind: midi
play:
type: control_change
channel: 16
controller: 100
value: 0
# ... other events
|
Track Mappings
Map track names to output channels:
1
2
3
4
5
6
|
track_mappings:
click: [1]
cue: [2]
backing-track-l: [3]
backing-track-r: [4]
keys: [5, 6] # Multiple channels for stereo
|