Coder Social home page Coder Social logo

Comments (20)

rncbc avatar rncbc commented on July 25, 2024

it might be correct behavior, because you're trying to use a continuous/scalar controller value (a rotary/slider knob?) to actuate over a toggle/on-off subject (command shortcut). So that only the changes in value do trigger the action.

from qtractor.

simonvanderveldt avatar simonvanderveldt commented on July 25, 2024

No, I'm using a button that on every press sends whatever I set it to. So I have the following situations:

  • Set the button to send value=0, nothing happens
  • Set the button to send value=127, it only works once
  • Set the button to send value=1 or 2 or ... or 126, it always works

from qtractor.

rncbc avatar rncbc commented on July 25, 2024

if you can configure the button at all, please make it a toggled one, sending value=0 (OFF) and value=127 (ON) in alternation, that i think is the usual way buttons work :)

i might be short-sighted but letting a button to always send one fixed and constant value, whenever you press/depress it, is kind of a "stupid" setting to have--blame on the device not you nor me ;)

and please, don't you tell me about that stateless/restful control model if you're thinking on that...
let me tell this is no web service at all: this is about a plain old stateful control model: both ends are supposed to keep their own state, being either a physical/external controller/actuator (a knob, slider, button, whatever) and then the other end, the receiver (re)actor (qtractor in this case) -- both ends' state should match, at sometime, somehow, and eventually :)

hth
cheers

from qtractor.

simonvanderveldt avatar simonvanderveldt commented on July 25, 2024

if you can configure the button at all, please make it a toggled one, sending value=0 (OFF) and value=127 (ON) in alternation, that i think is the usual way buttons work :)

When doing that it actually triggers the command twice, the first time for the press (value = 127) and the second time for the release (value = 0).

Qtractor already behaves the way I expected it to (trigger the shortcut action on value receive) for values 1-126, just not for 0 and 127, so it seems like a bug in handling those values to me.

from qtractor.

rncbc avatar rncbc commented on July 25, 2024

not quite a bug but yes it's fringe/corner bug of sorts.. whatever :)
it might have to do with some one-shot/triggering semantics to shortcuts in particular: something I've been chalking as same as a latched (ie. non-momentary) type of control actuator and that was probably way too naive or kinda wrong doing :/
ok. maybe a new special triggering mode should be on demand here, special only for shortcuts maybe, may a so called "one-shot" perhaps?
moving on up, into the next development cycle though
cheers && thanks

from qtractor.

simonvanderveldt avatar simonvanderveldt commented on July 25, 2024

I think this can be the simplest implementation possible, in pseudo code: If message that matches shortcut comes in trigger the shortcut, the actual value of the message can be ignored.
Don't think it would need anything more complex, right?

from qtractor.

rncbc avatar rncbc commented on July 25, 2024

yes, except to shortcuts that are of the checkable/toggled kind...

from qtractor.

rncbc avatar rncbc commented on July 25, 2024

ok. the first fix is in qtractor-0.8.5.3git. 7df581

cheers && thanks

from qtractor.

simonvanderveldt avatar simonvanderveldt commented on July 25, 2024

Thx! I'll give it a try this weekend.

Regaring the MIDI mappings in general: I was wondering what the expected behavior for all MIDI mappable actions is.
For example the MIDI mappings one can make in the Controllers view for Solo, Mute, etc seems to expect a "toggle" type value (0 for off, 1-127 for on) to be sent. This means the device that sends the MIDI messages needs to keep state as well.
Is this the way those mappings are supposed to work? Wouldn't it be nice(r) if the MIDI controller could just send a CC message and Qtractor would toggle the state?

from qtractor.

rncbc avatar rncbc commented on July 25, 2024

as of this commit above (qtractor >= 0.8.5.3git. 7df581), the so called "one-shot" behavior is now in place for all action shortcuts, making a MIDI controller's device state/value irrelevant for actually triggering the mapped action.

all other mappings (not related to one-shot shortcuts) still honor the state and/or value on either or both ends as before and always, so that if you want to control a toggle subject (eg. Solo, Mute, etc.) with a momentary controller (eg. key, pad, foot-switch, etc.) you'll probably need to un-check the so called Latch mode of operation ;)

hth.
cheers

from qtractor.

simonvanderveldt avatar simonvanderveldt commented on July 25, 2024

as of this commit above (qtractor >= 0.8.5.3git. 7df581), the so called "one-shot" behavior is now in place for all action shortcuts, making a MIDI controller's device state/value irrelevant for actually triggering the mapped action.

