User Tools

Site Tools


prime2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
prime2 [2023/11/26 22:02] ounsatnprime2 [2024/05/13 23:19] (current) ounsatn
Line 1: Line 1:
 +**This project is in progess, and not still finished**
 +
 {{http://dnttalo.cluster029.hosting.ovh.net/Pictures/P2toAKF.jpg}} {{http://dnttalo.cluster029.hosting.ovh.net/Pictures/P2toAKF.jpg}}
  
Line 6: Line 8:
 Prime use QML from QT to do assignments and map functions.  Prime use QML from QT to do assignments and map functions. 
 You can write your own javascript / qml code to suit your needs.  You can write your own javascript / qml code to suit your needs. 
-I'm not a QT expert, i'm still learning :p  
  
 +Qml below allow to map these functions : 
 +
 +Back , Forward, load Right & Left , Rotary button are mapped like this :
 +(Load R/L is mapped below) 
 +
 +{{http://dnttalo.cluster029.hosting.ovh.net/Pictures/BackForward.jpg}}
  
-Import section to get all the QT/QML prime objects  
  
 <code> <code>
 +
 +### Code Header with Air Imports ###
 +
 import airAssignments 1.0 import airAssignments 1.0
 import ControlSurfaceModules 0.1 import ControlSurfaceModules 0.1
Line 18: Line 27:
 import Planck 1.0 import Planck 1.0
 import QtQuick 2.12 import QtQuick 2.12
-</code> 
  
 +### Then assignment begin for global parameters ###
  
-Then Assignments begin  
  
-<code> 
 MidiAssignment { MidiAssignment {
  objectName: 'PRIME 2 Controller Assignment'  objectName: 'PRIME 2 Controller Assignment'
Line 56: Line 63:
  ledType: LedType.Simple  ledType: LedType.Simple
  }  }
- 
-</code> 
- 
-Back , Forward, load Right & Left , Rotary button are mapped like this : 
-(Load R/L is mapped below)  
- 
-{{http://dnttalo.cluster029.hosting.ovh.net/Pictures/BackForward.jpg}} 
- 
-<code> 
- 
  
  
Line 106: Line 103:
  
 </code> </code>
 +
  
 Then we create one repeater bloc for deck1 and further, another for deck2  Then we create one repeater bloc for deck1 and further, another for deck2 
Line 116: Line 114:
  
 <code> <code>
 +
 +### Repeater 1 for Deck Left ###
  
  Repeater {  Repeater {
Line 216: Line 216:
 Below some pics of these functions.  Below some pics of these functions. 
  
-** Cues +** Cues ** 
 + 
 {{http://dnttalo.cluster029.hosting.ovh.net/Pictures/AKF_Cues.jpg}} {{http://dnttalo.cluster029.hosting.ovh.net/Pictures/AKF_Cues.jpg}}
  
-** Loops+** Loops ** 
 {{http://dnttalo.cluster029.hosting.ovh.net/Pictures/AKF_Loops.jpg}} {{http://dnttalo.cluster029.hosting.ovh.net/Pictures/AKF_Loops.jpg}}
  
 ** Slicer  ** Slicer 
 +
 {{http://dnttalo.cluster029.hosting.ovh.net/Pictures/AKF_Slice1.jpg}} {{http://dnttalo.cluster029.hosting.ovh.net/Pictures/AKF_Slice1.jpg}}
 {{http://dnttalo.cluster029.hosting.ovh.net/Pictures/AKF_Slice2.jpg}} {{http://dnttalo.cluster029.hosting.ovh.net/Pictures/AKF_Slice2.jpg}}
Line 285: Line 289:
 <code>  <code> 
  
 +### Repeater 2 for Deck Right ###
  
 Repeater { Repeater {
Line 388: Line 393:
 </code> </code>
  
-Next I configure Filter Sweep button for the 2 decks like below, and parameters button used to change note repeat speed in slice mode.  
  
-{{http://dnttalo.cluster029.hosting.ovh.net/Pictures/FilterSweep.jpg}}+Code below allow to map functions on the pic below 
 +{{http://dnttalo.cluster029.hosting.ovh.net/Pictures/Prime2Layout.jpg}} 
  
  
Line 432: Line 438:
   
   
- readonly property QObjProperty padsView2: Planck.getProperty("/Engine/Deck%1/Pads/View".arg(2))+ readonly property QObjProperty padsView2: Planck.getProperty("/Engine/Deck%1/Pads/View".arg(2))
   
- property string padsMode2: padsView2.translator.string+ property string padsMode2: padsView2.translator.string
   
- readonly property bool padsModeIsAutoLoop2: padsMode2 === "AUTO" + readonly property bool padsModeIsAutoLoop2: padsMode2 === "AUTO" 
- readonly property bool padsModeIsLoop2: padsMode2 === "LOOPS" + readonly property bool padsModeIsLoop2: padsMode2 === "LOOPS" 
- readonly property bool padsModeIsLoopRoll2: padsMode2 === "ROLL" + readonly property bool padsModeIsLoopRoll2: padsMode2 === "ROLL" 
- readonly property bool padsModeIsSlicerContinuous2: padsMode2 === "SLICER" + readonly property bool padsModeIsSlicerContinuous2: padsMode2 === "SLICER" 
- readonly property bool padsModeIsSlicer2: padsModeIsSlicerContinuous2 || padsMode2 === "FIXED"+ readonly property bool padsModeIsSlicer2: padsModeIsSlicerContinuous2 || padsMode2 === "FIXED"
   
- readonly property bool loopEnabled2: Planck.getProperty("/Engine/Deck%1/Track/LoopEnableState".arg(2)).translator.state + readonly property bool loopEnabled2: Planck.getProperty("/Engine/Deck%1/Track/LoopEnableState".arg(2)).translator.state 
- readonly property bool loopEditable2: Planck.getProperty("/Engine/Deck%1/Track/LoopEnableState".arg(2)).translator.editable+ readonly property bool loopEditable2: Planck.getProperty("/Engine/Deck%1/Track/LoopEnableState".arg(2)).translator.editable
  
  
Line 486: Line 492:
 </code> </code>
  
-Then we will map FX section / Buttons. +Then we will map Parameters buttons, used when you are in slice or loop modes  
  
 <code> <code>
  
  
 +//
 +// PARAMETERS DECK RIGHT & LEFT 
 +//
 +
 +
 +
 + ValueNoteAssignment {
 + objectName: "Parameter Left Deck%1".arg(1)
 + note: 58
 + channel: 0
 + output: QtObject {
 + readonly property QObjProperty pHalveLoop1: Planck.getProperty("/Engine/Deck%1/Track/HalveLoop".arg(1))
 + readonly property QObjProperty pShiftLoopLeft1: Planck.getProperty("/Engine/Deck%1/Track/ShiftLoopLeft".arg(1))
 + readonly property QObjProperty pHalve1: Planck.getProperty("/Engine/Deck%1/Track/Slicer/Halve".arg(1))
  
 + function setValue(channel, value, assignmentEnabled) {
 + console.log("SVVal:",value)
 + console.log("SVChan:",assignmentEnabled)
 + if(assignmentEnabled && value) {
 + if(padsModeIsSlicer1) {
 + pHalve1.translator.state = true
 + }
 + else if(loopEnabled1) {
 + if(device.shift) {
 + pShiftLoopLeft1.translator.state = true
 + }
 + else {
 + pHalveLoop1.translator.state = true
 + }
 + }
 + }
 + }
 + }
 + }
 +
 +
 + ValueNoteAssignment {
 + objectName: "Parameter Right Deck%1".arg(1)
 + note: 59
 + channel: 0
 + output: QtObject {
 + readonly property QObjProperty pDoubleLoop1: Planck.getProperty("/Engine/Deck%1/Track/DoubleLoop".arg(1))
 + readonly property QObjProperty pShiftLoopRight1: Planck.getProperty("/Engine/Deck%1/Track/ShiftLoopRight".arg(1))
 + readonly property QObjProperty pDouble1: Planck.getProperty("/Engine/Deck%1/Track/Slicer/Double".arg(1))
  
 + function setValue(channel, value, assignmentEnabled) {
 + if(assignmentEnabled && value) {
 + if(padsModeIsSlicer1) {
 + pDouble1.translator.state = true
 + }
 + else if(loopEnabled) {
 + if(device.shift) {
 + pShiftLoopRight1.translator.state = true
 + }
 + else {
 + pDoubleLoop1.translator.state = true
 + }
 + }
 + }
 + }
 + }
 + }
 +
 +
 +
 +
 + ValueNoteAssignment {
 + objectName: "Parameter Left Deck%1".arg(2)
 + note: 62
 + channel: 0
 + output: QtObject {
 + readonly property QObjProperty pHalveLoop2: Planck.getProperty("/Engine/Deck%1/Track/HalveLoop".arg(2))
 + readonly property QObjProperty pShiftLoopLeft2: Planck.getProperty("/Engine/Deck%1/Track/ShiftLoopLeft".arg(2))
 + readonly property QObjProperty pHalve2: Planck.getProperty("/Engine/Deck%1/Track/Slicer/Halve".arg(2))
  
 + function setValue(channel, value, assignmentEnabled) {
 + //console.log("SVVal:",value)
 + //console.log("SVChan:",assignmentEnabled)
 + //device.sendColorButton(1,59)
 + if(assignmentEnabled && value) {
 + if(padsModeIsSlicer2) {
 + pHalve2.translator.state = true
 + }
 + else if(loopEnabled2) {
 + if(device.shift) {
 + pShiftLoopLeft2.translator.state = true
 + }
 + else {
 + pHalveLoop2.translator.state = true
 + }
 + }
 + }
 + }
 + }
 + }
 +
 +
 + ValueNoteAssignment {
 + objectName: "Parameter Right Deck%1".arg(2)
 + note: 63
 + channel: 0
 + output: QtObject {
 + readonly property QObjProperty pDoubleLoop2: Planck.getProperty("/Engine/Deck%1/Track/DoubleLoop".arg(2))
 + readonly property QObjProperty pShiftLoopRight2: Planck.getProperty("/Engine/Deck%1/Track/ShiftLoopRight".arg(2))
 + readonly property QObjProperty pDouble2: Planck.getProperty("/Engine/Deck%1/Track/Slicer/Double".arg(2))
  
- + function setValue(channel, value, assignmentEnabled) { 
- + if(assignmentEnabled && value) { 
-     /////////////////////////////////////////////////////////////////////////// + if(padsModeIsSlicer2) { 
- // Effect Controls + pDouble2.translator.state = true 
-  Repeater +
- model: ListModel + else if(loopEnabled2) 
- ListElement + if(device.shift) 
- deckName: "Left" + pShiftLoopRight2.translator.state = true 
- deckMidiChannel: 0+
 + else 
 + pDoubleLoop2.translator.state = true 
 +
 +
 +
 + } 
 + }
  }  }
- +  
- ListElement +  
- deckName: "Right+            /* 
- deckMidiChannel: 1+ ValueCCAssignment 
 + objectName: "Volume Deck%1".arg(deckName) 
 + cc: 14 
 + normalizeValue: false 
 + channel: deckMidiChannel 
 + outputValueOutput { 
 + useSoftTakeover: false 
 + target: PropertyTarget { path: "/Engine/Mixer/Channel%1/Volume/Level".arg(index + 1)} 
 + }
  }  }
- }+            */
  
- Item { +            ValueNoteAssignment { 
- id: deckFx + objectName: "Cue Deck%1".arg(deckName
-  + note: 13
- ValueNoteAssignment { +
- objectName: "FX%1 Active Button".arg(1+
- note: 93+
  channel: deckMidiChannel  channel: deckMidiChannel
- enabled: !device.shift 
  output: ActionOutput {  output: ActionOutput {
  target: PropertyTarget {  target: PropertyTarget {
- path: "/Engine/Mixer/Channel%1/DJFx/Active".arg(1)+ path: "/Engine/Mixer/Channel%1/PFL".arg(index + 1)
  }  }
  }  }
  }  }
- + 
 + ValueOutputAssignment { 
 + objectName: "Channnel Cue LED %1".arg(deckName) 
 + enabled: !device.isInitializing 
 + messageType: type.note 
 + midiIndex: 13 
 + channel: deckMidiChannel 
 + minimum:
 + path: "/Engine/Mixer/Channel%1/PFL".arg(index + 1) 
 +
  ValueNoteAssignment {  ValueNoteAssignment {
- objectName: "FX%1 Active Button".arg(2) + objectName: "CrossfaderSendleft+ index 
- note: 05+ note: 15
  channel: deckMidiChannel  channel: deckMidiChannel
- enabled!device.shift+ valueTransformQtObject { 
 + function transformValue(in_val) { 
 + var leftVal = 0.
 + if (in_val === leftVal) { 
 + return 1.0 
 +
 + else { 
 + return 0.0 
 +
 +
 + }
  output: ActionOutput {  output: ActionOutput {
- target: PropertyTarget { + behaviour: force.hold 
- path: "/Engine/Mixer/Channel%1/DJFx/Active".arg(2)+ target: PropertyTarget { path: "/Engine/Mixer/Channel%1/Crossfader/SendLeft".arg(index + 1); } 
 +
 +
 + 
 + ValueNoteAssignment { 
 + objectName: "CrossfaderSendRight" + index 
 + note: 15 
 + channel: deckMidiChannel 
 + valueTransform: QtObject { 
 + function transformValue(in_val) { 
 + var rightVal = 0.0156 // A little bit less than 2/127 to make comparing easier 
 + if (in_val >= rightVal
 + return 1.0 
 +
 + else { 
 + return 0.0 
 + }
  }  }
 + }
 + output: ActionOutput {
 + behaviour: force.hold
 + target: PropertyTarget { path: "/Engine/Mixer/Channel%1/Crossfader/SendRight".arg(index + 1); }
  }  }
  }  }
   
  
 + }
 + }
 +
 +
 +
 +
 + Repeater {
 + model: ListModel {
 +
 + ListElement {
 + mixerChannelName: '2'
 + mixerChannelMidiChannel: 0
 + }
 + }
 +
 + Item {
 + objectName: 'Mixer Channel %1'.arg(model.mixerChannelName)
 +
 + MixerChannelAssignmentConfig {
 + id: mixerChannelConfig
 + name: model.mixerChannelName
 + midiChannel: model.mixerChannelMidiChannel
 + }
 +
 + MixerChannelCore {
 + pflNote: 116
 + trimCC: 117
 + trebleCC:31 
 + midCC: 6
 + bassCC: 30
 + faderCC: 230
 + }
 +
 + //SweepFxKnob {
 + // cc: 23
 + //}
 +
 + SweepFxSelect {
 + channelNames: [model.mixerChannelName]
 + buttonsModel: ListModel {
 + ListElement {
 + note: 58
 + fxIndex: SweepEffect.DualFilter
 + }
 + ListElement {
 + note: 590
 + fxIndex: SweepEffect.Wash
 + }
 + }
 + }
 + }
 + }
 +
 +
 +
 +     ///////////////////////////////////////////////////////////////////////////
 + // Effect Controls
 +  
 +  
 + Repeater {
 + model: ListModel {
 +
 +                ListElement {
 + deckName: "Left"
 + deckMidiChannel: 0
 + }
 +
 +                ListElement {
 +                    deckName: "Right"
 +                    deckMidiChannel: 1
 +                    }
 +
 + }
   
 + Item {
 +            id: deckFx
   
- ValueCCAssignment {+ readonly property string activeDeckIndex:  
 +  
 + Planck.getProperty("/GUI/Decks/Decks").translator.entries[index] 
 + onActiveDeckIndexChanged:
 + pGridEdit.translator.state = false 
 + pShowCueEdit.translator.state = false 
 +
 + 
 +                readonly property bool cueLEDState1: Planck.getProperty("/Engine/Deck%1/Track/CueLEDState".arg(1)).translator.state 
 + 
 +                readonly property bool cueLEDFlashing1: Planck.getProperty("/Engine/Deck%1/Track/CueLEDState".arg(1)).translator.flashing 
 + 
 +                readonly property QObjProperty pTempoSyncedFlashState1: Planck.getProperty("/Engine/Deck%1/TempoSyncedFlashState".arg(1)) 
 +                readonly property bool tempoSyncedFlashState1: pTempoSyncedFlashState1.translator.state 
 + 
 + 
 + 
 +                readonly property string syncMode1: Planck.getProperty("/Engine/Deck%1/SyncMode".arg(1)).translator.string 
 + 
 +                readonly property string syncMode2: Planck.getProperty("/Engine/Deck%1/SyncMode".arg(2)).translator.string 
 + 
 + 
 + 
 +            // Fx Activation Deck1 
 +            ValueNoteAssignment { 
 + objectName: "FX%1 Active Button".arg(1) 
 + note: 93 
 +                channel: deckMidiChannel 
 + enabled: !device.shift 
 + output: ActionOutput { 
 + target: PropertyTarget { 
 +                        path: "/Engine/Mixer/Channel%1/DJFx/Active".arg(1) 
 + function setValue(deckMidiChannel) 
 +
 + console.log("chan",deckMidiChannel)  
 + }  
 + }  
 +
 +
 +  
 +            // Fx Selection Deck1 
 +            ValueCCAssignment {
  objectName: "FX%1 Selection".arg(1)  objectName: "FX%1 Selection".arg(1)
  cc: 17  cc: 17
Line 562: Line 838:
  }  }
  }  }
-  + 
-  +            // Fx Selecting Deck1 
- ValueCCAssignment {+            ValueCCAssignment {
  objectName: "FX%1 Selecting".arg(1)  objectName: "FX%1 Selecting".arg(1)
  cc: 17  cc: 17
  channel: deckMidiChannel  channel: deckMidiChannel
  enabled: !Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Selecting".arg(1)).translator.state  enabled: !Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Selecting".arg(1)).translator.state
- output: ActionOutput { +                    output: ActionOutput { 
- behaviour: force.action +                        behaviour: force.action 
- target: PropertyTarget { +                        target: PropertyTarget { 
- path: "/Engine/Mixer/Channel%1/DJFx/Selecting".arg(1) +                            path: "/Engine/Mixer/Channel%1/DJFx/Selecting".arg(1) 
- }+                        } 
 +                    } 
 +                } 
 + 
 +            // FxAmount Deck1 
 +            ValueCCAssignment { 
 + objectName: "FX%1 Amount".arg(1) 
 + cc: 18 
 + channel: deckMidiChannel 
 +                enabled: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Knob2Target".arg(1)).translator.string === "Amount" 
 + 
 +                  output: JogOutput { 
 + 
 +                      jogAcceleration: 1.5; 
 +                        jogSensitivity: 0.5; 
 +                        type: 0 
 +                        target: PropertyTarget { path: "/Engine/Mixer/Channel%1/DJFx/Amount".arg(1) } 
 +                        property bool debug:true 
 + 
 +                        // You can comment below, i let it as an example. Its documented in Engine binary. 
 +                        // Open Engine Binary with 7zip, extract .rodata , open with np++ and search for "MidiAssignment"
 + 
 +                        function setValue(channel, value, assignmentEnabled, timestamp) { 
 + 
 +                            if(!assignmentEnabled) { 
 +                                privateData.oldJogValue = -1.0 
 +                                return; 
 +                            } 
 +                            //console.log("out",value) 
 +                            var t = target.get(channel, value); 
 + 
 +                            // result[0]: bool indicating whether the value needs decreasing 
 +                            // result[1]: float amount by which to decrease / increase 
 +                            var result = [false, 0.0]; 
 +                            switch(type) 
 +                            { 
 +                            case 0: 
 +                            case 3: 
 +                                calcValueTypeA(value, result); 
 +                                break; 
 +                            case 1: 
 +                                calcValueTypeB(value, result); 
 +                                break; 
 +                            case 2: 
 +                                calcValueTypeC(value, result); 
 +                                break; 
 +                            default: 
 +                                console.warn("Incorrect output type."
 +                                break; 
 +                            } 
 + 
 +                            if(!t || (t.editable !== undefined && !t.editable)) 
 +                                return; 
 + 
 +                            if(invert === result[0]) 
 +                            { 
 +                                t.incValue(result[1], rangeMax, rangeMin, roundRobin, false, timestamp); 
 +                            } 
 +                            else 
 +                            { 
 +                                t.decValue(result[1], rangeMin, rangeMax, roundRobin, false, timestamp); 
 +                            } 
 +                        } 
 + 
 +                        function calcValueTypeA(value, result) { 
 + 
 +                            var v = value * 127.0 
 +                            //console.log("val:",v) 
 +                            result[0] = v >= 64.0 
 + 
 +                            if(result[0]) { 
 +                                v = 128 - v 
 +                            } 
 + 
 +                            // Now v is in [0...63] 
 +                            v /= 63.0; 
 + 
 +                            result[1] = jogSensitivity * v; 
 +                        } 
 + 
 +                  }
  }  }
 +
 +            // FxMix Deck1
 +            ValueCCAssignment {
 + objectName: "FX%1 Mix".arg(1)
 + cc: 19
 + channel: deckMidiChannel
 + output: JogOutput {
 + jogAcceleration: 1.5;
 + jogSensitivity: 0.5;
 + type: 0
 + target: PropertyTarget { path: "/Engine/Mixer/Channel%1/DJFx/Mix".arg(1) }
 + }
 +               }
 +
 +            // Fx Rate Deck1 ( mapped to Inexistant CC)
 +            ValueCCAssignment {
 +                objectName: "FX%1 Rate".arg(1)
 +                cc: 1001
 +                channel: deckMidiChannel
 +                enabled: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Knob2Target".arg(1)).translator.string === "Rate"
 +                    output: QtObject {
 +                        readonly property QObjProperty pTarget: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Rate".arg(1))
 +                        function setValue(channel, value, assignmentEnabled) {
 +                            if(assignmentEnabled) {
 +                                var counterClock = value > 0.5
 +                                var changeIndex = counterClock ? -1 : 1
 +                                pTarget.translator.index = pTarget.translator.index + changeIndex
 +                            }
 +                        }
 +                    }
 +               }
 +
 +
 +/////////////// DECK 2 ( RIGHT )
 +
 +            // Fx Activation Deck2
 + ValueNoteAssignment {
 + objectName: "FX%1 Active Button".arg(2)
 + note: 05
 + channel: deckMidiChannel
 + enabled: !device.shift
 +                    output: ActionOutput {
 +                        target: PropertyTarget {
 +                            path: "/Engine/Mixer/Channel%1/DJFx/Active".arg(2)
 +                    }
 + }
  }  }
   
 +            // Fx Selection Deck2
  ValueCCAssignment {  ValueCCAssignment {
  objectName: "FX%1 Selection".arg(2)  objectName: "FX%1 Selection".arg(2)
  cc: 20  cc: 20
  channel: deckMidiChannel  channel: deckMidiChannel
- 
  enabled: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Selecting".arg(2)).translator.state  enabled: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Selecting".arg(2)).translator.state
- output: QtObject { +                    output: QtObject { 
- readonly property QObjProperty pSelectionIndex: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/PreselectIndex".arg(2)) +                        readonly property QObjProperty pSelectionIndex: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/PreselectIndex".arg(2)) 
- function setValue(channel, value, assignmentEnabled) { +                        function setValue(channel, value, assignmentEnabled) { 
- if(assignmentEnabled) { +                            if(assignmentEnabled) { 
- if(value > 0.5) { // turn counter clockwise, value normalized +                                if(value > 0.5) { // turn counter clockwise, value normalized 
- pSelectionIndex.translator.unnormalized = pSelectionIndex.translator.unnormalized - 1 +                                    pSelectionIndex.translator.unnormalized = pSelectionIndex.translator.unnormalized - 1 
- +                                
- else { +                                else { 
- pSelectionIndex.translator.unnormalized = pSelectionIndex.translator.unnormalized + 1 +                                    pSelectionIndex.translator.unnormalized = pSelectionIndex.translator.unnormalized + 1 
- +                                
- +                            
- +                        
- }+                    }
  }  }
-  + 
- +            // Fx Selecting Deck2
  ValueCCAssignment {  ValueCCAssignment {
  objectName: "FX%1 Selecting".arg(2)  objectName: "FX%1 Selecting".arg(2)
Line 604: Line 1006:
  channel: deckMidiChannel  channel: deckMidiChannel
  enabled: !Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Selecting".arg(2)).translator.state  enabled: !Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Selecting".arg(2)).translator.state
- output: ActionOutput { +                    output: ActionOutput { 
- behaviour: force.action +                        behaviour: force.action 
- target: PropertyTarget { +                        target: PropertyTarget { 
- path: "/Engine/Mixer/Channel%1/DJFx/Selecting".arg(2) +                            path: "/Engine/Mixer/Channel%1/DJFx/Selecting".arg(2) 
- }+                        }
  }  }
  }  }
   
- +            // Fx Rate Deck2 ( mapped to Inexistant CC) 
 +            ValueCCAssignment { 
 +                objectName: "FX%1 Rate".arg(2) 
 +                cc: 1000 
 +                channel: deckMidiChannel 
 +                enabled: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Knob2Target".arg(2)).translator.string === "Rate" 
 +                    output: QtObject { 
 +                        readonly property QObjProperty pTarget: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Rate".arg(2)) 
 +                        function setValue(channel, value, assignmentEnabled) { 
 +                            if(assignmentEnabled) { 
 +                                var counterClock = value > 0.5 
 +                                var changeIndex = counterClock ? -1 : 1 
 +                                pTarget.translator.index = pTarget.translator.index + changeIndex 
 +                            } 
 +                        } 
 +                    } 
 +            }
   
- +            // FxAmount Deck2
- +
-// ValueCCAssignment { +
-// objectName: "FX%1 Rate".arg(1) +
-// cc: 100 +
-// channel: deckMidiChannel +
-// enabled: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Knob2Target".arg(1)).translator.string === "Rate" +
-// output: QtObject { +
-// readonly property QObjProperty pTarget: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Rate".arg(1)) +
-// function setValue(channel, value, assignmentEnabled) { +
-// if(assignmentEnabled) { +
-// var counterClock = value > 0.5 +
-// var changeIndex = counterClock ? -1 : 1 +
-// pTarget.translator.index = pTarget.translator.index + changeIndex +
-// } +
-// } +
-// } +
-// } +
- +
- ValueCCAssignment { +
- objectName: "FX%1 Amount".arg(1) +
- cc: 18 +
- channel: deckMidiChannel +
- enabled: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Knob2Target".arg(1)).translator.string === "Amount" +
- output: EndlessKnobOutput { +
- smallestIncrement: 0.01 +
- biggestIncrement: 0.1 +
- target: PropertyTarget { path: "/Engine/Mixer/Channel%1/DJFx/Amount".arg(1) } +
-+
- }  +
- +
  ValueCCAssignment {  ValueCCAssignment {
  objectName: "FX%1 Amount".arg(2)  objectName: "FX%1 Amount".arg(2)
Line 650: Line 1038:
  channel: deckMidiChannel  channel: deckMidiChannel
  enabled: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Knob2Target".arg(2)).translator.string === "Amount"  enabled: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Knob2Target".arg(2)).translator.string === "Amount"
- output: EndlessKnobOutput { +                    output: EndlessKnobOutput { 
- smallestIncrement: 0.01 +                        smallestIncrement: 0.01 
- biggestIncrement: 0.1 +                        biggestIncrement: 0.1 
- target: PropertyTarget { path: "/Engine/Mixer/Channel%1/DJFx/Amount".arg(2) } +                        target: PropertyTarget { path: "/Engine/Mixer/Channel%1/DJFx/Amount".arg(2) } 
- }+                    }
  }   }
   
- +            // FxMix Deck2
  ValueCCAssignment {  ValueCCAssignment {
- objectName: "FX%1 Mix".arg(1+ objectName: "FX%1 Mix".arg(2
- cc: 19+ cc: 22
  channel: deckMidiChannel  channel: deckMidiChannel
- output: ValueOutput { +                    output: ValueOutput { 
- target: PropertyTarget { +                        target: PropertyTarget { 
- path: "/Engine/Mixer/Channel%1/DJFx/Mix".arg(1)+                            path: "/Engine/Mixer/Channel%1/DJFx/Mix".arg(2) 
 +                        } 
 +                    } 
 + }  
 + 
 +            // In test 
 +            ValueNoteAssignment { 
 +            objectName: "Cue-Split" 
 +            channel: 0 
 +            note: 59 
 +                output: ActionOutput { 
 +                    behaviour: force.hold 
 +                    target: PropertyTarget { path: "/Engine/Mixer/Cue/CueMix/Split";
 +                } 
 +            } 
 + 
 +            // SyncLed Deck1 
 + OutputAssignment { 
 + objectName: "Sync LED Deck%1".arg(1) 
 + properties: { 'ledValue': ''
 +  
 + readonly property int ledValue: { 
 + if(syncMode1 === "TempoSync") { 
 + globalSyncMode === "Tempo" || tempoSyncedFlashState ? 127 : 0 
 +
 + else if(syncMode1 === "BeatOrBarSync") { 
 + 127 
 +
 + else { 
 + 1
  }  }
  }  }
 +
 + function send() {
 + //device.sendSimpleColor(deckMidiChannel, 8, ledValue)
 + device.sendColorSyncd1(ledValue,"Deck1Sync")
 + //console.log("simpecolor",ledValue)
 + }
 +
 + Component.onCompleted: send()
  }  }
 +
 +            // SyncLed Deck2
 + OutputAssignment {
 + objectName: "Sync LED Deck%1".arg(2)
 + properties: { 'ledValue': '' }
 +
 + readonly property int ledValue: {
 + if(syncMode2 === "TempoSync") {
 + globalSyncMode === "Tempo" || tempoSyncedFlashState ? 127 : 0
 + }
 + else if(syncMode2 === "BeatOrBarSync") {
 + 127
 + }
 + else {
 + 1
 + }
 + }
  
 + function send() {
 + //device.sendSimpleColor(deckMidiChannel, 8, ledValue)
 + device.sendColorSyncd2(ledValue,"Deck2Sync")
 + //console.log("simpecolor",ledValue)
 + }
  
- ValueCCAssignment + Component.onCompleted: send() 
- objectName: "FX%1 Mix".arg(2+
- cc22 +  
- channel: deckMidiChannel +            // Cue Led Deck1 
- outputValueOutput + OutputAssignment 
- target: PropertyTarget + objectName: "Cue LED Deck%1".arg(1
- path: "/Engine/Mixer/Channel%1/DJFx/Mix".arg(2)+ properties{ 'ledValue': '' } 
 +  
 + readonly property int ledValue: { 
 + if(cueLEDState1) 
 + 127 
 +
 + else if(cueLEDFlashing1
 + tempoSyncedFlashState1 ? 127 : 0 
 +
 + else { 
 + 1
  }  }
  }  }
- }  
-  
  
- + function send() { 
- } + device.sendColorLedd1(ledValue,"led"
 +
 +  
 + Component.onCompleted: send() 
 + }
  
  
 +//////////// FX ASSIGNMENTS TO RED PADS NOTE 54 to 57
 +//////////// Fx index goes from (0) to (12) in order below
 +//////////// Echo (0), Delayn Hall, PingPong, AutoGate, Flanger, LFO Filter, Phaser, Crush, Roll, RevRoll, Scratch, Reverb (12)
  
 +            // RED PAD 1
 +            ValueNoteAssignment {
 +                objectName: "FX%1 Selection".arg(1)
 +                note: 54
 +                channel: 9
 +                enabled: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Selecting".arg(1)).translator.state
 +                    output: QtObject {
 +                        readonly property QObjProperty pSelectionIndex: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/PreselectIndex".arg(1))
 +                        function setValue(channel, value, assignmentEnabled) {
 +                            if(value > 0) { // turn counter clockwise, value normalized
 +                                pSelectionIndex.translator.unnormalized = 3
 +                                //console.log("idx:",pSelectionIndex.translator.unnormalized )
 +                                // Send to device - look at device file
 +                                device.sendFxColorbutton(0)
 +                            }
 +                        }
 +                    }
 +                }
  
-/* 
- FxAssignmentConfig { 
- id: fxConfig 
- midiChannel: 0 
- channelNames: ['1', '2'] 
- } 
  
- DJFxSelect +            ValueNoteAssignment 
- pushNote53 +                objectName"FX%1 Selecting".arg(1) 
- touchNote91 +                note54 
- turnCC17 +                channel9 
- }+                enabled: !Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Selecting".arg(1)).translator.state 
 +                    output: ActionOutput { 
 +                        behaviour: force.action 
 +                        target: PropertyTarget { 
 +                            path: "/Engine/Mixer/Channel%1/DJFx/Selecting".arg(1) 
 +                        } 
 +                    } 
 +                }
  
- DJFxTime +            // RED PAD 2 
- pushNote8 +            ValueNoteAssignment 
- turnCC18 +                objectName"FX%1 Selection".arg(1) 
- }+                note55 
 +                channel: 9
  
- DJFxWetDry +                enabled: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Selecting".arg(1)).translator.state 
- cc19 +                    output: QtObject 
- }+                        readonly property QObjProperty pSelectionIndexPlanck.getProperty("/Engine/Mixer/Channel%1/DJFx/PreselectIndex".arg(1)) 
 +                        readonly property QObjProperty pFx1Active: Planck.getProperty("/Engine/Mixer/Channel1/DJFx/Active"
 +                        function setValue(channel, value, assignmentEnabled) {
  
- DJFxActivate +                            if(value > 0) // turn counter clockwise, value normalized 
- fxActivateType: FxActivateType.Button +                                pSelectionIndex.translator.unnormalized = 4 
- activateControlsModelListModel { +                                //console.log("idx:",pSelectionIndex.translator.unnormalized ) 
- ListElement { +                                //console.log("pFx1Active:",pFx1Active.translator.state) 
- midiChannel0 +                                device.sendFxColorbutton(1) 
- note: 93 +                            
-  +                        
- +                    
- ListElement { +                }
- midiChannel:+
- note: 92 +
- +
-  +
-  +
-  +
- +
- }+
  
  
- +            ValueNoteAssignment { 
 +                objectName: "FX%1 Selecting".arg(1) 
 +                note: 55 
 +                channel: 9 
 +                enabled: !Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Selecting".arg(1)).translator.state 
 +                    output: ActionOutput { 
 +                        behaviour: force.action 
 +                        target: PropertyTarget { 
 +                            path: "/Engine/Mixer/Channel%1/DJFx/Selecting".arg(1) 
 +                        } 
 +                    } 
 +                } 
 + 
 +            // RED PAD 3 
 +            ValueNoteAssignment { 
 +                objectName: "FX%1 Selection".arg(1) 
 +                note: 56 
 +                channel: 9 
 +                enabled: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Selecting".arg(1)).translator.state 
 +                    output: QtObject { 
 +                        readonly property QObjProperty pSelectionIndex: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/PreselectIndex".arg(1)) 
 +                        function setValue(channel, value, assignmentEnabled) { 
 +                                if(value > 0) { // turn counter clockwise, value normalized 
 +                                    pSelectionIndex.translator.unnormalized = 6 
 +                                    console.log("idx:",pSelectionIndex.translator.unnormalized ) 
 +                                    device.sendFxColorbutton(2) 
 +                                } 
 +                        } 
 +                    } 
 +                } 
 + 
 + 
 +            ValueNoteAssignment { 
 +                objectName: "FX%1 Selecting".arg(1) 
 +                note: 56 
 +                channel: 9 
 +                enabled: !Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Selecting".arg(1)).translator.state 
 +                    output: ActionOutput { 
 +                        behaviour: force.action 
 +                        target: PropertyTarget { 
 +                            path: "/Engine/Mixer/Channel%1/DJFx/Selecting".arg(1) 
 +                        } 
 +                    } 
 +                } 
 + 
 +            // RED PAD 4 
 +            ValueNoteAssignment { 
 +                objectName: "FX%1 Selecting".arg(1) 
 +                note: 57 
 +                channel: 9 
 +                enabled: !Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Selecting".arg(1)).translator.state 
 +                    output: ActionOutput { 
 +                        behaviour: force.action 
 +                        target: PropertyTarget { 
 +                            path: "/Engine/Mixer/Channel%1/DJFx/Selecting".arg(1) 
 +                        } 
 +                    } 
 +                } 
 + 
 + 
 +            ValueNoteAssignment { 
 +                objectName: "FX%1 Selection".arg(1) 
 +                note: 57 
 +                channel: 9 
 +                enabled: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Selecting".arg(1)).translator.state 
 +                    output: QtObject { 
 +                        readonly property QObjProperty pSelectionIndex: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/PreselectIndex".arg(1)) 
 +                        function setValue(channel, value, assignmentEnabled) { 
 +                                if(value > 0) { // turn counter clockwise, value normalized 
 +                                    pSelectionIndex.translator.unnormalized = 8 
 +                                    console.log("idx:",pSelectionIndex.translator.unnormalized ) 
 +                                    device.sendFxColorbutton(3) 
 +                                } 
 +                        } 
 +                    } 
 +                } 
 + 
 +//////////// END FX ASSIGNMENTS TO RED PADS 
 + 
 + 
 +//////////// FX ASSIGNMENTS TO GREEN PADS NOTE 58 to 61 
 +//////////// Fx index goes from (0) to (12) in order below 
 +//////////// Echo (0), Delayn Hall, PingPong, AutoGate, Flanger, LFO Filter, Phaser, Crush, Roll, RevRoll, Scratch, Reverb (12) 
 + 
 +            // GREEN PAD 1 
 +            ValueNoteAssignment { 
 +                objectName: "FX%1 Selection".arg(2) 
 +                note: 58 
 +                channel: 9 
 +                enabled: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Selecting".arg(2)).translator.state 
 +                    output: QtObject { 
 +                        readonly property QObjProperty pSelectionIndex: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/PreselectIndex".arg(2)) 
 +                        function setValue(channel, value, assignmentEnabled) { 
 +                            if(value > 0) { // turn counter clockwise, value normalized 
 +                                pSelectionIndex.translator.unnormalized = 3 
 +                                //console.log("idx:",pSelectionIndex.translator.unnormalized ) 
 +                                // Send to device - look at device file 
 +                                device.sendFxColorbuttonD2(4) 
 +                            } 
 +                        } 
 +                    } 
 +                } 
 + 
 + 
 +            ValueNoteAssignment { 
 +                objectName: "FX%1 Selecting".arg(2) 
 +                note: 58 
 +                channel: 9 
 +                enabled: !Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Selecting".arg(2)).translator.state 
 +                    output: ActionOutput { 
 +                        behaviour: force.action 
 +                        target: PropertyTarget { 
 +                            path: "/Engine/Mixer/Channel%1/DJFx/Selecting".arg(2) 
 +                        } 
 +                    } 
 +                } 
 + 
 +            // GREEN PAD 2 
 +            ValueNoteAssignment { 
 +                objectName: "FX%1 Selection".arg(2) 
 +                note: 59 
 +                channel: 9 
 + 
 +                enabled: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Selecting".arg(2)).translator.state 
 +                    output: QtObject { 
 +                        readonly property QObjProperty pSelectionIndex: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/PreselectIndex".arg(2)) 
 +                        readonly property QObjProperty pFx1Active: Planck.getProperty("/Engine/Mixer/Channel1/DJFx/Active"
 +                        function setValue(channel, value, assignmentEnabled) { 
 + 
 +                            if(value > 0) { // turn counter clockwise, value normalized 
 +                                pSelectionIndex.translator.unnormalized = 4 
 +                                //console.log("idx:",pSelectionIndex.translator.unnormalized ) 
 +                                //console.log("pFx1Active:",pFx1Active.translator.state) 
 +                                device.sendFxColorbuttonD2(5) 
 +                            } 
 +                        } 
 +                    } 
 +                } 
 + 
 + 
 +            ValueNoteAssignment { 
 +                objectName: "FX%1 Selecting".arg(2) 
 +                note: 59 
 +                channel: 9 
 +                enabled: !Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Selecting".arg(2)).translator.state 
 +                    output: ActionOutput { 
 +                        behaviour: force.action 
 +                        target: PropertyTarget { 
 +                            path: "/Engine/Mixer/Channel%1/DJFx/Selecting".arg(2) 
 +                        } 
 +                    } 
 +                } 
 + 
 +            // GREEN PAD 3 
 +            ValueNoteAssignment { 
 +                objectName: "FX%1 Selection".arg(2) 
 +                note: 60 
 +                channel: 9 
 +                enabled: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Selecting".arg(2)).translator.state 
 +                    output: QtObject { 
 +                        readonly property QObjProperty pSelectionIndex: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/PreselectIndex".arg(2)) 
 +                        function setValue(channel, value, assignmentEnabled) { 
 +                                if(value > 0) { // turn counter clockwise, value normalized 
 +                                    pSelectionIndex.translator.unnormalized = 6 
 +                                    console.log("idx:",pSelectionIndex.translator.unnormalized ) 
 +                                    device.sendFxColorbuttonD2(6) 
 +                                } 
 +                        } 
 +                    } 
 +                } 
 + 
 + 
 +            ValueNoteAssignment { 
 +                objectName: "FX%1 Selecting".arg(1) 
 +                note: 60 
 +                channel: 9 
 +                enabled: !Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Selecting".arg(2)).translator.state 
 +                    output: ActionOutput { 
 +                        behaviour: force.action 
 +                        target: PropertyTarget { 
 +                            path: "/Engine/Mixer/Channel%1/DJFx/Selecting".arg(2) 
 +                        } 
 +                    } 
 +                } 
 + 
 +            // GREEN PAD 4 
 + 
 +            ValueNoteAssignment { 
 +                objectName: "FX%1 Selection".arg(2) 
 +                note: 61 
 +                channel: 9 
 +                enabled: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Selecting".arg(2)).translator.state 
 +                    output: QtObject { 
 +                        readonly property QObjProperty pSelectionIndex: Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/PreselectIndex".arg(2)) 
 +                        function setValue(channel, value, assignmentEnabled) { 
 +                                if(value > 0) { // turn counter clockwise, value normalized 
 +                                    pSelectionIndex.translator.unnormalized = 8 
 +                                    console.log("idx:",pSelectionIndex.translator.unnormalized ) 
 +                                    device.sendFxColorbuttonD2(7) 
 +                                } 
 +                        } 
 +                    } 
 +                } 
 + 
 + 
 +            ValueNoteAssignment { 
 +                objectName: "FX%1 Selecting".arg(2) 
 +                note: 61 
 +                channel: 9 
 +                enabled: !Planck.getProperty("/Engine/Mixer/Channel%1/DJFx/Selecting".arg(2)).translator.state 
 +                    output: ActionOutput { 
 +                        behaviour: force.action 
 +                        target: PropertyTarget { 
 +                            path: "/Engine/Mixer/Channel%1/DJFx/Selecting".arg(2) 
 +                        } 
 +                    } 
 +                } 
 + 
 + 
 +//////////// END FX ASSIGNMENTS TO RED PADS 
 + 
 + 
 + 
 +        } //Closing Item 
 +    } // Closing Repeater 
 + 
 +} // Closing assignment 
  
- DJFxAssign { 
-  
- notes: [94, 95] 
- } 
-  
-*/ 
-} 
  
 </code> </code>
 +
 +
 +Files for this project are available there : 
 +
 +[[http://dnttalo.cluster029.hosting.ovh.net/Akai/|Akai Prime2 Files]]
 +
prime2.1701032555.txt.gz · Last modified: 2023/11/26 22:02 by ounsatn

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki