Mapping something (e.g. loop size/out) to jog wheel

1101113151623

Answers

  • Sûlherokhh
    Sûlherokhh Member, Traktor Mapping Mod Posts: 2,628 mod
    edited September 2023

    I changed all 16 instances of this:

     WiresGroup {
       enabled: !gridAdjustEnableProp.value && module.active && !deckLoading
       Wire {
         enabled: !loopActive.value && !((deckBeat == 8) || (deckBeat == 1)) && deckPlaying;
         from: "%surface%.jogwheel_ring.1"; to: "turntable.lights" ;
       }
    ...
    }
    

    to this:

     WiresGroup {
       enabled: !gridAdjustEnableProp.value && module.active && !deckLoading
       Wire {
         enabled: !loopActive.value && !((deckBeat == 8) || (deckBeat == 1));
         from: "%surface%.jogwheel_ring.1"; to: "turntable.lights" ;
       }
    ...
    }
    

    removing every instance of '&& deckPlaying', so the turn LED work even when cueing and not playing.

    Explanations:

    The first WiresGroup (line 88) is for the turning LED, which work when you are not using GridAdjust ('!gridAdjustEnableProp.value'), when the turning deck is focussed ('module.active') and when the loading animation is not active ('!deckLoading').

    enabled: !gridAdjustEnableProp.value && module.active && !deckLoading
    

    As you can see the sign '!' means 'not'.

    The second WiresGroup (line 183) is for the loading animation LED, which work when you are not using GridAdjust ('!gridAdjustEnableProp.value'), when the turning deck is focussed ('module.active') and when the loading animation is active ('deckLoading').

    enabled: !gridAdjustEnableProp.value && module.active && deckLoading
    

    Extra info for particular LED's (1-8) for turning lights:

    The expression of, for example '!((deckBeat == 8) || (deckBeat == 1))' can be translated as

    • not (either deckBeat value equals 8 or deckBeat value equals 1), or equivalenly
    • neither (deckBeat value equals 8) nor (deckBeat value equals 1)

    and so i could write it as '( !(deckBeat == 8) && !(deckBeat == 1))', or as '((deckBeat != 8) && (deckBeat != 1))'.

    I hope this helps. Test away.


    Edit: More Info...

    I put in the code

     !((deckBeat == 8) || (deckBeat == 1))
    

    as a way to invert the LED display. As you know i initially had it so that only two LED would light up, the rest staying black. The code i used was

    ((deckBeat == 8) || (deckBeat == 1))
    

    and so i just put a '!' in front to invert the LED display with the smalles code change possible.

    🦋

  • VityaT
    VityaT Member Posts: 40 Helper

    @Sûlherokhh

    Thank you for the explanations! I've really got answers to some my questions.

    I have tested new version and one thing is still there - after traktor is just started and noone deck is loaded LEDs are lit up. And they must not lit up when deck is empty.

    I think it's because there is always "before-track" part in deck (realy don't know how to name it properly). I've mark it on screenshots

    And it needed to make additional condition to bypass this.

    I've tried to determine that deck is loaded and play with something like "app.traktor.decks.X.is_loaded" or "app.traktor.decks.X.track.content.track_length" in line 89 but had no luck

    AppProperty 
     { 
      id: deckNoEmptyProp; 
      path: "app.traktor.decks." + deckIdx + "is_loaded" 
     }
    property bool deckNoEmpty: deckNoEmptyProp.value
    ...
      WiresGroup {
       //enabled: !gridAdjustEnableProp.value && module.active && !deckLoading
       enabled: !gridAdjustEnableProp.value && module.active && (deckNoEmptyProp.value!=0) && !deckLoading
    
  • Sûlherokhh
    Sûlherokhh Member, Traktor Mapping Mod Posts: 2,628 mod

    instead of this:

    (deckNoEmptyProp.value!=0)
    


    you could try out this:

    (deckNoEmptyProp.value == 1)
    

    or this:

    (deckNoEmptyProp.value == true)
    

    or this:

    deckNoEmptyProp.value
    

    or this:

    deckNoEmpty
    

    or this:

    (deckNoEmpty == true)
    


    Foremost it may be better to call the values deckLoadedProp and deckLoaded to avoid the logical double negation in the name NoEmpty.

  • VityaT
    VityaT Member Posts: 40 Helper

    @Sûlherokhh

    Thank you as always!

    I've found the soulution an it is pretty simple

    All i needed is to know that deck is already loaded. And i did this with boolean variable in timer part

    property bool deckIsLoaded: false
    
    ...
    
    Timer {
      id: loadJogAnimationTimer
      interval: 150 //milliseconds per step. reduce to speed up animation
      repeat: true
      running: deckLoading
      onTriggered: {
       deckLoadingAnimationProp.value = deckLoadingAnimationProp.value - 1;
       if ( deckLoading && deckLoadingAnimationProp.value < 1 ) {
        deckLoading = false;
        deckLoadingAnimationProp.value = 0;
        deckIsLoaded=true;
       }
      }
     }
    ...
     WiresGroup {
      enabled: !gridAdjustEnableProp.value && module.active && !deckLoading && deckIsLoaded
    Wire {
          enabled: !loopActive.value && !((deckBeat == 8) || (deckBeat == 1));
          from: "%surface%.jogwheel_ring.1"; to: "turntable.lights" ;
        }
    ...
    }
    

    Now for me LED Mod is done. If Traktor Kontrol S3 users interested in it then here is the final version


    Sûlherokhh thanks again!

  • Sûlherokhh
    Sûlherokhh Member, Traktor Mapping Mod Posts: 2,628 mod

    Awesome! I am happy you got this working to your satisfaction. If you need any more assistance for further projects, just let me know. If you develop any more of your ideas, i am sure i would not be the only one happy if you let us know as well. :)

    At this point i would once again like to say thank you to everyone supporting my efforts to make this way to customize NI controllers a bit more accessible to users, which is a driving motivation. You know who you are. 🙏

  • VityaT
    VityaT Member Posts: 40 Helper

    Just quick update

    If someone likes not inverted mod then here it is


  • dj_estrela
    dj_estrela Member Posts: 165 Pro
    edited October 2023

    This is really smart, but it is so sad :(


    In 2023 with 32GB machines, why must we add so much complexity to economize these 8x global variables?

    Why only 8x? Can't the devs just change the C+× #define from 8 to 256? Or 8888?


    Remix decks have a hidden unused global variable = another massive hack :(

    PS: same story on local TSI modifiers - only 8 per page, with 3 bits each

  • dj_estrela
    dj_estrela Member Posts: 165 Pro

    This is crazy. No reaction at all for such a useful feature

  • dj_estrela
    dj_estrela Member Posts: 165 Pro

    So true.

    The market wants simplicity and standardisation. All controllers look and do the same.

    NI is following this market, failing at it, and displeasing both sets of users: too complex for some, not complex enough for others.

    This is nowhere's land.

  • Sûlherokhh
    Sûlherokhh Member, Traktor Mapping Mod Posts: 2,628 mod

    You said it. Nothing to add here, except these emoticons: 🥴➔😵➔😫

    I am just glad i still love looking under the hood. In another life i would have been a car mechanic for sure... :)

  • Stevan
    Stevan Traktor Mapping Mod Posts: 2,004 mod

    Anministrators are not experts and they don't care about our mapping work or to support modding work. Devs (who are competant to comment) are not watching the forum.

    Also we need mapping section here. Anything mapping gets lost quickly in the sea of Traktor issues in this forum.

  • Psyka
    Psyka Member Posts: 46 Member

    Hi everyone :)

    I read all this post and I see a lot of very good programmer for Traktor.

    Maybe one can help me, it's not a difficult problem I think.

    I play with 2 technics, X-One 96 and 2x D2; and I change the D2 with a very good Mod : Moonbeam.

    In this Mod, I can see a beatcounter (1 to 8) to my 4 decks.


    Now I try to send with Traktor midi cc out, the beat 1 of 8 of the master deck, to command a new line of lights program (it's QLC+)

    I program that with the controller manager in Traktor :

    • Beat phase out, and modifiers.

    So can I send midi cc out 1 of 8 beats of my track, that ok, BUT this is not necessary the first beat of the track... It's just one in height times.


    I'm not sure it's understandable... Sorry for my English.


    Thanks a lot 😊

    👋

  • Sûlherokhh
    Sûlherokhh Member, Traktor Mapping Mod Posts: 2,628 mod
  • Psyka
    Psyka Member Posts: 46 Member
    edited November 2023

    The question is how to send with Traktor a midi cc out impulsion when deck which play in master play beat 1 of 8 of the music 😬

  • Sûlherokhh
    Sûlherokhh Member, Traktor Mapping Mod Posts: 2,628 mod
    edited November 2023

    This is the code that calculates the beats (8 in total) in the qml mod i did for the s3:

    AppProperty { id: deckElapsedTime; path: "app.traktor.decks." + deckIdx + ".track.player.elapsed_time" }
    AppProperty { id: deckGridOffset; path: "app.traktor.decks." + deckIdx + ".content.grid_offset" }
    AppProperty { id: deckMixerBpm; path: "app.traktor.decks." + deckIdx + ".tempo.base_bpm" }
    AppProperty { id: remixBeatPos; path: "app.traktor.decks." + deckIdx + ".remix.current_beat_pos" }
    
    readonly property var jogwheelTurnSpeedFactor: deckMixerBpm.value / 4 // Tempo varies with track's bpm
    readonly property var deckBeats: deckTypeProp.value != 1 ? (((deckElapsedTime.value * 1000 - deckGridOffset.value + 10) * jogwheelTurnSpeedFactor) / 7500.0) : parseInt(remixBeatPos.value) * 2
    readonly property var deckBeat: (deckBeats < 0.0) ? (8 - (parseInt(Math.abs(deckBeats) % 8))) : parseInt(Math.abs(deckBeats) % 8) + 1
    

    I don't have the Moonbeam mod at hand to have a look how it is done in there, but i am sure it will look somewhat like that. The Moonbeam beatcounter likely shows only 4 different beats, but i don't know. In the last bit of code (replicated below), every '8' in the code line references the number of beats:

    readonly property var deckBeat: (deckBeats < 0.0) ? (8 - (parseInt(Math.abs(deckBeats) % 8))) : parseInt(Math.abs(deckBeats) % 8) + 1
    

    The variable 'deckBeat' is the integer number that counts from 1 to 8 to indicate the beat the track sits currently. You would have to add a bit of code to the file to create a midi out signal for traktor eventually using the traktor midi out mapping commands. Currently there are 8 on-off midi toggles (buttons) and 16 continuous (knobs/faders) real type midi signals (from 0.0 to 1.0) that you can code an output to.

    I've corroborated with @Stevan for the S4MK3 mod we did in this thread to achieve that, so we know it is possible. If you can post the file from the Moonbeam mod that contains the beat-counter code, i may be able to provide some code snippets that will trigger 8 different midi out signals per deck (or just for the master deck).

    If the Moonbeam mod only counts to 4, i can also implement an additional (separate) counter that will count to 8.

    Is this something you would like me to do for you?

Back To Top