/sardine

Python's missing "algorave" module

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Sardine: ✨ Live Coding Library for Python ✨

Python's missing algorave module. Hackable live coding tool for modern Python (3.10+)

Discord | Website | Examples | Installation | Author | About Live Coding


Sardine algorave picture

Sardine is a versatile and hacker-friendly Python library designed for musical improvisation, algorithmic composition, and beyond. It transforms your standard Python interpreter into a powerful music instrument, enabling you to create and map melodic and rhythmic patterns to any electronic instrument (MIDI, OSC, and SuperCollider). With Sardine, you can:

  • Unleash your musical creativity on stage, in the studio, or for personal enjoyment

    • Seamlessly communicate with any MIDI/OSC device and the SuperCollider audio engine using Sardine.
    • Utilize bindings for SuperDirt, a widely recognized synthesis engine embraced by live coders globally.
  • Empower your Python code with time-aware capabilities

    • Employ temporal recursion to make any Python code time and tempo aware.
    • Accurately launch synchronous or asynchronous functions with time-specific results.
    • Customize your own Senders or Receivers to pattern any desired elements!
  • Develop intricate audio/visual installations with MIDI and OSC I/O

    • Assign callbacks to any OSC event, transforming Sardine into a sophisticated reactive toolbox.
    • Monitor changing values and incorporate them into your musical patterns or code.
  • Synchronize with other computers and musical instruments

    • Synchronise your hardware with MIDI Clocks.
    • Synchronize effortlessly with other tools or players using the Link Protocol.

Installation

In order to install Sardine, your system will require a recent version of Python (3.10+). We now support 3.11 versions as well. A more detailed installation guide can be found on Sardine's website. Refer to the website for complete details concerning the installation process.

  1. Run: python -m pip install --find-links https://thegamecracks.github.io/python-rtmidi-wheels/ sardine-system.
    • the --find-links option is used as a temporary fix to the unavailability of some dependencies in the Pypi repositories for Python 3.10/3.11.
  2. Install SuperCollider and SuperDirt for an additional supported audio backend.
  3. Run sardine-config and configure Sardine to your liking following this guide
  4. Install the text editor of your choice: VSCode, Neovim, Vim, Emacs, Jupyter Notebook, etc... There are many options you can pick from. They have all been tested with Sardine.

Contributions

Sardine is in its early stages of development, and we're actively seeking contributors to help enhance the project. If you're passionate about music and technology, we welcome your expertise, whether it's code, documentation, or ideas. We are looking for contributors!

To collaborate with the Sardine community, connect with us on Discord, Github or send a private message if you have specific inquiries. Together, we can create an even more powerful tool for musical expression and creativity!

Experimental Bash Script

In the sardine directory, you will find a script called install_sardine.sh. This script automates the installation process for you. Depending on your platform, follow the instructions below to run the script:

macOS and Linux

  1. Open a terminal and navigate to the sardine directory.
  2. Make the script executable by running: chmod +x install_sardine.sh
  3. Execute the script: ./install_sardine.sh

Windows

The script will taunt you to install most of the dependencies manually. The installation can't really be automated on Windows.

  1. Install Git for Windows if you haven't already.
  2. Open Git Bash and navigate to the sardine directory.
  3. Execute the script: bash install_sardine.sh

The script will try (and fail) to install the required dependencies and set up the environment for you. It will:

  • Install Git, NPM, and Yarn (if not already installed)
  • Install and configure pyenv with Python 3.11 (PyEnv)
  • Install the Sardine package
  • Install SuperCollider and SuperDirt Quarks
  • Please be patient, as this process may take some time.