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

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.6.tar.gz (617.9 kB view details)

Uploaded Source

Built Distribution

pydrumscore-0.0.6-py3-none-any.whl (96.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pydrumscore-0.0.6.tar.gz
  • Upload date:
  • Size: 617.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pydrumscore-0.0.6.tar.gz
Algorithm Hash digest
SHA256 8df5ce5709d7b5315b4f659043c0ff09d649fd171ebd05103209bfdc9c8924e9
MD5 dd91af4e87b375c01f4970e04e44384a
BLAKE2b-256 b765b07b4e7f40dc20227febddb48522d0c1f75d3e9cebf7e42d9c604b164ebd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pydrumscore-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 96.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pydrumscore-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 28f5f165db2a6357b0310ce19f54380babab414d654f2c6cc2e16ccfe9befb39
MD5 3fae3f89b8b707ee0646440e0482cd16
BLAKE2b-256 9b2a05f089e0b7632c274f6696956b43e3467182b16e6ed8062b8f51d0793b4e

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