Link on linux & merges

This commit is contained in:
dandaedre 2021-10-06 15:50:22 +02:00
parent 774b218911
commit a9a30bc829
5 changed files with 21 additions and 9 deletions

View File

@ -50,3 +50,5 @@ To do so add a custom patch (or use a currently defined one, but chances are pat
* TODO: Pagehandler: make a note handler
* TODO: Color management, get colors associated to all statuses
* TODO: General decorators @armtake
* TODO: Do a cleaner page printl
* TODO: Do all page tests

View File

@ -1 +1 @@
__all__ = ["mapping","GrandMA2"] #Never import * as every parse is supposed to be named MessageParse
__all__ = ["mapping","GrandMA2","midipagehandler"] #Never import * as every parse is supposed to be named MessageParse

View File

@ -1,3 +1,4 @@
#!/bin/python3
###########################
# IMPORTS
@ -84,6 +85,7 @@ class midiPageHandler(object):
self._maxpages=pages
self._maxN=0
self._makeNotes(table)
self.initValues()
####################
# Manage attributes
@ -288,10 +290,10 @@ class AkaiAPCMini(midiPageHandler):
"A specific implementation of the page handler"
def __init__(self):
super(AkaiAPCMini,self).__init__([[i+(7-j)*8 for i in range(8)] for j in range(8)])
super(AkaiAPCMini,self).__init__([[i+(7-j)*8 for i in range(8)] for j in range(8)]+[[i for i in range(64,72)],[i for i in range(82,90)]])
# Add the two control lines
self.initValues()
self._updateSize()
self.colors={"black":0,"green":1,"blinking_green":2,"red":3,"blinking_red":4,"yellow":5,"blinking_yellow":6}
self.addPossibleValues(("Inactive","Active","Selected","Live"))
_INACTIVE,_ACTIVE,_LIVE,_SELECTED=self.statusId("Inactive"),self.statusId("Active"),self.statusId("Selected"),self.statusId("Live")
@ -349,5 +351,5 @@ if __name__ == '__main__':
ak.prettyPrint(ak._changedbasevalues)
print(ak.statusId(("Active","Selected","Live")))
ak.
# ak.
# light=lightHandler(ak.listStatus(),{})

View File

@ -1,3 +1,4 @@
#!/bin/python3
from mapping.base import BasicMessageParse,BasicActions,MatchError,BasicMidiInterface
import mido
from mapping.midi import MessageParse
@ -35,8 +36,10 @@ _COLORS={"black":0,"green":1,"blinking_green":2,"red":3,"blinking_red":4,"yellow
# GLOBAL CONTROL
###
# try:
from mapping import midiPageHandler
# except:
# from
handler=midiPageHandler.AkaiAPCMini()
class pulseLink(object):
"""Link between lights, messages and states
@ -50,13 +53,16 @@ class pulseLink(object):
def _onload(self):
"Send a reset colors"
import time,sys
# handler.prettyPrint(handler._activebasevalues)
#vars.output=self.outputs[vars.interface_nb]
def pagepress(trigger,val,note,*params):
"A key was pressed on the pagebuttons area"
try:
print(handler._noteToPos[note])
pos=handler._noteToPos[note]
#,handler._posToNote[pos[0],pos[1]]
dprint("Received {} (note:{})".format(pos,note)
except TypeError as e:
eprint("[Error] : Unassigned pagebutton {} - Note {:2} ({:3})".format(trigger,note,val))
eprint(e)

View File

@ -1,6 +1,8 @@
[interface]
input=APC MINI 2
output1=APC MINI 3
input=APC MINI:APC MINI MIDI 1
#APC MINI 2
output1=APC MINI:APC MINI MIDI 1
#APC MINI 3
inputchanel = 1
outputchannel1 = 1
#outputchannel2 = 1