Skip to content

Commit 0d1af52

Browse files
ArthurGibertchmanie
authored andcommitted
feat(midi2cv): add velocity to Gate and Note Gate mode
1 parent 85dc047 commit 0d1af52

File tree

2 files changed

+5
-32
lines changed

2 files changed

+5
-32
lines changed

configurator/src/components/ManualTab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ const apps: ManualAppData[] = [
643643
"Color",
644644
],
645645
storage: ["Attenuation", "Muted"],
646-
text: "This app converts MIDI messages into CV signals. It supports multiple modes, each with different output behaviors. The output range is typically 0–10V, except for Pitch Bend mode which uses ±5V. Parameters include MIDI channel, curve shaping (for CC and Aftertouch), pitch bend range. The Note Gate mode is especially useful for triggering drum modules, as it allows individual gate outputs to be assigned to specific MIDI notes—ideal for drum sequencing setups.",
646+
text: "This app converts MIDI messages into CV signals. It supports multiple modes, each with different output behaviors. The output range is typically 0–10V, except for Pitch Bend mode which uses ±5V. When set to MIDI to Gate conversion (Gate and Note Gate modes) the gate voltage is directly related to the velocity of the MIDI note with the minimum velocity being 1V and maximum 10V. Parameters include MIDI channel, curve shaping (for CC and Aftertouch), pitch bend range. The Note Gate mode is especially useful for triggering drum modules, as it allows individual gate outputs to be assigned to specific MIDI notes—ideal for drum sequencing setups.",
647647
channels: [
648648
{
649649
jackTitle: "Output",

faderpunk/src/apps/midi2cv.rs

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -290,20 +290,6 @@ pub async fn run(
290290
// //info!("outval ={}, pitch = {} out = {}", outval, pitch, out);
291291
jack.set_value(out);
292292
}
293-
294-
// match latch_active_layer {
295-
// LatchLayer::Main => {}
296-
// LatchLayer::Alt => {
297-
// leds.set(
298-
// 0,
299-
// Led::Top,
300-
// Color::Red,
301-
// Brightness::Custom((att / 16) as u8),
302-
// );
303-
// leds.set(0, Led::Bottom, Color::Red, Brightness::Custom(0));
304-
// }
305-
// LatchLayer::Third => {}
306-
// }
307293
}
308294
};
309295

@@ -349,21 +335,6 @@ pub async fn run(
349335
LatchLayer::Third => {}
350336
}
351337
}
352-
353-
// let fader_val = fader.get_value();
354-
355-
// if buttons.is_shift_pressed() && latched_glob.get() {
356-
// att_glob.set(fader_val);
357-
// storage
358-
// .modify_and_save(
359-
// |s| {
360-
// s.att_saved = fader_val;
361-
// s.att_saved
362-
// },
363-
// None,
364-
// )
365-
// .await;
366-
// }
367338
}
368339
};
369340

@@ -398,7 +369,8 @@ pub async fn run(
398369
}
399370
if mode == 2 {
400371
if !muted_glob.get() {
401-
jack.set_value(4095);
372+
let vel_out = (scale_bits_7_12(vel) as u32 * 3686 / 4095 + 410) as u16;
373+
jack.set_value(vel_out);
402374
note_num += 1;
403375
leds.set(0, Led::Top, led_color, LED_BRIGHTNESS);
404376
} else {
@@ -409,7 +381,8 @@ pub async fn run(
409381
}
410382
if mode == 6 && bits_7_16(key) == note as u16 {
411383
if !muted_glob.get() {
412-
jack.set_value(4095);
384+
let vel_out = (scale_bits_7_12(vel) as u32 * 3686 / 4095 + 410) as u16;
385+
jack.set_value(vel_out);
413386
note_num += 1;
414387
leds.set(0, Led::Top, led_color, LED_BRIGHTNESS);
415388
} else {

0 commit comments

Comments
 (0)