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 64th-note flam to the score
d.note('snare', duration=1/2, flam=1/16, part=d.snare)
d.rest(duration=1/2, part=d.kick)
d.rest(duration=1/2, part=d.hihat)

# add a roll of 5 notes for an eighth-note, increasing in volume
d.roll(duration=1/2, subdivisions=5, crescendo=[100, 127])
d.rest(duration=1/2, part=d.kick)
d.rest(duration=1/2, part=d.hihat)

# 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.6.tar.gz (54.3 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.6-py3-none-any.whl (45.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: music_drummer-0.1.6.tar.gz
  • Upload date:
  • Size: 54.3 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.6.tar.gz
Algorithm Hash digest
SHA256 92454b8f8dc4102828077edfbbf180dca8f1e8044d07016d79af7812858ce1d3
MD5 332c611b1468273fc0ac0cd72942d40e
BLAKE2b-256 aa720ab9488f715626315dd2a08652726a9f7c2cf67f50e4e22d2b1cd1d90afc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: music_drummer-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 45.8 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 aba6c884d2c50c1e2fc32d1871d554ffe706006bf298fe3425c234b4a214dfaf
MD5 c5e72f95ee18d5f13a0ed76e71d0355b
BLAKE2b-256 440b899f4710cabed9b8684116b78b237622ad3c2b49a8fda2eb1a9799437374

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