Closed Potreba closed 1 year ago
mod_anyctrl will insert your controller in the internal midi loop of your Force. If you send the correct midi message from your controller, you can simulate any button of the Force. Basically, if your want to PLAY when your press your foot controller, it must send the PLAY midi message. You can hardcode that rapidly in your Arduino source. I also did midi usb interfaces with Arduino and STM32F103 uC. Usbmidiklik.
You have to pass the usb name (use "lsusb" on the Linux command line) of your controller as a command line parameter to mod_anyctrl so it will recognize it.
Midi controls for MPC and Force (draft document) : https://docs.google.com/spreadsheets/d/1FIs0A5jHfwl3VmDx-JLCFPhBvkAvlwbQu6nkoF2CoRg/edit#gid=692652057
b0 00 00-7f - Navigate
b0 01 00-7f - Knobs
b0 02 00-7f - Menu
b0 03 00-7f - Matrix
b0 04 00-7f - Note
b0 05 00-7f - Master
b0 09 00-7f - Clip
b0 0b 00-7f - Mixer
b0 23 00-7f - Load
b0 24 00-7f - Save
b0 25 00-7f - Edit
b0 26 00-7f - Delete
b0 31 00-7f - Shift
b0 34 00-7f - Select
b0 35 00-7f - Tap Tempo
b0 36 00-7f - +
b0 37 00-7f - -
b0 38 00-7f - Launch 1
b0 39 00-7f - Launch 2
b0 3a 00-7f - Launch 3
b0 3b 00-7f - Launch 4
b0 3c 00-7f - Launch 5
b0 3d 00-7f - Launch 6
b0 3e 00-7f - Launch 7
b0 3f 00-7f - Launch 8
b0 43 00-7f - Undo
b0 49 00-7f - Rec
b0 51 00-7f - Stop
b0 52 00-7f - Play
b0 5b 00-7f - Mute
b0 5c 00-7f - Solo
b0 5d 00-7f - Rec Arm
b0 5e 00-7f - Clip Stop
b0 5f 00-7f - Stop All
b0 70 00-7f - ^
b0 71 00-7f - v
b0 72 00-7f - <
b0 73 00-7f - >
b0 74 00-7f - Launch
b0 75 00-7f - Step Seq
b0 76 00-7f - Arp
b0 7a 00-7f - Copy
b0 7b 00-7f - Assign A
b0 7c 00-7f - Assign B
# export ANYCTRL_NAME="Launchpad Pro MK3";LD_PRELOAD=/media/MSTICK/tkgl_anyctrl.so /usr/bin/FORCE
Thanks for all info!
export ANYCTRL_NAME="Launchpad Pro MK3";LD_PRELOAD=/media/MSTICK/tkgl_anyctrl.so /usr/bin/FORCE
Should I change or add ANYCTRL_NAME="my usb controller name";LD_PRELOAD=/media/MSTICK/tkgl_anyctrl.so /usr/bin/FORCE ? And that's it? Or I should edit tkgl_anyctrl.so or anything else?
b0 52 00-7f - if I understand correctly, b0 means control change, 52 is CC#, 00 is Midi channel 01? Or its 00-7f meaning from 0 to 127? Sorry for so much questions, google didn't return anything I could decipher
Yes ANYCTRL_NAME="my usb controller name". You can copy the lib to a USB key (here the name is "MSTICK").
00-7F is the range in deed. That means the third byte must be in that range
Hello, First of all HAPPY NEW YEAR. Wish you the best I'm trying to launch this with KIKPAD connected on it (the device name after LSUSB)
(tkgl_anyctrl) **** Error : MPC card not found I've got error. what do i need to add ? Regards Herve
Thanks ! Happy new year to uou too. Can you post here the result of lsusb command when the Kikpad is plugged in ? (I suppose you are using the Novation emulation firmware ?) Try with "Launchpad Mini MK3" only.
Hi,Here's the result without success
# lsusbBus 001 Device 002: ID 09e8:0046 AKAI Professional M.I. Corp. MPC One MIDIBus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hubBus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hubBus 002 Device 004: ID 1235:0113 Focusrite-Novation Launchpad Mini MK3Bus 002 Device 005: ID 174c:55aa ASMedia Technology Inc. ASM1051E SATA 6Gb/s bridge, ASM1053E SATA 6Gb/s bridge, ASM1153 SATA 3Gb/s bridge, ASM1153E SATA 6Gb/s bridgeBus 002 Device 003: ID 045b:0209 Hitachi, LtdBus 002 Device 002: ID 045b:0209 Hitachi, LtdBus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub# export ANYCTRL_NAME="Focusrite-Novation Launchpad Mini MK3";LD_PRELOAD=/media/HAKAI/tkgl_anyctrl.so /usr/bin/FORCE------------------------------------TKGL_ANYCTRL V1.0 by the KikGen Labs------------------------------------(tkgl_anyctrl) **** Error : MPC card not found# export ANYCTRL_NAME="Launchpad Mini MK3";LD_PRELOAD=/media/HAKAI/tkgl_anyctrl.so /usr/bin/FORCE------------------------------------TKGL_ANYCTRL V1.0 by the KikGen Labs------------------------------------(tkgl_anyctrl) **** Error : MPC card not found# export ANYCTRL_NAME="Novation Launchpad Mini MK3";LD_PRELOAD=/media/HAKAI/tkgl_anyctrl.so /usr/bin/FORCE------------------------------------TKGL_ANYCTRL V1.0 by the KikGen Labs------------------------------------(tkgl_anyctrl) **** Error : MPC card not found#
Regards
Herve Laporte
Le lundi 9 janvier 2023 à 14:03:41 UTC+1, TheKikGen ***@***.***> a écrit :
Thanks ! Happy new year to uou too. Can you post here the result of lsusb command when the Kikpad is plugged in ? (I suppose you are using the Novation emulation firmware ?) Try with "Launchpad Mini MK3" only.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
Can your post result of "aconnect -l " ?
Here it is :
root@mpc-one:/media/TKGL_BOOTSTRAP# aconnect -l
client 0: 'System' [type=kernel]
0 'Timer '
1 'Announce '
client 16: 'MPC One MIDI' [type=kernel,card=0]
0 'MPC Studio Live Public'
Connected From: 136:0
1 'MPC Studio Live Private'
Connecting To: 134:0
Connected From: 135:0
2 'MPC Studio Live MIDI Port'
Connecting To: 137:0
Connected From: 137:2
client 20: 'Launchpad Mini MK3' [type=kernel,card=1]
0 'KIKPAD IN '
Connecting To: 134:0
Connected From: 135:0, 136:0
1 'KIKPAD IN '
client 130: 'Virtual MIDI Output 1 Input' [type=user,pid=279]
0 'in '
Connected From: 137:5
client 131: 'Virtual MIDI Output 2 Input' [type=user,pid=279]
0 'in '
Connected From: 137:3
client 132: 'Virtual MIDI Input 1 Output' [type=user,pid=279]
0 'out '
Connecting To: 137:4
client 133: 'Virtual MIDI Input 2 Output' [type=user,pid=279]
0 'out '
Connecting To: 137:1
client 134: 'Client-134' [type=user,pid=333]
0 'TKGL Virtual In Private'
Connected From: 16:1, 20:0
client 135: 'Client-135' [type=user,pid=333]
0 'TKGL Virtual Out Private'
Connecting To: 16:1, 20:0
client 136: 'Client-136' [type=user,pid=333]
0 'TKGL Virtual Out Public'
Connecting To: 16:0, 20:0
client 137: 'MPC' [type=user,pid=333]
0 'MPC One MIDI MPC Studio Live MIDI Port'
Connected From: 16:2
1 'Virtual MIDI Input 2 Output out'
Connected From: 133:0
2 'MPC One MIDI MPC Studio Live MIDI Port'
Connecting To: 16:2
3 'Virtual MIDI Output 2 Input in'
Connecting To: 131:0
4 'Virtual MIDI Input 1 Output out'
Connected From: 132:0
5 'Virtual MIDI Output 1 Input in'
Connecting To: 130:0
root@mpc-one:/media/TKGL_BOOTSTRAP#
If you are using the bootstrap image, the Kikpad with the Launchpad MK3 emulation should work.
check in the module script tkgl_mod_iamforce.sh https://github.com/TheKikGen/MPC-LiveXplore-bootstrap/blob/main/tkgl_bootstrap_%5BProjectData%5D/modules/mod_iamforce/tkgl_mod_iamforce.sh#L70
Alternatively to tkgl_anyctrl.so, you can use mpcmapper.so.
Ex :
LD_PRELOAD=./tkgl_mpcmapper.so ../../MPCF-306 --tkgl_iamForce --tkgl_configfile=tkgl_mpc
mapper.ini --tkgl_ctrlname="Launchpad Mini.*(KIKPAD|MIDI).*"
LD_PRELOAD=./tkgl_mpcmapper.so ../MPCF-306 --tkgl_help
(MPCF-306 is the name of my local Force binary V306)
In your case, you could try :
LD_PRELOAD=/media/HAKAI/tkgl_mpcmapper.so /usr/bin/FORCE --tkgl_iamForce --tkgl_configfile=tkgl_mpcmapper.ini --tkgl_ctrlname="Launchpad Mini.*(KIKPAD|MIDI).*"
You need to copy tkgl_mpcmapper.so and tkgl_mpcmapper.ini from the github repository to your HAKAI sdcard.
https://github.com/TheKikGen/MPCLiveXplore-libs/tree/main/src
@TheKikGen happy new year to you!
I've added anyctrl to doer_list . If I add it first, iamforce never starts (plays kikgen logo and back to mpc). I've tried editing tkgl_mod_anyctrl.sh for my test controller. I've found name of the controller by using Putty and lsusb and amidi -l. I'm confused which one to use, so I used both. I'm not a programmer, so I've copied your code into every place I think it might've work. But it didn't . I tried sending 'Play" command and it is b0 52 00-0F = 1 chan CC 82 00-127 . Nothing happens
#!/bin/sh
#
# __ __| | | /_) | ___| | |
# | __ \ _ \ ' / | | / | _ \ __ \ | _` | __ \ __|
# | | | | __/ . \ | < | | __/ | | | ( | | |\__ \
# _| _| |_|\___| _|\_\_|_|\_\\____|\___|_| _| _____|\__,_|_.__/ ____/
#
# BOOTSTRAP script for ANYCTRL LD_PRELOAD LIBRARY.
SCRIPT_NAME=$(readlink -f "$0")
SCRIPT_DIR=$(dirname "$SCRIPT_NAME")
source "$SCRIPT_DIR/../../scripts/tkgl_path"
# This "low-level" library allows you to set up any controller as a control
# surface to drive the MPC standalone application (FULL PRIVATE AND PUBLIC PORTS).
#------------------------------------------------------------------------------
# Enter here the name (or a substring) of your external midi controller.
# You can use the command 'amidi -l' to find it
export ANYCTRL_NAME="ReMOTE SL MIDI 1"
export ANYCTRL_NAME="ReMOTE SL MIDI 2"
export ANYCTRL_NAME="ReMOTE SL MIDI 3"
export ANYCTRL_NAME="Focusrite-Novation RemoteSL + ZeroSL"
#------------------------------------------------------------------------------
# Launch MPC application as usual, but take command line difference in account
# The Force has one.., MPCs haven't. Don't know if this is important.
ARGV=""
[ "$DEVICE" == "Force" ] && ARGV="$@"
#------------------ original script start here---------------------------------
# find dfu util info
DFUUTILINFO=$(dfu-util -l | grep "0x08000000")
#if in dfu-update mode run firmware update script
[ "x$DFUUTILINFO" != "x" ] && sh /usr/share/Akai/SME0/Firmware/update.sh
export ANYCTRL_NAME="ReMOTE SL MIDI 1";LD_PRELOAD=$TKGL_LIB/tkgl_anyctrl.so
export ANYCTRL_NAME="Focusrite-Novation RemoteSL + ZeroSL";LD_PRELOAD=$TKGL_LIB/tkgl_anyctrl.so
if type systemd-inhibit >/dev/null 2>&1
then
exec systemd-inhibit --what=handle-power-key /usr/bin/MPC $ARGV
else
# Reduce the soft stack size limit to 1MiB (from the default 8MiB). This
# is used as the default stack size for new threads and since MPC is
# locked in memory this memory is allocated. Since the limit is read
# before main, we cannot set it in the application and must do so here.
ulimit -S -s 1024
exec /usr/bin/MPC $ARGV
fi
I just pushed a correction of tkgl_anyctrl.c and its light version tkgl_anyctrl_lt.c You fill find the new library so file here : https://github.com/TheKikGen/MPCLiveXplore-libs/tree/main/src Remind: the light version is enough if you need only to map MPC/Force buttons with messages from your controller. ANYCTRL_NAME variable contains a regex pattern to match the port name (visible with a aconnect -l cmd).
export ANYCTRL_NAME="Launchpad Mini.*(KIKPAD|MIDI).*";LD_PRELOAD=./tkgl_anyctrl_lt.so /usr/bin/MPC
@Potreba your script can't work as is.
post here the result of a "aconnect -l" command.
client 0: 'System' [type=kernel]
0 'Timer '
1 'Announce '
client 16: 'MPC Live Controller' [type=kernel,card=0]
0 'MPC Public '
Connected From: 136:0
1 'MPC Private '
Connecting To: 134:0
Connected From: 135:0
2 'MPC MIDI Port A '
Connecting To: 137:0
Connected From: 137:7
3 'MPC MIDI Port B '
Connecting To: 137:1
Connected From: 137:8
client 20: 'UMC404HD 192k' [type=kernel,card=1]
0 'UMC404HD 192k MIDI 1'
Connecting To: 137:2
Connected From: 137:9
client 28: 'ReMOTE SL' [type=kernel,card=3]
0 'ReMOTE SL MIDI 1'
Connecting To: 137:3
Connected From: 137:10
1 'ReMOTE SL MIDI 2'
Connecting To: 137:4
Connected From: 137:11
2 'ReMOTE SL MIDI 3'
Connecting To: 137:5
Connected From: 137:12
client 130: 'Virtual MIDI Output 1 Input' [type=user,pid=287]
0 'in '
Connected From: 137:15
client 131: 'Virtual MIDI Output 2 Input' [type=user,pid=287]
0 'in '
Connected From: 137:13
client 132: 'Virtual MIDI Input 1 Output' [type=user,pid=287]
0 'out '
Connecting To: 137:14
client 133: 'Virtual MIDI Input 2 Output' [type=user,pid=287]
0 'out '
Connecting To: 137:6
client 134: 'Client-134' [type=user,pid=339]
0 'TKGL Virtual In Private'
Connected From: 16:1
client 135: 'Client-135' [type=user,pid=339]
0 'TKGL Virtual Out Private'
Connecting To: 16:1
client 136: 'Client-136' [type=user,pid=339]
0 'TKGL Virtual Out Public'
Connecting To: 16:0
client 137: 'MPC' [type=user,pid=339]
0 'MPC Live Controller MPC MIDI Port A'
Connected From: 16:2
1 'MPC Live Controller MPC MIDI Port B'
Connected From: 16:3
2 'UMC404HD 192k MIDI 1'
Connected From: 20:0
3 'ReMOTE SL MIDI 1'
Connected From: 28:0
4 'ReMOTE SL MIDI 2'
Connected From: 28:1
5 'ReMOTE SL MIDI 3'
Connected From: 28:2
6 'Virtual MIDI Input 2 Output out'
Connected From: 133:0
7 'MPC Live Controller MPC MIDI Port A'
Connecting To: 16:2
8 'MPC Live Controller MPC MIDI Port B'
Connecting To: 16:3
9 'UMC404HD 192k MIDI 1'
Connecting To: 20:0
10 'ReMOTE SL MIDI 1'
Connecting To: 28:0
11 'ReMOTE SL MIDI 2'
Connecting To: 28:1
12 'ReMOTE SL MIDI 3'
Connecting To: 28:2
13 'Virtual MIDI Output 2 Input in'
Connecting To: 131:0
14 'Virtual MIDI Input 1 Output out'
Connected From: 132:0
15 'Virtual MIDI Output 1 Input in'
Connecting To: 130:0
@Potreba Ok. You must copy the last version of tkgl_anyctrl.so mentioned above to the tkglbootstrap[ProjectData]/lib/ directory first. Then, you can use that script version with your Remote SL controller :
#!/bin/sh
#
# __ __| | | /_) | ___| | |
# | __ \ _ \ ' / | | / | _ \ __ \ | _` | __ \ __|
# | | | | __/ . \ | < | | __/ | | | ( | | |\__ \
# _| _| |_|\___| _|\_\_|_|\_\\____|\___|_| _| _____|\__,_|_.__/ ____/
#
# BOOTSTRAP script for ANYCTRL LD_PRELOAD LIBRARY.
SCRIPT_NAME=$(readlink -f "$0")
SCRIPT_DIR=$(dirname "$SCRIPT_NAME")
source "$SCRIPT_DIR/../../scripts/tkgl_path"
# This "low-level" library allows you to set up any controller as a control
# surface to drive the MPC standalone application (FULL PRIVATE AND PUBLIC PORTS).
#------------------------------------------------------------------------------
# Enter here the name (or regex pattern) of your external midi controller.
# You can use the command 'amidi -l' to find it
# Example : ANYCTRL_NAME="Launchpad Mini.*(KIKPAD|MIDI).*"
# Capture the Remote SL first port with a regex pattern
# client 28: 'ReMOTE SL' [type=kernel,card=3]
# 0 'ReMOTE SL MIDI 1'
export ANYCTRL_NAME="ReMOTE SL.*"
#------------------------------------------------------------------------------
# Launch MPC application as usual, but take command line difference in account
# The Force has one.., MPCs haven't. Don't know if this is important.
ARGV=""
[ "$DEVICE" == "Force" ] && ARGV="$@"
#------------------ original script start here---------------------------------
# find dfu util info
DFUUTILINFO=$(dfu-util -l | grep "0x08000000")
#if in dfu-update mode run firmware update script
[ "x$DFUUTILINFO" != "x" ] && sh /usr/share/Akai/SME0/Firmware/update.sh
export LD_PRELOAD=$TKGL_LIB/tkgl_anyctrl.so
if type systemd-inhibit >/dev/null 2>&1
then
exec systemd-inhibit --what=handle-power-key /usr/bin/MPC $ARGV
else
# Reduce the soft stack size limit to 1MiB (from the default 8MiB). This
# is used as the default stack size for new threads and since MPC is
# locked in memory this memory is allocated. Since the limit is read
# before main, we cannot set it in the application and must do so here.
ulimit -S -s 1024
exec /usr/bin/MPC $ARGV
fi
I've copied files from your link above to 'lib' folder and copied code you've written above to tkgl_mod_anyctrl.sh . Still nothing works. I'm sending midi messages b0 52 00-7f - Play from SL . This is hex, right, so its CC#82.
Connect with ssh :
# ssh root@<your mpc ip address>
Stop the MPC application :
# systemctl stop inmusic-mpc
try manually to launch MPC with anyctrl (with the bootstrap sdcard in) :
# cd /media/TKGL_BOOTSTRAP/tkgl_bootstrap_[ProjectData]/lib
# export ANYCTRL_NAME="ReMOTE SL.*";LD_PRELOAD=./tkgl_anyctrl_lt.so /usr/bin/MPC
Post the result here
Hi! I'm looking for ways to control IamForce with external midi controller. I'm looking for info to build Arduino / Opendeck midi controller as a footwsitch to do stuff like up/down arrow , combined down/launch_scene8, maybe expression pedal to crossfader. As far as I understand Mod_anyctrl is a module responsible for such task? Is there a way to map midi CC / note like you did with mpc.conf file?