Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support mute/solo/volume for tracks #19

Open
wants to merge 15 commits into
base: trunk
Choose a base branch
from

Conversation

swesterfeld
Copy link
Collaborator

This is my first attempt to implement mute/solo/volume support for tracks.

What is good:

  • user can use volume slider, which has a good non-linear mapping to the track volume
  • user can toggle mute/solo to mute and solo tracks

What is incomplete:

  • the UI code doesn't pull the initial values from the track
  • the UI code doesn't display the new volume dB value if the volume is changed (could be a tooltip)
  • I wasn't able to do the slider properly, so right now I do some hacky stuff with numberinput.js to be able to display a slider without any number input; this should be conditional
  • serialization isn't implemented (also see below)

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.

@swesterfeld swesterfeld force-pushed the track-mute-solo-volume branch from 342000c to 9c0df38 Compare October 6, 2023 09:55
@swesterfeld
Copy link
Collaborator Author

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

@tim-janik tim-janik self-requested a review October 27, 2023 15:53
@tim-janik tim-janik self-assigned this Oct 27, 2023
@swesterfeld swesterfeld force-pushed the track-mute-solo-volume branch from abf79e1 to 4801503 Compare November 19, 2023 15:36
@swesterfeld swesterfeld force-pushed the track-mute-solo-volume branch from d32b9fe to 29e5bac Compare November 20, 2023 10:09
@swesterfeld
Copy link
Collaborator Author

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.

@tim-janik tim-janik added this to the v0.3.0 milestone Jan 27, 2024
@tim-janik tim-janik modified the milestones: v0.3.0, v0.4.0 Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants