c64cryptoboy / ChiptuneSAK

A pipeline for processing music and creating output for various constrained playback environments
MIT License
19 stars 1 forks source link

ChiptuneSAK

logo

ChiptuneSAK (Swiss Army Knife) is a generalized pipeline for processing music note data and targeting various constrained playback environments.

ChiptuneSAK can import music from many formats and converts it to a common representation called chirp (CHiptunesak Intermediate RePresentation). Chirp can be processed and transformed in many ways, and then exported to various playback formats and environments.

ChiptuneSAK documention is on readthedocs.io

Background

In the past, we've written a number of one-off note data processing tools for previous projects (e.g. the ten-Commodore Orchestrion, an Unknown Realm Bard midi->ml64 importer, etc.). And with more similar projects on the way, it became apparent that there were opportunities to introduce generality and reusability into our processing pipelines. Therefore, our separate efforts have been redirected into this library. Its workflow is inspired by the LLVM compiler framework, which accepts many programming languages, "raises" them to a common intermediate format that can be manipulated, then "lowers" the code to many target platforms.

Team

Project Status

The code is currently in an alpha state. Fundamental data representations have mostly stabilized. We are currently working on a variety of concrete importers and exporters from which to continue to generalize the processing pipeline. These importers and exporters include:

Music importers

Importers: under development

Importers: proposed

ChIRp processing / transformations

ChIRp processing: under development

ChIRp processing: proposed

Music exporters

Exporters: Under development

Exporters: Proposed

Requirements/Building

Bootstrap: Ubuntu 20.04

# Install system dependencies
sudo apt install lilypond python3-venv build-essential

# Convenience Make target for setting things up
make venv
source venv/bin/activate

## Or if you prefer setting things up manually, you might do something like:

# Make and activate a Python virtual environment
python3 -m venv venv
source venv/bin/activate

# Install Python development dependencies
pip3 install -r requirements.txt

# Install ChiptuneSAK in editable mode
pip3 install --editable .

# Run the unittests to make sure things are working as expected
python3 -m unittest discover -p "*Test.py"

Bootstrap: Windows 10

The following instructions make the following assumptions:

# If PowerShell, run as Admin:

# Set Powershell Execution Policy to all running local scripts:
Set-ExecutionPolicy RemoteSigned
# Answer "[A] Yes to All" when prompted
# Compare your Python version to what was used writing this README
python --version  # Python 3.8.3

# Create a Python virtual environment (EXPLICITLY use `python` instead of `python3`)
python -m venv venv
.\venv\Scripts\Activate

# Install requirements in to virtualenv
pip install -r .\requirements.txt

# Install ChiptuneSAK in editable mode
pip install --editable .

# Run the unittests to make sure things are working as expected
tests\testall.bat

Generating Documentation

from docs folder:

make html

Running Tests

from the root folder, download the test data:

python3 res/downloadTestResources.py

from test folder:

python3 -m unittest discover -p "*Test.py" -v

or for an individual test:

python3 -m unittest chirpTest.py

Run a simple example

from examples/ folder:

python3 lechuck.py