eh2k / squares-and-circles

squares-and-circles is an alternate firmware for the Eurorack module O_C, targeting Teensy 4.
https://eh2k.github.io/□●/
168 stars 14 forks source link
dsp eurorack eurorack-diy teensy

Feedback welcome: Feel free to leave me a message or any hints in the "General Feedback" issue.

□︎●︎ WebFlasher MODULAGrid

squares-and-circles is an alternate firmware for the Eurorack module O_C, targeting Teensy 4.0.

ChangeLog ```` == 2024-11-07 * Bugfix: * M-OSC/Waveforms - V_OCT modulation * SEQ/EuclidArp - Screensaver circle offset * Crash on patch saving/restoring (#97 ?!) * New Engines: * SEQ/TuringMachine == 2024-11-04 * Bugfix * 808ish-BD Crash #103 * Enhancements: * Crashreport fix (listing engine ids added) * SEQ/EuclidArp - fixed recalc pattern on slide > 1 - gate timing (using samples_per_step) * New APIs - clock::samples_per_step - engine::setPatchStateEx - engine::stepReset == 2024-11-02 * Enhancement: * SEQ/EuclidArp - fixed: note order (starting with root note) - quantized output - slide modes: OFF, ON, RND25, RND50, RND75 * Mod/TM - reset #100 - shift_reg & seed - added to patch state * GND/Scope - x-scale added #73 == 2024-10-29 * Enhancement: * TR707 - dynamic level/pan params in io-page/mixer section #29 * Bugfix: * setPixel missing (scope app not working) == 2024-10-28 * Enhancement: * Mod/SEQ - 4-step sequencer modulation #91 * Multitrigs (TR707 etc) #29 * TR707 - midi mapping (GM Standard Drum Map) #29 * Mod/LFO - New paramter: Waveform #89 * CV/LFO - New paramter: Scale, Offset, Waveform #89 * IO-PAGE - Listing of modulation trig/cv inputs * Bugfix: * M-OSC/Waveforms - display correct waveform instead of "shape" * out of memory handling / memory fragmentation - no new/delete usings in open303 * crash-reporting improvment * Sporadic midi stops working while update with webflasher * Modulation/LFO Shape ist not saved in the patch storage (is set to sine, after restore) #98 * New Engines: * SEQ/EuclidRythm * SEQ/EuclidArp * DSM: * One-Engine-Mode == 2025-07-02 * Bugfix: DSM0 "CRC32:0x63F R:1" == 2024-06-15 * Enhancement: * T1 Clock - resets to begin after 200milis silence * internal crc32 checks for debugging * midi response optimization * squares-and-circles api * serial * fs * Bugfixes * out of memory handling - prevent crashing == 2024-04-19 * Enhancement: Engine Load "Options" (Reset IO + Copy From) #74 * SD Format - preserves stored patches == 2024-04-14 * Enhancement: Patch storage (managment) * Bugfix: * tinyusb buffer/optimization == 2024-03-28 * Enhancement: Turing Machine Modulation * Enhancement: FV1emu (cleanup + 16bit delay optimization) * Bugfix: Crash on Midi-CC * Refactoring MIDI-Settings / Clock-Settings * Enhancement: Midi-Channel moved to IO-Settings * ***New Analysis Engines: GND/Scope, GND/FFT * OC_T41 Support == 2024-02-14 * Enhancement/Bugfix: No usb midi response while 5sec startup #66 == 2024-02-12 * Enhancement/Bugfix: Unique midi device names (support multiple S&C devices for WebMidi #66) == 2024-02-07 * Enhancement/Bugfix: DXFM (custom syx handling) * Enhancement: FV1emu / FX-Compiler (using 16bit delay buffer for less memory consumption) * Enhancement: UI - one pixel left another up - bigger modulation popup == 2024-01-23 * Bugfix: Black screen ?! == 2024-01-20 * DevSync: * Bugfix T4X: CV input > 6 V is received as negative voltage bug * Bugfix: ClassicVAVCF -> param change Decay/Level * Enhancement: Modualtion attenuverter resolution 1/2000 * Enhancement/Bugfix: Modulation ranges.. * Enhancement: NEw Modulation CV src aka "+" constant voltage * Enhancement: Visualizing parameter modulations (moving knobs) * Enhancement: squares-and-circles api * Enhancement DSM: Support MID Button (ui navigaten - mid botton back function) == 2024-01-14 * DevSync: Fix DSM0 audio clipping == 2023-12-21 * DevSync: Fix DSM0 Callibration + Voltage engines == 2023-12-18 * DevSync: DSM0 ITCM usage + Bugfix DSM0 calibration * Enhancements/BreakingChanges: * Dynamic Loader (apps as header includes for now) - Noise, SAM, Faust engines ported == 2023-12-03 == * Bugfix: DxFM custom syx didnt work * DevSync: DSM0 perf+wdt == 2023-11-19 == * Refactoring CV-Engines (based on modulations) - CV-Output Scope-View * New CV-Engines: - EnvGen_AD - EnvFollower * Bugfix: CV-Engine (fine-tune after quantizer) * Bugfix: #57 * Bugfix: plaits engines trigger_patched reset == 2023-11-04 == * Bugfix: CV/Voltage modulation == 2023-10-14 == * Bugfix: CV/LFO shape selection == 2023-10-07 == * Bugfix: - crash in dac calibration == 2023-09-24 == * Enhancements: - I/O-Page: UI enhancements - Speech/SAM "random numbers" - Speech/LPC "AuxMix" Parameter * Bugfix: - Speech/LPC word selection - VOCT semitone = encoder step (skipped increments) == 2023-09-17 == * mi-libs sync/upgrade * new Synth-Engine: - ClassicVAVCF (Classic waveshapes with filter) - DxFM_BNK1-3 (using the SixOpEngine default patches) * Several engines, parameter naming, ranges and defaults optimizations ... * Optimised behaviour on encoders increments - Value change is 1/128 per step if the increments don't immediately follow each other - Short-time display of the value (0-127) * Bugfix: - GND engine - crash on encoder rotation == 2023-09-03 == * Enhancements, new engines: * Claps refactoring, drumsynth based on RC808 models * DxFM enhancement, 2 voice stereo mode * Waveforms, 2 voice stereo mode * JU60_chorus, emulation of Juno60 chorus, based on VA BBD * Noise engines: NES_noise, 808_squares * Bugfixes * #52 Modulations & quantizer * #51 Engine loading - IO config is lost / restored to defaults == 2023-08-09 == * Audio routing refactoring * Optimizations and bugfixes ````

■ Demos

Acknowledgments & Credits

Big thanks to the creators of ornament & crime (o_C) and PJRC for the Teensy and also to all those who have worked on the code and algorithms partly reused here, especially Mutable Instruments. They served a great source of learning and provided a huge playground and the foundation for this project.

Motivation / Challenge

Given are the following ingredients: Two buttons, two encoders and a 128x64 display. Sixteen I/O ports (4x trigs, 4x cv and 4x dac) and a Cortex-M7.

Damn many possibilities to complicate it. Mono, stereo and then again CV. A tricky task to design a simple UI logic, not get lost in menu diving, and to get as much out of the hardware as possible (work in progress).

Concept

Similar to Monomachine and Machinedrum here we have basically 4 configurable tracks. Each track can be assigned with a synthesizer machine, controlled by a trigger and CV input. As there are mono and stereo machines, the generated audio signal is routed to one or two neighbor DAC outputs by default. E.g you can chain the mono audio signal from an oscillator machine to the neighbor fx-machine with stereo-outputs.


Machines wiki



Screenshots

Engines

Machine/Engine

Machines/Engines are controlled by individual parameters.

[Short press left/right [ENCODER]] changes parameter selection
[Rotate left/right [ENCODER]] changes parameter value

Modulations

[Long press left or right [ENCODER]] shows/hides the modulation popup*

For each parameter a modulation can be assigned:

I/O-Configuration

[Long press [RIGHT]] enters the I/O-Configuration page.

The I/O-Configuration page lets you virtually patch the engine with the hardware ports. Depending on the engine interface, trigger, gate, accent and V/OCT can be configured. In addition to the trigger, which is set with a rising edge, a gate state is also provided, that can be processed by the engine. Engines like Closed/Open-HiHats have an additional accent input - this works technically like a second trigger. The V/OCT input can optionally be quantized and transposed. In addition to the Tx inputs, the Cx inputs can also be used as a source for triggers and accents. The output can be configured as mono or stereo. Several engines can share the same output - the signal is mixed.

Ctrl / Inputs

In case the Engine supports Triggers/Gates - Trigger Input is configurable:

In case the Engine supports Accents (Closed/Open HiHat) - Accent Input is configurable:

In case the Engine is an AUDIO_PROCESSOR - Input signal mix is configurable:


Mix / Outputs

MIDI/CLOCK-Settings

[Long press [LEFT] + [RIGHT]] for getting to the MIDI-Settings page.

The MIDI&Clock-Settings page lets you select the MIDI-Control.

In case the MIDI-Control is enabled, you can setup the Midi-Channel in the engine IO-settings.

Each engine can be assigned to a MIDI-Channel - it is possible to control single mono engines together polyphonically (for this all engines have to be set to the same midi channel). Midi-Engines consume the MIDI-Stream directly, therefore the MIDI-Messages are not converted as incoming CVs or triggers.

Clock-Source is used by engines like FX/Delay (clocked sync) or MIDI/Clock

Midi-Control

[Press L-ENC + R-ENC] to enter the patch storage page

Supported Hardware

Hardware setup procedure

Use WebFlasher to enter callibration mode, or execute advanced setup commands
Power on the module with the [LEFT] button pressed for entering the setup procedure.

Display setup

Encoder setup



DAC calibration

To calibrate the DAC, you need a multimeter. Besides the reference voltage of 0V, the voltages -2V and +2V should be calibrated as accurately as possible. Start with DAC1 (channel A) - connect the multimeter typically using alligator clip on a patch cable inserted in the jack. Use the right encoder to set the voltage as accurately as possible (press the encoder for coarse adjustment). Do it on all outputs - use the left encoder for channel selection. After calibrating 0V on all outputs, press [right] to step to the -2V calibration. Repeat the procedure and press [right] to calibrating +2V.

ADC calibration

To calibrate the ADC 0V reference, remove all patch cables from the module. Use the right encoder to adjust the offset (press the encoder for fast adjustment). Do it on all cv-inputs, select the channel with the left encoder. Press [right] to enter the -2V calibration. Now you need to connect the DAC outputs to the cv-inputs. The DAC output produces the reference voltage, that is calibrated on the input. Repeat the calibration procedure and step to the +2V calibration.

I/O Test:


⧉ Conclusions and the future

The project started as a kind of personal research in embedded DSP that I did over half a year. At some point, it turned out by chance that the O_C was very well suited for this by only upgrading the Teensy. Apart from the small optional mod on the DAC voltage range, the current O_C hardware unfortunately has some unchangeable limitations for audio applications. As you know, the Teensy 4.0 doesn't have "high-end" ADCs and a limited amount of RAM. On the other hand, it is the the combination of limitations that make the project unique.

Regarding the user interface and the concept of firmware, I am a bit torn. On the one hand, the two buttons and the two encoders are sufficient and actually practical for a multifunction module, but on the other hand, something is missing. Additional buttons/encoders could definitely simplify the operation/interaction - let's see if this puzzle can be solved.

License

The application code respectively the suite of machines/engines and the third-party source files are published under permissive software licenses. For the exact license and copyright holder - see the header of individual source code files or readme/license file in the sub folder.

The firmware as a whole is for personal use only. If you are considering commercial distributing hardware with this firmware, please contact me (eh2k◯gmx.de).