prime4
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| prime4 [2023/09/10 21:08] – created ounsatn | prime4 [2023/09/11 23:01] (current) – ounsatn | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| To use prime 4, you have to change your productcode to JC11 when binding. | To use prime 4, you have to change your productcode to JC11 when binding. | ||
| (mount -o bind productcode "/ | (mount -o bind productcode "/ | ||
| + | |||
| + | |||
| + | When running prime you'll see which file you can create for your assignments. | ||
| + | Below is an example when i run prime 4 : | ||
| + | |||
| + | < | ||
| + | air.assignments.deviceadapter: | ||
| + | air.assignments.deviceadapter: | ||
| + | air.assignments.deviceadapter: | ||
| + | air.assignments.deviceadapter: | ||
| + | air.assignments.deviceadapter: | ||
| + | air.assignments.deviceadapter: | ||
| + | air.assignments.deviceadapter: | ||
| + | air.assignments.deviceadapter: | ||
| + | air.assignments.deviceadapter: | ||
| + | air.assignments.deviceadapter: | ||
| + | air.assignments.deviceadapter: | ||
| + | air.assignments.deviceadapter: | ||
| + | </ | ||
| + | |||
| + | So all these qml files can be created. | ||
| + | |||
| + | |||
| + | Then you can use the following qml to use it on your force. | ||
| + | (qml syntax has been taken from Prime Firmware) | ||
| + | |||
| + | [[http:// | ||
| + | [[http:// | ||
| + | |||
| + | |||
| + | [[http:// | ||
| + | [[http:// | ||
| + | |||
| + | I will explain a bit the syntax | ||
| + | |||
| + | **_Private_ files are used for inputs / actions buttons .** | ||
| + | |||
| + | < | ||
| + | |||
| + | Akai_Pro_Force_Private_Device.qml : | ||
| + | |||
| + | import airAssignments 1.0 | ||
| + | import InputAssignment 0.1 | ||
| + | import OutputAssignment 0.1 | ||
| + | import Device 0.1 | ||
| + | import QtQuick 2.9 | ||
| + | |||
| + | // QT_LOGGING_RULES=air.planck.firmware.upgrade=true LD_LIBRARY_PATH=/ | ||
| + | |||
| + | Device { | ||
| + | id: device | ||
| + | |||
| + | property real gamma: 3.5 | ||
| + | property real padGamma: 3.5 | ||
| + | |||
| + | controls: [] | ||
| + | useGlobalShift: | ||
| + | numberOfLayers: | ||
| + | |||
| + | property string deviceInfo: "" | ||
| + | property string currentMixerFirmwareVersion | ||
| + | |||
| + | /////////////////////////////////////////////////////////////////////////// | ||
| + | // Setup | ||
| + | |||
| + | function queryAbsoluteControls() { | ||
| + | console.log(" | ||
| + | Midi.sendSysEx(" | ||
| + | } | ||
| + | |||
| + | property Timer initPhaseEndTimer: | ||
| + | interval: 1000 | ||
| + | repeat: false | ||
| + | onTriggered: | ||
| + | console.log(" | ||
| + | device.isInitializing = false | ||
| + | queryAbsoluteControls() | ||
| + | } | ||
| + | } | ||
| + | |||
| + | property bool isInitializing: | ||
| + | |||
| + | Component.onCompleted: | ||
| + | currentColors = {} | ||
| + | currentSimpleColors = {} | ||
| + | console.log(" | ||
| + | Midi.sendSysEx(" | ||
| + | |||
| + | isInitializing = true | ||
| + | |||
| + | requestPowerOnButtonState() | ||
| + | |||
| + | console.log(" | ||
| + | Midi.sendSysEx(" | ||
| + | |||
| + | initPhaseEndTimer.start() | ||
| + | } | ||
| + | |||
| + | Component.onDestruction: | ||
| + | Midi.sendNoteOff(0, | ||
| + | } | ||
| + | |||
| + | property var currentColors | ||
| + | property var currentSimpleColors | ||
| + | |||
| + | // Dec to Hex Conversion | ||
| + | function d2h(d){ | ||
| + | return (+d).toString(16).toUpperCase() | ||
| + | } | ||
| + | |||
| + | function midiColorChannel(c, | ||
| + | return d2h(Math.min(127, | ||
| + | } | ||
| + | |||
| + | function mapColor(color) { | ||
| + | return Qt.rgba(color.r, | ||
| + | } | ||
| + | |||
| + | function midiColor(color, | ||
| + | var c = mapColor(color) | ||
| + | return midiColorChannel(c.r, | ||
| + | } | ||
| + | |||
| + | function sendNoteOn(channel, | ||
| + | Midi.sendNoteOn(channel, | ||
| + | } | ||
| + | |||
| + | function sendSimpleColor(channel, | ||
| + | currentSimpleColors[index] = value | ||
| + | |||
| + | if (value === 0) { | ||
| + | Midi.sendNoteOff(channel, | ||
| + | } | ||
| + | else { | ||
| + | Midi.sendNoteOn(channel, | ||
| + | } | ||
| + | } | ||
| + | |||
| + | //Color Send Function | ||
| + | function sendColor(channel, | ||
| + | { | ||
| + | currentColors[index] = color | ||
| + | |||
| + | var g = device.gamma | ||
| + | if(index >= 15 && index <= 23) { | ||
| + | g = device.padGamma | ||
| + | } | ||
| + | |||
| + | var sysEx = "F0 00 02 0B 7F 0C 03 00 05 " + d2h(channel) + " " + d2h(index) + " " + midiColor(color, | ||
| + | Midi.sendSysEx(sysEx) | ||
| + | |||
| + | } | ||
| + | |||
| + | function requestPowerOnButtonState() { | ||
| + | Midi.sendSysEx(" | ||
| + | } | ||
| + | |||
| + | function sysExToIntList(sysExString) | ||
| + | { | ||
| + | var valueList = sysExString.split(" | ||
| + | var result = [] | ||
| + | |||
| + | for(var i = 0; i < valueList.length; | ||
| + | result.push(parseInt(valueList[i], | ||
| + | } | ||
| + | |||
| + | return result | ||
| + | } | ||
| + | |||
| + | function sysEx(sysExString) { | ||
| + | console.info(" | ||
| + | var valueList = sysExToIntList(sysExString) | ||
| + | var result = "" | ||
| + | |||
| + | // 0xf0 0x00 0x02 0x0b 0x00 0x06 0x42 0x00 0x01 0x01 0xf7 | ||
| + | if(valueList[1] === 0x00 && valueList[2] === 0x02 && valueList[3] === 0x0B && valueList[4] === 0x00 && valueList[6] === 0x42) | ||
| + | { | ||
| + | if(valueList[9] === 0x0) { | ||
| + | console.log(" | ||
| + | } | ||
| + | else if(valueList[9] === 0x1) { | ||
| + | console.log(" | ||
| + | quitToTestApp() | ||
| + | } | ||
| + | } | ||
| + | else if(valueList[1] === 0x7E && valueList[2] === 0x00 && valueList[3] === 0x06 && valueList[4] === 0x02) | ||
| + | { | ||
| + | var i | ||
| + | for(i = 0; i < 4; ++i) { | ||
| + | result += valueList[i + 11] | ||
| + | if(i === 1) { | ||
| + | result += " | ||
| + | } | ||
| + | } | ||
| + | deviceInfo = result | ||
| + | |||
| + | var mixerVersion = "" | ||
| + | if(valueList.length === 43) { | ||
| + | // | ||
| + | for(i = 0; i < 4; ++i) { | ||
| + | mixerVersion += valueList[i + 37] | ||
| + | if(i === 1) { | ||
| + | mixerVersion += " | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | currentMixerFirmwareVersion = mixerVersion | ||
| + | |||
| + | console.log(" | ||
| + | |||
| + | var currentSerialNumber = Planck.readFromFile("/ | ||
| + | var serial = "" | ||
| + | |||
| + | for(i = 20; i < 35; ++i) { | ||
| + | if(valueList[i] === 0) { | ||
| + | break | ||
| + | } | ||
| + | serial += String.fromCharCode(valueList[i]) | ||
| + | } | ||
| + | |||
| + | if(serial !== currentSerialNumber && serial.length > 0) { | ||
| + | Planck.setDeviceSerialNumber(serial) | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | < | ||
| + | Akai_Pro_Force_Private_Assignments.qml : | ||
| + | |||
| + | import airAssignments 1.0 | ||
| + | import ControlSurfaceModules 0.1 | ||
| + | import Planck 1.0 | ||
| + | import QtQuick 2.12 | ||
| + | import InputAssignment 0.1 | ||
| + | import OutputAssignment 0.1 | ||
| + | |||
| + | |||
| + | MidiAssignment { | ||
| + | objectName: | ||
| + | |||
| + | Utility { | ||
| + | id: util | ||
| + | } | ||
| + | |||
| + | GlobalAssignmentConfig { | ||
| + | id: globalConfig | ||
| + | midiChannel: | ||
| + | } | ||
| + | |||
| + | GlobalAction { | ||
| + | id: globalAction | ||
| + | } | ||
| + | |||
| + | Back { | ||
| + | note: 67 | ||
| + | ledType: LedType.Simple | ||
| + | } | ||
| + | |||
| + | Forward { | ||
| + | //note: 115 | ||
| + | shiftAction: | ||
| + | ledType: LedType.Simple | ||
| + | } | ||
| + | |||
| + | BrowseEncoder { | ||
| + | // | ||
| + | turnCC: 100 | ||
| + | ledType: LedType.Simple | ||
| + | } | ||
| + | |||
| + | View { | ||
| + | note: 0 | ||
| + | holdAction: | ||
| + | shiftAction: | ||
| + | ledType: LedType.Simple | ||
| + | } | ||
| + | |||
| + | Shift { | ||
| + | note: 49 | ||
| + | ledType: LedType.Simple | ||
| + | } | ||
| + | |||
| + | Media { | ||
| + | mediaButtonsModel: | ||
| + | ListElement { | ||
| + | name: ' | ||
| + | shiftName: | ||
| + | note: 20 | ||
| + | hasLed: true | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | Mixer { | ||
| + | cueMixCC: 12 | ||
| + | cueGainCC: | ||
| + | crossfaderCC: | ||
| + | } | ||
| + | |||
| + | MicSettings {} | ||
| + | |||
| + | Mics { | ||
| + | mic1Note: 36 | ||
| + | mic2Note: 37 | ||
| + | mic1ShiftAction: | ||
| + | } | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | Repeater { | ||
| + | model: ListModel { | ||
| + | ListElement { | ||
| + | deckName: | ||
| + | deckMidiChannel: | ||
| + | loadNote: | ||
| + | } | ||
| + | } | ||
| + | |||
| + | Item { | ||
| + | DeckAssignmentConfig { | ||
| + | id: deckConfig | ||
| + | name: model.deckName | ||
| + | midiChannel: | ||
| + | } | ||
| + | |||
| + | DeckAction { | ||
| + | id: deckAction | ||
| + | } | ||
| + | |||
| + | Bank {} | ||
| + | |||
| + | Load { | ||
| + | note: model.loadNote | ||
| + | ledType: | ||
| + | } | ||
| + | |||
| + | PerformanceModes { | ||
| + | ledType: LedType.RGB | ||
| + | |||
| + | modesModel: | ||
| + | ListElement { | ||
| + | |||
| + | note: 110 | ||
| + | view: " | ||
| + | } | ||
| + | ListElement { | ||
| + | |||
| + | note: 111 | ||
| + | view: " | ||
| + | altView: | ||
| + | } | ||
| + | ListElement { | ||
| + | |||
| + | note: 112 | ||
| + | view: " | ||
| + | } | ||
| + | ListElement { | ||
| + | |||
| + | note: 113 | ||
| + | view: " | ||
| + | altView: | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | ActionPads { | ||
| + | | ||
| + | firstPadNote: | ||
| + | ledType: | ||
| + | } | ||
| + | |||
| + | Sync { | ||
| + | syncNote: | ||
| + | syncHoldAction: | ||
| + | } | ||
| + | |||
| + | PlayCue { | ||
| + | cueNote: | ||
| + | cueShiftAction: | ||
| + | playNote: | ||
| + | } | ||
| + | |||
| + | PitchBend { | ||
| + | minusNote: | ||
| + | plusNote: | ||
| + | } | ||
| + | |||
| + | JogWheel { | ||
| + | touchNote: | ||
| + | ccUpper: | ||
| + | ccLower: | ||
| + | jogSensitivity: | ||
| + | hasTrackSearch: | ||
| + | } | ||
| + | |||
| + | Vinyl { | ||
| + | note: 35 | ||
| + | holdAction: | ||
| + | } | ||
| + | |||
| + | AutoLoop { | ||
| + | pushNote: | ||
| + | turnCC: 160 | ||
| + | loopInactiveShiftTurnAction: | ||
| + | ledType: | ||
| + | } | ||
| + | |||
| + | SpeedSlider { | ||
| + | ccUpper: | ||
| + | ccLower: | ||
| + | invert: true | ||
| + | } | ||
| + | } | ||
| + | |||
| + | } | ||
| + | |||
| + | |||
| + | |||
| + | Repeater { | ||
| + | model: ListModel { | ||
| + | ListElement { | ||
| + | deckName: | ||
| + | deckMidiChannel: | ||
| + | loadNote: | ||
| + | } | ||
| + | } | ||
| + | |||
| + | Item { | ||
| + | DeckAssignmentConfig { | ||
| + | id: deckConfig | ||
| + | name: model.deckName | ||
| + | midiChannel: | ||
| + | } | ||
| + | |||
| + | DeckAction { | ||
| + | id: deckAction | ||
| + | } | ||
| + | |||
| + | Bank {} | ||
| + | |||
| + | Load { | ||
| + | note: model.loadNote | ||
| + | ledType: | ||
| + | } | ||
| + | |||
| + | PerformanceModes { | ||
| + | ledType: LedType.RGB | ||
| + | modesModel: | ||
| + | ListElement { | ||
| + | |||
| + | note: 78 | ||
| + | view: " | ||
| + | } | ||
| + | ListElement { | ||
| + | |||
| + | note: 79 | ||
| + | view: " | ||
| + | altView: | ||
| + | } | ||
| + | ListElement { | ||
| + | |||
| + | note: 80 | ||
| + | view: " | ||
| + | } | ||
| + | ListElement { | ||
| + | |||
| + | note: 81 | ||
| + | view: " | ||
| + | altView: | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | ActionPads { | ||
| + | |||
| + | firstPadNote: | ||
| + | ledType: | ||
| + | |||
| + | } | ||
| + | |||
| + | Sync { | ||
| + | syncNote: | ||
| + | syncHoldAction: | ||
| + | } | ||
| + | |||
| + | PlayCue { | ||
| + | cueNote: | ||
| + | cueShiftAction: | ||
| + | playNote: | ||
| + | } | ||
| + | |||
| + | PitchBend { | ||
| + | minusNote: | ||
| + | plusNote: | ||
| + | } | ||
| + | |||
| + | JogWheel { | ||
| + | touchNote: | ||
| + | ccUpper: | ||
| + | ccLower: | ||
| + | jogSensitivity: | ||
| + | hasTrackSearch: | ||
| + | } | ||
| + | |||
| + | Vinyl { | ||
| + | note: 35 | ||
| + | holdAction: | ||
| + | } | ||
| + | |||
| + | AutoLoop { | ||
| + | pushNote: | ||
| + | turnCC: 230 | ||
| + | loopInactiveShiftTurnAction: | ||
| + | ledType: | ||
| + | } | ||
| + | |||
| + | SpeedSlider { | ||
| + | ccUpper: | ||
| + | ccLower: | ||
| + | invert: true | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | Repeater { | ||
| + | model: ListModel { | ||
| + | ListElement { | ||
| + | mixerChannelName: | ||
| + | mixerChannelMidiChannel: | ||
| + | } | ||
| + | } | ||
| + | |||
| + | Item { | ||
| + | objectName: | ||
| + | |||
| + | MixerChannelAssignmentConfig { | ||
| + | id: mixerChannelConfig | ||
| + | name: model.mixerChannelName | ||
| + | midiChannel: | ||
| + | } | ||
| + | |||
| + | MixerChannelCore { | ||
| + | pflNote: | ||
| + | trimCC: 3 | ||
| + | trebleCC: | ||
| + | midCC: 6 | ||
| + | bassCC: 200 | ||
| + | faderCC: | ||
| + | } | ||
| + | |||
| + | SweepFxKnob { | ||
| + | cc: 24 | ||
| + | } | ||
| + | |||
| + | SweepFxSelect { | ||
| + | channelNames: | ||
| + | buttonsModel: | ||
| + | ListElement { | ||
| + | note: 60 | ||
| + | fxIndex: | ||
| + | |||
| + | } | ||
| + | ListElement { | ||
| + | note: 61 | ||
| + | fxIndex: | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | } | ||
| + | |||
| + | |||
| + | |||
| + | Repeater { | ||
| + | model: ListModel { | ||
| + | |||
| + | ListElement { | ||
| + | mixerChannelName: | ||
| + | mixerChannelMidiChannel: | ||
| + | } | ||
| + | } | ||
| + | |||
| + | Item { | ||
| + | objectName: | ||
| + | |||
| + | MixerChannelAssignmentConfig { | ||
| + | id: mixerChannelConfig | ||
| + | name: model.mixerChannelName | ||
| + | midiChannel: | ||
| + | } | ||
| + | |||
| + | MixerChannelCore { | ||
| + | pflNote: | ||
| + | trimCC: 3 | ||
| + | trebleCC: | ||
| + | midCC: 6 | ||
| + | bassCC: 22 | ||
| + | faderCC: | ||
| + | } | ||
| + | |||
| + | SweepFxKnob { | ||
| + | cc: 24 | ||
| + | } | ||
| + | |||
| + | SweepFxSelect { | ||
| + | channelNames: | ||
| + | buttonsModel: | ||
| + | ListElement { | ||
| + | note: 62 | ||
| + | fxIndex: | ||
| + | } | ||
| + | ListElement { | ||
| + | note: 63 | ||
| + | fxIndex: | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | /////////////////////////////////////////////////////////////////////////// | ||
| + | // Effect Controls | ||
| + | Repeater { | ||
| + | model: ListModel { | ||
| + | ListElement { | ||
| + | deckName: | ||
| + | deckMidiChannel: | ||
| + | } | ||
| + | |||
| + | ListElement { | ||
| + | deckName: | ||
| + | deckMidiChannel: | ||
| + | } | ||
| + | } | ||
| + | |||
| + | Item { | ||
| + | id: deckFx | ||
| + | |||
| + | ValueNoteAssignment { | ||
| + | objectName: | ||
| + | note: 93 | ||
| + | channel: | ||
| + | enabled: | ||
| + | output: ActionOutput { | ||
| + | target: | ||
| + | path: "/ | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | ValueNoteAssignment { | ||
| + | objectName: | ||
| + | note: 05 | ||
| + | channel: | ||
| + | enabled: | ||
| + | output: ActionOutput { | ||
| + | target: | ||
| + | path: "/ | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ValueCCAssignment { | ||
| + | objectName: | ||
| + | cc: 17 | ||
| + | channel: | ||
| + | |||
| + | enabled: | ||
| + | output: QtObject { | ||
| + | readonly property QObjProperty pSelectionIndex: | ||
| + | function setValue(channel, | ||
| + | if(assignmentEnabled) { | ||
| + | if(value > 0.5) { // turn counter clockwise, value normalized | ||
| + | pSelectionIndex.translator.unnormalized = pSelectionIndex.translator.unnormalized - 1 | ||
| + | } | ||
| + | else { | ||
| + | pSelectionIndex.translator.unnormalized = pSelectionIndex.translator.unnormalized + 1 | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | ValueCCAssignment { | ||
| + | objectName: | ||
| + | cc: 17 | ||
| + | channel: | ||
| + | enabled: | ||
| + | output: ActionOutput { | ||
| + | behaviour: | ||
| + | target: | ||
| + | path: "/ | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | ValueCCAssignment { | ||
| + | objectName: | ||
| + | cc: 20 | ||
| + | channel: | ||
| + | |||
| + | enabled: | ||
| + | output: QtObject { | ||
| + | readonly property QObjProperty pSelectionIndex: | ||
| + | function setValue(channel, | ||
| + | if(assignmentEnabled) { | ||
| + | if(value > 0.5) { // turn counter clockwise, value normalized | ||
| + | pSelectionIndex.translator.unnormalized = pSelectionIndex.translator.unnormalized - 1 | ||
| + | } | ||
| + | else { | ||
| + | pSelectionIndex.translator.unnormalized = pSelectionIndex.translator.unnormalized + 1 | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | ValueCCAssignment { | ||
| + | objectName: | ||
| + | cc: 20 | ||
| + | channel: | ||
| + | enabled: | ||
| + | output: ActionOutput { | ||
| + | behaviour: | ||
| + | target: | ||
| + | path: "/ | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | // | ||
| + | // | ||
| + | // cc: 100 | ||
| + | // | ||
| + | // | ||
| + | // | ||
| + | // | ||
| + | // | ||
| + | // | ||
| + | // | ||
| + | // | ||
| + | // | ||
| + | // } | ||
| + | // } | ||
| + | // } | ||
| + | // } | ||
| + | |||
| + | ValueCCAssignment { | ||
| + | objectName: | ||
| + | cc: 18 | ||
| + | channel: | ||
| + | enabled: | ||
| + | output: EndlessKnobOutput { | ||
| + | smallestIncrement: | ||
| + | biggestIncrement: | ||
| + | target: | ||
| + | } | ||
| + | } | ||
| + | |||
| + | ValueCCAssignment { | ||
| + | objectName: | ||
| + | cc: 21 | ||
| + | channel: | ||
| + | enabled: | ||
| + | output: EndlessKnobOutput { | ||
| + | smallestIncrement: | ||
| + | biggestIncrement: | ||
| + | target: | ||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | ValueCCAssignment { | ||
| + | objectName: | ||
| + | cc: 19 | ||
| + | channel: | ||
| + | output: ValueOutput { | ||
| + | target: | ||
| + | path: "/ | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | ValueCCAssignment { | ||
| + | objectName: | ||
| + | cc: 22 | ||
| + | channel: | ||
| + | output: ValueOutput { | ||
| + | target: | ||
| + | path: "/ | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | /* | ||
| + | FxAssignmentConfig { | ||
| + | id: fxConfig | ||
| + | midiChannel: | ||
| + | channelNames: | ||
| + | } | ||
| + | |||
| + | DJFxSelect { | ||
| + | pushNote: 53 | ||
| + | touchNote: | ||
| + | turnCC: 100 | ||
| + | } | ||
| + | |||
| + | DJFxTime { | ||
| + | pushNote: 8 | ||
| + | turnCC: 18 | ||
| + | } | ||
| + | |||
| + | DJFxWetDry { | ||
| + | cc: 19 | ||
| + | } | ||
| + | |||
| + | DJFxActivate { | ||
| + | fxActivateType: | ||
| + | activateControlsModel: | ||
| + | ListElement { | ||
| + | midiChannel: | ||
| + | note: 93 | ||
| + | |||
| + | } | ||
| + | ListElement { | ||
| + | midiChannel: | ||
| + | note: 92 | ||
| + | } | ||
| + | |||
| + | |||
| + | |||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | DJFxAssign { | ||
| + | |||
| + | notes: [94, 95] | ||
| + | } | ||
| + | */ | ||
| + | |||
| + | </ | ||
| + | |||
| + | **_Public_ files are used to lit leds / pads.** | ||
| + | |||
| + | < | ||
| + | |||
| + | Akai_Pro_Force_Public_Device.qml : | ||
| + | |||
| + | import airAssignments 1.0 | ||
| + | import InputAssignment 0.1 | ||
| + | import OutputAssignment 0.1 | ||
| + | import Device 0.1 | ||
| + | import QtQuick 2.0 | ||
| + | import Planck 1.0 | ||
| + | |||
| + | Device { | ||
| + | id: device | ||
| + | |||
| + | property real gamma: 3.5 | ||
| + | property real padGamma: 3.5 | ||
| + | |||
| + | controls: [] | ||
| + | useGlobalShift: | ||
| + | numberOfLayers: | ||
| + | |||
| + | property string deviceInfo: "" | ||
| + | |||
| + | property QObjProperty pRunningDark: | ||
| + | property bool isRunningDark: | ||
| + | onIsRunningDarkChanged: | ||
| + | if(isRunningDark) { | ||
| + | Midi.sendNoteOn(0, | ||
| + | } | ||
| + | else { | ||
| + | for(var channel in currentColors) { | ||
| + | for(var key in currentColors[channel]) { | ||
| + | sendColor(channel, | ||
| + | } | ||
| + | } | ||
| + | for(var channel in currentSimpleColors) { | ||
| + | for(var simpleKey in currentSimpleColors[channel]) { | ||
| + | sendSimpleColor(channel, | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | property QObjProperty pCalibratePlatter: | ||
| + | property bool calibratePlatter: | ||
| + | onCalibratePlatterChanged: | ||
| + | if(calibratePlatter) { | ||
| + | console.log(" | ||
| + | // | ||
| + | } | ||
| + | } | ||
| + | |||
| + | /////////////////////////////////////////////////////////////////////////// | ||
| + | // Setup | ||
| + | |||
| + | property Timer initTimer: Timer { | ||
| + | interval: 1000 | ||
| + | repeat: false | ||
| + | onTriggered: | ||
| + | console.log(" | ||
| + | device.isInitializing = false | ||
| + | } | ||
| + | } | ||
| + | |||
| + | property bool isInitializing: | ||
| + | |||
| + | Component.onCompleted: | ||
| + | currentColors = {} | ||
| + | currentSimpleColors = {} | ||
| + | |||
| + | // | ||
| + | |||
| + | isInitializing = true | ||
| + | |||
| + | requestPowerOnButtonState(); | ||
| + | |||
| + | console.log(" | ||
| + | // | ||
| + | initTimer.start() | ||
| + | } | ||
| + | |||
| + | Component.onDestruction: | ||
| + | if(Planck.quitReason() === QuitReasons.ControllerMode) { | ||
| + | Midi.sendNoteOn(0, | ||
| + | } | ||
| + | else { | ||
| + | Midi.sendNoteOff(0, | ||
| + | } | ||
| + | } | ||
| + | |||
| + | property var currentColors | ||
| + | property var currentSimpleColors | ||
| + | |||
| + | function padToTwo(str) { | ||
| + | return str.padStart(2, | ||
| + | } | ||
| + | |||
| + | function dec2hex(d){ | ||
| + | return padToTwo((+d).toString(16).toUpperCase()) | ||
| + | |||
| + | |||
| + | } | ||
| + | |||
| + | |||
| + | |||
| + | function midiColorChannel(c, | ||
| + | return dec2hex(Math.min(127, | ||
| + | } | ||
| + | |||
| + | function mapColor(color) { | ||
| + | return Qt.rgba(color.r, | ||
| + | } | ||
| + | |||
| + | function midiColor(color, | ||
| + | var c = mapColor(color) | ||
| + | return midiColorChannel(c.r, | ||
| + | } | ||
| + | |||
| + | function sendNoteOn(channel, | ||
| + | Midi.sendNoteOn(channel, | ||
| + | } | ||
| + | |||
| + | function sendSimpleColor(channel, | ||
| + | |||
| + | if(!currentSimpleColors[channel]) { | ||
| + | currentSimpleColors[channel] = {}; | ||
| + | } | ||
| + | |||
| + | currentSimpleColors[channel][index] = value | ||
| + | |||
| + | if(isRunningDark) | ||
| + | return; | ||
| + | |||
| + | if(value === 0) { | ||
| + | Midi.sendNoteOff(channel, | ||
| + | } else { | ||
| + | Midi.sendNoteOn(channel, | ||
| + | } | ||
| + | } | ||
| + | |||
| + | //Color Send Function | ||
| + | function sendColor(channel, | ||
| + | { | ||
| + | if(!currentColors[channel]) { | ||
| + | currentColors[channel] = {}; | ||
| + | } | ||
| + | currentColors[channel][index] = color; | ||
| + | |||
| + | if(isRunningDark) { | ||
| + | return; | ||
| + | } | ||
| + | |||
| + | var g = device.gamma | ||
| + | if(index >= 15 && index <= 23) { | ||
| + | g = device.padGamma | ||
| + | } | ||
| + | |||
| + | //var sysEx = "F0 47 7F 40 65 00 04 " + dec2hex(channel) + " " + dec2hex(index) + " " + midiColor(color, | ||
| + | var sysEx = "F0 47 7F 40 65 00 04 " + dec2hex(index) + " " + padToTwo(midiColor(color, | ||
| + | Midi.sendSysEx(sysEx) | ||
| + | console.info(" | ||
| + | |||
| + | } | ||
| + | |||
| + | property list< | ||
| + | property bool enablePartialOledUpdates: | ||
| + | |||
| + | Repeater { | ||
| + | model: 8 | ||
| + | Item { | ||
| + | id: self | ||
| + | property var buffer | ||
| + | |||
| + | function numberToHex( num ) | ||
| + | { | ||
| + | var result = " | ||
| + | if(num < 0x10) | ||
| + | { | ||
| + | result += " | ||
| + | } | ||
| + | result += num.toString(16); | ||
| + | return result; | ||
| + | } | ||
| + | |||
| + | function buildSysEx(painter, | ||
| + | var result = "00 02 0B 7F 08 0B" | ||
| + | |||
| + | var imageData = painter.imageToString(x, | ||
| + | var dataLen = ((imageData.length+1) / 3) + 5; | ||
| + | |||
| + | result += " " + numberToHex((dataLen | ||
| + | result += " " + numberToHex( dataLen | ||
| + | result += " " + index.toString(16); | ||
| + | result += " " + numberToHex(y/ | ||
| + | result += " " + numberToHex((y/ | ||
| + | result += " " + numberToHex(x) + " "; | ||
| + | result += " " + numberToHex(x+w-1); | ||
| + | result += " " + imageData | ||
| + | |||
| + | return result; | ||
| + | } | ||
| + | |||
| + | function update(painter) { | ||
| + | if(device.enablePartialOledUpdates) { | ||
| + | var i = 0 | ||
| + | var bufToSend = [] | ||
| + | for(var y = 0; y < 4; y++) { | ||
| + | for(var x = 0; x < 16; x++) { | ||
| + | var result = buildSysEx(painter, | ||
| + | if(buffer[i] !== result) { | ||
| + | // | ||
| + | buffer[i] = result; | ||
| + | bufToSend.push(result); | ||
| + | } | ||
| + | i++ | ||
| + | } | ||
| + | } | ||
| + | |||
| + | if(bufToSend.length < 20) { | ||
| + | for(var i = 0; i < bufToSend.length; | ||
| + | |||
| + | // | ||
| + | // | ||
| + | } | ||
| + | } else { | ||
| + | var fullSysEx = buildSysEx(painter, | ||
| + | // | ||
| + | // | ||
| + | } | ||
| + | } else { | ||
| + | var fullSysEx = buildSysEx(painter, | ||
| + | // | ||
| + | // | ||
| + | |||
| + | } | ||
| + | } | ||
| + | |||
| + | Component.onCompleted: | ||
| + | var b = []; | ||
| + | for(var i = 0; i < 4 * 16; i++) | ||
| + | { | ||
| + | b.push( "" | ||
| + | } | ||
| + | |||
| + | buffer = b; | ||
| + | device.oleds.push(self) | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | function requestPowerOnButtonState() { | ||
| + | // | ||
| + | } | ||
| + | |||
| + | function sysExToIntList(sysExString) | ||
| + | { | ||
| + | var valueList = sysExString.split(" | ||
| + | var result = []; | ||
| + | |||
| + | for(var i=0; | ||
| + | result.push(parseInt(valueList[i], | ||
| + | } | ||
| + | |||
| + | return result; | ||
| + | } | ||
| + | |||
| + | function sysEx(sysExString) { | ||
| + | // | ||
| + | var valueList = sysExToIntList(sysExString); | ||
| + | var result = ""; | ||
| + | |||
| + | // 0xf0 0x00 0x02 0x0b 0x00 0x06 0x42 0x00 0x01 0x01 0xf7 | ||
| + | if(valueList[1] === 0x00 && valueList[2] === 0x02 && valueList[3] === 0x0B && valueList[6] === 0x42) | ||
| + | { | ||
| + | if(valueList[9] === 0x0) { | ||
| + | console.log(" | ||
| + | } | ||
| + | else if(valueList[9] === 0x1) { | ||
| + | console.log(" | ||
| + | quitToTestApp() | ||
| + | } | ||
| + | } | ||
| + | else if(valueList[1] === 0x7E && valueList[2] === 0x00 && valueList[3] === 0x06 && valueList[4] === 0x02) | ||
| + | { | ||
| + | for(var i=0; | ||
| + | result += valueList[i + 11]; | ||
| + | if(i == 1) | ||
| + | result += " | ||
| + | } | ||
| + | deviceInfo = result; | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | } | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | < | ||
| + | |||
| + | Akai_Pro_Force_Public_Assignments.qml : | ||
| + | |||
| + | import airAssignments 1.0 | ||
| + | import InputAssignment 0.1 | ||
| + | import OutputAssignment 0.1 | ||
| + | import ControlSurfaceModules 0.1 | ||
| + | import QtQuick 2.12 | ||
| + | |||
| + | MidiAssignment { | ||
| + | objectName: | ||
| + | id: assignment | ||
| + | |||
| + | Utility { | ||
| + | id: util | ||
| + | } | ||
| + | |||
| + | GlobalAssignmentConfig { | ||
| + | id: globalConfig | ||
| + | midiChannel: | ||
| + | } | ||
| + | |||
| + | GlobalAction { | ||
| + | id: globalAction | ||
| + | } | ||
| + | |||
| + | Back { | ||
| + | note: 3 | ||
| + | ledType: LedType.Simple | ||
| + | } | ||
| + | |||
| + | Forward { | ||
| + | note: 4 | ||
| + | shiftAction: | ||
| + | ledType: LedType.Simple | ||
| + | } | ||
| + | |||
| + | BrowseEncoder { | ||
| + | pushNote: 6 | ||
| + | turnCC: 5 | ||
| + | ledType: LedType.Simple | ||
| + | } | ||
| + | |||
| + | View { | ||
| + | note: 7 | ||
| + | shiftAction: | ||
| + | holdAction: | ||
| + | ledType: LedType.Simple | ||
| + | } | ||
| + | |||
| + | ZoneOut { | ||
| + | note: 16 | ||
| + | } | ||
| + | |||
| + | Media { | ||
| + | mediaButtonsModel: | ||
| + | ListElement { | ||
| + | name: ' | ||
| + | shiftName: | ||
| + | note: 20 | ||
| + | hasLed: true | ||
| + | } | ||
| + | } | ||
| + | removableDeviceModel: | ||
| + | ListElement { // SD | ||
| + | slot: ' | ||
| + | note: 52 | ||
| + | } | ||
| + | ListElement { // USB 1 | ||
| + | slot: ' | ||
| + | note: 53 | ||
| + | } | ||
| + | ListElement { // USB 2 | ||
| + | slot: ' | ||
| + | note: 54 | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | Repeater { | ||
| + | model: ListModel { | ||
| + | ListElement { | ||
| + | deckName: | ||
| + | deckMidiChannel: | ||
| + | loadNote: | ||
| + | } | ||
| + | } | ||
| + | |||
| + | Item { | ||
| + | objectName: | ||
| + | |||
| + | DeckAssignmentConfig { | ||
| + | id: deckConfig | ||
| + | name: model.deckName | ||
| + | midiChannel: | ||
| + | } | ||
| + | |||
| + | DeckAction { | ||
| + | id: deckAction | ||
| + | } | ||
| + | |||
| + | Load { | ||
| + | note: model.loadNote | ||
| + | ledType: | ||
| + | } | ||
| + | |||
| + | Censor { | ||
| + | note: 1 | ||
| + | } | ||
| + | |||
| + | TrackSkip { | ||
| + | prevNote: | ||
| + | nextNote: | ||
| + | } | ||
| + | |||
| + | BeatJump { | ||
| + | prevNote: | ||
| + | nextNote: | ||
| + | } | ||
| + | |||
| + | Sync { | ||
| + | syncNote: | ||
| + | syncHoldAction: | ||
| + | } | ||
| + | |||
| + | PlayCue { | ||
| + | cueNote: | ||
| + | cueShiftAction: | ||
| + | playNote: | ||
| + | |||
| + | } | ||
| + | |||
| + | PerformanceModes { | ||
| + | ledType: | ||
| + | modesModel: | ||
| + | ListElement { | ||
| + | note: 56 | ||
| + | view: ' | ||
| + | } | ||
| + | ListElement { | ||
| + | note: 57 | ||
| + | view: ' | ||
| + | altView: | ||
| + | } | ||
| + | ListElement { | ||
| + | note: 58 | ||
| + | view: ' | ||
| + | } | ||
| + | ListElement { | ||
| + | note: 59 | ||
| + | view: ' | ||
| + | altView: | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | ActionPads { | ||
| + | firstPadNote: | ||
| + | ledType: | ||
| + | } | ||
| + | |||
| + | Parameter { | ||
| + | leftNote: | ||
| + | rightNote: | ||
| + | } | ||
| + | |||
| + | BeatGrid { | ||
| + | leftNote: | ||
| + | rightNote: | ||
| + | editGridNote: | ||
| + | } | ||
| + | |||
| + | Shift { | ||
| + | note: 28 | ||
| + | ledType: | ||
| + | } | ||
| + | |||
| + | PitchBend { | ||
| + | minusNote: | ||
| + | plusNote: | ||
| + | } | ||
| + | |||
| + | JogWheel { | ||
| + | touchNote: | ||
| + | ccUpper: | ||
| + | ccLower: | ||
| + | jogSensitivity: | ||
| + | ledType: | ||
| + | } | ||
| + | |||
| + | KeyLock { | ||
| + | note: 34 | ||
| + | } | ||
| + | |||
| + | Vinyl { | ||
| + | note: 35 | ||
| + | } | ||
| + | |||
| + | Slip { | ||
| + | note: 36 | ||
| + | } | ||
| + | |||
| + | ManualLoop { | ||
| + | inNote: 37 | ||
| + | outNote: | ||
| + | } | ||
| + | |||
| + | AutoLoop { | ||
| + | pushNote: | ||
| + | turnCC: 32 | ||
| + | ledType: | ||
| + | } | ||
| + | |||
| + | SpeedSlider { | ||
| + | ccUpper: | ||
| + | ccLower: | ||
| + | downLedNote: | ||
| + | centreLedNote: | ||
| + | upLedNote: | ||
| + | } | ||
| + | |||
| + | DeckSelect { | ||
| + | primaryDeckIndex: | ||
| + | primaryDeckNote: | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | Repeater { | ||
| + | model: ListModel { | ||
| + | ListElement { | ||
| + | deckName: | ||
| + | deckMidiChannel: | ||
| + | loadNote: | ||
| + | } | ||
| + | } | ||
| + | |||
| + | Item { | ||
| + | |||
| + | DeckAssignmentConfig { | ||
| + | id: deckConfig | ||
| + | name: model.deckName | ||
| + | midiChannel: | ||
| + | } | ||
| + | |||
| + | DeckAction { | ||
| + | id: deckAction | ||
| + | } | ||
| + | |||
| + | Load { | ||
| + | note: model.loadNote | ||
| + | ledType: | ||
| + | } | ||
| + | |||
| + | Censor { | ||
| + | note: 1 | ||
| + | } | ||
| + | |||
| + | TrackSkip { | ||
| + | prevNote: | ||
| + | nextNote: | ||
| + | } | ||
| + | |||
| + | BeatJump { | ||
| + | prevNote: | ||
| + | nextNote: | ||
| + | } | ||
| + | |||
| + | Sync { | ||
| + | syncNote: | ||
| + | syncHoldAction: | ||
| + | } | ||
| + | |||
| + | PlayCue { | ||
| + | cueNote: | ||
| + | cueShiftAction: | ||
| + | playNote: | ||
| + | |||
| + | } | ||
| + | |||
| + | PerformanceModes { | ||
| + | ledType: | ||
| + | modesModel: | ||
| + | ListElement { | ||
| + | note: 24 | ||
| + | view: ' | ||
| + | } | ||
| + | ListElement { | ||
| + | note: 25 | ||
| + | view: ' | ||
| + | altView: | ||
| + | } | ||
| + | ListElement { | ||
| + | note: 26 | ||
| + | view: ' | ||
| + | } | ||
| + | ListElement { | ||
| + | note: 27 | ||
| + | view: ' | ||
| + | altView: | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | ActionPads { | ||
| + | firstPadNote: | ||
| + | ledType: | ||
| + | } | ||
| + | |||
| + | Parameter { | ||
| + | leftNote: | ||
| + | rightNote: | ||
| + | } | ||
| + | |||
| + | BeatGrid { | ||
| + | leftNote: | ||
| + | rightNote: | ||
| + | editGridNote: | ||
| + | } | ||
| + | |||
| + | Shift { | ||
| + | note: 28 | ||
| + | ledType: | ||
| + | } | ||
| + | |||
| + | PitchBend { | ||
| + | minusNote: | ||
| + | plusNote: | ||
| + | } | ||
| + | |||
| + | JogWheel { | ||
| + | touchNote: | ||
| + | ccUpper: | ||
| + | ccLower: | ||
| + | jogSensitivity: | ||
| + | ledType: | ||
| + | } | ||
| + | |||
| + | KeyLock { | ||
| + | note: 34 | ||
| + | } | ||
| + | |||
| + | Vinyl { | ||
| + | note: 35 | ||
| + | } | ||
| + | |||
| + | Slip { | ||
| + | note: 36 | ||
| + | } | ||
| + | |||
| + | ManualLoop { | ||
| + | inNote: 37 | ||
| + | outNote: | ||
| + | } | ||
| + | |||
| + | AutoLoop { | ||
| + | pushNote: | ||
| + | turnCC: 32 | ||
| + | ledType: | ||
| + | } | ||
| + | |||
| + | SpeedSlider { | ||
| + | ccUpper: | ||
| + | ccLower: | ||
| + | downLedNote: | ||
| + | centreLedNote: | ||
| + | upLedNote: | ||
| + | } | ||
| + | |||
| + | DeckSelect { | ||
| + | primaryDeckIndex: | ||
| + | primaryDeckNote: | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | // Numbers of channels arranged from left to right: | ||
| + | readonly property var mixerChannelOrder: | ||
| + | Repeater { | ||
| + | model: mixerChannelOrder | ||
| + | |||
| + | ValueNoteAssignment { | ||
| + | objectName: | ||
| + | note: 21 + index | ||
| + | channel: 15 | ||
| + | output: QtObject { | ||
| + | readonly property QObjProperty pLine: Planck.getProperty("/ | ||
| + | function setValue(channel, | ||
| + | if(assignmentEnabled) { | ||
| + | pLine.translator.value = value | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | Repeater { | ||
| + | model: 4 | ||
| + | Item { | ||
| + | ColorOutputAssignment { | ||
| + | objectName: | ||
| + | idx: 13 | ||
| + | channel: | ||
| + | |||
| + | readonly property color deckColor: Planck.getProperty("/ | ||
| + | onColor: | ||
| + | } | ||
| + | } | ||
| + | Component.onCompleted: | ||
| + | device.sendSimpleColor(15, | ||
| + | device.sendSimpleColor(15, | ||
| + | device.sendSimpleColor(15, | ||
| + | device.sendSimpleColor(15, | ||
| + | device.sendSimpleColor(15, | ||
| + | |||
| + | device.sendSimpleColor(15, | ||
| + | device.sendSimpleColor(15, | ||
| + | device.sendSimpleColor(15, | ||
| + | device.sendSimpleColor(15, | ||
| + | device.sendSimpleColor(15, | ||
| + | } | ||
| + | } | ||
| + | |||
| + | /////// FX | ||
| + | |||
| + | Repeater { | ||
| + | model: ListModel { | ||
| + | ListElement { | ||
| + | deck: " | ||
| + | controlChannel: | ||
| + | ccIndex: | ||
| + | } | ||
| + | ListElement { | ||
| + | deck: " | ||
| + | controlChannel: | ||
| + | ccIndex: | ||
| + | } | ||
| + | ListElement { | ||
| + | deck: " | ||
| + | controlChannel: | ||
| + | ccIndex: | ||
| + | } | ||
| + | ListElement { | ||
| + | deck: " | ||
| + | controlChannel: | ||
| + | ccIndex: | ||
| + | } | ||
| + | } | ||
| + | OutputAssignment { | ||
| + | properties: | ||
| + | |||
| + | readonly property QObjProperty pCurrentBPM: | ||
| + | readonly property int currentBpm: pCurrentBPM && pCurrentBPM.translator ? Math.round(pCurrentBPM.translator.unnormalized * 10) : 1200 | ||
| + | readonly property int minMixerTempo: | ||
| + | readonly property int maxMixerTempo: | ||
| + | |||
| + | function send() { | ||
| + | if(currentBpm === 0) { | ||
| + | return | ||
| + | } | ||
| + | var bpm = currentBpm | ||
| + | Math.log2 = Math.log2 || function(x){return Math.log(x)*Math.LOG2E; | ||
| + | if(currentBpm < minMixerTempo) { | ||
| + | var wrapPower = Math.ceil(Math.log2(minMixerTempo / currentBpm)) | ||
| + | bpm = currentBpm * Math.pow(2, wrapPower) | ||
| + | } | ||
| + | else if(currentBpm > maxMixerTempo) { | ||
| + | var wrapPower = Math.ceil(Math.log2(currentBpm / maxMixerTempo)) | ||
| + | bpm = currentBpm / Math.pow(2, wrapPower) | ||
| + | } | ||
| + | Midi.sendControlChange(controlChannel, | ||
| + | Midi.sendControlChange(controlChannel, | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | property bool displaysActive : false | ||
| + | onDisplaysActiveChanged: | ||
| + | if(!displaysActive) { | ||
| + | clearPainter.draw(); | ||
| + | } | ||
| + | } | ||
| + | |||
| + | ValueNoteAssignment { | ||
| + | objectName: | ||
| + | note: -1 | ||
| + | channel: -1 | ||
| + | output: QtObject { | ||
| + | function setValue(channel, | ||
| + | activityTimer.restart() | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | ValueCCAssignment { | ||
| + | objectName: | ||
| + | cc: -1 | ||
| + | channel: -1 | ||
| + | output: QtObject { | ||
| + | function setValue(channel, | ||
| + | activityTimer.restart() | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | Connections { | ||
| + | target: globalConfig | ||
| + | onCurrentFocusAreaChanged: | ||
| + | activityTimer.restart() | ||
| + | } | ||
| + | } | ||
| + | |||
| + | Timer { | ||
| + | id: activityTimer | ||
| + | interval: 10 * 60 * 1000 | ||
| + | running: true | ||
| + | onRunningChanged: | ||
| + | if(running) { | ||
| + | displaysActive = true | ||
| + | } | ||
| + | } | ||
| + | |||
| + | onTriggered: | ||
| + | } | ||
| + | |||
| + | Painter { | ||
| + | id: clearPainter | ||
| + | width: 128 | ||
| + | height: 64 | ||
| + | format: Painter.AK01_DISPLAY | ||
| + | |||
| + | function draw() | ||
| + | { | ||
| + | setCompositionMode(Painter.SourceOver); | ||
| + | |||
| + | clear(" | ||
| + | setColor(" | ||
| + | |||
| + | for (var displayIndex = 0; displayIndex < device.oleds.length; | ||
| + | device.oleds[displayIndex].update(clearPainter) | ||
| + | } | ||
| + | } | ||
| + | |||
| + | Component.onDestruction: | ||
| + | } | ||
| + | |||
| + | |||
| + | Repeater { | ||
| + | model: ListModel { | ||
| + | ListElement { | ||
| + | sideChannel: | ||
| + | controlChannel: | ||
| + | displayIndex: | ||
| + | slotName: | ||
| + | } | ||
| + | ListElement { | ||
| + | sideChannel: | ||
| + | controlChannel: | ||
| + | displayIndex: | ||
| + | slotName: | ||
| + | } | ||
| + | } | ||
| + | |||
| + | Item { | ||
| + | id: beatSlot | ||
| + | readonly property QObjProperty pEffectType: | ||
| + | readonly property string effectType: pEffectType && pEffectType.translator ? pEffectType.translator.string : "" | ||
| + | |||
| + | readonly property bool hasBeatLengths: | ||
| + | |||
| + | ValueCCAssignment { | ||
| + | objectName: | ||
| + | cc: 4 | ||
| + | channel: | ||
| + | enabled: | ||
| + | output: JogOutput { | ||
| + | jogAcceleration: | ||
| + | jogSensitivity: | ||
| + | roundRobin: | ||
| + | |||
| + | type: 0 | ||
| + | target: | ||
| + | path: "/ | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | ValueNoteAssignment { | ||
| + | objectName: | ||
| + | note: 9 | ||
| + | channel: | ||
| + | enabled: | ||
| + | output: IncDecValueOutput { | ||
| + | target: | ||
| + | path: "/ | ||
| + | } | ||
| + | increaseValue: | ||
| + | roundRobin: | ||
| + | } | ||
| + | } | ||
| + | ValueNoteAssignment { | ||
| + | objectName: | ||
| + | note: 10 | ||
| + | channel: | ||
| + | enabled: | ||
| + | output: IncDecValueOutput { | ||
| + | target: | ||
| + | path: "/ | ||
| + | } | ||
| + | increaseValue: | ||
| + | roundRobin: | ||
| + | } | ||
| + | } | ||
| + | ValueNoteAssignment { | ||
| + | objectName: | ||
| + | note: 9 | ||
| + | channel: | ||
| + | initialValue: | ||
| + | enabled: | ||
| + | resendValueOnEnabledChanged: | ||
| + | |||
| + | output: QtObject { | ||
| + | function setValue(channel, | ||
| + | device.sendSimpleColor(sideChannel, | ||
| + | } | ||
| + | } | ||
| + | Component.onCompleted: | ||
| + | } | ||
| + | ValueNoteAssignment { | ||
| + | objectName: | ||
| + | note: 10 | ||
| + | channel: | ||
| + | initialValue: | ||
| + | enabled: | ||
| + | resendValueOnEnabledChanged: | ||
| + | |||
| + | output: QtObject { | ||
| + | function setValue(channel, | ||
| + | device.sendSimpleColor(sideChannel, | ||
| + | } | ||
| + | } | ||
| + | Component.onCompleted: | ||
| + | } | ||
| + | |||
| + | OutputAssignment { | ||
| + | properties: | ||
| + | function send() { | ||
| + | if(effectType === 'Bit Crush' | ||
| + | Midi.sendControlChange(controlChannel, | ||
| + | } | ||
| + | else { | ||
| + | Midi.sendControlChange(controlChannel, | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | OutputAssignment { | ||
| + | properties: | ||
| + | function send() { | ||
| + | Midi.sendControlChange(controlChannel, | ||
| + | } | ||
| + | readonly property bool fxEnable: Planck.getProperty("/ | ||
| + | onFxEnableChanged: | ||
| + | if (fxEnable) { | ||
| + | send() | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | Item { | ||
| + | Connections { | ||
| + | target: | ||
| + | onDisplaysActiveChanged: | ||
| + | if(assignment.displaysActive) { | ||
| + | beatDrawTimer.start() | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | Timer { | ||
| + | id: beatDrawTimer | ||
| + | interval: | ||
| + | onTriggered: | ||
| + | } | ||
| + | |||
| + | Painter { | ||
| + | id: beatDisplayPainter | ||
| + | width: 128 | ||
| + | height: | ||
| + | font.family: | ||
| + | font.weight: | ||
| + | font.pixelSize: | ||
| + | font.capitalization: | ||
| + | format: | ||
| + | |||
| + | property QObjProperty pBeatLength: | ||
| + | property string beatLength: pBeatLength && pBeatLength.translator ? pBeatLength.translator.string : "" | ||
| + | property int beatLengthIndex: | ||
| + | |||
| + | property QObjProperty pValue: Planck.getProperty("/ | ||
| + | property real value: pValue && pValue.translator ? pValue.translator.value : 0.25 | ||
| + | property int iValue: Math.round(value * 124) | ||
| + | |||
| + | property string effectType: beatSlot.effectType | ||
| + | |||
| + | function draw() | ||
| + | { | ||
| + | setCompositionMode(Painter.SourceOver); | ||
| + | |||
| + | clear(" | ||
| + | setColor(" | ||
| + | |||
| + | if(effectType === 'Bit Crush' | ||
| + | drawTextInRect(0, | ||
| + | } | ||
| + | else if(beatSlot.hasBeatLengths) { | ||
| + | drawTextInRect(0, | ||
| + | } | ||
| + | |||
| + | drawRect(0, | ||
| + | fillRect(2, | ||
| + | |||
| + | if(value !== 0.5) { | ||
| + | if(value > 0.5) | ||
| + | setColor(" | ||
| + | drawLine(62, | ||
| + | } | ||
| + | |||
| + | device.oleds[displayIndex].update(beatDisplayPainter) | ||
| + | } | ||
| + | |||
| + | onEffectTypeChanged: | ||
| + | onBeatLengthChanged: | ||
| + | onIValueChanged: | ||
| + | |||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | Repeater { | ||
| + | model: ListModel { | ||
| + | ListElement { | ||
| + | sideChannel: | ||
| + | controlChannel: | ||
| + | displayIndex: | ||
| + | slotName: | ||
| + | } | ||
| + | ListElement { | ||
| + | sideChannel: | ||
| + | controlChannel: | ||
| + | displayIndex: | ||
| + | slotName: | ||
| + | } | ||
| + | } | ||
| + | |||
| + | Item { | ||
| + | id: fxBank | ||
| + | ValueCCAssignment { | ||
| + | objectName: | ||
| + | cc: 1 | ||
| + | channel: | ||
| + | enabled: | ||
| + | output: JogOutput { | ||
| + | jogAcceleration: | ||
| + | jogSensitivity: | ||
| + | |||
| + | type: 0 | ||
| + | target: | ||
| + | path: "/ | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | ValueCCAssignment { | ||
| + | objectName: | ||
| + | cc: 2 | ||
| + | channel: | ||
| + | enabled: | ||
| + | output: JogOutput { | ||
| + | jogAcceleration: | ||
| + | jogSensitivity: | ||
| + | roundRobin: | ||
| + | |||
| + | type: 0 | ||
| + | target: | ||
| + | path: "/ | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | ValueCCAssignment { | ||
| + | objectName: | ||
| + | cc: 3 | ||
| + | channel: | ||
| + | enabled: | ||
| + | output: JogOutput { | ||
| + | jogAcceleration: | ||
| + | jogSensitivity: | ||
| + | roundRobin: | ||
| + | |||
| + | type: 0 | ||
| + | target: | ||
| + | path: "/ | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | ValueNoteAssignment { | ||
| + | note: 6 | ||
| + | channel: | ||
| + | enabled: | ||
| + | output: IncDecValueOutput { | ||
| + | target: | ||
| + | path: "/ | ||
| + | } | ||
| + | changeAmount: | ||
| + | increaseValue: | ||
| + | roundRobin: | ||
| + | } | ||
| + | } | ||
| + | ValueNoteAssignment { | ||
| + | objectName: | ||
| + | note: 6 | ||
| + | channel: | ||
| + | output: QtObject { | ||
| + | function setValue(channel, | ||
| + | if(value< | ||
| + | return | ||
| + | } | ||
| + | var pEnable = Planck.getProperty("/ | ||
| + | if(!device.shift) { | ||
| + | pEnable.translator.state = !pEnable.translator.state | ||
| + | } else if(pEnable.translator.state) { | ||
| + | pEnable.translator.state = false | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | ValueNoteAssignment { | ||
| + | objectName: | ||
| + | note: 7 | ||
| + | channel: | ||
| + | enabled: | ||
| + | output: QtObject { | ||
| + | function setValue(channel, | ||
| + | if(value< | ||
| + | return | ||
| + | } | ||
| + | var pTwoStateParam = Planck.getProperty("/ | ||
| + | pTwoStateParam.translator.state = !pTwoStateParam.translator.state | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | ValueNoteAssignment { | ||
| + | objectName: | ||
| + | note: 8 | ||
| + | channel: | ||
| + | enabled: | ||
| + | output: QtObject { | ||
| + | function setValue(channel, | ||
| + | Midi.sendNoteOn(sideChannel, | ||
| + | if(value< | ||
| + | return | ||
| + | } | ||
| + | Planck.getProperty("/ | ||
| + | |||
| + | var pTwoStateParam = Planck.getProperty("/ | ||
| + | pTwoStateParam.translator.state = true | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | OutputAssignment { | ||
| + | properties: | ||
| + | function send() { | ||
| + | Midi.sendControlChange(controlChannel, | ||
| + | if(propertyData.type.string === 'Bit Crush' | ||
| + | Midi.sendControlChange(controlChannel, | ||
| + | } | ||
| + | else { | ||
| + | Midi.sendControlChange(controlChannel, | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | OutputAssignment { | ||
| + | properties: | ||
| + | function send() { | ||
| + | Midi.sendControlChange(controlChannel, | ||
| + | } | ||
| + | } | ||
| + | OutputAssignment { | ||
| + | properties: | ||
| + | function send() { | ||
| + | Midi.sendControlChange(controlChannel, | ||
| + | } | ||
| + | } | ||
| + | OutputAssignment { | ||
| + | properties: | ||
| + | function send() { | ||
| + | if(propertyData.fxEnable.state) { | ||
| + | Midi.sendNoteOn(sideChannel, | ||
| + | Midi.sendNoteOn(controlChannel, | ||
| + | } else { | ||
| + | Midi.sendNoteOn(sideChannel, | ||
| + | Midi.sendNoteOn(controlChannel, | ||
| + | Midi.sendNoteOff(controlChannel, | ||
| + | |||
| + | var pTwoStateParam = Planck.getProperty("/ | ||
| + | if (pTwoStateParam.translator.state === true) { | ||
| + | pTwoStateParam.translator.state = false | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | OutputAssignment { | ||
| + | |||
| + | properties: | ||
| + | ' | ||
| + | ' | ||
| + | } | ||
| + | |||
| + | property var flashStates: | ||
| + | |||
| + | Timer { | ||
| + | id: freezeTimer | ||
| + | repeat: | ||
| + | interval: | ||
| + | running: | ||
| + | property bool isOn: false | ||
| + | |||
| + | onTriggered: | ||
| + | isOn = !isOn | ||
| + | for(var x = 0; x < Object.keys(parent.flashStates).length; | ||
| + | var channelNumber = parent.flashStates[Object.keys(parent.flashStates)[x]] | ||
| + | if(channelNumber !== 0){ | ||
| + | if(isOn) { | ||
| + | Midi.sendNoteOn(channelNumber, | ||
| + | } else { | ||
| + | Midi.sendNoteOff(channelNumber, | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | function stopTimer() { | ||
| + | delete flashStates[slotName] | ||
| + | if(Object.keys(flashStates).length === 0) | ||
| + | freezeTimer.stop() | ||
| + | } | ||
| + | |||
| + | function send() { | ||
| + | const dspNote = 2 | ||
| + | const colourNote = 7 | ||
| + | |||
| + | const full = 127 | ||
| + | const dim = 1 | ||
| + | |||
| + | if(propertyData.fxTwoStateParamName.string === "" | ||
| + | // No param | ||
| + | Midi.sendNoteOff(sideChannel, | ||
| + | Midi.sendNoteOff(controlChannel, | ||
| + | stopTimer() | ||
| + | } | ||
| + | else if(propertyData.fxTwoState.state){ | ||
| + | // Param present and on | ||
| + | var effectEnabled = Planck.getProperty("/ | ||
| + | var effectName = Planck.getProperty("/ | ||
| + | if(effectEnabled) { | ||
| + | Midi.sendNoteOn(sideChannel, | ||
| + | Midi.sendNoteOn(controlChannel, | ||
| + | if(effectName === " | ||
| + | freezeTimer.start() | ||
| + | flashStates[slotName] = sideChannel | ||
| + | } | ||
| + | } | ||
| + | else { | ||
| + | propertyData.fxTwoState.state = false | ||
| + | if(effectName === " | ||
| + | stopTimer() | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | else { | ||
| + | // Param present and off | ||
| + | Midi.sendNoteOn(sideChannel, | ||
| + | Midi.sendNoteOff(controlChannel, | ||
| + | stopTimer() | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | OutputAssignment { | ||
| + | properties: | ||
| + | function send() { | ||
| + | if(propertyData.fxTwoState.state) { | ||
| + | Midi.sendNoteOn(sideChannel, | ||
| + | } else { | ||
| + | Midi.sendNoteOn(sideChannel, | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | Item { | ||
| + | |||
| + | Timer { | ||
| + | id: fxSelectDrawTimer | ||
| + | repeat: | ||
| + | interval: | ||
| + | running: | ||
| + | onTriggered: | ||
| + | } | ||
| + | |||
| + | Painter { | ||
| + | id: fxSelectDisplayPainter | ||
| + | width: 128 | ||
| + | height: | ||
| + | font.family: | ||
| + | font.pixelSize: | ||
| + | font.capitalization: | ||
| + | format: | ||
| + | |||
| + | property QObjProperty pType: Planck.getProperty("/ | ||
| + | property string type: pType && pType.translator ? pType.translator.string : "" | ||
| + | |||
| + | function draw() | ||
| + | { | ||
| + | setCompositionMode(Painter.SourceOver); | ||
| + | clear(" | ||
| + | setColor(" | ||
| + | |||
| + | drawTextInRect(0, | ||
| + | device.oleds[displayIndex].update(fxSelectDisplayPainter) | ||
| + | } | ||
| + | |||
| + | onTypeChanged: | ||
| + | } | ||
| + | } | ||
| + | Item { | ||
| + | Timer { | ||
| + | id: drawTimer | ||
| + | repeat: | ||
| + | interval: | ||
| + | running: | ||
| + | onTriggered: | ||
| + | } | ||
| + | |||
| + | Painter { | ||
| + | id: fxDisplayPainter | ||
| + | width: 128 | ||
| + | height: | ||
| + | font.family: | ||
| + | font.weight: | ||
| + | font.pixelSize: | ||
| + | font.capitalization: | ||
| + | format: | ||
| + | |||
| + | property QObjProperty pType: Planck.getProperty("/ | ||
| + | property string type: pType && pType.translator ? pType.translator.string : "" | ||
| + | |||
| + | property QObjProperty pParamName: Planck.getProperty("/ | ||
| + | property string paramName: pParamName && pParamName.translator ? pParamName.translator.string : "" | ||
| + | |||
| + | property QObjProperty pValue: Planck.getProperty("/ | ||
| + | property real value: pValue && pValue.translator ? pValue.translator.value : 0.25 | ||
| + | property int iValue: Math.round(value * 124) | ||
| + | property string lastPattern: | ||
| + | |||
| + | readonly property var patterns: [ | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | ] | ||
| + | |||
| + | function draw() | ||
| + | { | ||
| + | setCompositionMode(Painter.SourceOver); | ||
| + | |||
| + | clear(" | ||
| + | setColor(" | ||
| + | |||
| + | if(paramName !== ' | ||
| + | lastPattern = "" | ||
| + | } | ||
| + | if(paramName === ' | ||
| + | drawTextInRect(0, | ||
| + | |||
| + | var patternNumber = (value * 127) >> 3 | ||
| + | var ptn = patterns[patternNumber] | ||
| + | if(lastPattern === ptn) { | ||
| + | return | ||
| + | } | ||
| + | lastPattern = ptn | ||
| + | |||
| + | var x = 3 | ||
| + | for (var i = 0; i < ptn.length; i++) { | ||
| + | if (ptn[i] == ' | ||
| + | fillRect(x, | ||
| + | } | ||
| + | x = x + 7 | ||
| + | if ((i + 1) % 4 === 0) { | ||
| + | x = x + 3 | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | else if(paramName !== '' | ||
| + | drawTextInRect(0, | ||
| + | if(type === 'Ping Pong') { | ||
| + | var newValue = (2 * value) - 1 | ||
| + | drawRect(0, | ||
| + | fillRect(2, | ||
| + | fillRect(64, | ||
| + | fillRect(64, | ||
| + | fillRect(64, | ||
| + | } | ||
| + | else { | ||
| + | drawRect(0, | ||
| + | fillRect(2, | ||
| + | } | ||
| + | } | ||
| + | |||
| + | device.oleds[displayIndex+1].update(fxDisplayPainter) | ||
| + | } | ||
| + | |||
| + | onParamNameChanged: | ||
| + | onIValueChanged: | ||
| + | } | ||
| + | } | ||
| + | Item { | ||
| + | Timer { | ||
| + | id: fqDrawTimer | ||
| + | repeat: | ||
| + | interval: | ||
| + | running: | ||
| + | onTriggered: | ||
| + | } | ||
| + | |||
| + | Timer { | ||
| + | id: waitTimer | ||
| + | repeat: | ||
| + | interval: | ||
| + | running: | ||
| + | onTriggered: | ||
| + | } | ||
| + | |||
| + | Painter { | ||
| + | id: fqDisplayPainter | ||
| + | width: 128 | ||
| + | height: | ||
| + | font.family: | ||
| + | font.weight: | ||
| + | font.pixelSize: | ||
| + | font.capitalization: | ||
| + | format: | ||
| + | |||
| + | property QObjProperty pValue: Planck.getProperty("/ | ||
| + | property real value: pValue && pValue.translator ? pValue.translator.value : 0.25 | ||
| + | property int iValue: Math.round(value * 124) | ||
| + | property bool drawTitle: false | ||
| + | |||
| + | property var freqencyArray: | ||
| + | 60, | ||
| + | 124, | ||
| + | 256, | ||
| + | 554, | ||
| + | 1145, | ||
| + | 2366, | ||
| + | 4889, | ||
| + | 10103, | ||
| + | |||
| + | function drawFrequencyTitle() | ||
| + | { | ||
| + | drawTitle = true | ||
| + | draw() | ||
| + | } | ||
| + | |||
| + | function draw() | ||
| + | { | ||
| + | setCompositionMode(Painter.SourceOver); | ||
| + | |||
| + | clear(" | ||
| + | setColor(" | ||
| + | |||
| + | waitTimer.restart() | ||
| + | |||
| + | if(iValue === 62){ | ||
| + | drawTextInRect(0, | ||
| + | fillRect(2, | ||
| + | } | ||
| + | else if(value < 0.5) { | ||
| + | var msg = freqencyArray[iValue] + " | ||
| + | if(freqencyArray[iValue] >= 1000) { | ||
| + | msg = (freqencyArray[iValue]/ | ||
| + | } | ||
| + | drawTextInRect(0, | ||
| + | fillRect(2, | ||
| + | } else { | ||
| + | var val = iValue-63 | ||
| + | var msg = freqencyArray[val] + " | ||
| + | if(freqencyArray[val] >= 1000) { | ||
| + | msg = (freqencyArray[val]/ | ||
| + | } | ||
| + | drawTextInRect(0, | ||
| + | fillRect(2 + (value - 0.5) * 2 * 125, 20, 124, 10, " | ||
| + | } | ||
| + | drawRect(0, | ||
| + | |||
| + | if(drawTitle === true){ | ||
| + | setCompositionMode(Painter.SourceOver); | ||
| + | fillRect(0, | ||
| + | drawTextInRect(0, | ||
| + | drawTitle = false | ||
| + | waitTimer.stop() | ||
| + | } | ||
| + | |||
| + | device.oleds[displayIndex+2].update(fqDisplayPainter) | ||
| + | } | ||
| + | |||
| + | onIValueChanged: | ||
| + | } | ||
| + | } | ||
| + | |||
| + | Connections { | ||
| + | target: assignment | ||
| + | onDisplaysActiveChanged: | ||
| + | if(assignment.displaysActive) { | ||
| + | fxSelectDrawTimer.start() | ||
| + | drawTimer.start() | ||
| + | fqDrawTimer.start() | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | readonly property var activeDecks: | ||
| + | property var deckThru: [0, 0, 0, 0] | ||
| + | property bool xFaderStartLeft: | ||
| + | property bool xFaderStartRight: | ||
| + | |||
| + | ValueNoteAssignment { | ||
| + | note: 25 | ||
| + | channel: 15 | ||
| + | output: QtObject { | ||
| + | function setValue(channel, | ||
| + | xFaderStartLeft = value !== 0 | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | ValueNoteAssignment { | ||
| + | note: 27 | ||
| + | channel: 15 | ||
| + | output: QtObject { | ||
| + | function setValue(channel, | ||
| + | xFaderStartRight = value !== 0 | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | property var crossFaderTable: | ||
| + | 0.00000000, | ||
| + | 0.00205353, | ||
| + | 0.01090184, | ||
| + | 0.04340103, | ||
| + | 0.10441190, | ||
| + | 0.20832913, | ||
| + | 0.35995648, | ||
| + | 0.44990933, | ||
| + | 0.50626161, | ||
| + | 0.56640229, | ||
| + | 0.63551382, | ||
| + | 0.71511354, | ||
| + | 0.79719121, | ||
| + | 0.84442776, | ||
| + | 0.89446325, | ||
| + | 0.94746353, | ||
| + | ]; | ||
| + | |||
| + | function calculateExternalMixerVolume(deckIndex) | ||
| + | { | ||
| + | var crossFader = Planck.getProperty("/ | ||
| + | var deckVolume = Planck.getProperty("/ | ||
| + | var externalVolume | ||
| + | |||
| + | if(deckThru[deckIndex - 1] === 1) { | ||
| + | externalVolume = deckVolume | ||
| + | } else { | ||
| + | var deckIdx = parseInt(deckIndex, | ||
| + | if(deckIdx === 1 || deckIdx === 3) { | ||
| + | if(deckThru[deckIdx - 1] === 2) { | ||
| + | crossFader = 1 - crossFader | ||
| + | } | ||
| + | } else if(deckIdx === 2 || deckIdx === 4) { | ||
| + | if(deckThru[deckIdx - 1] === 0) { | ||
| + | crossFader = 1 - crossFader | ||
| + | } | ||
| + | } | ||
| + | var faderIndex = crossFader * 511; | ||
| + | |||
| + | if (deckIdx === 1 || deckIdx === 3) | ||
| + | { | ||
| + | faderIndex = 511 - faderIndex; | ||
| + | } | ||
| + | if (faderIndex > 255) | ||
| + | { | ||
| + | faderIndex = 255; | ||
| + | } | ||
| + | |||
| + | var crossFaderLow = crossFaderTable[Math.floor(faderIndex)] | ||
| + | var crossFaderHigh = crossFaderTable[Math.ceil(faderIndex)] | ||
| + | |||
| + | var interpolatedTableValue = crossFaderLow + ((crossFaderHigh - crossFaderLow) * (crossFader - Math.floor(crossFader))); | ||
| + | externalVolume = deckVolume * interpolatedTableValue; | ||
| + | } | ||
| + | |||
| + | Planck.getProperty("/ | ||
| + | |||
| + | } | ||
| + | |||
| + | ValueCCAssignment { | ||
| + | id: xfaderStartStop | ||
| + | objectName: | ||
| + | cc: 14 | ||
| + | channel: 15 | ||
| + | enabled: xFaderStartLeft || xFaderStartRight | ||
| + | |||
| + | property QObjProperty pCrossFaderPosition: | ||
| + | |||
| + | output: QtObject { | ||
| + | function setValue(channel, | ||
| + | xfaderStartStop.pCrossFaderPosition.translator.value = value | ||
| + | if(assignmentEnabled) { | ||
| + | for (var i = 0; i < deckThru.length; | ||
| + | calculateExternalMixerVolume(i+1); | ||
| + | var deckIndex = " | ||
| + | var deckIsActive = activeDecks.indexOf(deckIndex) !== -1 | ||
| + | if(xFaderStartLeft && deckIsActive && deckThru[i] === 0) { | ||
| + | if (value === 1) | ||
| + | Planck.getProperty("/ | ||
| + | else | ||
| + | Planck.getProperty("/ | ||
| + | } | ||
| + | if (xFaderStartRight && deckIsActive && deckThru[i] === 2) { | ||
| + | if (value === 0) | ||
| + | Planck.getProperty("/ | ||
| + | else | ||
| + | Planck.getProperty("/ | ||
| + | } | ||
| + | } | ||
| + | } else { | ||
| + | for (var index = 1; index < deckThru.length + 1; index++) { | ||
| + | calculateExternalMixerVolume(index); | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | Repeater { | ||
| + | model: parseInt(Planck.getProperty("/ | ||
| + | Item { | ||
| + | property string deckIndex: " | ||
| + | |||
| + | ValueCCAssignment { | ||
| + | objectName: | ||
| + | cc: 14 | ||
| + | channel: | ||
| + | output: QtObject { | ||
| + | function setValue(channel, | ||
| + | Planck.getProperty("/ | ||
| + | calculateExternalMixerVolume(deckIndex); | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | ValueNoteAssignment { | ||
| + | objectName: | ||
| + | note: 15 | ||
| + | channel: | ||
| + | normalizeValue: | ||
| + | output: QtObject { | ||
| + | function setValue(channel, | ||
| + | deckThru[channel] = value | ||
| + | calculateExternalMixerVolume(deckIndex) | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | And what it gives : | ||
| + | I'm in slicer mode, on the 2 decks. | ||
| + | |||
| + | |||
| + | {{http:// | ||
| + | |||
| + | |||
| + | |||
prime4.1694372923.txt.gz · Last modified: 2023/09/10 21:08 by ounsatn