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

11920212224

Answers

  • Psyka
    Psyka Member Posts: 61 Member

    :)

    It's a certain a5tr0 who made the Moonbeam mod, but it's impossible to find it on native instrument (it was on the old version of the site)

    On my D2 mod, do you think it's possible to add a second midi command midi 9 cc61 of the 1 of 16 beat but with no delay?

    Thank :)

  • pixel
    pixel Member Posts: 418 Pro

    Now I'm out of here, they don't see a signal and now they want a second one. You should solve the problem first🙃

  • Psyka
    Psyka Member Posts: 61 Member

    I'm sorry if I wasn't clear in my penultimate message but now everything works. The midi signal is send by TP4.1 and is received by the QLC+ light software (it was just a tsi out problem).
    Thank you very much for your help! :)

    Given that everything is working correctly, that's why I was asking if it was possible to have a second midi signal (9cc61) but with 0ms of lag.


    Good night.

  • Sûlherokhh
    Sûlherokhh Member, Traktor Mapping Mod Posts: 3,603 mod

    Technically that is quite possible, with a couple of extra lines of code and MIDIButton2.

  • Psyka
    Psyka Member Posts: 61 Member

    Awesome 🙂

  • Psyka
    Psyka Member Posts: 61 Member
    edited November 2024

    test message

  • Sûlherokhh
    Sûlherokhh Member, Traktor Mapping Mod Posts: 3,603 mod

    I sent you the D2 file that makes your DECK button blink with the MIDI beat to see if the MIDIbutton code works. Did you test it on your D2? This would help identify your problem.

  • Psyka
    Psyka Member Posts: 61 Member

    Thanks again for the answer.

    I just tore my hair out for 3h30 and I finally have a solution to why the 4.1 mod works yesterday and not today :
    ---> I made a copy of the traktor file!


    I think traktor doesn't like when I close it, to have created a new setting.YYY.MM.DD.tsi when there are 2 identical versions of traktor in the same file. (at least on Mac).
    So by reloading an old setting.tsi, the D2 beatcounter works again like yesterday.
    I don't know what happens, but that was my problem.
    I've just lost almost 4 hours to figure this outt 😭

  • Sûlherokhh
    Sûlherokhh Member, Traktor Mapping Mod Posts: 3,603 mod

    Good for you! Your suffering is felt by every coder on a daily basis. But it's compensated by the elation of finally solving the cause of the suffering. 🤗

  • Psyka
    Psyka Member Posts: 61 Member

    Ahah yes!

    Very happy to understand this problem, but I really would that take me less time 😅

  • Sûlherokhh
    Sûlherokhh Member, Traktor Mapping Mod Posts: 3,603 mod
    edited November 2024

    The mistakes you make are of the kind everyone needs to make when using any kind of software. The only way around it is to pay someone to make those mistakes for you. But then you miss out on learning how to solve problems on your own or with a team. ☺️

  • Psyka
    Psyka Member Posts: 61 Member

    Hi everyone :)

    With this precious community I find a solution for send a midi cc from Traktor to control my lights every one time of 16 of the master deck.

    This is the precious code :

     //----------------------------------- Beatcounter LED ------------------------------------//
    
      AppProperty { id: masterIdProp; path: "app.traktor.masterclock.source_id" } //-1: MasterClock, 0: Deck A, 1: Deck B, 2: Deck C, 3: Deck D
      readonly property int masterId: masterIdProp.value + 1
      AppProperty { id: deckTypeProp; path: "app.traktor.decks." + masterId + ".type"; }
      AppProperty { id: deckElapsedTime; path: "app.traktor.decks." + masterId + ".track.player.elapsed_time" }
      AppProperty { id: deckGridOffset; path: "app.traktor.decks." + masterId + ".content.grid_offset" }
      AppProperty { id: deckMixerBpm; path: "app.traktor.decks." + masterId + ".tempo.base_bpm" } //true_bpm
      AppProperty { id: remixBeatPos; path: "app.traktor.decks." + masterId + ".remix.current_beat_pos" }
      AppProperty { id: midiButtonProp1; path: "app.traktor.midi.buttons.1" }
    
    
      // enter a custom delay value in ms; can be negative
      readonly property real beatDelay: 2260
    
      readonly property var turnSpeedFactor: deckMixerBpm.value / 8 // Tempo varies with track's bpm
      readonly property var deckBeats: deckTypeProp.value != 1 ? (((deckElapsedTime.value * 1000 - deckGridOffset.value + beatDelay) * turnSpeedFactor) / 7500.0) : parseInt(remixBeatPos.value) * 2
      readonly property var deckBeat: (deckBeats < 0.0) ? (16 - (parseInt(Math.abs(deckBeats) % 16))) : parseInt(Math.abs(deckBeats) % 16) + 1
    
      onDeckBeatChanged:
      {
        if (deckBeat == 1) {
          midiButtonProp1.value = true
        }
        else {
          midiButtonProp1.value = false
        }
      }
    
    } //Mapping
    
    

    That's work perfectly in time with music and lights but only when the tempo of the deck is at +-0%, I have a delay if I use at -8% or -5% or +4%…

    With some try I found that : if the master deck is at -8% (-0,08) I have to send the midi cc at 1800ms instead of 2260.

    So with this simple math I think that's will work :

     // enter a custom delay value in ms; 
    can be negative  readonly property real beatDelay: 2260 + (deckMixerTempo.value * 5750)
    

    (example : if deckMixerTempo.value is between -0,08 and + 0,08, I have

    • If deck is at -8% : 2260 + (-0,08 x 5750) = 1800 —> OK

    • If deck is at -0% : 2260 + (0 x 5750) = 2600 —> OK

    I just want to know if syntax is good?

    And if "deckMixerTempo.value" is the good variable I need and is between -0,08< "deckMixerTempo.value"< + 0,08

    Thank everyone :)

  • Sûlherokhh
    Sûlherokhh Member, Traktor Mapping Mod Posts: 3,603 mod

    Congratz. Great you kept at it.

    If you use ratio of deckBPM and trackBPM and put it in a variable, you can calculate the offset in combination with your experimentally derrived cutoffs. Then it should work no matter what tempo you set the deck to. Another math project. 😉

  • Psyka
    Psyka Member Posts: 61 Member

    Thank you for the answer.

    So the problem is quite simple, I found a new formula :

    If -8% : ex 100 bmp at à 92 BMP 

    DeckBPM / track BPM = 92/100= 0,92

    —> 2260 - ((1-(deckBpm \ TrackBpm))* 5750) = 1800 ms OK

    readonly property real beatDelay: 2260 - ((1-(deckBpm \ TrackBpm))* 5750)
    

    Is that ok for division? : "/"

    DeckBPM and Track BMP are variables for the master deck?

    Thank a lot :)

  • Sûlherokhh
    Sûlherokhh Member, Traktor Mapping Mod Posts: 3,603 mod

    Should be working. I solve this mostly by risking a syntax error. :)

    Oh, you should use '/' not '\'

Back To Top