Giter VIP home page Giter VIP logo

nanoleafmusic's Introduction

NanoleafMusic

This project is no longer be developed due to changes with the Nanoleaf API and discontinuation of the product.

Sync your Nanoleaf Light Panels with Spotify

NanoleafMusic is a quick and easy tool to sync your Spotify playback with your Nanoleaf light panels. It doesn't even require a rhythm module. You can use it with your own color palette, or have it use colors from the album art.

Installation

Installation is super simple, and you can install this program like you would most other programs on your platform. A Java runtime is packaged with the program.

Packages are available for:

Usage

Step 1: Connecting to your Nanoleaf

To connect your device, you must be on the same network as the device. Once you load the program, you should a list of the devices on the network. If you don't see any devices, try pressing refresh a couple times.

Select the device you want to connect too, and press the connect button. A dialog will pop up to prompt you to start the authorization process. To do this, press and hold the power button on the device controller until the LED indicator starts flashing white. Then press the OK button in the program.

Step 1.5: Saving Device Info

Once you connect to a device, you will be asked if you want to save the device information for easy reconnection. Pressing yes will save the device host, port, and the access token to your platforms default preferences location . Pressing save will overwrite any device that is already saved.

Step 2: Connecting to Spotify

After connecting, you will be prompted to connect to Spotify. To do so, click the Connect to Spotify button, and a browser will be opened. On that page, you will be prompted to sign in to Spotify and then asked if you want to authorize this program. If you accept, you will be redirected to another page and if everything goes correctly you can return to the program.

Step 3: Starting the Effect

To start the effect, just play some music on Spotify.

The effect has two different ways to set the colors, album art and color palette mode. The default mode is album art, where a 6 color palette is generated using the artwork for the playing track. The color palette mode lets you pick the colors you want. To enable this, open the settings dropdown and disable the Use Album Colors checkbox. Then press the Set Color Palette button.

Setting the Color Palette

To add a color to the palette, use the color selection dropdown, and then press the Add Color button to add it to the list. To remove a color from the palette, select the color in the list, then press the remove button. Finally, press the save button to apply your changes and update the colors. To go back to album art mode, open the settings drop down and enable it again. When you exit the program, both your color palette and color made will be saved for next time.

Switching the Effect

To change the effect, open the setting drop down, and move your mouse over the 'Choose Effect' option and another menu, with the available effects should appear. Your current effect will appear above the 'Now Playing' label in the playback view.

Troubleshooting

  • Your Nanoleaf Device is not showing up on the list of devices

    • Check to make sure you are on the same LAN as your Nanoleaf device, and that you can listen for and send MDNS packets.

    • Press the refresh button and see if it shows up. Sometimes the program fails in the initial MDNS discovery and can take a few tries to find the device.

  • I can't connect to Spotify

    • Make sure you are accepting the prompts in your browser and on the same device the program is running on. It listens at localhost on port 8001 for the response from Spotify.
  • I've changed the song, but the program doesn't show the song has changed.

    • It can take a moment for the program to notice the song has changed, but once you see it change on the program, it should be reflected on the device.
    • If it still doesn't respond, in the settings menu there is a reload effect button. Press that to restart the effect. If it doesn't work, I recommend restarting the program.

Available Effects:

  • Pulse Beat: The classic and original effect. Creates a ripple that pulses out from a random panel on every beat.
  • Fireworks: Lights up a random group of panels on every beat, like distant fireworks.
  • Vibe: More minimal and bright, on every beat the color of a random panel gets brighter, and every bar the color changes.

Future Goals

All of my future goals for releases are in the project section of this repository, and you can keep track of the progress of them. If you have any suggestions for features, you can open an issue and I'll look into it.

Credits

Acknowledgements / Thanks

HUGE shoutout and thank you to Ethan Rowan and their prior work with the Nanoleaf API, especially their excellent API wrapper and desktop program. Their program inspired this project.

Used Libraries

nanoleafmusic's People

Contributors

jaxcksn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

