Skip to content

Commit

Permalink
devsync a0c24c1 #103
Browse files Browse the repository at this point in the history
  • Loading branch information
eh2k committed Nov 6, 2024
1 parent 39a9940 commit dc35138
Show file tree
Hide file tree
Showing 31 changed files with 158 additions and 98 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +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 platformio
find ./app -type f -name *.bin -exec touch {} +
pip install intelhex subprocess32 pyelftools Jinja2 platformio elf_size_analyze
git submodule update --init
sh ./app/build.sh
git status
sh ./app/build.sh --rebuild
git --no-pager diff
git checkout -- .
- name: pack_artifacts
run: |
export hash=$(git rev-parse --short HEAD)
Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,21 @@
<summary><b>ChangeLog</b></summary>

````
== 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:
* SEC/EuclidArp
* SEQ/EuclidArp
- fixed: note order (starting with root note)
- quantized output
- slide modes: OFF, ON, RND25, RND50, RND75
Expand Down
Binary file modified app/CV/EnvGen_ADSR.bin
Binary file not shown.
12 changes: 7 additions & 5 deletions app/CV/EnvGen_ADSR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
// See http://creativecommons.org/licenses/MIT/ for more information.
//

// build_flags: -fno-inline -mfloat-abi=hard -mfpu=fpv5-d16

#include "../squares-and-circles-api.h"
#include "peaks/modulations/multistage_envelope.h"
#include "peaks/modulations/multistage_envelope.cc"
Expand All @@ -35,9 +37,6 @@ 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] = {};
Expand Down Expand Up @@ -74,6 +73,8 @@ void engine::setup()

void engine::process()
{
peaks::GateFlags flags[FRAME_BUFFER_SIZE];

uint16_t params[4];
params[0] = _attack;
params[1] = _decay;
Expand All @@ -96,9 +97,10 @@ void engine::process()
std::fill(&flags[1], &flags[FRAME_BUFFER_SIZE], peaks::GATE_FLAG_LOW);
}

int16_t *buffer = engine::outputBuffer_i16<0>();
_processor.Process(flags, buffer, FRAME_BUFFER_SIZE);

static float y = 0;
static int y = 0;
if ((engine::t() % 50) == 0)
{
_scope.push(y);
Expand All @@ -108,7 +110,7 @@ void engine::process()
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;
buffer[i] /= 2;
}

void engine::draw()
Expand Down
Binary file modified app/DRUMS/808ish-BD.bin
Binary file not shown.
9 changes: 5 additions & 4 deletions app/DRUMS/808ish-BD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
// See http://creativecommons.org/licenses/MIT/ for more information.
//

// build_flags: -fno-inline -mfloat-abi=hard -mfpu=fpv5-d16

#include "../squares-and-circles-api.h"
#include "peaks/drums/bass_drum.h"
#include "peaks/drums/bass_drum.cc"
Expand All @@ -35,12 +37,9 @@ int32_t _punch = UINT16_MAX / 2;
int32_t _tone = UINT16_MAX / 2;
int32_t _decay = UINT16_MAX / 2;

peaks::GateFlags flags[FRAME_BUFFER_SIZE];

