Skip to content

Commit 598c89c

Browse files
committed
devsync 6d501ea
1 parent cbf07e7 commit 598c89c

File tree

12 files changed

+76
-80
lines changed

12 files changed

+76
-80
lines changed

CHANGELOG.txt

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
== 2026-02-24
6+
* Enhancements:
7+
* Merged TR-909-Ride into TR-909-HiHat engine
8+
* IO-Page: Indent on MultiTrigs level/pan
9+
* Bugfix:
10+
* SYNTH/DxFM - Stereo parameter fix
11+
* Midi cc to an unexisting parameter crashes s&c #152
512
== 2026-02-21
613
* New Engines
714
* SEQ/303-Patterns
@@ -10,7 +17,7 @@ All notable changes to this project will be documented in this file.
1017
* Trig Gates "inverted" fix
1118
* Output designation according to the latest rev3 panel.
1219
* Patches are stored end of 8MB flash range (T40 2MB)
13-
* Enchancement:
20+
* Enhancements:
1421
* Default IO config - (reset on load empty patch)
1522
* Named Output/Inputs (outputBuffer_f32(name)/inputBuffer_f32(name))
1623
* M-OSC/Waveforms - Attack removed, Stereo parameter added
@@ -26,15 +33,15 @@ All notable changes to this project will be documented in this file.
2633
* Bugfix:
2734
* Modulation Clock disabled (except clocked engines) -> global clock default for non clocked engines #118
2835
== 2025-12-14
29-
* Enchancement
36+
* Enhancements
3037
* SEQ engines: support any input for clock-source #118
3138
* Midi+Clock+Timing: Tigger-Input-Delay setting #150
3239
== 2025-12-07
3340
* Bugfix
3441
* IO-page/Stereo control not allways visible (depends on output settings)
3542
* IO-page/Input level not visible for CV-Engines (now allways visible, scope usecase etc)
3643
* GND/Scope performance issue (range limit)
37-
* Enchancement
44+
* Enhancements
3845
* Modulation CV - Attenuverter min/max = ±2 #149
3946
* Scope/FFT stereo signal pass through
4047
* WhitePink noise stereo (+BROWN mode)
@@ -48,7 +55,7 @@ All notable changes to this project will be documented in this file.
4855
* FX/Delay - patch restore allways default control values
4956
* FX/Delay - dynamic time parameter by internal clock (general bpm == 0 case)
5057
* FX/Delay - heap corruption (cause DelayLine array)
51-
* Enchancement
58+
* Enhancements
5259
* FX/Delay - Dry/Wet control #101
5360
* UsbHid - remote display (https://eh2k.github.io/%E2%96%A1%E2%97%8F/remote/)
5461
* DrumSynth - MidiNote mapping implemented
@@ -64,7 +71,7 @@ All notable changes to this project will be documented in this file.
6471
* Glitch/Noise caused in some cases by drawing x > 128 (TR707 sample visualization)
6572
* TR707: fixed TOM samplerate from 25000 to 12500
6673
* MIDI CC doesn't reach last step of a parameter #139
67-
* Enchancement
74+
* Enhancements
6875
* TR707
6976
- optional crash & ride crymbals added
7077
- Midi CC04 (Footcontroller) support for Closed/OpenHihat
@@ -144,7 +151,7 @@ All notable changes to this project will be documented in this file.
144151
* Enhancements
145152
* DrumSynth ...
146153
== 2024-12-17
147-
* Bugfix/Enchancement #117
154+
* Bugfix/Enhancements #117
148155
* Parameter value was not visualized when modulations set (Bug since 2024-12-16)
149156
* Midi pitch was added before quantizer
150157
* V_OCT parameter value was added before quantized
@@ -153,10 +160,10 @@ All notable changes to this project will be documented in this file.
153160
* New paramters io-page
154161
* Quantizer-Root
155162
* Transpose-Finetune
156-
* Bugfix/Enchancement
163+
* Bugfix/Enhancements
157164
* tanspose offset was quantized
158165
== 2024-12-14
159-
* Bugfix/Enchancement
166+
* Bugfix/Enhancements
160167
* SEQ triggered & trig-input triggered engines were not in sync
161168
* V_OCT/Scale parameter, semitones from active quantizer (#117)
162169
* Claps less RAM usage

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ The available engine types include drums, synthesizers, oscillators, sequencers,
7979
* [Analog-HH2](https://github.com/eh2k/squares-and-circles/wiki/Analog-HH2),
8080
* [909ish-BD](https://github.com/eh2k/squares-and-circles/wiki/909ish-BD),
8181
* [909ish-SD](https://github.com/eh2k/squares-and-circles/wiki/909ish-SD),
82-
* [TR909-HiHat, TR909-Ride](https://github.com/eh2k/squares-and-circles/wiki/TR909_HiHats)
82+
* [TR909-HiHat](https://github.com/eh2k/squares-and-circles/wiki/TR909_HiHats)
8383
* [808ish-BD](https://github.com/eh2k/squares-and-circles/wiki/808ish-BD),
8484
* [808ish-SD](https://github.com/eh2k/squares-and-circles/wiki/808ish-SD),
8585
* [808ish-HiHat](https://github.com/eh2k/squares-and-circles/wiki/808ish-HiHat),

app/DRUMS/TR909-HiHat.bin

860 Bytes
Binary file not shown.

app/DRUMS/TR909-Ride.bin

-1.88 KB
Binary file not shown.

app/SYNTH/DxFM.bin

-4 Bytes
Binary file not shown.

app/index.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"DRUMS/FM-Drum.bin",
1414
"DRUMS/TR707.bin",
1515
"DRUMS/TR909-HiHat.bin",
16-
"DRUMS/TR909-Ride.bin",
1716
"FILTER/MoogLadder.bin",
1817
"FILTER/SVF.bin",
1918
"FILTER/TeeBee.bin",

app/squares-and-circles-loader.sha

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
85b3d76
1+
6d501ea

doc/engines.png

182 Bytes
Loading

src/DRUMS/TR909-HiHat.cpp

Lines changed: 57 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,94 @@
22

33
static float _ch_vol = 1.f;
44
static float _ch_dec = 0.2f;
5+
static float _oh_vol = 1.f;
56
static float _oh_dec = 0.5f;
7+
static float _rd_vol = 1.f;
8+
static float _rd_dec = 0.5f;
69

7-
int32_t _select = 0;
10+
int32_t _select;
11+
const char *sample_names[] = {"CH", "OH", "RD"};
12+
// void *_samples[3] = {};
813
void *_ch = nullptr;
914
void *_oh = nullptr;
15+
void *_rd = nullptr;
16+
17+
static std::pair<uint8_t, uint8_t> midi_key_map[] = {
18+
{42, 0}, // HH - Closed
19+
{44, 0}, // HH - Pedal
20+
{46, 1}, // HH - Open
21+
{51, 2}, // RD - Ride
22+
{59, 2}, // RD - Ride Edge
23+
{53, 2}, // RD - Ride Bell
24+
// {49, 3}, // CR - Crash
25+
// {55, 3}, // CR - Crash Edge
26+
// {57, 3}, // CR - Crash Bow
27+
{0xFF, 0}, // END
28+
};
29+
30+
float *_outputL = nullptr;
31+
float *_outputR = nullptr;
1032

1133
void engine::setup()
1234
{
1335
const uint8_t *HiHats_bin = machine::fs_read("909_HIGH");
36+
const uint8_t *Ride_bin = machine::fs_read("909_RIDE");
1437

15-
if (HiHats_bin == nullptr)
38+
if (HiHats_bin == nullptr || Ride_bin == nullptr)
1639
return;
1740

18-
_oh = dsp_sample_u8(HiHats_bin, 24576, 32000, 0);
1941
const int ch_start = 24576;
2042
_ch = dsp_sample_u8(HiHats_bin + ch_start, 32768 - ch_start, 32000, 0);
43+
_oh = dsp_sample_u8(HiHats_bin, 24576, 32000, 0);
44+
_rd = dsp_sample_u8(Ride_bin, 32768, 32000, 0);
2145

22-
engine::addParam("", &_select, 0, 0); // . = hidden
2346
engine::addParam("CH-Lev", &_ch_vol);
2447
engine::addParam("CH-Dec", &_ch_dec);
48+
engine::addParam("OH-Lev", &_oh_vol);
2549
engine::addParam("OH-Dec", &_oh_dec);
50+
engine::addParam("RD-Lev", &_rd_vol);
51+
engine::addParam("RD-Dec", &_rd_dec);
52+
53+
_outputL = engine::outputBuffer_f32(OUT_AUDIO_L);
54+
_outputR = engine::outputBuffer_f32(OUT_AUDIO_R);
55+
engine::setupMultiTrigs(3, sample_names, midi_key_map);
2656
}
2757

2858
void engine::process()
2959
{
3060
if (_oh == nullptr)
3161
return;
3262

33-
auto outputL = engine::outputBuffer<0>();
34-
memset(outputL, 0, sizeof(float) * FRAME_BUFFER_SIZE);
35-
36-
if (engine::accent()) // OH
63+
if (engine::trig() & (1 << 1)) // OH
3764
{
38-
dsp_set_sample_pos(_oh, 0, 1.f, _oh_dec);
65+
dsp_set_sample_pos(_oh, 0, _oh_vol, _oh_dec);
3966
}
40-
else if (engine::trig()) // CH
67+
else if (engine::trig() & (1 << 0)) // CH
4168
{
4269
dsp_set_sample_pos(_ch, 0, _ch_vol, _ch_dec);
4370
dsp_set_sample_pos(_oh, 0, 0, _oh_dec);
4471
}
4572

46-
dsp_process_sample(_ch, 0, 1, engine::cv(), outputL);
47-
dsp_process_sample(_oh, 0, 1, engine::cv(), outputL);
73+
if (engine::trig() & (1 << 2)) // RD
74+
{
75+
dsp_set_sample_pos(_rd, 0, _rd_vol, _rd_dec);
76+
}
77+
78+
memset(_outputL, 0, sizeof(float) * FRAME_BUFFER_SIZE);
79+
memset(_outputR, 0, sizeof(float) * FRAME_BUFFER_SIZE);
80+
void *_samples[] = {_ch, _oh, _rd};
81+
for (size_t i = 0; i < LEN_OF(_samples) && _samples[i] != nullptr; i++)
82+
{
83+
float tmp[FRAME_BUFFER_SIZE] = {};
84+
dsp_process_sample(_samples[i], 0, 1, engine::cv(), tmp);
85+
float levelL = engine::mixLevelL(i);
86+
float levelR = engine::mixLevelR(i);
87+
for (size_t j = 0; j < FRAME_BUFFER_SIZE; j++)
88+
{
89+
_outputL[j] += tmp[j] * levelL;
90+
_outputR[j] += tmp[j] * levelR;
91+
}
92+
}
4893
}
4994

5095
void engine::draw()

src/DRUMS/TR909-Ride.cpp

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)