Skip to main content

Glorified Metronome

Project description

python-music-drummer

Glorified Metronome

SYNOPSIS

from music_drummer.music_drummer import Drummer

d = Drummer()

d.instruments['kick']['num'] = 36 # change the kick patch
d.instruments['snare']['num'] = 40 # change the snare patch

d.set_bpm(99) # change the beats per minute from 120

d.set_ts('5/8') # change the time sigature 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(d.instruments['snare']['num'], dur=1/2, flam=1/16, part=d.snare)

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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: music_drummer-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 cbfc047a9c71961b4d63f8a13baa1e7e9521f84411ffae396a652bbdb52b857a
MD5 9ff01b4228eb5eb5a6c1d9e730e437bb
BLAKE2b-256 079119200aecdac3b756832e928ceb7f90d517b29477f9c9946a4c55d72bf03e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: music_drummer-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 24bb6acd1ccd37156bbda2cc2a76246206727e7a73f73c7e2c06cf37211fd061
MD5 4573b84c5367b2c0e2c8665e1e4edaca
BLAKE2b-256 aacceae9e6ecda249c30e0e19237f5ff9a879820f45e40370cdb008182c4d455

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