animated sheet music using MuseScore
Project description
aMusing v0.1.1
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
- STFT
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)
from amusing.munim.oscilloscope import Oscilloscope
oscilloscope = Oscilloscope(fps, width)
oscilloscope.read_audio(AUDIO_FILEPATH)
oscilloscope.render_video(TO_VIDEO_FILEPATH)
Inspiration
Examples
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.1.1.tar.gz
(14.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
amusing-0.1.1-py3-none-any.whl
(15.5 kB
view details)
File details
Details for the file amusing-0.1.1.tar.gz.
File metadata
- Download URL: amusing-0.1.1.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b12a32737a80034f4cb32b409526f4704dec176da654f126ccf6641639bd883
|
|
| MD5 |
f5501019bac52a9722b7a2d0f00f1e4f
|
|
| BLAKE2b-256 |
96b8e2fc82745f29707da182b61de400213271bebbf837c6d4e0361d85da9e9f
|
File details
Details for the file amusing-0.1.1-py3-none-any.whl.
File metadata
- Download URL: amusing-0.1.1-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
281b977d5681792a7a70ff8f5348e0f32c5bd9357afaa692ab685d080e9bd6ba
|
|
| MD5 |
26f0a89b8f261574005e0481beee1694
|
|
| BLAKE2b-256 |
fba0cbace4880ebcd185d8eae75b325194146cf55d5bb1107b304e70816dc388
|