Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

amusing

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amusing

animated sheet music using MuseScore

  • 0.1.1
  • PyPI
  • Socket score

Maintainers
1

aMusing v0.1.1

  • Installation
  • Introduction
  • Example Code
  • Inspiration
  • Examples

Installation

pip install amusing

Introduction

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

Score

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

Munim

  • spectogram.py
    • STFT
      • linear spectrum
    • Morlet (DWT)
      • logarithmic spectrum
  • oscilloscope.py
    • 2D Oscilloscope

Example Code

Score

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

from amusing.score.animate import Amusing, Note


if __name__ == '__main__':
    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.spectogram 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.spectogram 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.oscilloscope import Oscilloscope

oscilloscope = Oscilloscope(fps, width)
oscilloscope.read_audio(AUDIO_FILEPATH)
oscilloscope.render_video(TO_VIDEO_FILEPATH)

Inspiration

Chopin Prelude 16 ANIMATED

Examples

Chopin op. 25 no. 11

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc