stmpler

#sampler #music #stm32 #stm32f4 #embedded

About

I had a STM32F429 eval board lying around. Also, I needed some sort of sample player to trigger samples with MIDI foot controller. And that is how stmpler came to life.

Stmpler is a simple (only few parts besides eval board), mono, lo-fi (12bit, 20.5kHz, no DAC/PWM output), MIDI controlled sample player (wav samples from SD card) based on STM32F429 Discovery eval board.

stmpler1 stmpler1

Hardware

STM32F429 eval board does not have many free pins so the SD card is used in SPI mode (instead of SDIO). Audio output is generated by filtering PWM signal (I was too lazy to put some sort of real DAC). Because of that, there is a compromise between bit depth and sampling rate (higher sampling rate means lower bit depth). I decided to go with 12 bit and 20.5kHz.

I was also too lazy to make a proper PCB for the components so they are floating inside the box, isolated with tape (as seen on image below :)). Schematics for the MIDI in and audio out are below, and the SD card pinout is in the file pins.txt in the source code repository . Power supply is made using one of those cheap car phone chargers.

stmpler inside look stmpler schematic

Software

Board runs Chibios/RT 2.6.8 RTOS and uses uGFX for GUI. Paths to both are setup in the Makefile.

Source code can be obtained from: https://bitbucket.org/igor_b/stmpler/src

Implemented stuff:

  • it is usable :)
  • selecting files from SD card (only one directory level)
  • save and load config file (binary form)
  • linear interpolation without antilaliasing filter

TODO:

  • code refactoring (there are some very ugly pieces now)
  • parsing config from text files (ini or json)
  • up to four different configs (scenes)
  • better interpolation (windowed sinc or at least some polynomial)
  • antialias filter!!!
  • (maybe) add proper DAC and increase sampling rate
  • (maybe) audio effects
  • (maybe) some sort of synth (beside sample playback)

Video

Comments

Go to top