Skip to content

Commit

Permalink
devsync 2cd9d0a
Browse files Browse the repository at this point in the history
  • Loading branch information
eh2k committed Oct 27, 2024
1 parent e030c30 commit 5df6ebd
Show file tree
Hide file tree
Showing 72 changed files with 2,854 additions and 324 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ jobs:
export GCC_PATH=/$(realpath .)/xpack-arm-none-eabi-gcc-10.3.1-2.1/bin/
export PATH="${PATH}:/$(realpath .)/xpack-arm-none-eabi-gcc-10.3.1-2.1/bin/"
arm-none-eabi-gcc --version
pip install intelhex subprocess32 pyelftools Jinja2
pip install intelhex subprocess32 pyelftools Jinja2 platformio
find ./app -type f -name *.bin -exec touch {} +
git submodule update --init
sh ./app/build.sh
git status
pip install --upgrade platformio mido python-rtmidi intelhex
pio run -v --environment squares-and-circles
- name: pack_artifacts
run: |
export hash=$(git rev-parse --short HEAD)
Expand All @@ -42,6 +40,6 @@ jobs:
mv -v "$f" $HEX_FILE
zip -j -9 $ZIP_FILE $HEX_FILE .github/workflows/LICENSE.txt $(dirname ${f%.*})/loader.sha
sha256sum $ZIP_FILE
curl -fs -X PUT -u ${{ secrets.UPLOAD_KEY }} ${{ secrets.LATEST_DROP_FOLDER }}/${FIRMWARE}_engines_latest.zip --upload-file $ZIP_FILE || true
curl -fs -X PUT -u ${{ secrets.UPLOAD_KEY }} ${{ secrets.LATEST_DROP_FOLDER }}/${FIRMWARE}_engines_latest.sha -d "$hash"
curl -fs -X PUT -u ${{ secrets.UPLOAD_KEY }} ${{ secrets.LATEST_DROP_FOLDER }}/$ZIP_FILE --upload-file $ZIP_FILE || true
curl -fs -X PUT -u ${{ secrets.UPLOAD_KEY }} ${{ secrets.LATEST_DROP_FOLDER }}/${FIRMWARE}_latest.sha -d "$hash"
done
102 changes: 71 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,25 @@
<summary><b>ChangeLog</b></summary>

````
== 2025-07-02
* Bugfix: DSM0 "CRC32:0x63F R:1"
== 2024-06-15
== 2024-09-27
* 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
* New Engines:
* SEQ/EuclidRythm
* SEQ/EuclidArp
* DSM:
* One-Engine-Mode
== 2024-06-14
* Enhancement:
* T1 Clock - resets to begin after 200milis silence
* internal crc32 checks for debugging
Expand Down Expand Up @@ -157,9 +173,9 @@ E.g you can chain the mono audio signal from an oscillator machine to the neighb

<img align="right" src="doc/menu_engines.png" width=196px />

