Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/reesporte/jc3000
a python package for making music
https://github.com/reesporte/jc3000
music python
Last synced: 3 days ago
JSON representation
a python package for making music
- Host: GitHub
- URL: https://github.com/reesporte/jc3000
- Owner: reesporte
- License: mit
- Created: 2021-01-04T00:43:43.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-09-24T21:29:53.000Z (about 3 years ago)
- Last Synced: 2024-11-14T09:12:15.862Z (5 days ago)
- Topics: music, python
- Language: Python
- Homepage: https://pypi.org/project/jc3000/
- Size: 25.4 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jc3000
A small python package for generating music. Inspired by [this](https://walkerart.org/collections/artworks/wind-chime-after-dream) which was inspired by [this](https://en.wikipedia.org/wiki/John_Cage).You can generate any notes you want based on any [fundamental](https://en.wikipedia.org/wiki/Fundamental_frequency) _(the frequency of concert A in this case, fundamental is used kind of loosely)_. You can also use either just or equal [temperament](https://en.wikipedia.org/wiki/Musical_temperament).
No guarantees things won't break in the future, I'm still tweaking things, but I think the general API should stay fairly consistent.
## Installation
You can install it via pip. It requires numpy. Probably not compatible with python <= 3.6.```
python3 -m pip install jc3000
```## Examples
* Play the licc
```
from jc3000 import Sequences = Sequence(fs=44100, fundamental=440, equal=True)
s.add_note('d', duration=.125)
s.add_note('e', .125)
s.add_note('f', .125)
s.add_note('g', .125)
s.add_note('e', .257) # .257 for ~swing-iness~
s.add_note('c', .125)
s.add_note('d', .25)s.write_file('the_licc.wav')
```* Play the C major scale with concert A set to 432 Hz.
```
from jc3000 import Sequences = Sequence(fundamental=432)
notes = ['cdefgabc']
for i, note in enumerate(notes):
if i < 5:
s.add_note(note)
else:
s.add_note(note, octave=1)
s.write_file('cmajor_432hz.wav')
```## More
Default sample rate is [44,100 Hz](https://en.wikipedia.org/wiki/44,100_Hz#Origin).
Default concert A is [440 Hz](https://en.wikipedia.org/wiki/A440_(pitch_standard)).