Python Client

What is it?

The DAWNet client is a python3 pip package. It is used to create DAWNet remotes. Remotes are scripts created with the python client. The client allows a user to register remote functions with the DAWNet discovery server. After a function has been registered it can then be triggered remotely from `DAWNet plugin.

WARNING

NOTE: The plugin is in an active, pre-alpha state. It has only been tested on Ableton 11 on MAC M1.

Installation

!pip install elixir-client --upgrade
import elixir_client.core as dawnet
from elixir_client import DAWNetFilePath

WARNING

NOTE: ffmpeg is a system requirement

FFMPEG install instructions:

- On macOS: Use Homebrew by running 'brew install ffmpeg' in the terminal.
- On Linux (Debian/Ubuntu): Run 'sudo apt-get install ffmpeg' in the terminal.
- On Linux (Fedora): Run 'sudo dnf install ffmpeg' in the terminal.
- On Linux (Arch Linux): Run 'sudo pacman -S ffmpeg' in the terminal.

For other operating systems or more detailed instructions, visit the FFMpeg website
FFMpeg Downloadopen in new window

Usage

This is a simple example of a Rune script created using the elixir-client. The script defines an arbitrary function that takes two arguments, an integer and a DAWNetFilePath. The function is registered with the DAWNet discovery server. The script then connects to the DAWNet discovery server and waits for a remote trigger.

import elixir_client.core as dawnet
from elixir_client import DAWNetFilePath

# The token is generated by the DAWNet plugin.  
# It is used by the discovery server to associate the remote with the plugin.
TOKEN="0715c132-0b31-406e-b562-9206c479a48a"

# The registered method can be named anything. Note that the method must be `async`.  
# All parameters must be type hinted.  
# 4 parameter types are supported: int, float, str, DAWNetFilePath
# DAWNetFilePath is a special type. When the file is sent to the remote, it is intercepted by the system and 
# transported to a temp dir on the remote.  In this case the variable `b` is local path to the file.
async def arbitrary_method(a: int, b: DAWNetFilePath):
    try:
        # -----------------------------------------
        # This is where you can write custom code to operate on the input params.
        # ex param `a` could be the number of variations created from param `b` using something like MusicLM
        # -----------------------------------------

        # This is how you send results back to the plugin, when processing is complete.
        await dawnet.output().add_file(b)
        # This message is displayed in the plugin.
        await dawnet.output().add_message("This is a message XYZ") 

        return True
    except Exception as e:
        
        # This is how you send errors back to the plugin
        await dawnet.output().add_error(f"Method encountered an error: {e}")
        return False


# The token generated by the plugin. 
dawnet.set_token(token=TOKEN)
# The name of the remote.  This is displayed in the plugin.
dawnet.set_name("My Remote Code")
# The description of the remote.  This is displayed in the plugin.
dawnet.set_description("This is not a real description.")
# Register the method with the discovery server.
dawnet.register_method(arbitrary_method)

# This should be the last line of the script.  It connects to the discovery server and waits for a remote trigger.
dawnet.connect_to_server()
Last Updated:
Contributors: Steve Hiehn, stevehiehn, Steve Hiehn