Skip to main content

Glorified Metronome

Project description

python-music-drummer

Glorified Metronome

SYNOPSIS

from music_drummer import Drummer

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 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


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.7.tar.gz (54.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

music_drummer-0.1.7-py3-none-any.whl (45.7 kB view details)

Uploaded Python 3

File details

Details for the file music_drummer-0.1.7.tar.gz.

File metadata

  • Download URL: music_drummer-0.1.7.tar.gz
  • Upload date:
  • Size: 54.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for music_drummer-0.1.7.tar.gz
Algorithm Hash digest
SHA256 7607b8d1c667a534e54eb2d399c64e7d0ce2cde24da8d1d1750d536a3c2ecfc0
MD5 9a3aa42fdd2c33dc1731037d3fa7314f
BLAKE2b-256 fbd3939c3fe99d9af9681bfa07118fedf4fe15d1a15c58106e53ba22e16b7d15

See more details on using hashes here.

File details

Details for the file music_drummer-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: music_drummer-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 45.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for music_drummer-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d3bd6e7952de081a300632f4543f9979ce033cc2eecd0cd876c2f576fc600b6d
MD5 b6be660084aec6971dc9b84d267c247c
BLAKE2b-256 82897f4ec451337235c156b9d8c6c743bf97d2a9ad0c1852c9727da26b8811ec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page