Glorified Metronome
Project description
python-music-drummer
Glorified Metronome
The methods of this package depend upon music21.
SYNOPSIS
from music_drummer import Drummer
from music21 import instrument
d = Drummer()
d.set_instrument('kick', 36) # change the kick patch from 35
d.set_instrument('snare', 40) # change the snare patch from 38
d.set_bpm(99) # change the beats per minute from 120
d.set_ts('5/8') # change the time signature from 4/4
d.count_in(2) # count-in on the hi-hats for 2 measures
# add a eighth-note snare flam to the score
d.note('snare', duration=1/2, flam=1/16)
d.rest('kick', duration=1/2)
d.rest('hihat', duration=1/2)
# add a 5-note snare roll for an eighth-note, increasing in volume
d.roll('snare', duration=1/2, subdivisions=5, crescendo=[100, 127])
d.rest('kick', duration=1/2)
d.rest('hihat', duration=1/2)
# add a crash
d.set_instrument('crash', 49, obj=instrument.CrashCymbals())
# crash and kick!
d.note('kick', duration=1/2)
d.note('crash', duration=1/2)
d.rest('snare', duration=1/2)
d.rest('hihat', duration=1/2)
# add an eighth-note phrase of 3 parts, to the score
for _ in range(4):
d.pattern(
patterns={ 'kick': '1000000010', 'snare': '0000001000', 'hihat': '1111111111' },
duration=1/2
)
d.sync_parts() # make the parts play simultaneously
d.score.show() # or text, midi, etc. see music21 docs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
music_drummer-0.1.8.tar.gz
(54.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file music_drummer-0.1.8.tar.gz.
File metadata
- Download URL: music_drummer-0.1.8.tar.gz
- Upload date:
- Size: 54.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70467e938a5da55f72b16530b4bc930d36bc757909e47beb644fbb677fa4c99a
|
|
| MD5 |
08da41dfcadcb49ec452cc03c4a159a9
|
|
| BLAKE2b-256 |
43bb3e96b7b09d626ac14096715985a1913f6b8a17f62f0b05f7578d38a9b021
|
File details
Details for the file music_drummer-0.1.8-py3-none-any.whl.
File metadata
- Download URL: music_drummer-0.1.8-py3-none-any.whl
- Upload date:
- Size: 45.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ca66ac71e4b2580a07d96b8e177154b5de7b2d53cd1105c3c6a49888424d9f5
|
|
| MD5 |
57996955d1a73ef7e4477be52c259ecd
|
|
| BLAKE2b-256 |
eb6e414586b92af6b227bd77b02e35b8b6038f3da07a34364cce54c11931f7f3
|