{"id":21150817,"url":"https://github.com/cedargrovestudios/circuitpython_midi_tools","last_synced_at":"2025-07-09T09:31:39.493Z","repository":{"id":62248743,"uuid":"559108677","full_name":"CedarGroveStudios/CircuitPython_MIDI_Tools","owner":"CedarGroveStudios","description":"A collection of CircuitPython methods for processing MIDI notes and Control Change codes.","archived":false,"fork":false,"pushed_at":"2023-09-16T05:38:50.000Z","size":440,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-09-16T14:25:20.888Z","etag":null,"topics":["circuitpython","circuitpython-community-bundle","midi","midi-converter"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CedarGroveStudios.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-29T04:45:20.000Z","updated_at":"2023-09-05T03:28:52.000Z","dependencies_parsed_at":"2023-01-20T17:16:55.944Z","dependency_job_id":null,"html_url":"https://github.com/CedarGroveStudios/CircuitPython_MIDI_Tools","commit_stats":null,"previous_names":[],"tags_count":1,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CedarGroveStudios%2FCircuitPython_MIDI_Tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CedarGroveStudios%2FCircuitPython_MIDI_Tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CedarGroveStudios%2FCircuitPython_MIDI_Tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CedarGroveStudios%2FCircuitPython_MIDI_Tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CedarGroveStudios","download_url":"https://codeload.github.com/CedarGroveStudios/CircuitPython_MIDI_Tools/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225530600,"owners_count":17483596,"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":["circuitpython","circuitpython-community-bundle","midi","midi-converter"],"created_at":"2024-11-20T10:08:33.833Z","updated_at":"2024-11-20T10:08:34.459Z","avatar_url":"https://github.com/CedarGroveStudios.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Introduction\n============\n\n\n\n\n.. image:: https://img.shields.io/discord/327254708534116352.svg\n    :target: https://adafru.it/discord\n    :alt: Discord\n\n\n.. image:: https://github.com/CedarGroveStudios/CircuitPython_MIDI_Tools/workflows/Build%20CI/badge.svg\n    :target: https://github.com/CedarGroveStudios/CircuitPython_MIDI_Tools/actions\n    :alt: Build Status\n\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n    :target: https://github.com/psf/black\n    :alt: Code Style: Black\n\nA CircuitPython method collection for processing MIDI notes and Control Change codes. It currently consists of seven\nhelpers for converting MIDI note values to and from frequency values and note name representations, and to provide\ndescriptions of MIDI Control Change (CC) controller codes.\n\n\nDependencies\n=============\nThis driver depends on:\n\n* `Adafruit CircuitPython \u003chttps://github.com/adafruit/circuitpython\u003e`_\n\nPlease ensure all dependencies are available on the CircuitPython filesystem.\nThis is easily achieved by downloading\n`the Adafruit library and driver bundle \u003chttps://circuitpython.org/libraries\u003e`_\nor individual libraries can be installed using\n`circup \u003chttps://github.com/adafruit/circup\u003e`_.\n\nInstalling to a Connected CircuitPython Device with Circup\n==========================================================\n\nMake sure that you have ``circup`` installed in your Python environment.\nInstall it with the following command if necessary:\n\n.. code-block:: shell\n\n    pip3 install circup\n\nWith ``circup`` installed and your CircuitPython device connected use the\nfollowing command to install:\n\n.. code-block:: shell\n\n    circup install cedargrove_midi_tools\n\nOr the following command to update an existing version:\n\n.. code-block:: shell\n\n    circup update\n\nUsage Example\n=============\n\n``note_or_name(note)``\n\nBidirectionally translates a MIDI sequential note value to a note name\nor a note name to a MIDI sequential note value. Note values are integers in\nthe range of 0 to 127 (inclusive). Note names are character strings\nexpressed in the format NoteOctave such as 'C4' or 'G#7'. Note names range\nfrom 'C-1' (note value 0) to 'F#9' (note value 127). If the input value is\noutside the note value or name range, the value of ``None`` is returned.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from cedargrove_midi_tools import note_or_name\n    \u003e\u003e\u003e note_or_name('G5')\n    79\n    \u003e\u003e\u003e note_or_name(79)\n    'G5'\n\n``note_to_name(note)`` and ``name_to_note(name)``\n\nTranslates a MIDI sequential note value to a note name or note name to a note\nvalue. Note values are integers in the range of 0 to 127 (inclusive).\nNote names are strings expressed in the NoteOctave format, such as 'C4' or\n'G#7'. Note names can range from 'C-1' (note value 0) to 'G9' (note value 127).\nIf the input value is outside the range, the value of ``None`` is returned.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from cedargrove_midi_tools import note_to_name, name_to_note\n    \u003e\u003e\u003e note_to_name(70)\n    'A#4'\n    \u003e\u003e\u003e name_to_note('A#4')\n    70\n\n``note_to_frequency(note)`` and ``frequency_to_note(frequency)``\n\nTranslates a MIDI sequential note value to its corresponding frequency in\nHertz (Hz) or a frequency to a MIDI note value. Note values integers\nin the range of 0 to 127 (inclusive). Frequency values are floating point.\nIf the input is outside of the range, the value ``None`` is returned.\nRef: MIDI Tuning Standard formula: https://en.wikipedia.org/wiki/MIDI_tuning_standard\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from cedargrove_midi_tools import note_to_frequency, frequency_to_note\n    \u003e\u003e\u003e note_to_frequency(60)\n    261.625\n    \u003e\u003e\u003e frequency_to_note(261.63)\n    60\n\n``frequency_to_note_cents(frequency)``\n\nTranslates a frequency in Hertz (Hz) to a MIDI sequential note value and\npositive offset in cents. Frequency values are floating point. Note values\nare integers in the range of 0 to 127 (inclusive). Cent values range from\n0 to +100 cents. If the input frequency is less than the corresponding\nfrequency for note 0 or greater than note 127, the note value cannot be\ndetermined and ``None`` is returned. Ref: MIDI Tuning Standard and cent\nformulae:\n\nhttps://en.wikipedia.org/wiki/MIDI_tuning_standard\n\nhttps://en.wikipedia.org/wiki/Cent_(music)\n\n``cc_code_to_description(cc_code)``\n\nProvides a controller description decoded from a Control Change controller code\nvalue.\nRef: https://www.midi.org/specifications-old/item/table-3-control-change-messages-data-bytes-2\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from cedargrove_midi_tools import cc_code_to_description\n    \u003e\u003e\u003e cc_code_to_description(24)\n    'Ctrl_24'\n    \u003e\u003e\u003e cc_code_to_description(1)\n    'Modulation'\n\n\nDocumentation\n=============\nAPI documentation for this library can be found `here \u003chttps://github.com/CedarGroveStudios/CircuitPython_MIDI_Tools/blob/main/media/pseudo_rtd_cedargrove_midi_tools.pdf\u003e`_.\n\nFor information on building library documentation, please check out\n`this guide \u003chttps://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1\u003e`_.\n\nContributing\n============\n\nContributions are welcome! Please read our `Code of Conduct\n\u003chttps://github.com/CedarGroveStudios/CircuitPython_MIDI_Tools/blob/HEAD/CODE_OF_CONDUCT.md\u003e`_\nbefore contributing to help this project stay welcoming.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedargrovestudios%2Fcircuitpython_midi_tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcedargrovestudios%2Fcircuitpython_midi_tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedargrovestudios%2Fcircuitpython_midi_tools/lists"}