Skip to content

Commit 5fc0289

Browse files
committed
character chnves and my setup
1 parent 7f41b52 commit 5fc0289

2 files changed

Lines changed: 29 additions & 23 deletions

File tree

CodeKlavier/Mapping.py

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ def mapping(self, midinumber):
109109
elif midinumber == 88:
110110
self.__keyboard.type('w')
111111
self.formatAndSend('w', display=2)
112+
elif midinumber == 89:
113+
self.__keyboard.type('v')
114+
self.formatAndSend('v', display=2)
112115
elif midinumber == 64:
113116
self.__keyboard.type('d')
114117
self.formatAndSend('d', display=2)
@@ -198,8 +201,8 @@ def mapping(self, midinumber):
198201
self.__keyboard.type('?')
199202
self.formatAndSend('?', display=2)
200203
elif midinumber == 105:
201-
self.__keyboard.type('.!')
202-
self.formatAndSend('.!', display=2)
204+
self.__keyboard.type('!.')
205+
self.formatAndSend('!.', display=2)
203206
elif midinumber == 95:
204207
self.__keyboard.press(Key.backspace)
205208
self.__keyboard.release(Key.backspace)
@@ -216,8 +219,8 @@ def mapping(self, midinumber):
216219
elif midinumber == 102:
217220
self.__keyboard.type('TempoClock.default')
218221
self.formatAndSend('TempoClock.default', display=5)
219-
220-
222+
223+
221224

222225
class Mapping_HelloWorld_NKK:
223226
"""Mapping of the HelloWorld piece
@@ -360,8 +363,8 @@ def mapping(self, midinumber):
360363

361364
class Mapping_Motippets:
362365
"""Mapping for the Motippets prototype.
363-
364-
Includes Hello World mappings for the Hybrid prototype
366+
367+
Includes Hello World mappings for the Hybrid prototype
365368
"""
366369
def __init__(self, debug=True):
367370
if debug:
@@ -450,7 +453,7 @@ def evaluateSC(self, what):
450453
elif what == 'noEnter_eval':
451454
with self.__keyboard.pressed(Key.shift):
452455
self.__keyboard.press(Key.enter)
453-
self.__keyboard.release(Key.enter)
456+
self.__keyboard.release(Key.enter)
454457

455458
def goDown(self):
456459
"""Press command-arrow down and enter.
@@ -502,6 +505,9 @@ def mapping(self, midinumber, prototype='Hello World'):
502505
elif midinumber == 88:
503506
self.__keyboard.type('w')
504507
self.formatAndSend('w', display=5, syntax_color='hello:', spacing=False)
508+
elif midinumber == 89:
509+
self.__keyboard.type('v')
510+
self.formatAndSend('v', display=5, syntax_color='hello:', spacing=False)
505511
elif midinumber == 64:
506512
self.__keyboard.type('d')
507513
self.formatAndSend('d', display=5, syntax_color='hello:', spacing=False)
@@ -584,8 +590,8 @@ def mapping(self, midinumber, prototype='Hello World'):
584590
self.__keyboard.type('?')
585591
self.formatAndSend('?', display=5, syntax_color='hello:', spacing=False)
586592
elif midinumber == 105:
587-
self.__keyboard.type('.!')
588-
self.formatAndSend('.!', display=5, syntax_color='hello:', spacing=False)
593+
self.__keyboard.type('!.')
594+
self.formatAndSend('!.', display=5, syntax_color='hello:', spacing=False)
589595
elif midinumber == 95:
590596
self.__keyboard.press(Key.backspace)
591597
self.__keyboard.release(Key.backspace)
@@ -603,12 +609,12 @@ def mapping(self, midinumber, prototype='Hello World'):
603609
self.__keyboard.type('TempoClock.default')
604610
self.formatAndSend('TempoClock.default', display=5, syntax_color='hello:', spacing=False)
605611
elif midinumber == 108:
606-
self.goDown()
612+
self.goDown()
607613
# motippets only commands:
608614
elif prototype == 'Motippets':
609615
if midinumber == 66:
610-
self.evaluateSC('eval')
611-
616+
self.evaluateSC('eval')
617+
612618
def formatAndSend(self, msg='', encoding='utf-8', host='localhost', display=1, syntax_color='', spacing=True):
613619
"""format and prepare a string for sending it over UDP socket
614620
@@ -629,8 +635,8 @@ def formatAndSend(self, msg='', encoding='utf-8', host='localhost', display=1, s
629635
elif display == 4:
630636
port = 4444
631637
elif display == 5:
632-
port = 5555
633-
638+
port = 5555
639+
634640
if spacing:
635641
newline = '\n'
636642
else:
@@ -877,7 +883,7 @@ def result(self, result_num, text, mod=0): #how to make optional params?
877883
elif text == 'less than':
878884
#self.__keyboard.type('~gong.play(' + str(mod) + ');');
879885
#self.evaluateSC('eval')
880-
self._osc.send_message("/gong", str(mod))
886+
self._osc.send_message("/gong", str(mod))
881887
self.formatAndSend('~gong.play(' + str(mod) + ');', display=3, syntax_color='snippet:')
882888

883889

@@ -946,8 +952,8 @@ def result(self, result_num, text, mod=0): #how to make optional params?
946952
elif text == 'less than':
947953
#self.__keyboard.type('~huygens.stuk('+ str(mod) +');')
948954
#self.evaluateSC('eval')
949-
self._osc.send_message("/huygens", str(mod))
950-
self.formatAndSend('~huygens.stuk(' + str(mod) + ');', display=3, syntax_color='snippet:')
955+
self._osc.send_message("/huygens", str(mod))
956+
self.formatAndSend('~huygens.stuk(' + str(mod) + ');', display=3, syntax_color='snippet:')
951957

952958
elif result_num == 6:
953959
if text == 'comment':
@@ -956,7 +962,7 @@ def result(self, result_num, text, mod=0): #how to make optional params?
956962
elif text == 'start':
957963
self.__keyboard.type('// HUYGENS countdown started!')
958964
self.evaluateSC('eval')
959-
elif text == 'code':
965+
elif text == 'code':
960966
self.__keyboard.type("")
961967
self.enter()
962968
self.__keyboard.type(" ____ ____ ____ __ __ _ ")
@@ -975,12 +981,12 @@ def result(self, result_num, text, mod=0): #how to make optional params?
975981
self.enter()
976982
elif text == 'huygens':
977983
self.__keyboard.type('~huygens.eind')
978-
self.evaluateSC('eval')
984+
self.evaluateSC('eval')
979985

980986
def customPass(self, name, content):
981987
"""
982988
post custom string message on codespace and display
983-
989+
984990
:param string name: a label to print in front of the string
985991
:param string content: the message or content
986992
"""
@@ -991,11 +997,11 @@ def customPass(self, name, content):
991997
def onlyDisplay(self, content, tag=1, warning=False):
992998
"""
993999
print a custom string on the UDP display only!
994-
1000+
9951001
:param string content: the message or content
9961002
:param int tag: the reference to a color tag
9971003
:param warning: wether to print the message with the warning color tag (i.e. red)
998-
1004+
9991005
"""
10001006
if warning:
10011007
self.formatAndSend(content, display=4, syntax_color='warning:')

default_setup.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[midi]
22
port: 2
3-
device_id: 152
3+
device_id: 144
44
noteoff_id: 0
55

66
[snippets]

0 commit comments

Comments
 (0)