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

1111214161723

Answers

  • Psyka
    Psyka Member Posts: 46 Member
    edited November 2023

    Thank Sûlherokhh for the express response.

    The Moonbeam in effect count from 1 to 8. I would send it but I can't send link in the forum because it's say I'm new to it and I must wait before send it... "You have to be around for a little while longer before you can post links."😖

    In effect, the simply thing I would, is send a on-off midi toggles ch9 cc60 when the master deck is at 1 of the 8.("On" at 1, and "OFF" else). So when "deckBeat=1". Is possible to have this variable in the control manager?


    Thank a lot :)

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

    I don't know the specific midi desgnation of the midi out signals, but otherwise yes, beat 1 will put the first toggle ON and the rest to OFF, etc.

    Do you mind showing the link as text (leaving out https:)?

  • Psyka
    Psyka Member Posts: 46 Member
    edited November 2023

    That will be perfect 👌🏻

    drive.google.com/drive/folders/1TOiqtn1sD24MVWlIMsBQpchUqtKpcO6g

    www.dropbox.com/scl/fo/ufu6ksotcd6weahv3b0s3/h?rlkey=sj509jtcx0g5m6xu8gq5bamt2&dl=0

    In Dropbox thereis the moonbeam and the tsi file I make today.

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

    Well, it looks like it will be easiest if insert the relevant code for a separate beat counter into the D2 controller basic file instead of trying to extract the relevant beat number from the Moonbeam screen code (which tries to catch a variation of possible maximum numbers).

    Either way i do it, both D2s are going to send the masterbeat count in parallel, but that should not cause any problems.

    I'll start inserting the code and then send you the file as soon as i find the peace of mind to concentrate on not making syntax errors. :)

  • Psyka
    Psyka Member Posts: 46 Member

    I not need the D2 send beatcount, if the midi cc is send with only traktor, that will be better for me.

    In fact, sometime I mix with s4 mk3, and I still need the beatcount midi cc for my light program.

    Thank a lot 😊

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

    I can only write the beat counter into the qml files of an existing device, which must be connected and running. But i can place it into both files, D2 and S4MK3.

  • Psyka
    Psyka Member Posts: 46 Member

    Ok no problem, I thought it was more complicated to do in qml file of a device than directly in traktor.

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

    Only the device qml files and parts of the collection and settings are accessible. The rest is compiled machine code.

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

    Hi.

    Actually I use Moonbeam on 3.6.1, but I will try on 3.10.1 soon (because S4 mk3 doesn't work on my 3.6.1 version).

    I work actually with my light program and I understand 2 very important things :

    • I can't receive masterbeat count in parallel, I need just one. -> For that, only the deck which is in master (automatic master mode) should send midi cc.
    • I have a delay with light and sound, so I don't need the 1 of 8 beat, but the 8 of 8.

    If this is possible of course... 😕

    Thank you very much.

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

    I doesn't work on 3.10 when i tried. So, if it works on 3.6.1 then that's the version i will install it on and modfiy it.

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

    @Psyka

    I can't receive masterbeat count in parallel, I need just one. -> For that, only the deck which is in master (automatic master mode) should send midi cc.

    Parallel in this case is not a problem. Both D2's will monitor the (single) master deck beats and MIDI output the same signal at the same time.

    I have a delay with light and sound, so I don't need the 1 of 8 beat, but the 8 of 8.

    I am not sure i understand. Are you saying the delay is exactly 1 beat? Either way, i already have a 10ms inverted delay in my code (MIDI signal will trigger 10ms before the actual beat). I will plug in a variable that you can manually adjust to whatever you want the delay value to be.

  • Psyka
    Psyka Member Posts: 46 Member

    Parallel in this case is not a problem. Both D2's will monitor the (single) master deck beats and MIDI output the same signal at the same time.

    ---> OK Perfect 👌

    Either way, i already have a 10ms inverted delay in my code (MIDI signal will trigger 10ms before the actual beat). I will plug in a variable that you can manually adjust to whatever you want the delay value to be.

    --> That's a much better solution! 🤩

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

    All right, here is my solution. Try it out and tell me if you have any trouble:

    Installation:

    Replace the following two files in your Moonbeam mod.

    • ...\Resources64\qml\CSI\D2\D2.qml
    • ...\Resources64\qml\CSI\S4MK3\S4MK3.qml

    There are two example mapping files you can import in PreferencesController Manager:

    • D2 MIDI TEST.tsi: This D2 mapping file will pick up the MIDIButton signals and lets the 8 pads of your D2 light up; just for testing. You don't need this file at all. If you use it for testing, deactivate the original D2 mapping file and don't run both at the same time.
    • generic MIDI BEATS.tsi: This is a generic MIDI mapping file containing the 8 MIDIButtons. You have to set the OUT port and assign your custom channel and CC values yourself. This is what your lightshow will need.


    More details; This is what i added to both D2 (line 534) and S4MK3 (line 75) files:

    //----------------------------------- 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.true_bpm" } //base_bpm
    AppProperty { id: remixBeatPos; path: "app.traktor.decks." + masterId + ".remix.current_beat_pos" }
    AppProperty { id: midiButtonProp1; path: "app.traktor.midi.buttons.1" }
    AppProperty { id: midiButtonProp2; path: "app.traktor.midi.buttons.2" }
    AppProperty { id: midiButtonProp3; path: "app.traktor.midi.buttons.3" }
    AppProperty { id: midiButtonProp4; path: "app.traktor.midi.buttons.4" }
    AppProperty { id: midiButtonProp5; path: "app.traktor.midi.buttons.5" }
    AppProperty { id: midiButtonProp6; path: "app.traktor.midi.buttons.6" }
    AppProperty { id: midiButtonProp7; path: "app.traktor.midi.buttons.7" }
    AppProperty { id: midiButtonProp8; path: "app.traktor.midi.buttons.8" }
    
    
    // enter a custom delay value in ms; can be negative
    readonly property real beatDelay: 10
    
    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) ? (8 - (parseInt(Math.abs(deckBeats) % 8))) : parseInt(Math.abs(deckBeats) % 8) + 1
    
    onDeckBeatChanged:
    {
      if (deckBeat == 1) {
        midiButtonProp1.value = true
        midiButtonProp2.value = false
        midiButtonProp3.value = false
        midiButtonProp4.value = false
        midiButtonProp5.value = false
        midiButtonProp6.value = false
        midiButtonProp7.value = false
        midiButtonProp8.value = false
      }
      else if (deckBeat == 2) {
        midiButtonProp1.value = false
        midiButtonProp2.value = true
        midiButtonProp3.value = false
        midiButtonProp4.value = false
        midiButtonProp5.value = false
        midiButtonProp6.value = false
        midiButtonProp7.value = false
        midiButtonProp8.value = false
      }
      else if (deckBeat == 3) {
        midiButtonProp1.value = false
        midiButtonProp2.value = false
        midiButtonProp3.value = true
        midiButtonProp4.value = false
        midiButtonProp5.value = false
        midiButtonProp6.value = false
        midiButtonProp7.value = false
        midiButtonProp8.value = false
      }
      else if (deckBeat == 4) {
        midiButtonProp1.value = false
        midiButtonProp2.value = false
        midiButtonProp3.value = false
        midiButtonProp4.value = true
        midiButtonProp5.value = false
        midiButtonProp6.value = false
        midiButtonProp7.value = false
        midiButtonProp8.value = false
      }
      else if (deckBeat == 5) {
        midiButtonProp1.value = false
        midiButtonProp2.value = false
        midiButtonProp3.value = false
        midiButtonProp4.value = false
        midiButtonProp5.value = true
        midiButtonProp6.value = false
        midiButtonProp7.value = false
        midiButtonProp8.value = false
      }
      else if (deckBeat == 6) {
        midiButtonProp1.value = false
        midiButtonProp2.value = false
        midiButtonProp3.value = false
        midiButtonProp4.value = false
        midiButtonProp5.value = false
        midiButtonProp6.value = true
        midiButtonProp7.value = false
        midiButtonProp8.value = false
      }
      else if (deckBeat == 7) {
        midiButtonProp1.value = false
        midiButtonProp2.value = false
        midiButtonProp3.value = false
        midiButtonProp4.value = false
        midiButtonProp5.value = false
        midiButtonProp6.value = false
        midiButtonProp7.value = true
        midiButtonProp8.value = false
      }
      else if (deckBeat == 8) {
        midiButtonProp1.value = false
        midiButtonProp2.value = false
        midiButtonProp3.value = false
        midiButtonProp4.value = false
        midiButtonProp5.value = false
        midiButtonProp6.value = false
        midiButtonProp7.value = false
        midiButtonProp8.value = true
      }
      else {
        midiButtonProp1.value = false
        midiButtonProp2.value = false
        midiButtonProp3.value = false
        midiButtonProp4.value = false
        midiButtonProp5.value = false
        midiButtonProp6.value = false
        midiButtonProp7.value = false
        midiButtonProp8.value = false
      }
    }
    


    This is the line in the code where you can change the delay value. Change it in both files to the same value:

    // enter a custom delay value in ms; can be negative
    readonly property real beatDelay: 10
    

    I hope this is going to be helpful to you. If it's to your liking, consider buying me a coffee. If there is anything you would like to have changed with this mod (fewer beats, half beats, etc.), let me know. 🦋


    Edit: Updated button assignments in the code.

  • Psyka
    Psyka Member Posts: 46 Member
    edited November 2023

    😮

    Big thank you to you!

    I will try this tomorrow 😬

    Can’t wait to use it.


    Ps : just for my information, is this a c++ code?

Back To Top