Spectral Multiband Resonator
C Objective-C Other
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.metadata fixed include headers, now compiles on gcc 5.4.1, but -- oops -- have… Feb 21, 2017
.settings Added settings folder Feb 16, 2017
filter_coefs added equal temperament one-interval and two-interval scales. Fixed t… Nov 15, 2016
hardware README update Mar 4, 2016
stm32 Removed F7 changes, should be a working F4 version that compiles with… Feb 21, 2017
.cproject Added Eclipse project files Feb 16, 2017
.gdbinit fixed path to main.elf Sep 4, 2015
.gitignore Fixed bug where qval[] loaded from slots got overridden immediately Jan 2, 2018
.project Added Eclipse project files Feb 16, 2017
CHANGELOG.md Updated CHANGELOG Dec 5, 2016
LICENSE Updated LICENSE to reflect hardware Apr 19, 2016
Makefile Fixed bug where qval[] loaded from slots got overridden immediately Jan 2, 2018
README.md Merge branch 'voltoctenv-dev' into dev_master Oct 19, 2016
TODO Added ability to compensate tracking independently on evens and odds Dec 31, 2015
adc.c Directory structure changes, cleaned up comments, cleaned up license … Sep 4, 2015
adc.h Directory structure changes, cleaned up comments, cleaned up license … Sep 4, 2015
audio_util.c Fixed a bug where a line in odds read from f_nudge_buf[1] but should … Nov 4, 2016
audio_util.h fixed include headers, now compiles on gcc 5.4.1, but -- oops -- have… Feb 21, 2017
codec.c Directory structure changes, cleaned up comments, cleaned up license … Sep 4, 2015
codec.h Directory structure changes, cleaned up comments, cleaned up license … Sep 4, 2015
dac.c Directory structure changes, cleaned up comments, cleaned up license … Sep 4, 2015
dac.h Directory structure changes, cleaned up comments, cleaned up license … Sep 4, 2015
dig_inouts.c fixed include headers, now compiles on gcc 5.4.1, but -- oops -- have… Feb 21, 2017
dig_inouts.h fixed include headers, now compiles on gcc 5.4.1, but -- oops -- have… Feb 21, 2017
envout_pwm.c Fixed TIM3 not being initializined correctly (inverted outputs on Env… Mar 29, 2017
envout_pwm.h Cleaning up timing (still needs work): Enabled NVIC priority/subprior… Oct 22, 2016
equal_pow_pan_padded.h two pass filter smoothly transitions through Q values thanks to extra… Oct 21, 2016
exp_1voct.h 1V per octave was at 1.5V per octave, changed to 1.0V. Added firmware… Oct 3, 2015
exp_4096.h Directory structure changes, cleaned up comments, cleaned up license … Sep 4, 2015
filter.c fixed include headers, now compiles on gcc 5.4.1, but -- oops -- have… Feb 21, 2017
filter.h fixed include headers, now compiles on gcc 5.4.1, but -- oops -- have… Feb 21, 2017
filter_coef.h added equal temperament one-interval and two-interval scales. Fixed t… Nov 15, 2016
flash.c fixed include headers, now compiles on gcc 5.4.1, but -- oops -- have… Feb 21, 2017
flash.h fixed include headers, now compiles on gcc 5.4.1, but -- oops -- have… Feb 21, 2017
globals.h fixed include headers, now compiles on gcc 5.4.1, but -- oops -- have… Feb 21, 2017
hardfault.s testing maxq... Jul 2, 2015
i2s.c Cleaning up timing (still needs work): Enabled NVIC priority/subprior… Oct 22, 2016
i2s.h Directory structure changes, cleaned up comments, cleaned up license … Sep 4, 2015
led_ring.c fixed include headers, now compiles on gcc 5.4.1, but -- oops -- have… Feb 21, 2017
led_ring.h Tracks FM in the Freq jack better: Added an update timer to run the p… Oct 23, 2016
leds.c fixed include headers, now compiles on gcc 5.4.1, but -- oops -- have… Feb 21, 2017
leds.h fixed include headers, now compiles on gcc 5.4.1, but -- oops -- have… Feb 21, 2017
limiter.c fixed include headers, now compiles on gcc 5.4.1, but -- oops -- have… Feb 21, 2017
limiter.h fixed include headers, now compiles on gcc 5.4.1, but -- oops -- have… Feb 21, 2017
log_4096.h Continous unquantized range (linear interpolation between semitones).… Oct 15, 2016
lpf.c Added FIR LPF to freq jacks instead of IIR Jan 3, 2018
lpf.h Added FIR LPF to freq jacks instead of IIR Jan 3, 2018
main.c Added FIR LPF to freq jacks instead of IIR Jan 3, 2018
mem.c Directory structure changes, cleaned up comments, cleaned up license … Sep 4, 2015
mem.h Directory structure changes, cleaned up comments, cleaned up license … Sep 4, 2015
params.c Added FIR LPF to freq jacks instead of IIR Jan 3, 2018
params.h Added FIR LPF to freq jacks instead of IIR Jan 3, 2018
pca9685_driver.c fixed include headers, now compiles on gcc 5.4.1, but -- oops -- have… Feb 21, 2017
pca9685_driver.h Tracks FM in the Freq jack better: Added an update timer to run the p… Oct 23, 2016
rotary.c Directory structure changes, cleaned up comments, cleaned up license … Sep 4, 2015
rotary.h Directory structure changes, cleaned up comments, cleaned up license … Sep 4, 2015
rotation.c fixed include headers, now compiles on gcc 5.4.1, but -- oops -- have… Feb 21, 2017
rotation.h fixed include headers, now compiles on gcc 5.4.1, but -- oops -- have… Feb 21, 2017
stm32f4xx_conf.h Directory structure changes, cleaned up comments, cleaned up license … Sep 4, 2015
system_mode.c Formatting cleanup and project file removal Jan 2, 2018
system_mode.h fixed include headers, now compiles on gcc 5.4.1, but -- oops -- have… Feb 21, 2017
twopass_calibration.h switched twopass_calibration to uin32_t to save CPU Nov 21, 2016
user_scales.c Added a BASE_TRACKOFFSET to counter inevitable small positive voltage… Nov 4, 2016
user_scales.h fixed include headers, now compiles on gcc 5.4.1, but -- oops -- have… Feb 21, 2017

README.md

SMR

Spectral Multiband Resonator

Firmware for the Spectral Multiband Resonator, a Eurorack-format module from 4ms Company.

The SMR is a 6-channel highly resonant filter ("resonator") with a ring of RGB LEDs, six sliders, and stereo audio inputs and outputs. The main processor is the STM32F427 chip. For more details see http://www.4mspedals.com/smr.php

The SMR would make a nice platform for other audio projects, the hardware contains:

  • 180MHz 32-bit ARM chip with FPU (STM32F427)
  • Stereo codec chip (running at 96kHz/24bit in this firmware)
    • Two audio inputs, two audio outputs
  • Five 16-channel PCA9685 LED drivers (10-bits per channel)
  • 26 RGB LEDs, 20 are arranged in a circle/ellipse, 6 are arranged in a line
  • Six slider potentiometers with an LED on the shaft
  • Five potentiometers
  • Six momentary LED buttons
  • A rotary encoder and button
  • Six toggle switches (one is SP3T, others are SPST)
  • Twelve CV inputs
  • Six gate/digital inputs (can be used as unscaled CV inputs)
  • Six CV outputs (0V-8V), driven by PWM

As of writing this (March 2016), there are three PCB versions: 1.0, 1.0.1, and 1.0.2. These are functionally identical and this firmware will run exactly the same on all versions.

Setting up your environment

You need to install the GCC ARM toolchain. This project is known to compile with arm-none-eabi-gcc version 4.8.3, and version 4.9.3. It is likely that it will compile with future versions as well.

It's recommended (but not necessary) to install ST-UTIL/stlink. Without it, you will have to update using the audio bootloader, which is very slow (5 minutes per update). With ST-UTIL or stlink and a programmer, you can update in 5-20 seconds. The Texane stlink package contains a gdb debugger, which works with ST-LINK programmers such as the STM32 Discovery boards to connect to the Spectral's 4-pin SWD header. The STM32F4 Discovery Board is low-cost (under US$15) and works great as a programmer and debugger.

You also may wish to install and IDE such as Eclipse. There are many resources online for setting up GCC ARM with Eclipse (as well as commerical software). This is totally optional. Instead of an IDE you can use your favorite text editor and a few commands on the command line (Terminal) which are given below.

Continue below for Max OSX, Linux, or Windows instructions.

Mac OSX

For Mac OSX, follow these instructions to install brew and then the arm toolchain and st-link (taken from https://github.com/nitsky/homebrew-stm32):

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap nitsky/stm32
brew install arm-none-eabi-gcc
brew install stlink

That's it! Continue below to Clone the Projects

Linux

For linux, check your package manager to see if there is a package for arm-none-eabi-gcc or gcc-arm-embedded or gcc-arm-none-eabi. Or just download it here:

Download GCC ARM toolchain from Launchpad

Next, install st-link from texane:

sudo apt-get install git libusb-1.0.0-dev pkg-config autotools-dev
cd (your work directory)
git clone https://github.com/texane/stlink.git
cd stlink
./autogen.sh
./configure
make
export PATH=$PATH:(your work directory)/stlink

The last command makes sure that the binary st-flash is in your PATH so that the Makefile can run it to program your module.

That's it! Continue below to Clone the Projects

Windows

Download GCC ARM toolchain from Launchpad

Download ST-UTIL

Install both. Please contact me if you run into problems that you can't google your way out of!

Clone the Projects

Make sure git is installed on your system. (OSX: type "brew install git" into the Terminal)

Create a work directory, and enter it.

Clone this project (SMR), stmlib, and the stm-audio-bootloader projects:

git clone https://github.com/4ms/SMR.git  
git clone https://github.com/4ms/stmlib.git
git clone https://github.com/4ms/stm-audio-bootloader.git

Create a symlink for stm-audio-bootloader so that it works with python (required to generate the .wav file for audio bootloading)

 ln -s stm-audio-bootloader stm_audio_bootloader

Verify that your directories are as follows:

(work directory)
|  
|--SMR/  
|--stm-audio-bootloader/  
|--stm_audio_bootloader/   <----symlink to stm-audio-bootloader
|--stmlib/

Compiling

Make your changes to the code in the SMR directory. When ready to compile, make the project like this:

cd SMR
make

If you want to flash the file onto the SMR, attach an ST-LINK programmer in SWD mode using a 4-conductor cable and run:

make flash

Read the Discovery Board's manual for how to set it to program external devices. On the STM32F4 Discovery board, you have to remove two DISCOVERY jumpers to put it in ST-LINK mode. Connect the 4-pin cable to the SWD header starting at the dot (pin 1) on the Disco board. On the SMR, pin 1 is labeled with a "1". Any 4-pin cable or even 4 breadboard jumper wires will work. A 10-to-16 pin eurorack power cable is fine too, if it's short enough.

When ready to build an audio file for the bootloader, make it like this:

make wav

This requires python to run. It creates the file main.wav in the build/ directory. Play the file from a computer or device into the SMR by following the instructions in the User Manual on the 4ms SMR page.

Troubleshooting: If you have trouble getting python to create a wav file, such as this error:

ImportError: No module named stm_audio_bootloader

Then try this command:

export PYTHONPATH=$PYTHONPATH:'.'

Bootloader

The bootloader is a separate project, slightly modifed from the stm-audio-bootloader from pichenettes.

The bootloader is already installed on all factory-built SMRs.

License

The code (software) is licensed by the MIT license.

The hardware is licensed by the CC BY-NC-SA license (Creative Commons, Attribution, NonCommercial, ShareAlike).

See LICENSE file.

I would like to see others build and modify the SMR and SMR-influenced works, in a non-commercial manner. My intent is not to limit the educational use nor to prevent people buying hardware components/PCBs collectively in a group. If you have any questions regarding the license or appropriate use, please do not hesitate to contact me!

Guidelines for derivative works

Do not include the text "4ms" or "4ms Company" or the graphic 4ms logo on any derivative works. This includes faceplates, enclosures, or front-panels. It's OK (but not required) to include the text "Spectral Multiband Resonator" or "SMR" if you wish.