>[Long press [LEFT]] enters the machine-selection-page.<br/>
>[Short press [R-ENCODER]] loads the selected engine.<br/>
>[Long press [R-ENCODER]] loads the selected engine - extended mode.<br/>
* [Long press [LEFT]] enters the machine-selection-page.<br/>
* [Short press [R-ENCODER]] loads the selected engine.<br/>
* [Long press [R-ENCODER]] loads the selected engine - extended mode.<br/>
* Load & reset I/O settings
* Load & keep IO settings <img align="right" src="doc/engine_load_resetio.png" width=196px />
* Copy #1-4 (parameter values + modulations + I/O settings)
Expand All @@ -175,50 +191,69 @@ E.g you can chain the mono audio signal from an oscillator machine to the neighb
## Engines
* **GND**
* `---`
* Scope
* FFT
* [Scope](https://github.com/eh2k/squares-and-circles/wiki/Scope)
* [FFT](https://github.com/eh2k/squares-and-circles/wiki/FFT)
* **CV**
* [V/OCT](https://github.com/eh2k/squares-and-circles/wiki/V_OCT)
* EnvGen_AD
* EnvGen_ADSR
* LFO
* EnvFollower
* [EnvGen_AD](https://github.com/eh2k/squares-and-circles/wiki/EnvGen_AD)
* [EnvGen_ADSR](https://github.com/eh2k/squares-and-circles/wiki/EnvGen_ADSR)
* [LFO](https://github.com/eh2k/squares-and-circles/wiki/LFO)
* [EnvFollower](https://github.com/eh2k/squares-and-circles/wiki/EnvFollower)
* **Drums**
* Analog-BD, Analog SD, Analog HH, Analog HH2
* 909ish-BD, 909ish-SD, [TR909-HiHat, TR909-Ride](https://github.com/eh2k/squares-and-circles/wiki/TR909_HiHats)
* 808ish-BD, 808ish-SD, 808ish-HiHat
* TR707, TR707-HiHat
* [Analog-BD](https://github.com/eh2k/squares-and-circles/wiki/Analog-BD),
* [Analog-SD](https://github.com/eh2k/squares-and-circles/wiki/Analog-SD),
* [Analog-HH](https://github.com/eh2k/squares-and-circles/wiki/Analog-HH),
* [Analog-HH2](https://github.com/eh2k/squares-and-circles/wiki/Analog-HH2),
* [909ish-BD](https://github.com/eh2k/squares-and-circles/wiki/909ish-BD),
* [909ish-SD](https://github.com/eh2k/squares-and-circles/wiki/909ish-SD),
* [TR909-HiHat, TR909-Ride](https://github.com/eh2k/squares-and-circles/wiki/TR909_HiHats)
* [808ish-BD](https://github.com/eh2k/squares-and-circles/wiki/808ish-BD),
* [808ish-SD](https://github.com/eh2k/squares-and-circles/wiki/808ish-SD),
* [808ish-HiHat](https://github.com/eh2k/squares-and-circles/wiki/808ish-HiHat),
* [TR707](https://github.com/eh2k/squares-and-circles/wiki/TR707),
* [DMX](https://github.com/eh2k/squares-and-circles/wiki/DMX),
* [Linn](https://github.com/eh2k/squares-and-circles/wiki/Linn),
* [FM-Drum](https://github.com/eh2k/squares-and-circles/wiki/FM-Drum)
* Djembe
* [Djembe](https://github.com/eh2k/squares-and-circles/wiki/Djembe)
* [Claps](https://github.com/eh2k/squares-and-circles/wiki/Claps)
* **M-OSC**
* [Waveforms](https://github.com/eh2k/squares-and-circles/wiki/Waveforms)
* Virt.Analog, Waveshaping, FM, Grain, Additive, Wavetable, Chord
* [Virt.Analog](https://github.com/eh2k/squares-and-circles/wiki/Virt.Analog)
* [Waveshaping](https://github.com/eh2k/squares-and-circles/wiki/Waveshaping)
* [2-OP-FM](https://github.com/eh2k/squares-and-circles/wiki/2-OP-FM)
* [Formant/PD](https://github.com/eh2k/squares-and-circles/wiki/Formant-PD)
* [Harmonic](https://github.com/eh2k/squares-and-circles/wiki/Harmonic)
* [Wavetable](https://github.com/eh2k/squares-and-circles/wiki/Waveforms)
* [Chord](https://github.com/eh2k/squares-and-circles/wiki/Waveforms)
* **SYNTH**
* Resonator
* [Resonator](https://github.com/eh2k/squares-and-circles/wiki/Resonator)
* [DxFM](https://github.com/eh2k/squares-and-circles/wiki/DxFM)
* [DxFM_BNK1-3](lib/plaits/resources.cc#L41)
* [Open303](https://github.com/eh2k/squares-and-circles/wiki/Open303)
* [ClassicVAVCF](lib/plaits/dsp/engine2/virtual_analog_vcf_engine.cc)
* **Stereo-FX**
* [Reverb](https://github.com/eh2k/squares-and-circles/wiki/clouds_reverb)
* ReverbSC
* Rev-Dattorro
* Delay
* Gated-Reverb
* Reverb-HP-LP
* [ReverbSC](https://github.com/eh2k/squares-and-circles/wiki/ReverbSC)
* [Rev-Dattorro](https://github.com/eh2k/squares-and-circles/wiki/Rev-Dattorro)
* [Delay](https://github.com/eh2k/squares-and-circles/wiki/Delay)
* [Gated-Reverb](https://github.com/eh2k/squares-and-circles/wiki/Gated-Reverb)
* [Reverb-HP-LP](https://github.com/eh2k/squares-and-circles/wiki/Reverb-HP-LP)
* [JU60_chorus](https://github.com/eh2k/squares-and-circles/wiki/JU60_chorus)
* **NOISE**
* [White/Pink](https://github.com/eh2k/squares-and-circles/wiki/White_Pink_noise)
* [NES_noise](https://github.com/eh2k/squares-and-circles/wiki/NES_noise)
* [808_squares](https://github.com/eh2k/squares-and-circles/wiki/808_squares)
* **SPEECH**
* LPC
* [LPC](https://github.com/eh2k/squares-and-circles/wiki/LPC)
* [SAM](https://github.com/eh2k/squares-and-circles/wiki/SAM)
* **MIDI**
* Monitor
* Clock
* VAx6
* [Monitor](https://github.com/eh2k/squares-and-circles/wiki/Monitor)
* [Clock](https://github.com/eh2k/squares-and-circles/wiki/Clock)
* [VAx6](https://github.com/eh2k/squares-and-circles/wiki/VAx6)
* **SEQ**
* [EuclidRythm](https://github.com/eh2k/squares-and-circles/wiki/EuclidRythm)
* [EuclidArp](https://github.com/eh2k/squares-and-circles/wiki/EuclidArp)


## Machine/Engine

Expand Down Expand Up @@ -257,16 +292,21 @@ For each parameter a modulation can be assigned:
* DECAY
* **LFO**: Free/Triggered Sine-LFO <img align="right" src="doc/mod_lfo.png" width=196px />
* TRIG: `-`, `!`, `T1`, `T2`, `T3`, `T4`, `C1`, `C2`, `C3`, `C4`
* SHAPE
* FREQUENCY
* SHAPE: `SIN`, `TRI`, `SQR`, `STEPS`, `NOISE`
* FREQUENCY: `0-127`
* WAVEFORM: `0-127`
* **EF**: Envelope Follower <img align="right" src="doc/mod_ef.png" width=196px />
* SRC: `C1`, `C2`, `C3`, `C4`
* ATTACK
* RELEASE
* **TM**: Turing Machine <img align="right" src="doc/mod_tm.png" width=196px />
* TRIG: `!`, `CLK`, `T1`, `T2`, `T3`, `T4`
* TRIG: `!`, `CLK`, `T1`, `T2`, `T3`, `T4`, `C1`, `C2`, `C3`, `C4`
* PROB: `0-9` (0-100%)
* STEPS: `1-16`
* **SEQ**: 4-Step Sequencer <img align="right" src="doc/mod_seq.png" width=196px />
* 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<br/>
>`CLK` = internal clock<br/>
All modulations have an attenuverter parameter (-/+).
Expand Down
Binary file added app/CV/EnvGen_ADSR.bin
Binary file not shown.
117 changes: 117 additions & 0 deletions app/CV/EnvGen_ADSR.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
// Copyright (C)2021 - E.Heidt
//
// Author: E.Heidt ([email protected])
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
// See http://creativecommons.org/licenses/MIT/ for more information.
//

#include "../squares-and-circles-api.h"
#include "peaks/modulations/multistage_envelope.h"
#include "peaks/modulations/multistage_envelope.cc"
#include "../DRUMS/resources/peaks_lut_env.hpp"

peaks::MultistageEnvelope _processor;

int32_t _attack = 0;
int32_t _decay = UINT16_MAX / 2;
int32_t _sustain = UINT16_MAX / 2;
int32_t _release = UINT16_MAX / 2;

peaks::GateFlags flags[FRAME_BUFFER_SIZE];
int16_t buffer[FRAME_BUFFER_SIZE];

struct
{
int8_t scope[128] = {};
int i = 0;

void draw(int y)
{
for (int x = 0; x < 127; x++)
{
if (x % 3 == 0)
gfx::setPixel(x, y);
gfx::drawLine(x, y - scope[(i + x) % 128], x + 1, y - scope[(1 + i + x) % 128]);
}
}

void push(int y)
{
scope[i++ % 128] = y;
if (i > 127)
i = 0;
}
} _scope;

void engine::setup()
{
_processor.Init();

engine::addParam("Attack", &_attack, 0, UINT16_MAX);
engine::addParam("Decay", &_decay, 0, UINT16_MAX);
engine::addParam("Sustain", &_sustain, 0, UINT16_MAX);
engine::addParam("Release", &_release, 0, UINT16_MAX);
engine::setMode(ENGINE_MODE_COMPACT | ENGINE_MODE_CV_OUT);
}

void engine::process()
{
uint16_t params[4];
params[0] = _attack;
params[1] = _decay;
params[2] = _sustain;
params[3] = _release;
_processor.Configure(params, peaks::CONTROL_MODE_FULL);

if (engine::trig())
{
flags[0] = peaks::GATE_FLAG_RISING;
std::fill(&flags[1], &flags[FRAME_BUFFER_SIZE], peaks::GATE_FLAG_HIGH);
}
else if (engine::gate())
{
std::fill(&flags[0], &flags[FRAME_BUFFER_SIZE], peaks::GATE_FLAG_HIGH);
}
else
{
flags[0] = flags[0] == peaks::GATE_FLAG_HIGH ? peaks::GATE_FLAG_FALLING : peaks::GATE_FLAG_LOW;
std::fill(&flags[1], &flags[FRAME_BUFFER_SIZE], peaks::GATE_FLAG_LOW);
}

_processor.Process(flags, buffer, FRAME_BUFFER_SIZE);

static float y = 0;
if ((engine::t() % 50) == 0)
{
_scope.push(y);
y = 0;
}
else
y = std::max<int>(y, buffer[0] / (INT16_MAX / 16));

for (int i = 0; i < FRAME_BUFFER_SIZE; i++)
engine::outputBuffer<0>()[i] = (float)buffer[i] / -INT16_MIN * 8.f;
}

void engine::draw()
{
_scope.draw(56);
}
Binary file modified app/DRUMS/Djembe.bin
Binary file not shown.
Binary file removed app/DRUMS/TR707-HiHat.bin
Binary file not shown.
33 changes: 0 additions & 33 deletions app/DRUMS/TR707-HiHat.cpp

This file was deleted.

Binary file modified app/DRUMS/TR707.bin
Binary file not shown.
Loading

0 comments on commit 5df6ebd

Please sign in to comment.