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.3a5.tar.gz (215.6 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pydrumscore-0.0.3a5.tar.gz
  • Upload date:
  • Size: 215.6 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.3a5.tar.gz
Algorithm Hash digest
SHA256 24a22bb5759d51ace379178781baaa1c1f24991fe495fa1b4d35b195de027f55
MD5 55cedf2e65ca7f970c7cd55fc483a272
BLAKE2b-256 757b9f5402b2551616028f20aaf42d81f3705102284e9bfe1644e0821ec5cd6b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pydrumscore-0.0.3a5-py3-none-any.whl
Algorithm Hash digest
SHA256 b62fb4ea5f87b98634a162a3b127f7ff0213ef74b26930e94cc5256f827c61b1
MD5 5bf6207748e358b3903b84606b054cf9
BLAKE2b-256 015373422b19c1f1c16bf64314b5db48dd197717fd675455206eb7648a46a54d

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