pitchr


Namepitchr JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/thedpws/pitcher
SummaryA Python library and framework for composing and playing music.
upload_time2020-08-02 03:28:28
maintainer
docs_urlNone
authorVinicius Martinson, Brian McDowell, Jacob Menke, Aeyzechiah Vasquez, Caleb Wong
requires_python>=3.6
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Pitchr
A python library and framework for composing music.
[Pitchr on PyPI](https://pypi.org/project/pitchr/)

Targets most Linux environments.

## Features

1. Enables creation of music by composition of music objects (notes, chords, measures, and staffs)
2. Unified interface for playing any music object (`note.play()`, `staff.play()`)
3. Unified interface for showing any music object (`note.show()`, `staff.show()`)
  * Spawns an image of the music object
4. Unified interface for exporting any music object (`note.save('note.pdf')`, `staff.save('staff.pdf')`)
5. Flexible manipulation of music
  * easily access notes by indexing a measure by beat: `note0 = measure[0]`
  * edit note attributes' pitch via methods `transpose`, `octave_up`, `augment`
6. Intelligently generates harmonies from your melodies
6. Finalizes your composition as beautiful standard sheet music
7. Enables interactive development in Jupyter Notebook

## Installation
To install: `pip3 install pitchr`.
Other dependencies that must be installed (available via your package manager):
  * libasound2
  * lilypond

Pitchr downloads models to `~/.pitchr/`. Set the `PITCHR_PATH` environment variable to change this behavior.

## Documentation
Documentation is hosted on Github Pages [here](https://thedpws.github.io/pitcher/)


## Getting Started
```python
from pitchr import *

# Instantiate notes
n = Note(pitch='C4', duration=1.0)

# Play them
n.play()

# Write music

m = Measure([
    Note('C', 1.0),
    Note('D', 1.0),
    Note('E', 1.0),
    Note('D', 1.0),
])

# See what you've written
m.show()

# Export to PDF
m.save('MySong.pdf')
```
## Helper UI

To access the helper UI, run from the command line: `python3 -m pitchr.helper`

![helper_ui](https://raw.githubusercontent.com/thedpws/pitcher/master/demo/helper_ui.png)

## More Detailed Notes

![flow](https://raw.githubusercontent.com/thedpws/pitcher/master/demo/flow.png)


## Note() class

**Init**:
- `pitch` (`"C#6"`)
- `duration` in beats
- `dynamic` (piano, forte, crescendo)
- `articulation` (staccato, accent, fermata)

### Note()
```python
from pitchr import *
note1 = Note("C4", 1, "forte")
note1.mingus_note # 'C-4'
note1.duration # 1
note1.dynamic # "forte"
note1.augment() or note1.diminish()
```

### Chords
```python
note2. = Note("E4", 1)
chord1 = Chord([note1, note2])
chord1.determine() # "Major third"
```

### Measure is a collection of Notes
```python
measure1 = Measure([note1, note2])
measure1.contains(note1) # True
measure1.append(note3)
```
### Staff is a collection of Measures

**Init**:
- `measures`
- `clef`
- `voice`https://thedpws.github.io/pitcher/

```python
staff1 = music.Staff(measure1, Clef.TREBLE, Voice.PIANO)
```

### Part is a collection of Staffs
```python
part1 = Part(staff1, tempo, time_signature, key_signature)
part1.add_staff(staff2)
part1.time_signature = 3/4
```
### Score is a collection of Parts
```python
score1 = Score("My Song", "Wonderful Subtitle", "Author Me", "me@email.com")
score1.get_author() # "Author Me"
score1.get_title() # "My Song"
score1.add_part(part1)
```
### Harmony generation
```python
from pitchr.harmony_maker import build_harmony
my_melody = Staff(my_measures)
my_harmony = build_harmony(my_melody)

my_harmony.play()
```

## Running all Pitchr tests
```bash
./run_pitchr_tests.sh
```

# Contributing
### Setting up dependencies
* python3.8 is required for pitchr and python3 should link to python3.8 to run the tests
* `ln -s /usr/bin/python3.8 /usr/bin/python3`
* To create the virtual environment, `cd` into the project directory and `python3 -m venv env`
* To install dependencies to the virtual environment, `source env/bin/activate && pip3 install -r requirements.txt`
* Install these dependencies using your local package manager (ex. `sudo apt install python3-dev python3-venv libasound2 libasound2-dev lilypond`):
  * `python3-dev`
  * `python3-venv`
  * `libasound2`
  * `libasound2-dev`
  * `lilypond`

### Working on the project
* Before working, activate the environment by `source env/bin/activate`
* Deactivate by `deactivate`



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/thedpws/pitcher",
    "name": "pitchr",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "Vinicius Martinson, Brian McDowell, Jacob Menke, Aeyzechiah Vasquez, Caleb Wong",
    "author_email": "azvasquez99@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/f6/cf/27b4e827185260b6e9201c969259e472b35af18cdad7b8b15aaec9716821/pitchr-1.1.0.tar.gz",
    "platform": "",
    "description": "# Pitchr\nA python library and framework for composing music.\n[Pitchr on PyPI](https://pypi.org/project/pitchr/)\n\nTargets most Linux environments.\n\n## Features\n\n1. Enables creation of music by composition of music objects (notes, chords, measures, and staffs)\n2. Unified interface for playing any music object (`note.play()`, `staff.play()`)\n3. Unified interface for showing any music object (`note.show()`, `staff.show()`)\n  * Spawns an image of the music object\n4. Unified interface for exporting any music object (`note.save('note.pdf')`, `staff.save('staff.pdf')`)\n5. Flexible manipulation of music\n  * easily access notes by indexing a measure by beat: `note0 = measure[0]`\n  * edit note attributes' pitch via methods `transpose`, `octave_up`, `augment`\n6. Intelligently generates harmonies from your melodies\n6. Finalizes your composition as beautiful standard sheet music\n7. Enables interactive development in Jupyter Notebook\n\n## Installation\nTo install: `pip3 install pitchr`.\nOther dependencies that must be installed (available via your package manager):\n  * libasound2\n  * lilypond\n\nPitchr downloads models to `~/.pitchr/`. Set the `PITCHR_PATH` environment variable to change this behavior.\n\n## Documentation\nDocumentation is hosted on Github Pages [here](https://thedpws.github.io/pitcher/)\n\n\n## Getting Started\n```python\nfrom pitchr import *\n\n# Instantiate notes\nn = Note(pitch='C4', duration=1.0)\n\n# Play them\nn.play()\n\n# Write music\n\nm = Measure([\n    Note('C', 1.0),\n    Note('D', 1.0),\n    Note('E', 1.0),\n    Note('D', 1.0),\n])\n\n# See what you've written\nm.show()\n\n# Export to PDF\nm.save('MySong.pdf')\n```\n## Helper UI\n\nTo access the helper UI, run from the command line: `python3 -m pitchr.helper`\n\n![helper_ui](https://raw.githubusercontent.com/thedpws/pitcher/master/demo/helper_ui.png)\n\n## More Detailed Notes\n\n![flow](https://raw.githubusercontent.com/thedpws/pitcher/master/demo/flow.png)\n\n\n## Note() class\n\n**Init**:\n- `pitch` (`\"C#6\"`)\n- `duration` in beats\n- `dynamic` (piano, forte, crescendo)\n- `articulation` (staccato, accent, fermata)\n\n### Note()\n```python\nfrom pitchr import *\nnote1 = Note(\"C4\", 1, \"forte\")\nnote1.mingus_note # 'C-4'\nnote1.duration # 1\nnote1.dynamic # \"forte\"\nnote1.augment() or note1.diminish()\n```\n\n### Chords\n```python\nnote2. = Note(\"E4\", 1)\nchord1 = Chord([note1, note2])\nchord1.determine() # \"Major third\"\n```\n\n### Measure is a collection of Notes\n```python\nmeasure1 = Measure([note1, note2])\nmeasure1.contains(note1) # True\nmeasure1.append(note3)\n```\n### Staff is a collection of Measures\n\n**Init**:\n- `measures`\n- `clef`\n- `voice`https://thedpws.github.io/pitcher/\n\n```python\nstaff1 = music.Staff(measure1, Clef.TREBLE, Voice.PIANO)\n```\n\n### Part is a collection of Staffs\n```python\npart1 = Part(staff1, tempo, time_signature, key_signature)\npart1.add_staff(staff2)\npart1.time_signature = 3/4\n```\n### Score is a collection of Parts\n```python\nscore1 = Score(\"My Song\", \"Wonderful Subtitle\", \"Author Me\", \"me@email.com\")\nscore1.get_author() # \"Author Me\"\nscore1.get_title() # \"My Song\"\nscore1.add_part(part1)\n```\n### Harmony generation\n```python\nfrom pitchr.harmony_maker import build_harmony\nmy_melody = Staff(my_measures)\nmy_harmony = build_harmony(my_melody)\n\nmy_harmony.play()\n```\n\n## Running all Pitchr tests\n```bash\n./run_pitchr_tests.sh\n```\n\n# Contributing\n### Setting up dependencies\n* python3.8 is required for pitchr and python3 should link to python3.8 to run the tests\n* `ln -s /usr/bin/python3.8 /usr/bin/python3`\n* To create the virtual environment, `cd` into the project directory and `python3 -m venv env`\n* To install dependencies to the virtual environment, `source env/bin/activate && pip3 install -r requirements.txt`\n* Install these dependencies using your local package manager (ex. `sudo apt install python3-dev python3-venv libasound2 libasound2-dev lilypond`):\n  * `python3-dev`\n  * `python3-venv`\n  * `libasound2`\n  * `libasound2-dev`\n  * `lilypond`\n\n### Working on the project\n* Before working, activate the environment by `source env/bin/activate`\n* Deactivate by `deactivate`\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A Python library and framework for composing and playing music.",
    "version": "1.1.0",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "beda688b3afeb84baa0c61616ce5a358",
                "sha256": "e9aaa5be0c3c08260232d67b0bd5f64dff9c77159b5cc7c0349747d7074a5b91"
            },
            "downloads": -1,
            "filename": "pitchr-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "beda688b3afeb84baa0c61616ce5a358",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 49211,
            "upload_time": "2020-08-02T03:28:26",
            "upload_time_iso_8601": "2020-08-02T03:28:26.671038Z",
            "url": "https://files.pythonhosted.org/packages/25/17/9d821e8b966da0188e2cc35012044f4fe190fa2f2a6cd51c73eb01563d26/pitchr-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "bba71949a04c6241a30e3112132ef803",
                "sha256": "fa10faf1b2c26bd7cfd99d994365f393baf839150f7a713d6018d3a96e483c82"
            },
            "downloads": -1,
            "filename": "pitchr-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "bba71949a04c6241a30e3112132ef803",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 30583,
            "upload_time": "2020-08-02T03:28:28",
            "upload_time_iso_8601": "2020-08-02T03:28:28.097408Z",
            "url": "https://files.pythonhosted.org/packages/f6/cf/27b4e827185260b6e9201c969259e472b35af18cdad7b8b15aaec9716821/pitchr-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-08-02 03:28:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "thedpws",
    "error": "Could not fetch GitHub repository",
    "lcname": "pitchr"
}
        
Elapsed time: 0.15055s