The prodigal Music Visualizer returns, and it's even better. Version 2 of Music-Visualizer is finally here! V2 brings a much better codebase and more ease for addition, and will only improve over time.
Yes, yes, I know! Unlike the previous version, for now, V2 releases of the .jar
will be a stand-alone player. SoundCloud integration will be hidden unless a valid SoundCloud ClientId
is set via environment variable.
To protect the ClientId
which SoundCloud uses to authenticate requests to its API, the best way (I've found for now) from it being decompiled out of the .jar
is to set an environment variable and retrieve it at run time.
Java JDK + IntelliJ + Kotlin
The codebase is an IntelliJ IDEA project, so I'd recommend using IntelliJ IDEA. This project also uses Kotlin, which is an incredible language! I'd also recommend using the Adoptium
: Eclipse Temurin 17 (LTS)
-
To avoid the token being packaged into the
.jar
during the Maven package Lifecycle, for now, I thought setting an environment variable would be the best way to secure the token. -
I've created a convenience scripts for setting the environment variable! In a terminal window change into the
tools
folder of this repo, then execute the script for your OS:- Note: Replace
<client-id>
with your actual SoundCloud ClientId
- Note: Replace
-
./tokenhelper.ps1 <client-id>
-
./tokenhelper.sh <client-id>
- Note: If you mess up setting the token, you'll need to manually edit your
.bashrc
file to correct the export value
- Note: If you mess up setting the token, you'll need to manually edit your
-
And Boom! You should be all set to go!
- If using IntelliJ IDEA IDE, when opening the project, hit the popup about the
pom.xml
file that says something like:Add as Maven Project
- This will make sure IntelliJ recognizes the project as being a Maven project!
- To build the .jar, in the Maven Lifecycle, use the
package
command - To install local needed dependencies for .jars in the
lib
folder, and to clean the project ('target' in root project dir) use theclean
command
Create an issue
for the repo if you encounter any errors or strange behavior/functionality with the application.
Please feel free to fork and submit bug fixes or feature requests!
- If you're using IntelliJ, if you happen to get this exception:
NoClassFoundException - Main
, try the following:- Close the project
- In the root of the repo, delete the
.idea
folder (this is the folder IntelliJ uses for the IDE) - Re-open the project in IntelliJ and then rebuild and debug
- Hopefully that fixes that exception, if not please open an issue for it.
- Processing 4 - Graphics library
- Minim - Audio library
- ControlP5 - Awesome GUI controls
- Apache Commons IO - IO Utility library
- Unirest - Java http-client library
- Gson - Java JSON library
Thank you for checking out my work/experiment! I'll be pushing updates to this project as often as I can. Please feel free to fork or port this to other languages! Have fun and keep on creating!