-
-
Save asus4/bb4e14b1998814f27bc4c7905da650ce to your computer and use it in GitHub Desktop.
#!/usr/bin/env python | |
# coding: UTF-8 | |
''' | |
Setup apc mini colors without Ablton Live | |
---------- | |
> brew install portmidi | |
requirements.txt | |
mido | |
# https://github.com/olemb/mido | |
---------- | |
API mini cheetsheet | |
http://community.akaipro.com/akai_professional/topics/midi-information-for-apc-mini | |
''' | |
import mido | |
import time | |
def led_off(note): | |
return mido.Message('note_on', note=note, velocity=0) | |
def led_green(note): | |
return mido.Message('note_on', note=note, velocity=1) | |
def led_green_blink(note): | |
return mido.Message('note_on', note=note, velocity=2) | |
def led_red(note): | |
return mido.Message('note_on', note=note, velocity=3) | |
def led_red_blink(note): | |
return mido.Message('note_on', note=note, velocity=4) | |
def led_yellow(note): | |
return mido.Message('note_on', note=note, velocity=5) | |
def led_yellow_blink(note): | |
return mido.Message('note_on', note=note, velocity=6) | |
def send(output, msg): | |
output.send(msg) | |
time.sleep(0.0015) # wait 1ms | |
def setup_apcmini(): | |
output = mido.open_output('APC MINI') | |
# reset all | |
for note in range(0, 99): | |
send(output, led_off(note)) | |
# set for unity | |
for note in range(0, 12): | |
send(output, led_green(note)) | |
for note in range(64, 72): # 64-71 red only | |
send(output, led_red(note)) | |
# set for resolume avenue | |
for note in range(40, 64): | |
send(output, led_yellow(note)) | |
# set scene change | |
for note in range(82, 90): # 82 - 90 green only | |
send(output, led_green(note)) | |
if __name__ == '__main__': | |
setup_apcmini() |
NOTE
def setup_apcmini():
output = mido.open_output('APC MINI')
# change all red
for note in range(0, 99):
send(output, led_red(note))
# change all yellow
for note in range(0, 99):
send(output, led_yellow(note))
# change all yellow
for note in range(0, 99):
send(output, led_yellow(note))
Hi, thanks for this it is exactly what I am looking for, but the AKAI community has changed into a forum and I can't get in with an invite from a a member. Is there another copy of the information somewhere please?
Hi @rainsbury, here's a copy. - I haven't tested it as I don't have APC Mini now :)
https://discourse.zynthian.org/t/zynseq-a-native-step-sequencer/4043/366
Thanks that is great.
I still have one, although the master volume slider is very erratic and I can't find anybody who sells a replacement at a reasonable price.
I want to use it now with model railway controller digital control. Each channel would be assigned to a loco with the slider controlling speed, and the buttons controlling functions on the sound chip and lights etc.
Hi there!
Thanks for the work, but have ever tested that script in Windows?
@lastiq No only tested on macOS,
If mido
works on Windows, this should work as well.
Please refer to the documentations for mido
README
1.needs portmidi
brew install portmidi
2.requirements.txt
mido
3.midi chartsheet
chartsheet
