Algorithmic Composition Utilities
The aim of the Dolce package is to provide a higher level, musically more expressive and abstract set of routines. It is meant to make expressing algorithmic music more intuitive and easy, by taking care of low-level MIDI implementation so that the composer can focus on his composition rather than following midi messages. This package is a work-in-progress and in active development. Your feedback is very welcome! :-)
Install
Run the command pip install dolce to install Dolce from Pypi.
Quick Start
# import the module
>>> import dolce
# First initialize the module,
>>> dolce.realtime.init()
# create a single note,
>>> c4 = dolce.make_note("c4")
# and put it in a list and send it to the processor to play it.
>>> dolce.proc([c4])
# Let us now define a second note with the key number 72, and specify it's starting time (onset) to be 1 second after the processor starts.
>>> c5 = dolce.make_note(pch=72, onset=1)
>>> dolce.proc([c4, c5])
# You should have heared both notes, played after each other.
# The full signature of the note function has the parameters:
# pch: the name of the note (a string) or the midi key number
# onset: is the ongoing time expressed in seconds, with respect to the process start time 0 (default is 0, which means now)
# dur: the duration of the note
# chnl: the midi channel to play the note on
# vel: the dynamic of the note
# Now we want to create an A minor chord with a duration of 2 seconds,
# and play it 1/2 second after the processor starts,
>>> a_min = dolce.make_chord(pchs=(69, 72, 76), onset=.5, dur=2)
# and send it to the processor to play it.
>>> dolce.proc([a_min])
# Let us now give the processor a list of notes/chords to play:
# the chromatic scale starting from the middle c upwards.
>>> voice1 = [dolce.make_note(pch=60+i, onset=i, dur=0.5) for i in range(12)]
>>> dolce.proc([voice1])
# Playing polyphony is as easy as passing multiple lists of note/chords
# to the processor:
>>> voice2 = [dolce.make_note(pch=48+i, onset=i+0.5, dur=0.5) for i in range(12)]
>>> voice3 = [dolce.make_chord(pchs=[60+i, 60+i+4, 60+i+7], onset=i+0.2, dur=0.5) for i in range(12)]
>>> dolce.proc([voice1, voice2, voice3])
# If you want to write a midi file to the disk instead of playing it back
# pass a path string as the second argument to the processor
>>> dolce.proc([voice1, voice2, voice3], "/tmp/dolce.mid")
Building a PyPI Release:
- Update the version in
src/dolce/version.py - Update the version in
pyproject.toml - List new changes in the
changelog.mdfile - Commit & push:
- Commit updates to main
- Push main to origin
- Tag the main branch with
git tag -a "vddmmyy" - Push tag with
git push --tags origin
- Run the build script
Metadata
Release files for dolce 151024
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| dolce-151024.tar.gz | 49.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dolce-151024-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 87.9 kB
Release files / dolce-151024.tar.gz
| Download URL | dolce-151024.tar.gz |
|---|---|
| Size | 49.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
55b231b7ae08cfa25c601ebcaa1802f71cea07afec2a613a998020f0f12e0137
|
|
BLAKE2b-256 checksum How to use checksums |
98f901d45ae9b5786330bc9d8241391f594b6b2704451455a9b9c888cd660ebf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Release files / dolce-151024-py3-none-any.whl
| Download URL | dolce-151024-py3-none-any.whl |
|---|---|
| Size | 38.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8bba6845479bfd8838a42ae0167230fbda36ec966c5e4bb76abeca4aa6c79d3a
|
|
BLAKE2b-256 checksum How to use checksums |
2a1534459dbd0607118682c4ee64b9c45535537b9fae802746ea2ea490bae738
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Security for dolce 151024
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.