Skip to content

yanxi0830/Nanoleaf-EnergyDrum

Repository files navigation

Installation Instructions

The music_processor python script requires the latest version of the following (non-standard) python packages

  • numpy
  • pyaudio
  • librosa

The recommended installation method is pip. See here for pip installation instructions.

Clone or download the appropriate SDK repo from our GitHub Page

Windows

To use the SDK on Windows, Cygwin needs to be installed. For installation instructions, see here

Install miniconda for Windows from here. Assume the absolute path to its root directory is CONDA_ROOT. In Cygwin, miniconda is called by the conda command.

In Cygwin, install up-to-date versions of make and gcc

The following is executed within Cygwin:

Append CONDA_ROOT to PATH by export PATH=CONDA_ROOT:$PATH

Check that the python called by the shell is the one in CONDA_ROOT by which python. Verify the output is CONDA_ROOT/python

Install numpy by conda install -c anaconda numpy

Install librosa by conda install -c conda-forge librosa

Note that pyaudio cannot be installed using conda on Windows. Use the pip packaged with conda by:

CONDA_ROOT/Scripts/pip install pyaudio

verify that pyaudio has been installed for conda by conda list

macOS

The following installation requires homebrew. See here for installation instructions.

pip install numpy

brew install portaudio

pip install pyaudio

pip install librosa

Note: If pip install pyaudio throws an error that it could not find portaudio.h, even though brew install portaudio has successfully installed portaudio, try running the following instead of pip install pyaudio:

pip install --global-option='build_ext' -global-option='-I/usr/local/include' -global-option='-L/usr/local/lib' pyaudio

Linux

For successful pyaudio install, make sure the packages portaudio19-dev and python-dev-all have been installed for your linux distribution, e.g., by using

sudo apt-get install portaudio19-dev

pip install numpy

pip install pyaudio

pip install librosa

Testing Your Plugin

Compile Your Plugin

The AuroraPlugin Framework comes with a makefile and a utilities library. Once you have completed the implementation of your plugin, you can build it using the makefile in the Debug folder. If any additional libraries have been used, the makefile must be modified to link those libraries in as well during linking.

To compile, use a terminal window (Cygwin terminal on windows) and change your working directory to the PluginSDK/Debug folder. Use the following commands:

make clean

make all

Once the compilation completes successfully, a libAuroraPlugin.so file will be placed in the Debug folder which can be used with the simulator

Run Your Plugin

On macOS and Linux, before running the simulator, a symbolic link will have to be made in /usr/local/lib to the libPluginUtilities.so file that is stored in the utilities folder of the AuroraPlugin directory. To make this link, type the following into terminal.

macOS: ln -s <Path>/Utilities/libPluginUtilties.so /usr/local/lib/libPluginUtilities.so

Ubuntu: ln -s <Path>/Utilities/libPluginUtilties.so /usr/lib/libPluginUtilities.so

where Path is the absolute path to the Aurora Plugin directory on your computer. No link is required in Cygwin, since the utilities library is statically linked in windows.

To run the simulator, open up a terminal (Cygwin terminal on windows) and change your working directory to the PluginSDK folder. The music_processor python script must be run first, by entering:

python music_processor.py

Note that music_processor should be run outside of Cygwin on Windows, e.g., in a command window.

Next, to run the simulator, enter:

./SoundModuleSimulator -p <absolute path to .so file> -i <ip address>

If you generated a color palette (see Plugin Builder), enter:

./SoundModuleSimulator -p <absolute path to .so file> -i <ip address> -cp <absolute path to palette file>

The .so file is the compiled plugin that you wish to run on the Aurora.

The IP address that you enter is the ip address of the Aurora on the local network. The ip address can be found by using Bonjour Browser on macOS and SSDP Scanner on Windows.

When using the simulator for the first time, the simulator will attempt to acquire an authentication token from the Aurora and ask the user to hold down the power button on the Aurora for 5-7 seconds. This step is not required during subsequent executions of the simulator. Note: the Simulator will only maintain authentication with one Aurora at a time.

Plugin Builder

A plugin builder tool can be used to simplify the process of:

  • Pairing with an Aurora
  • Creating a palette
  • Building and running plugins (Mac and Linux only)

In the directory plugin-builder-tool/ simply run the command: python main.py. A GUI will appear that prompts you to enter the ip address of the testing Aurora, your desired palette, and the absolute path to your plugin in the directory AuroraPluginTemplate/.

Note that the Plugin Builder tool will output information to the terminal. Please check the terminal output for instructions, e.g., during pairing with Aurora or debug printouts from your plugin.