Maintenance notice: These forum archives are read-only, and will be removed shortly. Please visit our forums at their new location,

Peggy 2.0 Audio spectrum analyzer

edited November 2013 in LED Matrix Kits
Iv just ordered my peggy 2.0 and am in the process of thinking of some ideas to customize it. Would anyone have any ideas on how to turn the display into an audio spectrum analyzer? 
Any thoughts or ideas would be much appreciated.
Regards, Jack L 


  • Running the LED display takes a certain amount of CPU time, as would running spectrum analyzer code, so while I am certain that it can be done, I am not certain *how fast* it would be. 

    You might begin by looking at the Peggy2 library for Arduino and the existing FFT spectrum analyzer code out there; here's an example that might be a good starting point to look at:
  • Hi again Windell,

    Iv made some progress on the issue, mirror Peggy works very well and am delighted with it. At the moment im trying to display the input from my laptops microphone on my Peggy. I found this code which works well and clearly shows the different levels. Im just not too sure on how to modify it to send or mirror it to the Peggy, this is the code....

    import krister.Ess.*;

    FFT myfft;
    AudioInput myinput;
    int bufferSize=512;

    void setup() {

      myinput=new AudioInput(bufferSize);
      myfft=new FFT(bufferSize*2);


    void draw() {
      for (int i=0; i<bufferSize;i++) {

    public void audioInputData(AudioInput theInput) {

    Any help you could give me would be much appreciated as always,
    Below is the link to where i found the code,

  • I also found this video on Youtube of spectrum analyser working on the peggy, but i couldn't find the code he used 

  • It sounds like you're at a stage where you could take the data generated by the FFT program and make it so that you could put its data-- instead of the data from the camera --in the data array that gets sent (1) to your screen and (2) to the Peggy in the Mirror Peggy sketch.  And, that would be the most straightforward way to do so.
Sign In or Register to comment.