/lightdream-artnet

Run pre-recorded Artnet LED shows off your Raspberry Pi

Primary LanguagePython

Lightdream Artnet

Project to run lightdream-scripts code on an rpi instead.

What is Lightdream?

lightdream

Click here for more info.

Lightdream takes sequences of Artnet data, encoded as video files, and plays them back to your network. This allows me to pre-record light shows for songs and coordinate playback of the audio and visuals. This has two modes so that I can play sequenced songs or generate a light show on-the-fly using premade clips and audio detection algorithms.

This currently supports about 40 uniiverses @ 40 fps, but you can push this farther before you hit hardware performance limits.

This is not a general purpose library, but it's intended for a workflow where you already have created Artnet data video files by using Lightjams Recorder or equivalent.

Features

  • sends out artnet data
  • autoplay mode
  • sequenced audio mode
  • metronome / calibration mode
  • filter system to modify frame data in realtime
  • Playlist Mode: Sync music files and video files.
    • Add the track info to util/track_metadata.yml and then add key.ogg to the audio folder and key.mp4 to video\sequences
  • Autoplay Mode: Play clips at random.
    • Add these clips to video\autoclips. Any .mp4 files should get picked up.

Setup

After running once, you'll have a config.yml file to work with. Check util/config.py for descriptions of the settings.

Installation Scripts

# Windows
pip install -r requirements.txt

For audio listener, you need
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio
PyAudio‑0.2.11‑cp310‑cp310‑win_amd64.whl
then `pip install PyAudio‑0.2.11‑cp310‑cp310‑win_amd64.whl`


# RPi: you also need these:
pip install gstreamer-player PyGObject pycairo mesa-utils

# RPi: not sure how many of these are necessary but hey why not
sudo apt-get install gstreamer1.0-tools gstreamer1.0-pulseaudio \
  libgirepository1.0-dev libcairo2-dev gir1.2-gstreamer-1.0

# check audio output device and make sure it's not HDMI
https://www.alsa-project.org/main/index.php/Setting_the_default_device

cat /proc/asound/cards
echo -e "defaults.pcm.card 1\ndefaults.ctl.card 1" > /etc/asound.conf

How to run at startup:

cat ~/.config/lxsession/LXDE-pi/autostart 

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash

cat /etc/xdg/autostart/lightdream.desktop
[Desktop Entry]
Exec=lxterminal -e "cd ~/lightdream-artnet && python main.py; bash"


Loading an .img file onto Rpi SD card:

  • use Win32 Disk Imager
  • to minify images:
    • sudo mount -t drvfs E: /mnt/e
    • cd /mnt/e/git/lightdream-artnet
    • sudo /usr/local/bin/pishrink.sh {imagefile.img}