https://github.com/kyle-west/musickal
A computer generated music engine written in Python
https://github.com/kyle-west/musickal
Last synced: 3 months ago
JSON representation
A computer generated music engine written in Python
- Host: GitHub
- URL: https://github.com/kyle-west/musickal
- Owner: kyle-west
- Created: 2018-10-23T12:35:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-18T02:24:04.000Z (over 6 years ago)
- Last Synced: 2025-01-10T04:24:51.507Z (5 months ago)
- Language: Python
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Setup
Install dependencies:
```sh
brew install portaudio
pip install pyaudio
```# Notes
To install all the notes, it is easiest to include the whole library.
```python
from Musickal import *
```Here is a reference to the notes we allow for (arranged to match the 4th octave
on the piano):
```
Db Eb Gb Ab Bb
C D E F G A B
```Note that half steps are annotated as flats instead of sharps. This is because `#`
is reserved in python for comments, where `b` is simply a letter.To specify an octave of a note, postfix it with the octave number:
```
... Db3 Eb3 Gb3 Ab3 Bb3 Db4 Eb4 Gb4 Ab4 Bb4 ...
C3 D3 E3 F3 G3 A3 B3 C4 D4 E4 F4 G4 A4 B4
```# Play the audio
Here is an example of how to play notes:
```python
from Musickal import *m = Musickal()
duration = .25
m.playSong([
(B, duration),
(A, duration),
(D, duration),
(C, duration),
(A, duration),
(F, duration),
(E, duration)
])
```