ry-ds

nanoleafmusic's Issues

crashes

program crash when trying to make it work with spotify. nanoleaf hexagon

[REQUEST] add a linux installer

Is your feature request related to a problem? Please describe.
It's a pain in the ass to install it through wine and mess with configs

Describe the solution you'd like
Adding a linux installer would be great

Crash after spotify connect

After i connect spotify i get an error message(that closes instand) and the software crashes making it unusabke

Error

java.net.SocketException: Invalid argument: no further information
at java.base/sun.nio.ch.Net.setInterface6(Native Method)
at java.base/sun.nio.ch.DatagramChannelImpl.setOption(Unknown Source)
at java.base/sun.nio.ch.DatagramSocketAdaptor.setOption(Unknown Source)
at java.base/sun.nio.ch.DatagramSocketAdaptor.setNetworkInterface(Unknown Source)
at java.base/sun.nio.ch.DatagramSocketAdaptor.setInterface(Unknown Source)
at java.base/java.net.MulticastSocket.setInterface(Unknown Source)
at net.straylightlabs.hola.sd.Query.openSocket(Query.java:200)
at net.straylightlabs.hola.sd.Query.runOnceOn(Query.java:133)
at net.straylightlabs.hola.sd.Query.runOnce(Query.java:116)
at dev.jaxcksn.nanoleafMusic.controllers.ConnectToDevice.findNanoleaf(ConnectToDevice.java:99)
at dev.jaxcksn.nanoleafMusic.controllers.ConnectToDevice.findDevices(ConnectToDevice.java:153)
at dev.jaxcksn.nanoleafMusic.controllers.ConnectToDevice.lambda$initialize$0(ConnectToDevice.java:68)
at java.base/java.lang.Thread.run(Unknown Source)

Program throws exception

Describe the bug
I installed NanoleafMusic but when i open it it throws the following:
java.net.SocketException: Invalid argument: no further information at java.base/sun.nio.ch.Net.setInterface6(Native Method) at java.base/sun.nio.ch.DatagramChannelImpl.setOption(Unknown Source) at java.base/sun.nio.ch.DatagramSocketAdaptor.setOption(Unknown Source) at java.base/sun.nio.ch.DatagramSocketAdaptor.setNetworkInterface(Unknown Source) at java.base/sun.nio.ch.DatagramSocketAdaptor.setInterface(Unknown Source) at java.base/java.net.MulticastSocket.setInterface(Unknown Source) at net.straylightlabs.hola.sd.Query.openSocket(Query.java:200) at net.straylightlabs.hola.sd.Query.runOnceOn(Query.java:133) at net.straylightlabs.hola.sd.Query.runOnce(Query.java:116) at dev.jaxcksn.nanoleafMusic.controllers.ConnectToDevice.findNanoleaf(ConnectToDevice.java:99) at dev.jaxcksn.nanoleafMusic.controllers.ConnectToDevice.findDevices(ConnectToDevice.java:153) at dev.jaxcksn.nanoleafMusic.controllers.ConnectToDevice.lambda$refreshList$2(ConnectToDevice.java:246) at java.base/java.lang.Thread.run(Unknown Source)

i tried reinstalling it, rebooting my system and refreshing inside the app. still the same error

Expected behavior
Would be nice if this could be fixed or anyone here tell me what to do :)

Screenshots
grafik

Desktop (please complete the following information):

  • OS: Windows 10 Pro
  • Version: 21H2

Nanoleaf Device (please complete the following information):

  • Type of Device: Light Panels

NanoleafMusic Closes itself

Describe the bug
I am on Windows 11.
I downloaded the application, connected with Spotify and my nanoLeafs are connected to the application.
When I start the music, nanoLeafMusic detects the music and displays it and after a second the application closes itself and the nanoLeafs do not change.

To Reproduce
Steps to reproduce the behavior:

  1. Connect the nanoleaf to nanoleafMusic
  2. Connect spotify
  3. Start a music on spotify
  4. See error

