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'


amusing = Amusing(width=WIDTH_IN_PIXELS,
                  outdir='frames',
                  threads=NUMBER_OF_THREADS)
amusing.read_score(MUSESCORE_FILEPATH)
amusing.add_job(measures=1,
                subdivision=Note(16))
amusing.add_job(measures=[2, 3],
                subdivision=Note(4).triplet())
amusing.add_job(measures=range(4, 7),
                subdivision=Note(8).n_tuplet(5, 4))
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.4.tar.gz (17.0 kB view hashes)

Uploaded Source

Built Distribution

amusing-0.0.4-py3-none-any.whl (18.3 kB view hashes)

Uploaded Python 3

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