Browse Source

Updated Readme with dependencies, gitignore, added basic midi test

master
Macoy Madson 4 years ago
parent
commit
2b555220a6
4 changed files with 71 additions and 0 deletions
  1. +3
    -0
      .gitignore
  2. +8
    -0
      README.md
  3. +24
    -0
      project/keykey.sublime-project
  4. +36
    -0
      sequencer.py

+ 3
- 0
.gitignore View File

@ -99,3 +99,6 @@ ENV/
# mypy
.mypy_cache/
# custom ignores
*.sublime-workspace

+ 8
- 0
README.md View File

@ -1,2 +1,10 @@
# keykey
MIDI Synth Sequencer Suite
## Dependencies
`sudo apt install libjack-jackd2-0 libjack-jackd2-dev`
`sudo pip3 install mido`
`sudo pip3 install python-rtmidi`
Maybe not needed:
`sudo pip3 install py-midi`

+ 24
- 0
project/keykey.sublime-project View File

@ -0,0 +1,24 @@
{
"folders":
[
{
"path": "../",
"name": "KeyKey",
"folder_exclude_patterns": ["project"],//, "thirdParty"],
"file_include_patterns": ["*.c", "*.cpp", "*.h", "*.hpp", "*.txt", "Jam*", "*.md", "*.py"]
},
],
"build_systems":
[
// For galavant/, use
// "working_dir": "$project_path/../../.."
// Not sure why, but Sublime will actually keep going up across builds if you just do ../ first
// Misc. Commands
{
"name": "List",
"shell_cmd": "ls -l",
"working_dir": "$project_path"
},
]
}

+ 36
- 0
sequencer.py View File

@ -0,0 +1,36 @@
import mido
import time
"""
mido.get_input_names()
mido.get_output_names()
"""
def testOutput():
outputs = mido.get_output_names()
lmmsOutPort = None
for output in outputs:
if 'LMMS'.lower() in output.lower():
lmmsOutPort = output
if not lmmsOutPort:
return
with mido.open_output(lmmsOutPort) as lmmsOut:
for i in range(1, 10):
song = [100, 80, 40, 80, 100]
for note in song:
testNote = mido.Message('note_on', note=note, velocity=127, time=0.1)
lmmsOut.send(testNote)
testNote = mido.Message('note_on', note=20, velocity=127, time=0.1)
lmmsOut.send(testNote)
time.sleep(0.1)
testNote = mido.Message('note_off', note=note, velocity=127, time=0.2)
lmmsOut.send(testNote)
testNote = mido.Message('note_off', note=20, velocity=127, time=0.2)
lmmsOut.send(testNote)
time.sleep(0.1)
if __name__ == '__main__':
testOutput()

Loading…
Cancel
Save