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.5.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.5-py3-none-any.whl (45.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: music_drummer-0.1.5.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.5.tar.gz
Algorithm Hash digest
SHA256 35b195da243ade0fd861b7a75503deaf9e5faa31fa92de800a233ce083325785
MD5 4cb45fde53fe9d3b40f78f26a3b04f06
BLAKE2b-256 72b09f03c6e3ec28dd790a113abf021ca3053cb9b33bf559664f4ab2586cc7c2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: music_drummer-0.1.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 cf57c06600fee734067475f2cd9f7be63a38e4fd90f2b2f5713e80c9985fd40c
MD5 669750220d7aaf71a52745550345039b
BLAKE2b-256 272f29874d4a20ee504ae60a974976e7a67416d8e238b648e6dea62ee698ed8e

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