Skip to main content

Tools for image based digitization of historical music storage media

Project description

HMSM-Tools

This python package contains tool for the digitization and analysis of Historical Musical Storage Media. This python package is the software implementation for the digitization part of the BMBF funded research project DISKOS at the Research Center Digital Organology at Leipzig University.

Installation

To install from PyPI use:

pip install hmsm

To install the development version directly from Github you can use pip like so:

pip install git+https://github.com/digital-organology/hmsm.git

For additional installation information see INSTALL.md.

Usage

Piano Roll Digitization

We support digitization for a number of formats of piano rolls out of the box, for an overview see FORMATS.md. If you miss support for a format of interest for you, we provide tooling to help you create configuration information for that format. For additional information on this, see CONFIG.md.

The program generally expects roll scans to be taken against a black or white background. If not specified using the --background parameter the color will be extrapolated from the provided image. The roll scan is also expected to be somewhat straight, with a slight curvature beeing compensated for automatically.

To process a roll, use the provided roll2midi utility, like so:

roll2midi -c animatic -t 60 hupfeld_animatic_roll.tif out.mid 

This will:

  • -c animatic use the animatic profile bundled with the application. You may also pass the path to a json file containing a custom configuration or even a raw json string here.
  • -t 60 set the roll speed to 60. The unit is feet-per-minute times 10, which is the unit annotated on (most) rolls. This means the roll will effectively be processed as if it were played back at 6 feet per minute.
  • hupfeld_animatic_roll.tif read the roll scan from this file
  • out.mid write the generated midi file here

For more inforamtion on the command line interface for roll digitization pass the -h or --help parameter:

roll2midi --help

Cardboard Disc Digitization

We currently support Image-to-Midi transformation for Ariston brand cardboard discs with 24 tracks. We expect our process to work for all types of discs that encode information in the same general way.

We used images that are overexposed and have the start position of the disc aligned to 0 Degrees. Example images are included in our GitHub repository. You may need to preproces your image using you favorite image processing software. Currently this may require addition preprocessing. Be sure to pass the rotation of the start position of the disc using the --offset parameter.

To digitize the example image included in this repository call the included command line utility, like so:

disc2midi -c ariston -m cluster assets/5070081_22.JPG out.mid

Midi to Disc Transformation

Included in this package is functionality to create images of cardboard discs from midi files. We currently include a profile for the Ariston 24 type of disc, though it should be relatively trivial to add support other types of discs. You can test this with any midi file of your choosing, any notes that are not contained in the given format will be dropped automatically.

midi2disc -t ariston_24 -s 4000 -n "Title can have<br>multiple lines" input.mid output.png

Though this is not a core feature of our application we used midis generated from original discs to verify that the results are close to the original media.

Disc to Roll Image Transformer

We also include a utility to transform circular media into a rectangular representation (similar to piano rolls). This can be useful if you prefer to use an existing digitization solution for piano rolls for the image to midi transformation process. It should generally work with all circular media types as long as there is sufficient contrast between background and medium for the algorithm to detect the edge of the medium correctly. To transform the included color photography of the same disc as used above run:

disc2roll --offset 92 assets/5070081_11.JPG roll.JPG

License

We provide this software under the GNU-GPL (Version 3-or-later, at your discretion).

The photographs included in this repository (located unter assets/) are taken from our research platform MusiXplora and are generally provided under a CC BY-SA 4.0 License unless otherwise specified.

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

hmsm-0.9.0.tar.gz (67.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

hmsm-0.9.0-py3-none-any.whl (72.3 kB view details)

Uploaded Python 3

hmsm-0.9.0-1-py3-none-any.whl (72.3 kB view details)

Uploaded Python 3

File details

Details for the file hmsm-0.9.0.tar.gz.

File metadata

  • Download URL: hmsm-0.9.0.tar.gz
  • Upload date:
  • Size: 67.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for hmsm-0.9.0.tar.gz
Algorithm Hash digest
SHA256 b7af3f1ba6b756b160f176632d7cb915c93cb7e7b6938e71f70d6264f503cc5b
MD5 387b548ae9dfdbb8e931d70de24b4b9c
BLAKE2b-256 dd13a7e962eee3686e95e575e1328e4e0a8b8ba37f8cd4bb021a55708dd64501

See more details on using hashes here.

File details

Details for the file hmsm-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: hmsm-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 72.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for hmsm-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d9be49044f15e2de927c9e4b63184b4bc36e03a893fda4f3ea9e9b6c180f1312
MD5 161c7c9a8797fe61c87bea17442a3f22
BLAKE2b-256 e5f0c484f4a814073c1e9c218aae7a83cc42ffd52e5c335d6b0ca27579a2ed25

See more details on using hashes here.

File details

Details for the file hmsm-0.9.0-1-py3-none-any.whl.

File metadata

  • Download URL: hmsm-0.9.0-1-py3-none-any.whl
  • Upload date:
  • Size: 72.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for hmsm-0.9.0-1-py3-none-any.whl
Algorithm Hash digest
SHA256 e6f1be59a4bfb7c6069e317627a2fdac0855e2419eb7c3b885f965515a032bfb
MD5 7c031940c6135227f457de747ee9f66c
BLAKE2b-256 acaeea71ea9150fa9976caedf8749dcab4b2dd108549835c75f3f21c34892443

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