Skip to content

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

Notifications You must be signed in to change notification settings

eh2k/squares-and-circles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

  • [Short Press [LEFT]/[RIGHT]] scrolls through the 4 machine-tracks.
  • [Long press [LEFT]] enters the machine-selection-page.
  • [Long press [RIGHT]] enters the menu-page.
  • [Long press left or right [ENCODER]] shows the modulation popup
  • [Long press [L-ENCODER] + [R-ENCODER]] saves the patch - will be restored at startup
    • DEBUG: skip restore - press [RIGHT] button while startup ).

Machines wiki

  • [Long press [LEFT]] enters the machine-selection-page.
  • [Short press [R-ENCODER]] loads the selected engine.
  • [Long press [R-ENCODER]] loads the selected engine - extended mode.
    • Load & reset I/O settings
    • Load & keep IO settings
    • Copy #1-4 (parameter values + modulations + I/O settings)


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:

  • CV:

    • SRC:
      • C1, C2, C3, C4 - Analog inputs
        • OP: THRU, S&H-T1, S&H-T2, S&H-T3, S&H-T4, T&H-T1, T&H-T2, T&H-T3, T&H-T4
          • THRU - Thru Input
          • S&H - Sample and Hold
          • T&H - Track and Hold
      • + - Constant internal voltage
        • 10V with 1/1000 resolution - nice for fine adjustments (detuning etc)
    • Hints:
      • Parameter 0 (top-left) is mainly used for V/OCT control. Thus, one single V/OCT signal / CV-Input can be shared by using modulation on parameter-0 with attenuverter = +1 (-3V..+6V) range. It is also possible to select the V/OCT input in the io-configuration page.
      • All other parameters can be modulated via CV-input with a assumed voltage-range of -4V..4V at 2kHz sample rate.
      • Be aware the CV-range is probably limited by hardware to: -3.5v..6.5V
  • RND: Trigger generates a random voltage

    • TRIG: !, T1, T2, T3, T4, C1, C2, C3, C4


  • ENV: Triggered Envelope (Attack, Decay)

    • TRIG: !, T1, T2, T3, T4, C1, C2, C3, C4
    • ATTACK
    • DECAY
  • LFO: Free/Triggered Sine-LFO

    • TRIG: -, !, T1, T2, T3, T4, C1, C2, C3, C4
    • SHAPE: SIN, TRI, SQR, STEPS, NOISE
    • FREQUENCY: 0-127
    • WAVEFORM: 0-127
  • EF: Envelope Follower

    • SRC: C1, C2, C3, C4
    • ATTACK
    • RELEASE
  • TM: Turing Machine

    • TRIG: !, CLK, T1, T2, T3, T4, C1, C2, C3, C4
    • PROB: 0-9 (0-100%)
    • STEPS: 1-16
  • SEQ: 4-Step Sequencer

    • TRIG: !, T1, T2, T3, T4, C1, C2, C3, C4, CLK/1, CLK/4, CLK/16, CLK/32, CLK/96
    • RESET: -, T1, T2, T3, T4, C1, C2, C3, C4
    • 4-STEPS: -64..64

! = current engine trigger
CLK = internal clock
All modulations have an attenuverter parameter (-/+).

  • The modulation-voltage is attenuverted/multiplied by -1..+1;

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:

  • Trig-Input:
    • -
    • T1, T2, T3, T4, C1, C2, C3, C4

In case the Engine supports V/OCT - V/OCT Input is configurable:

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

  • Accent-Input:
    • -
    • T1, T2, T3, T4, C1, C2, C3, C4

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

  • Aux-Input: -, C1, C2, C3, C4
    • AUX-IN: -3V..3V for additional audio source for effects (prefer CV4).
  • Insert-1: Feed-in signal from engine-1
  • Insert-2: Feed-in signal from engine-2
  • Insert-3: Feed-in signal from engine-3
  • Insert-Aux: Feed-in signal from aux-input

Mix / Outputs

  • Level: Output volume level
    • can result in distortion
    • not available on CV-Engines
  • Pan: Stereo panning
    • on stereo engines with mono output, panning is also used for mixing
  • Output
    • -, A, A+B, B, C, C+D, D
      • The option -(no output) is useful if the signal is to be routed into an AUDIO_PROCESSOR engine
  • Stereo
    • Experimental stereo feature - see STERIOLIZED Flag ;-)

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: BPM
    • - none
    • INT Internal Clock-Source (BPM)
    • T1 T1 as Clock-Input (4ppqn)
    • MIDI Clock received from MIDI

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

Midi-Control

  • Engines can be loaded/selected by midi program change
  • Default Parameter CC-Mappings
    | HEX | DEC | parameter-index | CH |
    |-----|-----|-----------------|----|
    |  20 |  32 |        0        |  * |
    |  21 |  33 |        1        |  * |
    |  22 |  34 |        2        |  * |
    |  23 |  35 |        3        |  * |
    |  24 |  36 |        4        |  * |
    |  25 |  37 |        5        |  * |
    |  26 |  38 |        6        |  * |
    |  27 |  39 |        7        |  * |
    

Patch Storage

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

  • Use L-ENC for patch slot selection
  • Use R-ENC for LOAD/SAVE
    • Load empty - restores all engines to GND/-

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

  • Press left encoder to flip180.
  • Press right encoder for changing display brightness (50%, maximal).

Encoder setup

  • Check the encoder rotation direction.
  • Press encoder for reversed 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:

  • Test/Verify your TRIG or CV inputs.
  • The output voltage is set by the cv input voltage (DACx = ADCx).

⧉ 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).

About

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

Topics

Resources

Stars

Watchers

Forks

Languages