Skip to main content

Implement your music models and algorithms directly in TuneFlow - The next-gen DAW for the AI era

Project description

tuneflow-devkit-py

Python DevKit for TuneFlow

Requirements

Python >= 3.7

Installation

pip install tuneflow-devkit-py

Note: You may need to make sure the version of tuneflow-py is compatible with the tuneflow-devkit-py you are using. To do that, check the requirements.txt in tuneflow-devkit-py and see if its tuneflow-py is set to the same version as your tuneflow-py.

Run a Python TuneFlow Plugin With tuneflow-devkit-py

To run a plugin locally, we need to create a debug server that hosts the plugin and talks to TuneFlow. Let's call it debug.py, which is as simple as 3 lines of code (see debug.py for an example):

# debug.py

from your_plugin_path import YourPlugin
from tuneflow_devkit import Debugger

if __name__ == "__main__":
    Debugger(plugin_class=YourPlugin).start()

To use it, simply run:

python debug.py

The plugin will then be loaded into a local debug server that talks to TuneFlow Desktop.

Next, start TuneFlow Desktop and run the Plugin Development plugin.

You will see the plugin loaded into TuneFlow Desktop in debug mode.

How to run the plugin in TuneFlow Desktop

Run the loaded plugin in TuneFlow Desktop, you will be able to see your python plugin executed.

Examples

The easiest way to learn how to write plugins is through examples. To view all example projects, check out https://github.com/tuneflow/tuneflow-py-demos.

Debug Your Plugin

When developing our plugin, we need to set breakpoints and watch variables as we execute the plugin. The setup varies with different IDEs, we'll use VSCode as an example below.

First create a debug config in .vscode/launch.json under your working directory, and fill it with something like below:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Python: Current File",
      "type": "python",
      "request": "launch",
      "program": "${file}",
      "console": "integratedTerminal",
      "justMyCode": true,
      "env": {
        "PYTHONPATH": "<your python path here>"
      }
    }
  ]
}

Next, in our plugin-related files, we need to set the breakpoints by clicking the space next to the line number:

Set breakpoints

Finally, open the debug entry file debug.py. In VSCode debug panel, set debug target to Python: Current File and click the start button.

Start debugging

Now, when you run the plugin, you will be able to stop at breakpoints and view your variables.

View debug information

Note: For more information on how to debug python code in VSCode, see https://code.visualstudio.com/docs/python/debugging

Making code changes when debugging your plugin

When you change your plugin code, you will need to exit the devkit and restart it. Please note that you need to exit the "Plugin Development" plugin in TuneFlow when you exit the devkit, so that the next time you start the devkit, "Plugin Development" plugin can be initialized correctly.

Contributing

Read Contributing

Resources

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tuneflow-devkit-py-0.1.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tuneflow_devkit_py-0.1.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file tuneflow-devkit-py-0.1.0.tar.gz.

File metadata

  • Download URL: tuneflow-devkit-py-0.1.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for tuneflow-devkit-py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 85673502ca7330b1dcee4f25c1ba3dc222cdb92cda8b00a8b9dc83f5da2c185c
MD5 9e63fd4978407f0c5c34412d758ec68b
BLAKE2b-256 110905c54e8d2eb3dd65dbff40283961010ded9aba83a94deb1a1c0b1fa705ff

See more details on using hashes here.

File details

Details for the file tuneflow_devkit_py-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tuneflow_devkit_py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 380d5202ab269a4699c57d40d115ace9198200f6a0a61ef1ad44bdfd34b0a8e0
MD5 4158de65d6b884a5261f1e57d56e39f6
BLAKE2b-256 dbf15f3c6937263c0d106dccf908191b3e8831f9a90f7dddc7f8d6cf7fc34a52

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page