Skip to content

Commit 3e91dc6

Browse files
committed
RC_0.0N4 - midi pitch fixes + disp refresh
1 parent d4a2510 commit 3e91dc6

File tree

5 files changed

+19
-5
lines changed

5 files changed

+19
-5
lines changed

platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ board = teensy40
1818
build_flags = -DUSB_MIDI_SERIAL -std=c++17 -I./lib/ -Wdouble-promotion -DMACHINE_OC_REV2E ;-D TEENSY_OPT_SMALLEST_CODE
1919
board_build.f_cpu = 600000000L
2020
lib_deps =
21-
https://github.com/eh2k/squares-and-circles/releases/download/0.0.0/machine_OCT40_053fad9.zip
21+
https://github.com/eh2k/squares-and-circles/releases/download/0.0.0/machine_OCT40_36693df.zip
2222
;./lib/machine/
2323
./lib/stmlib/
2424
./lib/braids/

src/main.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ int main()
5454
MACHINE_INIT(init_fv1);
5555
MACHINE_INIT(init_midi_polyVA)
5656

57-
machine::setup("0.0N", 0);
57+
machine::setup("0.0N4", 0);
5858

5959
while (true)
6060
machine::loop();

src/midiMonitor.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ struct MidiMonitor : public machine::MidiEngine
1515
{
1616
allocator.Init();
1717
allocator.set_size(LEN_OF(voice));
18+
machine::midi_handler->midiReset();
1819
}
1920

2021
void process(const machine::ControlFrame &frame, OutputFrame &of) override

src/peaks.cxx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,17 @@ struct PeaksEngine : public Engine
5555

5656
void process(const ControlFrame &frame, OutputFrame &of) override
5757
{
58-
_processor.Configure(params_, peaks::CONTROL_MODE_FULL);
58+
if (std::is_same<T, peaks::FmDrum>::value)
59+
{
60+
auto bak = params_[P1];
61+
params_[P1] += (frame.cv_voltage() * INT16_MAX / 3); // CV or Midi Pitch ?!
62+
_processor.Configure(params_, peaks::CONTROL_MODE_FULL);
63+
params_[P1] = bak;
64+
}
65+
else
66+
{
67+
_processor.Configure(params_, peaks::CONTROL_MODE_FULL);
68+
}
5969

6070
if (frame.trigger)
6171
{
@@ -124,7 +134,7 @@ class Hihat808 : public HiHatsEngine
124134

125135
void init_peaks()
126136
{
127-
add<PeaksEngine<peaks::FmDrum, TRIGGER_INPUT, 0, 3, 1, 2>>(DRUM, "FM-Drum", INT16_MAX, INT16_MAX, INT16_MAX, INT16_MAX, "Freq.", "Noise", "FM", "Decay");
137+
add<PeaksEngine<peaks::FmDrum, TRIGGER_INPUT | VOCT_INPUT | TRANSPOSE_EQ_0, 0, 3, 1, 2>>(DRUM, "FM-Drum", INT16_MAX, INT16_MAX, INT16_MAX, INT16_MAX, "Freq.", "Noise", "FM", "Decay");
128138

129139
add<PeaksEngine<peaks::BassDrum, TRIGGER_INPUT>>(DRUM, "808ish-BD", INT16_MAX, INT16_MAX, INT16_MAX, INT16_MAX, "Pitch", "Punch", "Tone", "Decay");
130140
add<PeaksEngine<peaks::SnareDrum, TRIGGER_INPUT, 0, 2, 1, 3>>(DRUM, "808ish-SD", INT16_MAX, INT16_MAX, INT16_MAX, INT16_MAX, "Pitch", "Snappy", "Tone", "Decay");

src/polyVA.cxx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ struct PolyVAEngine : public machine::MidiEngine
2323
float morph;
2424
float harmonics;
2525
float pitch = 0;
26+
float pitch_bend = 0;
2627

2728
float decay = 0.5f;
2829
float hf = 1.f;
@@ -70,7 +71,7 @@ struct PolyVAEngine : public machine::MidiEngine
7071
for (size_t i = 0; i < LEN_OF(voice); i++)
7172
{
7273
auto p = parameters[i];
73-
p.note += pitch * 12.f;
74+
p.note += (pitch * 12.f) + pitch_bend;
7475
p.timbre = timbre;
7576
p.morph = morph;
7677
p.harmonics = harmonics;
@@ -116,10 +117,12 @@ struct PolyVAEngine : public machine::MidiEngine
116117

117118
void onMidiPitchbend(int16_t pitch) override
118119
{
120+
pitch_bend = ((float)pitch / 8192) * 12;
119121
}
120122

121123
void onMidiCC(uint8_t ccc, uint8_t value) override
122124
{
125+
//nothing implemented..
123126
}
124127
};
125128

0 commit comments

Comments
 (0)