mixxx
mixxx copied to clipboard
make script.deckFromGroup(group) also filter deck from effect groups like [EqualizerRack1_[ChannelN]_Effect1]
Reported by: fkbreitl Date: 2020-10-15T10:27:37Z Status: Confirmed Importance: Wishlist Launchpad Issue: lp1899947 Tags: controllers
The Javascript helper function for controller mappings script.deckFromGroup(group) fails for [EqualizerRack1_[ChannelN]_Effect1].
This group is needed for example to adjust the equalizers: https://github.com/mixxxdj/mixxx/wiki/Mixxxcontrols#eqs-and-filters
Commented by: ronso0 Date: 2020-10-15T17:02:16Z
That function is made for deck strings only. [EqualizerRack1_[ChannelN]_Effect1] is a effect group.
https://github.com/mixxxdj/mixxx/blob/master/res/controllers/common-controller-scripts.js#L152
Commented by: ronso0 Date: 2020-10-16T14:15:21Z
Btw you can use the 'parseInt' from script.deckFromGroup(): // isolate 'N' from [ChannelN] sourceDeck = parseInt(group.substring(8,9));
Commented by: fkbreitl Date: 2020-10-16T15:32:46Z
I am extending my controller mapping to four decks. Therefore I need to know from which Channel a command was sent. It would be nice if I could use script.deckFromGroup() not only for deck strings. I think replacing the if statement by
// Extract deck number from the group text
deck = group.match("Channel.")[0].substring(7);
should fix this. Would you like me to try it out and write a PR?
Commented by: ronso0 Date: 2020-10-16T18:40:05Z
Why don't you use midi-components? it has a handler for deck switches.
That way you'd also have an up-to-date maaping that could be merged into Mixxx.
Commented by: fkbreitl Date: 2020-10-16T19:17:46Z
Because it didn't work when I tried it and because of its complexity I didn't know how to debug it.
Anyway, you can set this to won't fix if you don't like to fixing it. But the bug is valid, because the function should do what its name "deckFromGroup()" suggests. It also would be useful and the fix is easy.
Commented by: ronso0 Date: 2020-10-16T20:27:39Z
Sure, if you want to extend script.deckFromGroup() to filter decks from effect control groups (and others) go ahead!
Commented by: ronso0 Date: 2020-10-16T20:28:45Z
maybe you should check https://mixxx.zulipchat.com/#narrow/stream/113295-controller-mapping/topic/C.2B.2B.20controller.20system.20refactoring
Commented by: fkbreitl Date: 2020-10-17T08:14:55Z
Thank you, I have created https://github.com/mixxxdj/mixxx/pull/3178.