forked from eegsynth/eegsynth
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first implementation with midi input, it is not yet passed on to redis
- Loading branch information
1 parent
510e915
commit f10fe6d
Showing
5 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[general] | ||
name="Eye blink" | ||
name="Keyboard" | ||
|
||
[redis] | ||
hostname=10.9.25.37 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import mido | ||
import time | ||
import ConfigParser # this is version 2.x specific, on version 3.x it is called "configparser" and has a different API | ||
import redis | ||
|
||
config = ConfigParser.ConfigParser() | ||
config.read('keyboard.ini') | ||
|
||
r = redis.StrictRedis(host=config.get('redis','hostname'), port=config.getint('redis','port'), db=0) | ||
|
||
mido.get_input_names() | ||
|
||
port = mido.open_input(config.get('midi','device')) | ||
|
||
while True: | ||
for msg in port.iter_pending(): | ||
# FIXME here it should decide on a key-value pair and send that to redis | ||
print(msg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ hostname=10.9.25.37 | |
port=6379 | ||
|
||
[midi] | ||
device=FIXME | ||
device=Launch Control XL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import mido | ||
import time | ||
import ConfigParser # this is version 2.x specific, on version 3.x it is called "configparser" and has a different API | ||
import redis | ||
|
||
config = ConfigParser.ConfigParser() | ||
config.read('launchcontrol.ini') | ||
|
||
r = redis.StrictRedis(host=config.get('redis','hostname'), port=config.getint('redis','port'), db=0) | ||
|
||
mido.get_input_names() | ||
|
||
port = mido.open_input(config.get('midi','device')) | ||
|
||
while True: | ||
for msg in port.iter_pending(): | ||
# FIXME here it should decide on a key-value pair and send that to redis | ||
print(msg) |