DAWNet
DAWNet
is a DAW (digit audio workstation) plugin that connects to a remote Google Colab or Script. A user can send audio files from the plugin for remote processing. Hence, perform computationally expensive tasks such as text-2-audio or stem separation without leaving the DAW.
For more information:
dawnet-client
The DAWNet client
(this repo) is a python3 pip package. It is used to create DAWNet remotes
. The client is responsible for moving data and files backand forth from the plugin (and server). The client allows a user to register python 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 dawnet-client --upgrade
Tests
from the root of the source code dir run:
pip uninstall dawnet-client -y && pip install -e . && pytest -s
Usage
This is a simple example of a DAWNet remote script created using the dawnet-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.
For thorough documentation and tutorials visit: https://dawnet.tools/client/
import dawnet_client.core as dawnet
from dawnet_client import DAWNetFilePath, ui_param
TOKEN="0715c132-0b31-406e-b562-9206c479a48a"
@ui_param('a', 'DAWNetNumberSlider', min=0, max=10, step=1, default=5)
@ui_param('c', 'DAWNetMultiChoice', options=['cherries', 'oranges', 'grapes'], default='grapes')
async def arbitrary_method(a: int, b: DAWNetFilePath, c: str):
try:
await dawnet.results().add_file(b)
await dawnet.results().add_message("This is a message XYZ")
return True
except Exception as e:
await dawnet.results().add_error(f"Method encountered an error: {e}")
return False
dawnet.set_token(token=TOKEN)
dawnet.set_name("My Remote Code")
dawnet.set_description("This is not a real description.")
dawnet.register_method(arbitrary_method)
dawnet.set_input_target_sample_rate(44100)
dawnet.set_input_target_bit_depth(16)
dawnet.set_input_target_channels(2)
dawnet.set_input_target_format('wav')
dawnet.set_output_target_sample_rate(44100)
dawnet.set_output_target_bit_depth(16)
dawnet.set_output_target_channels(2)
dawnet.set_output_target_format('wav')
dawnet.connect_to_server()
CONFIGURATION:
Note: If the following environment variables are not set, the client will use the default values. The default values will point to the public DAWNet server. If you wish to host your own instance you will need to configure the following environment variables.
export DN_CLIENT_API_BASE_URL='http://localhost:8081'
export DN_CLIENT_SOCKET_IP='0.0.0.0'
export DN_CLIENT_SOCKET_PORT='8765'
export DN_CLIENT_SENTRY_API_KEY='XXX'
"DN_CLIENT_STORAGE_BUCKET", "https://storage.googleapis.com/your_gcp_bucket/"
Note: If the env var DN_CLIENT_TOKEN
is set it will override the set_token() function.