Skip to main content

animating sheet music

Project description

aMusing

Installation

pip install amusing

Example Code

Score

Get the individual frames of the score into output directory outdir:

from amusing.score import Amusing, Note

WIDTH_IN_PIXELS: int = 1820
NUMBER_OF_THREADS: int = 8

MUSESCORE_FILEPATH: str = 'score.mscx'

QUINTUPLET: float = 4/5

amusing = Amusing(width=WIDTH_IN_PIXELS,
                  outdir='frames',
                  threads=NUMBER_OF_THREADS)
amusing.read_score(MUSESCORE_FILEPATH)
amusing.add_job(measures=1,
                subdivision=Note.n16th)
amusing.add_job(measures=[2, 3],
                subdivision=Note.QUARTER * Note.TRIPLET)
amusing.add_job(measures=range(4, 7),
                subdivision=Note.EIGHTH * QUINTUPLET)
amusing.generate_frames()

Delete all jobs:

amusing.delete_jobs()

Munim

Music Animation

Render video of the frequency spectrum using Morlet wavelet

from amusing.munim import Morlet

AUDIO_FILEPATH: str = 'example.mp3'
TO_VIDEO_FILEPATH: str = 'example.mp4'

morlet = Morlet(fps, width, height)
morlet.read_audio(AUDIO_FILEPATH)
morlet.transform()
morlet.render_video(TO_VIDEO_FILEPATH)

Using Short-time Fourier Transform (STFT)

from amusing.munim import STFT

morlet = STFT(fps, width, height)
morlet.read_audio(AUDIO_FILEPATH)
morlet.transform()
morlet.render_video(TO_VIDEO_FILEPATH)

2d-Oscilloscope:

from amusing.munim import Oscillate

oscillate = Oscillate(fps, width)
oscillate.read_audio(AUDIO_FILEPATH)
oscillate.render_video(TO_VIDEO_FILEPATH)

Introduction

  • programmatic animation of sheet music
    • notes appearing consecutively
    • uses MuseScore as notation software

Animation

Score

  • generates full resolution frames of the video
  • not synchronized to audio

Munim

  • audio visualization
    • STFT
      • linear spectrum
    • Morlet (DWT)
      • arbitrary spectrum
      • implemented logarithmic
    • 2D Oscilloscope

ToDo

  • increase efficiency of making the score
  • programmatically combine frames to high quality video
    • automatic synchronization to audio
      • DWT where Wavelet function is a sample of the instrument sound
      • Deconvolution of overtones
  • add background interest

Inspiration

Chopin Prelude 16 ANIMATED

Examples

Chopin op. 25 no. 11

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

amusing-0.0.3.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

amusing-0.0.3-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for amusing-0.0.3.tar.gz
Algorithm Hash digest
SHA256 6c831a7270dd74c5990e6c8494b382304591f53c748f3c046c38c837c2a3e1fc
MD5 67c69f9d453dadc3f22cf2cc20a143e5
BLAKE2b-256 6716e3ac8e40927b92d38d28d90b76accdb273de277781ee5f2b75ce20b92e14

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for amusing-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bbd5adfc1f1b40a5993408fe9bae3d8e7b1b157541f905f444565ae677347c73
MD5 79ccd07978db61e5d55ad6efef5d8aae
BLAKE2b-256 e1c22faf6706c0603811e720ba97bd1b8adfe3ec0c8c8875e45239822eff5f21

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