Expected behavior
I want that the application doesn't crash when i start a music.

Screenshots
After this screen, the app closes itself without any error's message
image

Desktop (please complete the following information):

  • OS: Microsoft Windows 11 family
  • Version 10.0.22000 Build 22000

Nanoleaf Device (please complete the following information):

  • Type of Device: Hexagon nanoleaf

PROGRAM EXEPTION THROWN

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]

Nanoleaf Device (please complete the following information):

  • Type of Device: [Light Panels, Canvas or Shapes]
  • Firmware Version [e.g. 3.3.6]
  • Hardware Version [e.g. 1.6.2]

Additional context
Add any other context about the problem here. If you get an exception from the program, please paste it below.

[FEAT] V2 Codebase Overhaul

Creating an issue for this just so I can track progress and have something to reference in PRs.

I'm going to be updating the code base of this project to a new language. Most likely going to be C# or C++.

The reason for this is that JavaFX has proved to be hard to maintain and seems to be a bit overkill for the scope of the project.

With that,@Ry-DS has a fork with the java version that's working for those who will want the Java version. (See #21 for details)

Some planned features for V2:

  • Support new shapes
  • Create new UI and integration
  • Use deep links instead of HTTPS server for application.

There will probably be more, but this is just a general roadmap.

macOS App Nap causes the effect to pause.

App Nap on macOS is causing the effect to be paused when the program is not in the foreground. The effect resumes and "catches up" once App Nap ends.

This can probably be fixed by natively interacting with NSProcessInfo.

Effect randomly stops until it is reloaded

Describe the bug
The playing effect will randomly stop displaying itself on the connected device. The UI will still update, and no exceptions are thrown.

To Reproduce
This bug is particularly problematic because it is very difficult to reproduce. It seems to be almost random.

Desktop (please complete the following information):

  • OS: macOS and Windows
  • Version: v1.0 and v1.1-b

Nanoleaf Device (please complete the following information):

  • Type of Device: Light Panels

Additional context
I'm working on more verbose logging in #8 and when I start testing I will include a method to dump a bunch of data on an effect reload so that the next time I encounter it I can get some insight into what is happening.

Application uses too many different color classes

Ideally, the app should only use 2 different classes for representing color max. One for the UI and another for the effects. However, the app uses several different color classes.

Currently used color classes:

  • AWT in Pulse Beat and Vibe Effect
  • NanoleafAPI Colors in all Effects
  • RGB arrays in the Effect Manager
  • PaletteColor for the Color Picker
  • JavaFX Paint Color in the User Interface

Lots of math happens when calculating album color palettes in effects, and I think reducing conversions between Color classes will speed that up.

Support for Canvas Devices

Anything related to future support for Canvas Devices and all relevant updates/discussions will be posted here. If you have a canvas device and would like to help test canvas support I'd appreciate it as I don't own a canvas device.

Here to help!

I noticed you mentioned that you needed help with this project in your README. If you have a list of issues that need addressing or a simple writeup of what progress has been made thus far, I'm down to jump in and help out where I can :))

We could possibly look into making a CONTRIBUTING.md and a list of issues that need immediate attention (pinned to the top).

Recently bought some of these lights, and would love to get this working.

Reconnection Bug on Windows Platform

Describe the bug:
When pressing reconnect on Windows, the program won't reconnect to the device unless a new access token is granted to the program (by pressing and holding down the power button).

Expected behavior:
Pressing reconnect should use the saved access token.

Desktop:

  • OS: Windows
  • Version v1.2-beta

Nanoleaf Device:

  • Type of Device: Canvas (and probably Light Panels)

Additional context:
Discovered in testing done for issue #12. I have a strong hunch this is related to the storage of reconnection data on the Windows platform, since it doesn't happen on MacOS.

[REQUEST] Manual IP Configuration

Could not properly get my Nanoleaf Shapes to connect to the application. Would appreciate a manual connection configuration option where I have the availability to enter the proper IP and port of my Shapes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.