Can confirm this works. One can send any CC value (0-127) for the CC as configured in shortcuts and it works. Awesome! Thanks for the quick fix!

all other mappings (not related to one-shot shortcuts) still honor the state and/or value on either or both ends as before and always, so that if you want to control a toggle subject (eg. Solo, Mute, etc.) with a momentary controller (eg. key, pad, foot-switch, etc.) you'll probably need to un-check the so called Latch mode of operation ;)

Now that you mention it, could it be this behaviour is/was caused by the "Latch" option being enabled by default for one-shot shortcuts. Shouldn't "Latch" be off for them?
image

from qtractor.

rncbc avatar rncbc commented on July 25, 2024

could it be this behaviour is/was caused by the "Latch" option being enabled by default for one-shot shortcuts. Shouldn't "Latch" be off for them?

could be but "Latch" is disabled/grayed out anyway for shortcut actions :)
so...

from qtractor.

simonvanderveldt avatar simonvanderveldt commented on July 25, 2024

could be but "Latch" is disabled/grayed out anyway for shortcut actions :)
so...

Yeah, that's true, but even though it's grayed out it's showing the checkbox as checked. Whereas the checkbox for "Logarithmic" is shown as unchecked. This seems to suggest that even though the user can't change the value it's actually enabled for "Latch".
If that's the case I guess it would be cleaner to fix the issue by getting rid of the "Latch" = enabled setting for oneshot controls?

from qtractor.

rncbc avatar rncbc commented on July 25, 2024

I guess it would be cleaner to fix the issue by getting rid of the "Latch" = enabled setting for oneshot controls?

maybe now in 0.8.5.7git. 9ac6c3 ;)

byee

from qtractor.

simonvanderveldt avatar simonvanderveldt commented on July 25, 2024

Looks and works good!
One (hopefully final :P) question, shouldn't "Latch" for non-oneshot options be user changeable? It used to be before this change.
image

from qtractor.

rncbc avatar rncbc commented on July 25, 2024

and it is, only not for shortcuts, now made as one-shot with Latch option disabled but checked for toggling subjects and unchecked otherwise.

subtle uh? :)

from qtractor.

simonvanderveldt avatar simonvanderveldt commented on July 25, 2024

and it is, only not for shortcuts, now made as one-shot with Latch option disabled but checked for toggling subjects and unchecked otherwise.

But that means the user can no longer choose to either use a latching or a non-latching/momentary switch with toggling shortcuts (like Track mute), which means a regression for people using MIDI footswitches for example, right?

from qtractor.

rncbc avatar rncbc commented on July 25, 2024

well, yes probably, but for those cases I would not recommend to use action Shortcuts--which are all now one-shot type, ok?--there are other and better ways to map a MIDI controller into those controllable/automatable subjects, remember? that said, menu shortcuts might not be always the most sane to be mapped-to/actuated-by a "momentary" controller device (one that sends the same message type while toggling its state or value when is pressed (off->on) and depressed (on->off).
byee && merry xmas

from qtractor.

simonvanderveldt avatar simonvanderveldt commented on July 25, 2024

Since I'd like to start contributing back to Qtractor I thought this would be a good opportunity to dive into the code and see if I could understand how it's working and come up with something that works for all use cases.
I have something that works for me for all cases I could come up with for both one-shot as well as toggleable shortcuts and for both latching and non-latching controllers for those toggleable shortcuts.

@rncbc Since I don't know if this is OK with you and if you're open to contributions I haven't made a PR. The commit is here with some annotations about why/how I did things and questions I still have.
simonvanderveldt@e431914
What do you think?

byee && merry xmas

Merry Christmas to you too! 🎄

from qtractor.

rncbc avatar rncbc commented on July 25, 2024

hi, you can certainly make it a PR, a couple of notes though:

  • the "Latch" setting is "true" on MidiControlObserver::ctor because it is the usual mode on most MIDI controller devices that I know of; the non-latch/momentary ones seem to be rare out there, but that's not a real issue or is it?
  • "one-shot" shortcuts (ActionControl::MidiObserver) in fact were just being flagged as such by having both "Integer" and "Latch" attributes set to "true";
    your proposed commit seem to overrule both of the above, and makes me think whether it's neutral to other modes of controllers but plain ""one-shot" and toggled" ones.
    note also that I've done no field-tests, i'm just guessing
    cheers

from qtractor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.