Skip to content

Commit 93333f1

Browse files
m0nkmastersapphire-archesseangoodvibes
authored
Add ability to trim audio clips from start position (#3291)
* Initial stab at trimming the start of audio * Refactor audio clip view for improved marker handling and rendering - Adjusted visibility logic for start and end markers to enhance user interaction. - Updated rendering logic to differentiate between blinking and static marker states. - Improved comments for clarity and maintenance. - Implemented non-destructive start trimming functionality, allowing for better audio editing. - Fixed minor issues related to marker toggling and display updates. This commit builds upon the initial implementation of start trimming and enhances the overall user experience in the audio clip view. * - Implemented non-destructive trimming functionality for start markers, allowing for more flexible audio editing. - Fixed issues related to marker toggling. TODO - Currently trimming from the start results in the prior audio becoming hidden and the new play head moves to column one. Should change this so the new playhead does not move and the hidden audio is greyed out. * Button handling * Restore button actions * Put audio trim from start behind a feature flag * Build tidy. * improve audio clip marker handling * Cleaned up formatting in settings.cpp and audio_clip_view.h * Use predefined color constants. * refactor: standardize AudioClip reference handling in audio_clip_view.cpp * Refactor coloring code * Add assignment operator to RGB class in rgb.h * Refactor LED colour handling in waveform and pad LED rendering following recommended changes in audio_clip_view. #3291 (comment) * Formatting fixes. * Update settings.cpp * minor formatting fix * Update toolchain to v22 (#3307) Should reduce the Docker image size, and fixes formatting on OSX/Linux * fix(audio): improve audio clip view null checks and recording state - Add null checks for audio clip pointer - Reinstated linear recording checks - Clean up comments * fix: restore macro handling in audio clip view Restore macro activation functionality when clicking side column while holding song button. This was accidentally removed during audio clip trimming changes. * refactor(audio-clip): improve sample length handling restore comments * refactor(audio-clip): improve sample length handling restore comments * docs(rgb): improve assignment operator documentation * feat(audio): add trim from start of audio clip feature documentation Adds new feature setting to enable trimming from start of audio clips * Update community features docs on start trimming * Add reference to PR for start trimming * Update community features docs on start trimming (2) * Update community features docs on strart trimming * Fix conflict --------- Co-authored-by: Sapphire Koser <srkoser+GitHub@gmail.com> Co-authored-by: Sean Ditny <138174805+seangoodvibes@users.noreply.github.com>
1 parent 76d14f4 commit 93333f1

File tree

17 files changed

+300
-208
lines changed

17 files changed

+300
-208
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ set the stutter configuration independently of the song configuration if you wis
7474
#### <ins>Audio Clips</ins>
7575
- Added audio output modes, and changed audio clip monitoring to be seperate from source selection. Monitoring is now on
7676
when the output is a SAMPLER or a LOOPER, chosen by turning the select knob in an audio clip.
77+
- Added the ability to trim from the start of an audio clip without reversing it (enable in Community Features menu).
7778

7879
#### <ins>Instrument Clip View</ins>
7980

docs/community_features.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,6 +1175,18 @@ for the Lumi Keys Studio Edition, described below.
11751175
- While Lumi has limited options for MPE separation, it will be configured to align with the dominant MPE range
11761176
defined on the Deluge (upper or lower dominant).
11771177

1178+
### 4.11.0 - Audio Clip View - Trimming Clips
1179+
1180+
- ([#3291]) Added a new `STRING_FOR_COMMUNITY_FEATURE_TRIM_FROM_START_OF_AUDIO_CLIP` feature to allow users to trim from the start of a clip without needing to reverse it.
1181+
- Pressing a pad in the first column of an audio clip now makes it flash green allowing you to move the start position. The new start position snaps to column one.
1182+
- You can revert to an earlier portion by pressing undo (or reverse the clip and altering as before).
1183+
- This lets you easily alter the start of an audio clip without time stretching.
1184+
- Previously, this was only possible by reversing the audio clip and trimming the start as if it were the end.
1185+
- This feature is `OFF` by default and can be set to `ON` or `OFF` via `SETTINGS > COMMUNITY FEATURES`.
1186+
1187+
See this demo for more details:
1188+
[Audio Clip View - Trimming Tips](https://www.youtube.com/watch?v=iWhVUsx40Mg&t=45s&ab_channel=RonCavagnaro).
1189+
11781190
## 5. Community Features Menu (aka Runtime Settings)
11791191

11801192
In the main menu of the Deluge (accessed by pressing both "SHIFT" + the "SELECT" encoder) there is
@@ -1240,6 +1252,8 @@ Note: these settings are saved to `SETTINGS/CommunityFeatures.XML` on your SD ca
12401252
* When On, the number of `TAP TEMPO` button presses to engage `TAP TEMPO` is changed to `FOUR (4)` to avoid mistakingly changing tempo.
12411253
* `Horizontal menus (HORI)`
12421254
* When On, some menu items render in horizontal menus, with multiple items visible and editable at the same time.
1255+
* `Trim from start of audio clips (TRIM)`
1256+
* When On, the ability to trim from the start of an audio clip without needing to reverse it is enabled.
12431257

12441258
## 6. Sysex Handling
12451259

@@ -1576,6 +1590,8 @@ different firmware
15761590

15771591
[#3285]: https://github.com/SynthstromAudible/DelugeFirmware/pull/3285
15781592

1593+
[#3291]: https://github.com/SynthstromAudible/DelugeFirmware/pull/3291
1594+
15791595
[Automation View Documentation]: features/automation_view.md
15801596

15811597
[Arpeggiator Documentation]: features/arpeggiator.md

docs/menu_hierarchies.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,9 @@ NOTE: These options can change depending on how your default resolution is set
424424
- Grid View Loop Pads (LOOP)
425425
- OFF
426426
- ON
427+
- Trim from start of audio clips (TRIM)
428+
- OFF
429+
- ON
427430
</details>
428431

429432
Firmware Version (FIRM)
@@ -548,7 +551,7 @@ The Song menu contains the following menu hierarchy:
548551
- Pan
549552
- Reverb Sidechain (SIDE)
550553
- Volume Ducking (VOLU)
551-
554+
552555
- Stutter (STUT)
553556
- Quantize (QTZ)
554557
- Reverse (REVE)
@@ -843,7 +846,7 @@ The Sound menu contains the following menu hierarchy:
843846
- Pan
844847
- Reverb Sidechain (SIDE)
845848
- Volume Ducking (VOLU)
846-
849+
847850
- Stutter (STUT)
848851
- Use Song Settings (SONG)
849852
- Quantize (QTZ)
@@ -1228,7 +1231,7 @@ The Kit FX menu contains the following menu hierarchy:
12281231
- Pan
12291232
- Reverb Sidechain (SIDE)
12301233
- Volume Ducking (VOLU)
1231-
1234+
12321235
- Stutter (STUT)
12331236
- Use Song Settings (SONG)
12341237
- Quantize (QTZ)
@@ -1430,7 +1433,7 @@ The CV menu contains the following menu hierarchy:
14301433
- Gate
14311434
- Sync
14321435
NOTE: These options can change depending on how your default resolution is set
1433-
1436+
14341437
- Off
14351438
- 2-Bar
14361439
- 1-Bar
@@ -1804,7 +1807,7 @@ The Audio Clip menu contains the following menu hierarchy:
18041807
- Pan
18051808
- Reverb Sidechain (SIDE)
18061809
- Volume Ducking (VOLU)
1807-
1810+
18081811
- Stutter (STUT)
18091812
- Use Song Settings (SONG)
18101813
- Quantize (QTZ)

src/deluge/gui/colour/rgb.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ class RGB {
3232
/// Blue channel
3333
channel_type b = 0;
3434

35+
/// Copies RGB values from a colour
36+
constexpr RGB& operator=(const RGB& other) {
37+
r = other.r;
38+
g = other.g;
39+
b = other.b;
40+
return *this;
41+
}
42+
3543
/**
3644
* @brief Construct a monochrome (white) shade
3745
*

src/deluge/gui/l10n/english.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,7 @@
553553
"STRING_FOR_COMMUNITY_FEATURE_GRID_VIEW_LOOP_PADS": "Grid View Loop Layer Pads",
554554
"STRING_FOR_COMMUNITY_FEATURE_ALTERNATIVE_TAP_TEMPO_BEHAVIOUR": "Alternative Tap Tempo Behaviour",
555555
"STRING_FOR_COMMUNITY_FEATURE_HORIZONTAL_MENUS": "Horizontal menus",
556+
"STRING_FOR_COMMUNITY_FEATURE_TRIM_FROM_START_OF_AUDIO_CLIP": "Trim from start of audio clips",
556557

557558
"STRING_FOR_TRACK_STILL_HAS_CLIPS_IN_SESSION": "Track still has clips in session",
558559
"STRING_FOR_DELETE_ALL_TRACKS_CLIPS_FIRST": "Delete all track's clips first",

src/deluge/gui/l10n/g_english.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ PLACE_SDRAM_DATA Language english{
507507
{STRING_FOR_COMMUNITY_FEATURE_GRID_VIEW_LOOP_PADS, "Grid View Loop Layer Pads"},
508508
{STRING_FOR_COMMUNITY_FEATURE_ALTERNATIVE_TAP_TEMPO_BEHAVIOUR, "Alternative Tap Tempo Behaviour"},
509509
{STRING_FOR_COMMUNITY_FEATURE_HORIZONTAL_MENUS, "Horizontal menus"},
510+
{STRING_FOR_COMMUNITY_FEATURE_TRIM_FROM_START_OF_AUDIO_CLIP, "Trim from start of audio clips"},
510511
{STRING_FOR_TRACK_STILL_HAS_CLIPS_IN_SESSION, "Track still has clips in session"},
511512
{STRING_FOR_DELETE_ALL_TRACKS_CLIPS_FIRST, "Delete all track's clips first"},
512513
{STRING_FOR_CANT_DELETE_FINAL_CLIP, "Can't delete final Clip"},

src/deluge/gui/l10n/g_seven_segment.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ PLACE_SDRAM_DATA Language seven_segment{
408408
{STRING_FOR_COMMUNITY_FEATURE_ALTERNATIVE_PLAYBACK_START_BEHAVIOUR, "STAR"},
409409
{STRING_FOR_COMMUNITY_FEATURE_GRID_VIEW_LOOP_PADS, "LOOP"},
410410
{STRING_FOR_COMMUNITY_FEATURE_ALTERNATIVE_TAP_TEMPO_BEHAVIOUR, "TAPT"},
411+
{STRING_FOR_COMMUNITY_FEATURE_TRIM_FROM_START_OF_AUDIO_CLIP, "TRIM"},
411412
{STRING_FOR_TRACK_STILL_HAS_CLIPS_IN_SESSION, "CANT"},
412413
{STRING_FOR_DELETE_ALL_TRACKS_CLIPS_FIRST, "CANT"},
413414
{STRING_FOR_CANT_DELETE_FINAL_CLIP, "CANT"},

src/deluge/gui/l10n/seven_segment.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@
421421
"STRING_FOR_COMMUNITY_FEATURE_ALTERNATIVE_PLAYBACK_START_BEHAVIOUR": "STAR",
422422
"STRING_FOR_COMMUNITY_FEATURE_GRID_VIEW_LOOP_PADS": "LOOP",
423423
"STRING_FOR_COMMUNITY_FEATURE_ALTERNATIVE_TAP_TEMPO_BEHAVIOUR": "TAPT",
424+
"STRING_FOR_COMMUNITY_FEATURE_TRIM_FROM_START_OF_AUDIO_CLIP": "TRIM",
424425

425426
"STRING_FOR_TRACK_STILL_HAS_CLIPS_IN_SESSION": "CANT",
426427
"STRING_FOR_DELETE_ALL_TRACKS_CLIPS_FIRST": "CANT",
@@ -450,7 +451,6 @@
450451
"STRING_FOR_WRONG_SIZE": "SIZE FAIL",
451452
"STRING_FOR_BAD_KEY": "KEY FAIL",
452453

453-
"STRING_FOR_CLIP_CLEARED": "CLEAR",
454454
"STRING_FOR_SAMPLE_CLEARED": "CLEAR",
455455
"STRING_FOR_NOTES_CLEARED": "CLEAR",
456456
"STRING_FOR_AUTOMATION_CLEARED": "CLEAR",

src/deluge/gui/l10n/strings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,7 @@ enum class String : size_t {
538538
STRING_FOR_COMMUNITY_FEATURE_GRID_VIEW_LOOP_PADS,
539539
STRING_FOR_COMMUNITY_FEATURE_ALTERNATIVE_TAP_TEMPO_BEHAVIOUR,
540540
STRING_FOR_COMMUNITY_FEATURE_HORIZONTAL_MENUS,
541+
STRING_FOR_COMMUNITY_FEATURE_TRIM_FROM_START_OF_AUDIO_CLIP,
541542

542543
STRING_FOR_TRACK_STILL_HAS_CLIPS_IN_SESSION,
543544
STRING_FOR_DELETE_ALL_TRACKS_CLIPS_FIRST,

src/deluge/gui/menu_item/runtime_feature/settings.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ SettingToggle menuAlternativePlaybackStartBehaviour(RuntimeFeatureSettingType::A
4949
SettingToggle menuEnableGridViewLoopPads(RuntimeFeatureSettingType::EnableGridViewLoopPads);
5050
SettingToggle menuAlternativeTapTempoBehaviour(RuntimeFeatureSettingType::AlternativeTapTempoBehaviour);
5151
SettingToggle menuHorizontalMenus(RuntimeFeatureSettingType::HorizontalMenus);
52+
SettingToggle menuTrimFromStartOfAudioClip(RuntimeFeatureSettingType::TrimFromStartOfAudioClip);
5253

5354
std::array<MenuItem*, RuntimeFeatureSettingType::MaxElement - kNonTopLevelSettings> subMenuEntries{
5455
&menuDrumRandomizer,
@@ -72,7 +73,8 @@ std::array<MenuItem*, RuntimeFeatureSettingType::MaxElement - kNonTopLevelSettin
7273
&menuAlternativePlaybackStartBehaviour,
7374
&menuEnableGridViewLoopPads,
7475
&menuAlternativeTapTempoBehaviour,
75-
&menuHorizontalMenus};
76+
&menuHorizontalMenus,
77+
&menuTrimFromStartOfAudioClip};
7678

7779
Settings::Settings(l10n::String name, l10n::String title) : menu_item::Submenu(name, title, subMenuEntries) {
7880
}

0 commit comments

Comments
 (0)