Shop OBEX P1 Docs P2 Docs Learn Events
P2AMP - Wav Player with FFT Spectrum analyzer — Parallax Forums

P2AMP - Wav Player with FFT Spectrum analyzer

MXXMXX Posts: 22
edited 2026-02-05 17:57 in Propeller 2

Dear All,

I would like to share with you a small project I worked on during Xmas holidays.
It's a simple wav player (Winamp Style) running on the P2 Thing + LCD 4.3" (480x272) display with a nice FFT real-time spectrum analyzer.

It includes:

  • Paletted display driver to save hub memory (130 KB vs 390 KB with 256 colors 8 bit palette)
  • Different Fonts directly loaded from simple bitmap images
  • Wav player based on @Rayman code with some additions (like interactive volume control etc ..)
  • FFT for spectrum analyzer including windowing (hanning, hammin, flat-top, rectangular etc ..) and all related calculations for graphical representation of the spectrum.

I implemented my own FFT working on 16 bit signed samples (to save some memory) on a 4096 samples window updated every 1024 samples (audio @ 44.1 kHz 16 bit stereo).
4096 samples window at 44.1 kHz allows a good resolution at lower frequencies (approx 11 Hz).

This works on 4 cogs: main program, FFT, wav player and LCD.

Credits @Rayman for the player and LCD driver.

I can share details if interested.

Comments

  • "interested"
    are you kidding? that's brilliant.
    Looking forward to seeing the code.
    Dave

  • RaymanRayman Posts: 16,010

    Nice!

  • Nice one!

    (Also I think I forgot to thank you for the cookies - came on time this year)

  • MXXMXX Posts: 22

    @tritonium said:
    "interested"
    are you kidding? that's brilliant.
    Looking forward to seeing the code.
    Dave

    Thanks Dave,

    here is the whole source code, it compiles with FlexProp.
    FFT object also woks with propeller tool / PNut.

    Runs on our P2 board (The P2 Thing), can be adapted to run on other boards too by defining the correct pins.

    Enjoy!

  • Very pretty. I wonder if the output screen could be easily ported to be run over a VGA or DVI output...? Pure doubling gives 960x544 which could fit within an XGA formatted output and look even better if resolution was correspondingly increased a bit vertically and horizontally to 512x384. Might need some changes to your driver or if it's just palettized it could use my video driver in palette mode. A 512x384 video mode only needs 192kB in 8 bit palette mode so it should all fit in the hub RAM.

Sign In or Register to comment.