Ad-Hoc Network Integration for Immersive Performances (ANIFIP) leverages the potential of adhoc networks through a range of inventive applications. Our objective is to synchronize audio, visual effects, and lighting, culminating in immersive and captivating experiences for both performers and audiences.
ANIFIP is a project comprising two modules: a controller and a worker. The controller module, implemented in sender.py
, is responsible for sending MIDI files and bArtHoc messages via MQTT to worker nodes. The worker module, implemented in receiver.py
, receives MIDI files and performs synchronized actions on connected actuators.
The controller module utilizes the MQTT protocol to communicate with the receiver module. It performs the following tasks:
- Loads a MIDI file.
- Publishes the MIDI file to the receiver.
- Waits for acknowledgment from the receiver.
- Starts threads for reading MIDI messages and waiting for acknowledgment.
- Publishes bArtHoc messages depending on MIDI messages received from an input port.
- Controls playback.
The worker module listens for incoming MIDI files over MQTT, controls playback, and actuates connected hardware. It performs the following tasks:
- Listens for incoming MIDI files over MQTT.
- Listens for bArtHoc messages to synchronize with other nodes.
- Actuates connected hardware.
All dependencies are listed in requirements.txt
.
- Ensure that the dependencies are installed.
- Run the Worker module (
receiver.py
) on devices where actuators (e.g., audio, lighting) are connected. - Run the Controller module (
sender.py
) on the device from which you want to send MIDI files, control playback, and read MIDI messages. - Plug the MIDI controller into the device running the Controller module.
Modify the configurations in the config.py
file as per your requirements.
- Install NTP:
sudo apt-get update && sudo apt-get install ntp
. - Edit NTP configuration:
sudo nano /etc/ntp.conf
, comment out other pool and server lines, and addserver 127.127.1.0
andfudge 127.127.1.0 stratum 10
. - Synchronize clocks:
ntpq -p
.
- Install
batman-adv
. - Run
cd Desktop && ./batman_script.sh X
, replacing X with the ID of your Controller device.
- Install
kubo-go
. - Initialize and run IPFS:
ipfs init
andipfs daemon
.
- Navigate to the sender directory:
cd sender
. - Run
python sender.py
.
Follow these steps to configure the worker device:
- Install NTP:
sudo apt-get update && sudo apt-get install ntp
. - Edit NTP configuration:
sudo nano /etc/ntp.conf
, addserver 10.1.1.X
(replace X with the ID of the Controller device), and restart NTP service:sudo systemctl restart ntp
. - Synchronize clocks:
ntpq -p
.
- Install
batman-adv
. - Run
cd Desktop && ./batman_script.sh X
, replacing X with the ID of your Controller device. - Configure IPFS
- No IPFS configuration is needed for worker nodes.
- Navigate to the receiver directory:
cd receiver
. - Run
python receiver.py
for the receiver instance handling LED. - Run
python receiver_pc.py
for the receiver instance handling audio playback. - Run
python receiver_visualizer.py
for the receiver instance displaying the Tkinter canvas based on the MIDI file.