Hi - is there a way to determine the direction the encoder is turned?
Hello,
for traktor normally in the mapping.
I meant in QML.
E.g:
Wire {
from: "s4mk3.left.browse.encoder.is_turned";
to: ButtonScriptAdapter {
onRelease: {
// how do I read the encoder value and or the direction?
}
What is the application for this encoder?
Sorry, not sure I understand your question.
Sorry, what you need this encoder to do or why is it important to track the direction of the turn?
I use it to browse through a list and need to be able to move up and down the list.
Ahh i think now i get it, QML is a GitHub project (i mean for traktor, it is of course more)? So the experts for that stuff you will find there. I would also ask there.
You could try to ask this guy @kokernutz he is also active on GitHub
Thanks @Uwe303, QML is a language.
@Stevan, @kokernutz any hints?
I know that, but i refered to the project about traktor, but thanks for clearing that up, so one read that knows it
Does anyone know if this functionality is being used in any of the available mods?
The input '.encoder.is_turned' only registers turning it like a button trigger, hence the ButtonScriptAdapter attached.
To use the different turning directions you have two choices.
Example 1:
Wire { from: "%surface%.s4mk3.left.browse.encoder.turn"; to: EncoderScriptAdapter { onIncrement: { selectedHotcueType.value ==5 ? selectedHotcueType.value = selectedHotcueType.value - 5 : selectedHotcueType.value = selectedHotcueType.value + 1 } onDecrement: { selectedHotcueType.value ==0 ? selectedHotcueType.value = hotcue1Type.value + 5 : selectedHotcueType.value = selectedHotcueType.value -1 } } }
'onIncrement {}' is the command block for turning the encoder clockwise.
Example 2:
Wire { from: "%surface%.s4mk3.left.browse.encoder.turn"; to: RelativePropertyAdapter { path: "app.traktor.decks." + deckId + ".track.key.adjust"; step: 1/12; mode: RelativeMode.Stepped } }
'RelativePropertyAdapter' is the streamlined version, 'mode: RelativeMode.Increment' and 'mode: RelativeMode.Decrement' increases or decrases the value of something by 1, regardless of direction,
'mode: RelativeMode.Stepped' increases (clockwise) and decreases (counter-clockwise) a value with 'step:'being used for the size of a single step on the encoder.
'EncoderScriptAdapter' and 'RelativePropertyAdapter' can be used for the stepped encoders as well as for endless encoders and Jogwheels.
'EncoderScriptAdapter' has a lot more versatility, since you can include a lot of computations in the codeblock like for example register the speed of turning the encoder and do different things according to the speed. Here is one example i coded myself (without explanation):
Wire { from: "%surface%.knobs.1"; to: EncoderScriptAdapter { onTick: { if (value < -minimalTickValue1 || value > minimalTickValue1) mixerFXAdjust3.value = mixerFXAdjust3.value + (value * rotationScaleFactor1); else if (value < -minimalTickValue2 || value > minimalTickValue2) mixerFXAdjust3.value = mixerFXAdjust3.value + (value * rotationScaleFactor2); else if (value < -minimalTickValue3 || value > minimalTickValue3) mixerFXAdjust3.value = mixerFXAdjust3.value + (value * rotationScaleFactor3); } } }
Amazing! Thank you!
Is there a way to set the master volume from qml? (or any AppProperty for that matter?)
AppProperty { id: masterVolume; path: "app.traktor.mixer.master_volume" }
Once you have done that, you can adjust 'masterVolume.value' with any control you like. I am pretty certain that the value goes from 0.000 to 1.000.
Like this:
Wire { from: "%surface%.s4mk3.left.browse.encoder.turn"; to: RelativePropertyAdapter { path: "app.traktor.mixer.master_volume"; step: 0.05; mode: RelativeMode.Stepped } }
If you use a knob like on the mixer controls or fx section, you can also use DirectPropertyAdapter without 'Step:...' or 'Mode:...'.
Another way:
Wire { from: "%surface%.s4mk3.left.browse.encoder.turn"; to: EncoderScriptAdapter { onIncrement: { masterVolume.value = masterVolume.value + 0.05 } onDecrement: { masterVolume.value = masterVolume.value - 0.05 } } }
Here is a textfile with all the commands we could glean from the exe file: