def main(): """Main function as example. """ codeK = Setup() # Start the CodeKlavier codeK = Setup() myPort = codeK.perform_setup() codeK.open_port(myPort) device_id = codeK.get_device_id() print('your device id is: ', device_id, '\n') run(codeK)
def createConfig(configfile='my_settings.ini'): """Create a basic configfile TODO!!: avoid that the created configfile overwrites the existing file (if present)! :param string configfile: path and name of the configfile """ codeK = Setup() codeK.show_ports() myPort = codeK.get_port_from_user() codeK.open_port(myPort) device_id = codeK.get_device_id() config = configparser.ConfigParser() config.add_section('midi') config['midi']['port'] = str(myPort) config['midi']['device_id'] = str(device_id) with open(configfile, 'w') as f: config.write(f)
from threading import Thread, Event import sys import os import inspect # CodeKlavier modules from CK_Setup import Setup, BColors from Mapping import Mapping_Motippets from motippets_classes import Motippets # Start the CodeKlavier codeK = Setup() myPort = codeK.perform_setup() codeK.open_port(myPort) device_id = codeK.get_device_id() print('your device id is: ', device_id, '\n') # Use your favourite mapping of the keys mapping = Mapping_Motippets() print("\nCodeKlavier is ready and ON.") print("You are performing: Motippets") print("\nPress Control-C to exit.") # main memory (i.e. listen to the whole register) mainMem = Motippets(mapping, device_id) # midi listening per register memLow = Motippets(mapping, device_id)