Programmatically generate Lilypond scores, with ease and elegance of pure Python
Project description
Lento (current release: v301024) is a highly minimalist Python package (the entire API consists of a single class Part
and a main processor function proc
!) for compiling Lilypond sheet music.
For more information and examples please check the Documentation.
Some Coding Tips
Convert a collection of durations into a progressing beats collection by utilizing itertools.accumulate
:
from random import choice
from itertools import accumulate
durs = [choice([.25, .5, .75, 1]) for _ in range(4)]
beats = list(accumulate(durs, initial=0))
print("Durations", durs)
print("Beats", beats)
# Durations: [0.25, 0.5, 0.5, 0.75]
# Beats: [0, 0.25, 0.75, 1.25, 2.0]
Contributing
If you wish to contribute your code to this repository, please consider the following points:
- Packaging
-
Ensure to update the
src/lento/version.py
file and runpython prebuild.py
(and push the changes!) before initiating the build-upload process for each release with:python -m build && twine upload dist/*
-
This README is generated by prebuild.py
. Never edit it directly by hand! Instead, modify the readme
variable in the
pre-build file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.