Skip to main content

markovmusic

What is it?

Using markovmusic, you can make a Markov chain generate music using patterns learned from your own MIDI files.

Minimal use

  • Install this package
pip install markovmusic
  • Instantiate a composer
from markovmusic import MarkovComposer

model = MarkovComposer()
  • Specify a a MIDI file to train the composer on
model.fit("allmanbros/jessica.mid")
  • Compose and play new music
model.compose()

Advanced features

Usage of the following advanced features is in the docstrings for the following methods of MarkovComposer:

  • fit(): you can specify:
    • how many previous chords you want the composer to learn to use to predict the next chord (look_back)
    • whether to play the music while training or not (play)
  • compose(): you can specify:
    • how long the generated music should be (piece_length)
    • how creative or restrictive you want the generated music to be (temperature)
    • whether to play the music while generating or not (play)
    • a path to save the music as a WAV file (wav_path)
  • save_chain(): save a trained composer to disk
  • load_chain(): load a saved composer from disk

Metadata

Release files for markovmusic 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for markovmusic 0.1.0
File Size Uploaded Provenance
markovmusic-0.1.0.tar.gz 5.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for markovmusic 0.1.0
File Interpreter ABI Platform
markovmusic-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.1 kB

Release files / markovmusic-0.1.0.tar.gz

Download URL markovmusic-0.1.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6ad4b8bbd7296238e23569efebcff6709ed3ab5a89355317655bbf8cee7f091f
BLAKE2b-256 checksum
How to use checksums
9a87381e1c7c04771b34e4c98eeb6981932c60aac25532e3f2a4fe09d3656dd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.5

Release files / markovmusic-0.1.0-py3-none-any.whl

Download URL markovmusic-0.1.0-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
137823e43e9e2ef9116652b0d47295135d5a18ff035f439d30bc794b8a5ebe82
BLAKE2b-256 checksum
How to use checksums
552eced4669a5ab742c32d53a8b43984d2417f31720ab7f70fc67b31c888aaf8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.5

Security for markovmusic 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page