Open swesterfeld opened 1 year ago
Update: I've now implemented my first lit element for the track volume. The goal was not to be ultra generic here, but learning how to implement it. With this change we now have a volume slider that works. There is some duplicated code between knob.js and the new trackvolume.js for drag / pointer grab support
Update: I've now migrated the PR to use Track properties instead of Track methods for mute / solo / volume. To support automation in the future, the properties that do support automation (mute and volume) are now part of the AudioProcessor and no longer part of the Track, so these can receive messages while playing. Its not sample accurate yet, but this should be fairly easy to add later on.
The solo logic is a bit tricky because to know whether a track is muted or not, the track needs its own mute state, but also the information whether another track is solo, so this has kind of global state. Since we don't need to automate solo, I can compute the solo state is the non-RT code.
Everything works as far as I can see. The trackvolume.js file has duplicated code with knob.js, this should be moved elsewhere. Other than that, let me know if you see something that you'd like to be improved for merging the PR.
This is my first attempt to implement mute/solo/volume support for tracks.
What is good:
What is incomplete:
Other issues:
Right now the mute/solo/volume interface between the UI and core is done by adding methods to the track. However, these values should support automation in the future. So these values really looks like AudioProcessor parameters. These have a minimum, maximum, default, non-linear mapping between UI values and actual DSP values, the ability to enter a value directly, and these are serialized automatically by the framework. However, as far as I can see Track is not an AudioProcessor, so I cannot make these parameters here.
Btw, panning isn't implemented yet because we don't have a mixer view, it should be added once we have that.