Jump to content
Corsair Community

[Unofficial Program] Spectrograph Music Visualizer in Linux


CalcProgrammer1

Recommended Posts

Based on the work I and some other Redditors at /r/mechanicalkeyboards did last week decoding the K70 RGB's USB protocol I implemented a music visualizer. I wrote this in C using the OpenAL audio library, libusb for USB communication, SDL and SDL_gfx for drawing the on-screen spectrum graph, and chuck_fft for the Fast Fourier Transform (how to turn a sampled audio signal into a frequency spectrum). I tested it on Linux but there's no reason it shouldn't work on Windows/Mac as well. I've seen a lot of people discussing the use of the keyboard as an audio visualizer and it was one of the reasons I bought the keyboard in the first place.

 

[ame]

[/ame]

 

The code is in the video description but it's not cleaned up. I plan to clean it up and post on GitHub after playing around with more effects. It also draws a rainbow pattern in the background. The mapping of LED to position in a matrix came from Reddit user /u/fly-hard, I ported his demo to Linux for this project.

Link to comment
Share on other sites

  • Replies 58
  • Created
  • Last Reply

For someone with NO skill with anything like this, it would be awesome if someone could make this to work with, i.e. spotify, or just to visualise the audio going to the default output in windows!

Like, an application you just run and select colors for the different zones and then go...

Anyone?

Pretty please?

Might even donate for something like that!

Link to comment
Share on other sites

Question tho would it work like a normal profile or would the program just by pass CUE and talk driectly to the Keyboard?

 

It won't work properly when the software is running.

It talks to the keyboard kinda like CUE.

If they're both open they'll both send colors/animations to the keyboard so it'll "flicker between them".

Link to comment
Share on other sites

Ah i see. I thought it might be some sort of hook in to CUE where instead of loading a profile it loads something that would present its self as a profile to CUE and send the colors to CUE then CUe sends it to the keyboard.

Guess that was is just longer with no benfits.

 

We'll need the official Lua API to hook into CUE. Also since I wrote it in Linux where there is no CUE the Windows build will be the same.

Link to comment
Share on other sites

We'll need the official Lua API to hook into CUE. Also since I wrote it in Linux where there is no CUE the Windows build will be the same.

 

Oh yea. I read the Reddit post and forgot that you were running in linux. yea cant wait for LUA but i have a feeling things are only going to get more complicated with LUA.

Link to comment
Share on other sites

Got it to build in Windows, though it's not quite as good due to Windows' lack of a competent audio loopback interface. I'm going to clean up the code and upload it to GitHub along with a compiled version to play with in Windows.

 

Edit:

 

GitHub: https://github.com/CalcProgrammer1/CorsairKeyboardSpectrograph

 

Windows build: https://mega.co.nz/#!xwIzGAbS!AVeiysx9S8hZio5YOztyzSdOCSzMgAq9nuImDuErG6s

Link to comment
Share on other sites

  • 3 weeks later...
Hmm, been some time now :P

 

Do you still plan to fix the issue where it just flickers on some computers? :)

 

My friend fixed it for me, I've attached a zip with the 2 .exe files.

v1 = Rainbow background with just white waves like originally.

v2 = Black background with white-red waves that also instantly goes away. (White at bottom and increasingly red towards the top)

I also have a version where the wave has less delay and it fades away.

k70.zip

Link to comment
Share on other sites

I should have mentioned I have a k95. Just on my phone now though so I will try it when I am home, haven't looked at that zip yet.

 

Edit: does not work for me. instantly closes. Probably missing some stuff being as these files are like 250KB where as the most recent windows build from calc was over 1.3MB

Link to comment
Share on other sites

I should have mentioned I have a k95. Just on my phone now though so I will try it when I am home, haven't looked at that zip yet.

 

Edit: does not work for me. instantly closes. Probably missing some stuff being as these files are like 250KB where as the most recent windows build from calc was over 1.3MB

 

Remember to have OpenAL installed, though it might not work due to it maybe not being able to hook your k95 since it uses a different ID.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...