feat: add mute and solo toggles for instruments

Closes #168
This commit is contained in:
5684185+vsariola@users.noreply.github.com
2024-10-16 00:44:14 +03:00
parent 7b213bd8b0
commit 063b2c29c5
9 changed files with 106 additions and 9 deletions

View File

@ -18,6 +18,7 @@ type (
Comment string `yaml:",omitempty"`
NumVoices int
Units []Unit
Mute bool `yaml:",omitempty"` // Mute is only used in the tracker for soloing/muting instruments; the compiled player ignores this field
}
// Unit is e.g. a filter, oscillator, envelope and its parameters
@ -352,7 +353,7 @@ func (instr *Instrument) Copy() Instrument {
for i, u := range instr.Units {
units[i] = u.Copy()
}
return Instrument{Name: instr.Name, Comment: instr.Comment, NumVoices: instr.NumVoices, Units: units}
return Instrument{Name: instr.Name, Comment: instr.Comment, NumVoices: instr.NumVoices, Units: units, Mute: instr.Mute}
}
// Copy makes a deep copy of a Patch.