{"id":18952586,"url":"https://github.com/jdan/melopy","last_synced_at":"2025-04-09T09:09:19.560Z","repository":{"id":48530127,"uuid":"2127180","full_name":"jdan/Melopy","owner":"jdan","description":"Python music library","archived":false,"fork":false,"pushed_at":"2022-08-29T13:58:28.000Z","size":2871,"stargazers_count":241,"open_issues_count":6,"forks_count":32,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-02T07:09:27.452Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://jdan.github.io/Melopy","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/jdan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.txt","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-07-30T01:48:57.000Z","updated_at":"2025-01-20T23:54:46.000Z","dependencies_parsed_at":"2023-01-16T17:45:31.402Z","dependency_job_id":null,"html_url":"https://github.com/jdan/Melopy","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/jdan%2FMelopy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdan%2FMelopy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdan%2FMelopy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdan%2FMelopy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdan","download_url":"https://codeload.github.com/jdan/Melopy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248008630,"owners_count":21032556,"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-11-08T13:34:02.443Z","updated_at":"2025-04-09T09:09:19.543Z","avatar_url":"https://github.com/jdan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Melopy\n\nhttp://jdan.github.io/Melopy\n\nA python library for playing with sound.\u003cbr /\u003e\n*by [Jordan Scales](http://jordanscales.com) and friends*\n\n### Install it\n\nYou may need to use `sudo` for this to work.\n\n    $ pip install melopy\n\n### Load it\n\n```python\n$ python\nPython 2.7.2 (default, Jun 20 2012, 16:23:33)\n[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e import melopy\n\u003e\u003e\u003e melopy.major_scale('C5')\n['C5', 'D5', 'E5', 'F5', 'G5', 'A5', 'B5']\n\u003e\u003e\u003e\n```\n\n### Development\n\nTo install locally:\n\n    $ git clone git://github.com/jdan/Melopy\n    $ cd Melopy\n    $ python setup.py install\n\nFor examples, check out the `examples` directory:\n\n    $ python examples/canon.py\n    $ python examples/parser.py entertainer \u003c examples/scores/entertainer.mlp\n\nTo run the tests:\n\n    $ python tests/melopy_tests.py\n\n### Organization\n\nMelopy is broken down into 3 subcategories - `melopy`, `scales`, and `utility`.\n\n* `melopy.py` contains the Melopy class\n    * this is used for creating a Melopy and adding notes to it, rendering, etc\n* `scales.py` contains methods for generating scales\n    * for instance, if you want to store the C major scale in an array\n* `utility.py` contains methods for finding frequencies of notes, etc\n\n### melopy.py\n\n```python\n\u003e\u003e\u003e from melopy import Melopy\n\u003e\u003e\u003e m = Melopy('mysong')\n\u003e\u003e\u003e m.add_quarter_note('A4')\n\u003e\u003e\u003e m.add_quarter_note('C#5')\n\u003e\u003e\u003e m.add_quarter_note('E5')\n\u003e\u003e\u003e m.render()\n[==================================================] 100%\nDone\n```\n\n### scales.py\n\n* chromatic_scale\n* harmonic_minor_scale\n* major_pentatonic_scale\n* major_scale\n* minor_scale\n* major_triad\n* minor_triad\n* melodic_minor_scale\n* minor_pentatonic_scale\n\n```python\n\u003e\u003e\u003e from melopy.scales import *\n\u003e\u003e\u003e major_scale('C4')\n['C4', 'D4', 'E4', 'F4', 'G4', 'A4', 'B4']\n\u003e\u003e\u003e major_scale('C4','dict')\n{0: 'C4', 1: 'D4', 2: 'E4', 3: 'F4', 4: 'G4', 5: 'A4', 6: 'B4'}\n\u003e\u003e\u003e major_scale('C4','tuple')\n('C4', 'D4', 'E4', 'F4', 'G4', 'A4', 'B4')\n\u003e\u003e\u003e minor_scale('D#5')  # has some bugs\n['D#5', 'F5', 'F#5', 'G#5', 'A#5', 'B5', 'C#6']\n\u003e\u003e\u003e major_triad('A4')\n['A4', 'C#5', 'E5']\n\u003e\u003e\u003e major_triad('A4', 'tuple')\n('A4', 'C#5', 'E5')\n```\n\n### utility.py\n\n* key_to_frequency\n* key_to_note\n* note_to_frequency\n* note_to_key\n* frequency_to_key\n* frequency_to_note\n\n```python\n\u003e\u003e\u003e from melopy.utility import *\n\u003e\u003e\u003e key_to_frequency(49)\n440.0\n\u003e\u003e\u003e note_to_frequency('A4')\n440.0\n\u003e\u003e\u003e note_to_frequency('C5')\n523.2511306011972\n\u003e\u003e\u003e note_to_key('Bb5')\n62\n\u003e\u003e\u003e key_to_note(65)\n'C#6'\n\u003e\u003e\u003e key_to_note(304) # even something stupid\n'C26'\n\u003e\u003e\u003e frequency_to_key(660)\n56\n\u003e\u003e\u003e frequency_to_note(660)\n'E5'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdan%2Fmelopy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdan%2Fmelopy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdan%2Fmelopy/lists"}