Introduction: Audio Spectrum Software [C#]
what is this project ?
this project will allow you to capture the output audio of you pc and analyze it using fast fourier transform which allow us to draw a spectrum, such as the video shows
what language are we using ?
i'm using c# to build a windows application form
what software to are we using to build this program ?
visual studio 2015, worked with express and community.
what are the benefits of doing such a thing ?
first of all it's cool, :D, and i'm specifically using it to feed my rgb leds all over my desktop, in pc chassis, around the screen, and inside my keyboard and mousepad.
download spectrum rar file.
let's start coding ..
Step 1: Add Tool to Your Form
now your form need the tools we are using, which is the following:
1 ComboBox, 1 Spectrum, 2 PB.
that's about all, in my video i have hidden those extra controls other than the spectrum.
some advance stuff you can go with, make your spectrum larger like in my video.
which is done by modifying the Analyzer.cs and the Spectrum.xaml tool.
in the file you downloaded we are using 16 spectrum bars, to add more spectrums, let's say i want 64 spectrums
simply copy and paste the last two lines and change there Bar names.
at last, i have uploaded my example with one extra thing is drawing the spectrum as a line using charting.
Step 2: Start Your Windows Forms Applecation
first, start a windows forms application project.
what we are going to do in this project is capturing the audio output of the pc and convert it to a wave from using FFT, then take points on that wave form and convert it into an array of data changing from 0 - 255 for a certain amount of bars, all of that is done by the Analyzer class which uses the Bass.dll library.
include the Analyzer.cs class to your project along with the user controls and the libraries from the rar file.
also include the following references:
PresentationCore, PresentationFramework, System.Xaml, WindowsBase
now we need to define an instance of the class Analyzer as a global instance
then in the form constructor give it a value as a new instance, then enabling it and the display, your code should look something like this:
analyzer = new Analyzer(pb1, pb2, spectrum1, comboBox1);
analyzer.Enable = true;
analyzer.DisplayEnable = true;
Step 3: More Advance Stuff
i have setup some addressable leds ws2801 around my screen and in my pc chassis, also there's addressable leds in my keyboard and mousepad.
the ws2801 strips are connected to an arduino and controlling them is done via serial.
also the banner of the bass.dll that comes up when starting the form can be removed by signing up here for free:
here's an instructable to do as such:
at last, i'm going to make a tutorial on how to control the ws2801 leds also in c#.
special thanks to the guy who made the Analyzer.cs class and bass.dll library and it .net wrapper.
We have a be nice policy.
Please be positive and constructive.