{ "info": { "author": "P-bibs", "author_email": "author@example.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# ChordalPy\n\nA simple python library to ingest and manipulate musical chords stored in plaintext format according to [Christopher Harte's 2010 thesis](https://qmro.qmul.ac.uk/xmlui/bitstream/handle/123456789/534/HARTETowardsAutomatic2010.pdf?sequence=1).\n\n## Installation\n\n```bash\npython -m pip install ChordalPy\n```\n\n## The format\n\nThe chords that this library can parse are in a specific plaintext format detailed [here](https://qmro.qmul.ac.uk/xmlui/bitstream/handle/123456789/534/HARTETowardsAutomatic2010.pdf?sequence=1); however, here's a quick and dirty run down.\n\nEach chord has three parts: the root, the intervals, and the bass. They are seperated with a colon and a slash like so\n\n```\nroot:intervals/bass\n```\n\n### Root\n\nThe root is simply any letter name. It could be `'C'` or `'G#'` or `'Fbbbbb'`.\n\n### Intervals\n\nThe intervals section consists of a shorthand abbreviation for a common set of intervals followed by any changes to those intervals in parantheses. For example, a major triad with an added sharp sixth would be `maj(#6)`. The added intervals can do one of:\n1. Add an interval to the existing shorthand.\n2. Modify (sharp or flat) an interval in the existing shorthand.\n3. Remove an interval in the existing shorthand (notated with a `*` before the interval to be removed).\n\nThe list of shorthands can be found on page 105 of the earlier referenced PDF.\n\n### Bass\n\nThe bass is an interval degree (any digit 1-9) along with 0 or more modifiers (`#` or `b`)\n\n## A note on intervals\n\nThere is an interesting quick to musical intervals that means they cannot be entirely expressed with only one digit. Rather, they requrie a tuple of two integers.\n\nWhen looking through the source of this library, you will often find intervals notated as such. The first integer represents the number of letter names between the notes (for instance, in the interval from `C` to `G` the first integer would be `5`) and the second integer is the number of half steps (so in the interval from `C` to `G` the second integer would be `7`).\n\nUsing this method you can see how you would distiniguish between two enharmonic pitches. For example, `C` to `E` and `C` to `Fb`. The interval from `C` to `E` would be `(3, 4)` while the interval from `C` to `Fb` would be `(4, 4)`.\n\n## Library Usage\n\nParse a chord and print its members\n\n```python\nimport ChordalPy\n\nmy_chord = ChordalPy.parse_chord(\"C:maj\")\nspelling = my_chord.get_spelling()\nprint(\"C:maj has notes %s\" % spelling)\n```\n\nInstantiate a chord directly\n\n```python\nimport ChordalPy\n\n# C major in first inversion (C:maj/3)\nroot = \"C\"\nintervals = [(1, 0), (3, 4), (5, 7)]\nbass = \"E\"\n\nmy_chord = ChordalPy.Chord(root, intervals, bass)\n```\n\n### `Chord` Class\n\nPrint a string representation of a chord\n```python\nprint(str(my_chord))\n# C:[(1, 0), (3, 4), (5, 7)]/E\n```\n\nPrint the spelling of a chord\n```python\nprint(my_chord.get_spelling())\n# ['C', 'E', 'G']\n```\n\nPrint a binary note array of a chord\n```python\nprint(my_chord.get_note_array())\n# [1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0]\n```\n\nPrint a pseudohash of a chord's intervals\n```python\nprint(my_chord.get_pseudo_hash())\n# ecca\n```\n\nFind the note a given interval above a chord's root\n```python\nprint(my_chord.note_from_interval([5, 8]))\n# ecca\n```\n\n## See Also\n### Projects\n[Chordgen.com](paulbiberstein.me/chordgen) - A web tool that uses machine learning to generate chord progressions. [The machine learning model](https://github.com/P-bibs/ChordalPyGen) was trained on data created with this library.\n### Datasets\nA non-exhaustive list of datasets that use a format parsable by this library:\n* [Isophonics](http://isophonics.net/datasets)\n* [Real Book](https://github.com/keunwoochoi/lstm_real_book/blob/master/more_data_to_play_with/jazz_xlab.zip)\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/P-bibs/ChordalPy", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "ChordalPy", "package_url": "https://pypi.org/project/ChordalPy/", "platform": "", "project_url": "https://pypi.org/project/ChordalPy/", "project_urls": { "Homepage": "https://github.com/P-bibs/ChordalPy" }, "release_url": "https://pypi.org/project/ChordalPy/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "Parse and manipulate musical chords", "version": "0.1.0" }, "last_serial": 5610991, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "5de0f6f227bc5b618349048808c23adb", "sha256": "2b13dc0ca37b26c8dfc344235705669b20e3b0bbc41f1ce115155f30ddf6e29d" }, "downloads": -1, "filename": "ChordalPy-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "5de0f6f227bc5b618349048808c23adb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12701, "upload_time": "2019-07-31T02:40:36", "url": "https://files.pythonhosted.org/packages/e0/24/221cca41cd3604a5e5f84be5603ec0d75e3b5d925cc2a20a05c36efbf014/ChordalPy-0.1.0-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5de0f6f227bc5b618349048808c23adb", "sha256": "2b13dc0ca37b26c8dfc344235705669b20e3b0bbc41f1ce115155f30ddf6e29d" }, "downloads": -1, "filename": "ChordalPy-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "5de0f6f227bc5b618349048808c23adb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12701, "upload_time": "2019-07-31T02:40:36", "url": "https://files.pythonhosted.org/packages/e0/24/221cca41cd3604a5e5f84be5603ec0d75e3b5d925cc2a20a05c36efbf014/ChordalPy-0.1.0-py3-none-any.whl" } ] }