void engine::setup()
{
_processor.Init();
std::fill(&flags[0], &flags[FRAME_BUFFER_SIZE], peaks::GATE_FLAG_LOW);

engine::addParam("Pitch", &_freq, 0, UINT16_MAX);
engine::addParam("Punch", &_punch, 0, UINT16_MAX);
Expand All @@ -50,7 +49,9 @@ void engine::setup()

void engine::process()
{
_processor.set_frequency(_freq);
peaks::GateFlags flags[FRAME_BUFFER_SIZE];

_processor.set_frequency(_freq - 32768);
_processor.set_punch(_punch);
_processor.set_tone(_tone);
_processor.set_decay(_decay);
Expand Down
Binary file modified app/DRUMS/FM-Drum.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion app/DRUMS/FM-Drum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void engine::setup()

void engine::process()
{
int32_t freq = (_freq) + (engine::cv() * INT16_MAX / 3); // CV or Midi Pitch ?!
int32_t freq = (_freq) + (engine::cv_i32() / PITCH_PER_OCTAVE * INT16_MAX / 3); // CV or Midi Pitch ?!
freq += (-2 * INT16_MAX / 3);
CONSTRAIN(freq, 0, UINT16_MAX); // BUG: lower values?

Expand Down
Binary file modified app/DRUMS/TR909-HiHat.bin
Binary file not shown.
23 changes: 17 additions & 6 deletions app/DRUMS/TR909-HiHat.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
#include "../squares-and-circles-api.h"

// #include "eproms/tr909/hihats.h"
static const uint8_t *HiHats_bin = machine::fs_read("909_HIGH");

static float _ch_vol = 1.f;
static float _ch_dec = 0.2f;
static float _oh_dec = 0.5f;

int32_t _select = 0;
void *_ch;
void *_oh;
void *_ch = nullptr;
void *_oh = nullptr;

void engine::setup()
{
const uint8_t *HiHats_bin = machine::fs_read("909_HIGH");

if (HiHats_bin == nullptr)
return;

_oh = dsp_sample_u8(HiHats_bin, 24576, 32000, 0);
const int ch_start = 24576;
_ch = dsp_sample_u8(HiHats_bin + ch_start, 32768 - ch_start, 32000, 0);
Expand All @@ -25,6 +27,9 @@ void engine::setup()

void engine::process()
{
if (_oh == nullptr)
return;

auto outputL = engine::outputBuffer<0>();
memset(outputL, 0, sizeof(float) * FRAME_BUFFER_SIZE);

Expand All @@ -40,4 +45,10 @@ void engine::process()

dsp_process_sample(_ch, 0, 1, engine::cv(), outputL);
dsp_process_sample(_oh, 0, 1, engine::cv(), outputL);
}
}

void engine::draw()
{
if (_oh == nullptr)
gfx::drawString(20, 20, "ROMS NOT FOUND\n \n 909_HIGH");
}
Binary file modified app/DRUMS/TR909-Ride.bin
Binary file not shown.
24 changes: 17 additions & 7 deletions app/DRUMS/TR909-Ride.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
#include "../squares-and-circles-api.h"

// #include "eproms/tr909/ride.h"
static const uint8_t *Ride_bin = machine::fs_read("909_RIDE");

constexpr static int ch_start = 24576;

static float _ch_vol = 1.f;
static float _ch_dec = 0.2f;
static float _oh_dec = 0.5f;

int32_t _select = 0;
void *_ch;
void *_oh;
void *_ch = nullptr;
void *_oh = nullptr;

void engine::setup()
{
const uint8_t *Ride_bin = machine::fs_read("909_RIDE");
if (Ride_bin == nullptr)
return;

_ch = dsp_sample_u8(Ride_bin, 32768, 32000, 0);
_oh = dsp_sample_u8(Ride_bin, 32768, 32000, 0);

Expand All @@ -26,10 +27,13 @@ void engine::setup()

void engine::process()
{
if (_oh == nullptr)
return;

auto outputL = engine::outputBuffer<0>();
memset(outputL, 0, sizeof(float) * FRAME_BUFFER_SIZE);

if (engine::accent()) //OH
if (engine::accent()) // OH
{
dsp_set_sample_pos(_ch, 0, 0, _oh_dec);
dsp_set_sample_pos(_oh, 0, 1.f, _oh_dec);
Expand All @@ -42,4 +46,10 @@ void engine::process()

dsp_process_sample(_ch, 0, 1, engine::cv(), outputL);
dsp_process_sample(_oh, 0, 1, engine::cv(), outputL);
}
}

void engine::draw()
{
if (_oh == nullptr)
gfx::drawString(20, 20, "ROMS NOT FOUND\n \n 909_RIDE");
}
Binary file modified app/FX/JU60_chorus.bin
Binary file not shown.
9 changes: 5 additions & 4 deletions app/FX/JU60_chorus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ struct Juno60_Chorus_BBD
_delayR.clear();
}

float dry[FRAME_BUFFER_SIZE];
float phase_ = 0;

void lfo_tri(float phase_inc_, float *out)
Expand All @@ -201,13 +200,15 @@ struct Juno60_Chorus_BBD
}
}

float clockL[FRAME_BUFFER_SIZE];
float clockR[FRAME_BUFFER_SIZE];

void process(float *inOut, float *outR, uint32_t len)
{
float wet = 1.f - mode_.dry;
float f = mode_.freq / SAMPLE_RATE;

float dry[FRAME_BUFFER_SIZE];
float clockL[FRAME_BUFFER_SIZE];
float clockR[FRAME_BUFFER_SIZE];

memcpy(dry, inOut, len * sizeof(float));

lfo_tri(f, clockL);
Expand Down
3 changes: 0 additions & 3 deletions app/FX/ReverbSC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@

#include "../squares-and-circles-api.h"

extern "C"
{
#include "soundpipe/revsc.c"
}

static sp_data sp_data_ = {};
static sp_revsc sp_revsc_ = {};
Expand Down
Binary file modified app/M-OSC/Waveforms.bin
Binary file not shown.
48 changes: 25 additions & 23 deletions app/M-OSC/Waveforms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
// See http://creativecommons.org/licenses/MIT/ for more information.
//

// xuild_flags: -fno-inline -mfloat-abi=soft -mfpu=fpv5-d16

#include "../squares-and-circles-api.h"

#include "stmlib/stmlib.h"
Expand All @@ -34,16 +36,7 @@
#include "braids/settings.h"

#include "braids/vco_jitter_source.h"

#include "braids/analog_oscillator.cc"
#define kHighestNote kHighestNote2
#define kPitchTableStart kPitchTableStart2
#define kOctave kOctave2
#include "braids/digital_oscillator.cc"
#include "braids/settings.cc"
#include "braids/macro_oscillator.cc"
#include "braids/resources.cc"
#include "stmlib/utils/random.cc"
#include <algorithm>

using namespace braids;

Expand All @@ -52,18 +45,15 @@ MacroOscillator osc2;
Envelope envelope;
VcoJitterSource jitter_source;

uint8_t sync_samples[FRAME_BUFFER_SIZE];
uint8_t sync_samples[FRAME_BUFFER_SIZE] = {};

float _pitch = 0;
int32_t _pitch = DEFAULT_NOTE;
int32_t _shape = 0;
int32_t _timbre = UINT16_MAX / 2;
int32_t _color = UINT16_MAX / 2;
int32_t _attack = 0;
int32_t _decay = UINT16_MAX / 2;

float buffer[FRAME_BUFFER_SIZE];
float bufferR[FRAME_BUFFER_SIZE];

void engine::setup()
{
settings.Init();
Expand All @@ -72,19 +62,21 @@ void engine::setup()
jitter_source.Init();
envelope.Init();

std::fill(&sync_samples[0], &sync_samples[FRAME_BUFFER_SIZE], 0);
// std::fill(&sync_samples[0], &sync_samples[FRAME_BUFFER_SIZE], 0);

// settings.SetValue(SETTING_AD_VCA, true);
settings.SetValue(SETTING_SAMPLE_RATE, 5);
settings.SetValue(SETTING_PITCH_OCTAVE, 4);
settings.SetValue(SETTING_PITCH_RANGE, PITCH_RANGE_EXTERNAL);

engine::addParam(V_OCT, &_pitch);
engine::addParam(V_OCT, &_pitch, 0, 255);
engine::addParam("Shape", &_shape, braids::MACRO_OSC_SHAPE_CSAW, braids::MACRO_OSC_SHAPE_LAST - 1, (const char **)braids::settings.metadata(braids::Setting::SETTING_OSCILLATOR_SHAPE).strings);
engine::addParam("Timbre", &_timbre, 0, UINT16_MAX);
engine::addParam("Color", &_color, 0, UINT16_MAX);
engine::addParam("Decay", &_decay, 0, UINT16_MAX);
engine::addParam("Attack", &_attack, 0, UINT16_MAX);
engine::setMode(ENGINE_MODE_STEREOLIZED);

}

void engine::process()
Expand All @@ -106,8 +98,8 @@ void engine::process()

uint32_t ad_value = envelope.Render();

float pitchV = engine::cv();
int32_t pitch = (pitchV * 12.f + DEFAULT_NOTE + 12) * 128;
int32_t pitchV = engine::cv_i32();
int32_t pitch = pitchV + (DEFAULT_NOTE + 12) * 128;

// if (!settings.meta_modulation())
// {
Expand Down Expand Up @@ -143,8 +135,8 @@ void engine::process()

if (engine::is_stereo() && __io->stereo > 0) // Stereo
{
const float f = (float)__io->stereo / 255.f;
uint8_t stereo = f * f * f * 255;
const int32_t f = __io->stereo;
int32_t stereo = (f * f * f) / (255 * 255);

int32_t timbre = _timbre + stereo;
if (timbre > UINT16_MAX)
Expand All @@ -163,7 +155,7 @@ void engine::process()
for (int i = 0; i < FRAME_BUFFER_SIZE; i++)
audio_samples[i] = (gain * audio_samples[i]) / UINT16_MAX;
}
else
else
{
memcpy(engine::outputBuffer_i16<1>(), engine::outputBuffer_i16<0>(), FRAME_BUFFER_SIZE * sizeof(int16_t));
}
Expand All @@ -186,4 +178,14 @@ void engine::draw()
setParamName(&_decay, "VCA-off");
setParamName(&_attack, nullptr);
}
}
}

#include "braids/analog_oscillator.cc"
#define kHighestNote kHighestNote2
#define kPitchTableStart kPitchTableStart2
#define kOctave kOctave2
#include "braids/digital_oscillator.cc"
#include "braids/settings.cc"
#include "braids/macro_oscillator.cc"
#include "braids/resources.cc"
#include "stmlib/utils/random.cc"
Binary file modified app/MIDI/Clock.bin
Binary file not shown.
Loading

0 comments on commit dc35138

Please sign in to comment.