{"id":17082298,"url":"https://github.com/EMATech/micropython-midi","last_synced_at":"2025-02-22T05:30:47.549Z","repository":{"id":148465136,"uuid":"61442727","full_name":"EMATech/micropython-midi","owner":"EMATech","description":"A midi implementation example for micropython.","archived":false,"fork":false,"pushed_at":"2014-10-01T17:53:30.000Z","size":156,"stargazers_count":2,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-20T01:38:57.254Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"cjbarnes18/micropython-midi","license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EMATech.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-18T16:32:00.000Z","updated_at":"2025-01-25T15:34:28.000Z","dependencies_parsed_at":"2023-03-28T23:35:54.905Z","dependency_job_id":null,"html_url":"https://github.com/EMATech/micropython-midi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EMATech%2Fmicropython-midi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EMATech%2Fmicropython-midi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EMATech%2Fmicropython-midi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EMATech%2Fmicropython-midi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EMATech","download_url":"https://codeload.github.com/EMATech/micropython-midi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240131743,"owners_count":19752725,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T13:00:24.933Z","updated_at":"2025-02-22T05:30:47.525Z","avatar_url":"https://github.com/EMATech.png","language":"Python","readme":"=====================\nMidi for Micro Python\n=====================\n\nThere are 2 examples of midi for Micro Python in this repository.\n\nSimple Example\n==============\nThis is a simple midi example which uses the switch to trigger a\nsequence of notes.\n\n\nUsage\n-----\n\nin boot.py\n::\n    import midi_switch\n\non your host run ttymidi (see below)\n\n\nmidi module\n==========\n\nThis contains a Controller class that implements a simple abstraction\nand serves as documentation of some of the standard midi protocol.\n\nUsage\n-----\n\nAdd the following to main.py and import main in boot.py\n::\n    import midi\n    \n    serial = pyb.USB_VCP()\n    \n    \n    def midi_controller():\n        \"\"\"Use the accelerometer and the switch as a midi control.\"\"\"\n        instrument1 = midi.Controller(serial, channel=1)\n        accel = pyb.Accel()\n        switch = pyb.Switch()\n        while 1:\n            while not switch():\n                pyb.delay(10)\n            note = accel.x()\n            velocity = accel.y()\n            instrument1.note_on(note + 65, velocity + 65)\n            while switch():\n                pyb.delay(50)\n            instrument1.note_off(note + 65)\n\nIn the console run the function\n::\n    \u003e\u003e\u003e midi_controller()\nthen disconnect the console and run ttymidi\n::\n    $ ttymidi -s /dev/ttyACM0 -n MicroPythonMidi -b 9600 -v\nThe -v option will output the midi commands to the console.\n\nTo hear sound, connect the MicroPythonMidi output to your sound\napplication input using a patchbay tool such as patchage, then press the button.\n\nThe orientation of the board will control the pitch and the volume\nof the note played.\n\n\nttymidi\n=======\n\nttymidi a tool to link a serial input to alsa as a midi I/O device.\n\nIt is available from https://github.com/cjbarnes18/ttymidi.git\n\nOnce compiled, to get it to communicate with Micro Python use the\nfollowing options.\n::\n    $ ttymidi -s /dev/ttyACM0 -n MicroPythonMidi -b 9600\n\nThen use standard midi tools.\n\nI generally use *patchage* to manage the connections,\nand *Qsynth* is a good synthesizer to get started with.\n","funding_links":[],"categories":["Libraries","Recently Updated"],"sub_categories":["Audio","[Oct 12, 2024](/content/2024/10/12/README.md)"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEMATech%2Fmicropython-midi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEMATech%2Fmicropython-midi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEMATech%2Fmicropython-midi/lists"}