Skip to content

Commit

Permalink
Adjust tap-interval/delay-length ratio
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Horacek <[email protected]>
  • Loading branch information
phoracek committed Nov 1, 2023
1 parent d770616 commit d81b48e
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ backwards compatibility.
* LED can be configured to visualize the current position within the loop.
* Allow reset of the loop position through a control input.
* Play/pause the delay line using a control input.
* Allow configuration of the ratio between the tap interval and delay length.

## 1.2.0

Expand Down
2 changes: 2 additions & 0 deletions control/src/cache/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub struct Configuration {
pub default_display_page: DisplayPage,
pub position_reset_mapping: PositionResetMapping,
pub play_pause_mapping: PlayPauseMapping,
pub tap_interval_denominator: usize,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
Expand Down Expand Up @@ -38,6 +39,7 @@ impl Default for Configuration {
default_display_page: DisplayPage::Heads,
position_reset_mapping: None,
play_pause_mapping: None,
tap_interval_denominator: 1,
}
}
}
Expand Down
18 changes: 18 additions & 0 deletions control/src/cache/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ pub enum ConfigurationScreen {
Rewind((usize, usize)),
DefaultScreen(usize),
ControlMapping(Option<usize>),
TapIntervalDenominator(usize),
}

#[derive(Debug, Clone, Copy)]
Expand Down Expand Up @@ -241,6 +242,9 @@ fn ticked_dialog(menu: DialogScreen) -> DialogScreen {
ConfigurationScreen::ControlMapping(mapping) => {
ticked_configuration_control_mapping(mapping)
}
ConfigurationScreen::TapIntervalDenominator(denominator) => {
ticked_tap_interval_denominator(denominator)
}
},
DialogScreen::Calibration(calibration) => match calibration {
CalibrationScreen::SelectOctave1(i, cycles) => ticked_calibration_1(i, cycles),
Expand All @@ -267,6 +271,10 @@ fn ticked_configuration_control_mapping(mapping: Option<usize>) -> DialogScreen
DialogScreen::Configuration(ConfigurationScreen::ControlMapping(mapping))
}

fn ticked_tap_interval_denominator(denominator: usize) -> DialogScreen {
DialogScreen::Configuration(ConfigurationScreen::TapIntervalDenominator(denominator))
}

fn ticked_calibration_1(i: usize, mut cycles: u32) -> DialogScreen {
cycles = if cycles > 240 * 6 { 0 } else { cycles + 1 };
DialogScreen::Calibration(CalibrationScreen::SelectOctave1(i, cycles))
Expand Down Expand Up @@ -402,6 +410,16 @@ fn leds_for_configuration(configuration: &ConfigurationScreen) -> [bool; 8] {
}
leds
}
ConfigurationScreen::TapIntervalDenominator(denominator) => {
let index = match *denominator {
16 => 0,
8 => 1,
4 => 2,
1 => 3,
_ => unreachable!(),
};
index_to_leds(index)
}
}
}

Expand Down
28 changes: 28 additions & 0 deletions control/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,12 @@ impl Store {
return (draft, Some(screen));
}

if let Some(screen) =
update_tap_interval_denominator(&mut draft, &mut self.input.head[1].pan)
{
return (draft, Some(screen));
}

(draft, None)
}

Expand Down Expand Up @@ -601,6 +607,28 @@ fn update_play_pause_mapping(
}
}

fn update_tap_interval_denominator(
draft: &mut Configuration,
pot: &mut Pot,
) -> Option<ConfigurationScreen> {
let pot_active = pot.activation_movement();
if !pot_active {
return None;
}

let pot_value = pot.value();
let index = (pot_value * 3.999) as usize;
let denominator = match index {
0 => 16,
1 => 8,
2 => 4,
3 => 1,
_ => unreachable!(),
};
draft.tap_interval_denominator = denominator;
Some(ConfigurationScreen::TapIntervalDenominator(denominator))
}

fn f32_to_index_of_4(x: f32) -> usize {
if x < 0.25 {
0
Expand Down
40 changes: 36 additions & 4 deletions manual/user/manual.tex
Original file line number Diff line number Diff line change
Expand Up @@ -553,10 +553,10 @@ \subsection{Default display page}

Select what should be visualized on the display when pots are inactive.

\textbf{Position within the loop} -- the LEDs blink in round-robin fashion,
representing the current position within the loop. This is the default.
\textbf{1. Position within the loop} -- the LEDs blink in round-robin fashion,
representing the current position within the delay loop. This is the default.

\textbf{Active heads} -- the top and bottom rows of LEDs represent heads with
\textbf{2. Active heads} -- the top and bottom rows of LEDs represent heads with
active playback and feedback respectively.

While in the configuration menu, turn the SPEED knob to select the default page.
Expand All @@ -582,6 +582,37 @@ \subsection{Play/pause trigger}
control input for this mapping. Turning it all the way to the left will disable
this mapping.

\end{minipage}%
\begin{minipage}{0.05\textwidth}
\phantom{ }
\end{minipage}%
% Right column
\begin{minipage}[t]{0.45\textwidth}
\setlength{\parskip}{6pt}

\subsection{Tap/clock-in interval}

Configure the length of the tap/clock-in interval. Using a shorter interval
makes dialing in longer delay lengths easier. Setting the right interval
may also provide more intuitive control of tempo for cases where you count
beats and bars.

\textbf{1. 1/16 of the delay length} -- the delay is four times as long as the
the time it takes to tap-in. This is as if you counted-in 4 bars long
sequence.

\textbf{2. 1/8 of the delay length} -- the delay is twice as long as the time
it takes to tap-in. This is as if you counted-in 2 bars long sequence.

\textbf{3. 1/4 of the delay length} -- the length of the delay is the same as
the total time it takes to tap-in.

\textbf{4. Full delay length} -- the length of the delay is equal to the
interval between each of the taps.

While in the configuration menu, turn the second PAN knob to select the desired
interval.

\end{minipage}

\newpage
Expand Down Expand Up @@ -701,7 +732,8 @@ \section{Changelog}
& New filter placements \\
v1.3 & The status LED blinks three times \\
& Default display can be customized \\
& Delay position can be reset
& Delay position can be reset \\
& Configure the tap/delay length ratio
\end{tabular}

\end{minipage}
Expand Down

0 comments on commit d81b48e

Please sign in to comment.