Skip to main content

What is it?

PyDrumScore is a Python library for generating drum sheet music through code. It aims to provide a lean interface, relying on core Python features and data types. This allows the user to programatically bypass the relative complexity of modern scoring softwares, whose features often go beyond the scope of what is needed to create drum sheet music.

How does it work?

Two things are needed for the score generator:

  • The score metadata, such as its title, its author, or the year it was created.
  • A list of measures that represent the music being played.

The user's sole responsability is to fill these objects inside a python file. See here a complete example for a classic drum beat.

   """ basic_beat.py """

    # Import pydrumscore
   import pydrumscore as pds

   # Enter relevant metadata
   metadata = pds.Metadata(
         workTitle = "BasicBeat"
      )

   # Measures of the song; fill this!
   measures = []

   # Add a measure
   measures += pds.Measure(
      bd = [1, 3],  # Bass drum on 1 and 3
      sd = [2, 4],  # Snare on 2 and 4
      hh = pds.note_range(1, pds.end(), 1/2)  # Hi-hat from 1 to measure end,
                                        # each lasting half a beat
      )

Afterwards, simply call the exporter with:

pydrumscore basic_beat

The song module will be imported, and the contents of the metadata and measures objects will be converted to an uncompressed MuseScore file under the title BasicBeat.mscx. That's it! You can now open this file in MuseScore, from which you can review the results and export to a PDF file. Support for the MusicXML format is planned.

Installation

Using pip (recommended)

PyDrumScore is distributed as a pure Python package, in the form of a wheel distribution hosted on PyPI. It can thus be downloaded with pip, by simply executing in your Python environment:

pip install pydrumscore

This will install PyDrumScore and all its dependencies in your active Python environment. Note that it is good practice to use virtual environments when installing packages; see this guide for a good primer on the concept.

Manual install

It is possible to download the package content by hand through the project page. The .whl distribution, which is a zip file, can then be uncompressed and added to the environment. Note, however, that this does not handle the package dependencies like pip would; you will need to install them individually in your environment as well.

MuseScore plugin

The PyDrumScore package also contains a plugin for MuseScore to refresh modified files with a single button. This allows for a proper workflow for using MuseScore as a viewer to PyDrumScore. To set it up, see the tutorial on MuseScore's page. Make sure the plugin is added to your MuseScore plugins folder, and that it is enabled and has a shortcut.

Tutorials and examples

See the test folder for examples of fully transcribed songs. Stay tuned for upcoming video tutorials as well.

Release files for pydrumscore 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydrumscore 0.0.6
File Size Uploaded
pydrumscore-0.0.6.tar.gz 617.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pydrumscore 0.0.6
File Interpreter ABI Platform
pydrumscore-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size:714.5 kB

Release files / pydrumscore-0.0.6.tar.gz

Download URL pydrumscore-0.0.6.tar.gz
Size 617.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8df5ce5709d7b5315b4f659043c0ff09d649fd171ebd05103209bfdc9c8924e9
BLAKE2b-256 checksum
How to use checksums
b765b07b4e7f40dc20227febddb48522d0c1f75d3e9cebf7e42d9c604b164ebd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release files / pydrumscore-0.0.6-py3-none-any.whl

Download URL pydrumscore-0.0.6-py3-none-any.whl
Size 96.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
28f5f165db2a6357b0310ce19f54380babab414d654f2c6cc2e16ccfe9befb39
BLAKE2b-256 checksum
How to use checksums
9b2a05f089e0b7632c274f6696956b43e3467182b16e6ed8062b8f51d0793b4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page