ultraabox / ultrabox_typescript

ultrabox source code
MIT License
34 stars 25 forks source link

Make channel muting a persistent state #223

Open moonvixen opened 5 months ago

moonvixen commented 5 months ago

At the moment, muting a channel does not persist through:

The third (custom samples) is probably the most annoying as it means you need to remember which channels to re-disable once you've added your samples.

I've been working around this behaviour by setting the channel volume to 0 instead (which persists), but this isn't as visually discernible, and it means it can't "remember" channel volumes, which is a big problem for multi-instrument channels.

This would help for when you have a track in a song you've decided doesn't fit but would still prefer to keep it in the file to work with, or you just want to have some tracks disabled to continue working on later without needing to remember what you had toggled off last time.

Mid-The-Modder commented 5 months ago

Perhaps as a preference for remembering muted channels; some people see the vice versa as the intended case.

choptop84 commented 5 months ago

You could just use modulators

Mid-The-Modder commented 5 months ago

Still not as convenient as just pressing a keybind to do it, although it does do the trick (but even this backfires if you are using mod channels to do something like sidechaining, then you gotta do extra work to get rid of those before doing something as simple as muting instruments)

moonvixen commented 5 months ago

Perhaps as a preference for remembering muted channels; some people see the vice versa as the intended case.

I think this would both be relatively simple and acceptable - not everyone may want this but I think this is the best method.

You could just use modulators

Sure, and I could do what I do now and name my files with the channel mute status as a string (e.g. "MyTrack_P1-2-6_N5", where pitch channels 1,2,6 and noise channel 5 are muted) but it's rather annoying to work with. I think it's better if the program actually just stores that data since it does to begin with anyway.

--

I would say it's probably better if "volume = 0" and "channel = muted" are kept as separate statuses - they are technically different. Alternatively, mapping volume 0 to automatically trigger the "muted" status would also be fine, IMO. The outcome is more or less the same and the channel volume is already stored in songdata.

leovoel commented 4 months ago

For specifically page reloads, those ideally would not even happen normally (we're working on it...), but I believe it'd be enough to use sessionStorage to get that to persist across reloads (I think the undo history uses this).

But persisting it in songs would also do it. My only real objection is that for song URLs, space is limited, so storing stuff that isn't strictly song data feels a bit off. But at least JSON exports could keep it (it's not an efficient format anyway), though it'd probably be very confusing for users if that worked there and not in URLs.