Skip to main content

A python interface for generating drum sheet music through code

Project description

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 modify these objects inside a python file. They are free to use all the power of Python to do so. See here a complete example for a classic drum beat.

   """ basic_beat.py """

    # Import pydrumscore
   import pydrumscore.core.song 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, END, 1/2)  # Hi-hat from 1 to measure end,
                                        # each lasting half a beat
      )

Afterwards, simply call the exporter with:

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

Installation

Using pip

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.

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

pydrumscore-0.0.3.tar.gz (217.4 kB view details)

Uploaded Source

Built Distribution

pydrumscore-0.0.3-py3-none-any.whl (83.2 kB view details)

Uploaded Python 3

File details

Details for the file pydrumscore-0.0.3.tar.gz.

File metadata

  • Download URL: pydrumscore-0.0.3.tar.gz
  • Upload date:
  • Size: 217.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for pydrumscore-0.0.3.tar.gz
Algorithm Hash digest
SHA256 315089855a692f7d59e3243d9de1b6f9b122a52e73ef8431d4be078e017676d4
MD5 c9e25df7975988ddc35572ccddade806
BLAKE2b-256 a50d1d36d13136fb4193dc36bce5cb91e1dee1dce5f5b8d186506ed4237d3f25

See more details on using hashes here.

File details

Details for the file pydrumscore-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: pydrumscore-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 83.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for pydrumscore-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 203d3105694cbe6ed86113dc6d88b5531a0222da6b26e178894f8856efabe5d5
MD5 4d3e4e1317e3852506efb042bfc2bbe9
BLAKE2b-256 8f352bec3c816c39f462dfda60d564ea107d70fc24367c18f5f8b1b18cd23311

See more details on using hashes here.

Supported by

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