Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Waveform loop lock #293

Merged
merged 14 commits into from Aug 14, 2023

Conversation

weavermedia
Copy link
Contributor

@weavermedia weavermedia commented Aug 3, 2023

(Reimplementation of closed PR #214 with hopefully cleaner code)

Allows you to lock the sample loop points movements together in the waveform view.

  1. Set sample LOOP START and LOOP END as usual
  2. Hold LOOP START and tap LOOP END to engage loop lock [LOCK]
  3. Move either loop point and they're locked together
  4. SHIFT+TURN◀︎▶︎ clockwise to double the loop length [DOUB]
  5. SHIFT+TURN◀︎▶︎ anti-clockwise to half the loop length [HALF]
  6. Hold LOOP START and LOOP END again to release loop lock [FREE]

Usage notes

  • You can't double the length past the sample end point [CANT]
  • You can't half the length to less than 2 samples [CANT]
  • You can't scroll a loop outside of the sample start/end bounds

Todo

  • Set loopLocked by holding loopStart marker and tapping loopEnd marker
  • Allow doubling and halving the loop length with SHIFT+TURN◀︎▶︎
  • Prevent scrolling the loop outside the sample start and end points
  • Prevent doubling the loop longer than the sample end point
  • Prevent halving the loop to 0

Questions for the community

  • What's the Deluge UX way of using SCROLL ▲▼ for loop doubling/halving? SHIFT+TURN◀︎▶︎
  • Should the loopLocked boolean be a permanent sample attribute or just live in the sample marker editor file?
  • Does this need a runtime feature setting? No

Note the video shows outdated controls. Text here is up to date.

Deluge-SampleLoopLock.mp4

@weavermedia weavermedia mentioned this pull request Aug 3, 2023
6 tasks
@m-m-adams
Copy link
Collaborator

To maintain consistency with clip view I think doubling should go on shift+press <> and changing loop length should be on shift+turn <>. Neither of those are used in waveform edit view right now

@weavermedia
Copy link
Contributor Author

To maintain consistency with clip view I think doubling should go on shift+press <> and changing loop length should be on shift+turn <>. Neither of those are used in waveform edit view right now

I moved doubling and halving the loop length to SHIFT+TURN◀︎▶︎ and returned the vertical encoder action back to default.

I'm not sure about using SHIFT+PRESS◀︎▶︎ for doubling the loop length. It is indeed consistent with the clip view action but since there's no clip view equivalent for halving the length it might be confusing.

Do you think changing loop length is OK just on SHIFT+TURN◀︎▶︎?

@soymonitus
Copy link
Contributor

This feature is awesome!

@m-m-adams
Copy link
Collaborator

I think just turning to adjust is fine, having the double there but not a half also seems fine to me since it's like that for clips anyway

@weavermedia
Copy link
Contributor Author

@m-m-adams Do you think this feature needs a runtime setting? It doesn't change any default behavior, just adds some new behavior. It will be documented, if merged, but not sure it needs a runtime feature setting.

@m-m-adams
Copy link
Collaborator

Nope! Just extending existing behaviour in a way that complements the existing UI

Awesome feature

@weavermedia
Copy link
Contributor Author

Documentation added to Community Features doc. I think is ready to go now. Can I get a review @m-m-adams?

src/deluge/gui/ui/sample_marker_editor.cpp Outdated Show resolved Hide resolved
src/deluge/gui/ui/sample_marker_editor.cpp Outdated Show resolved Hide resolved
int loopEnd = getCurrentMultisampleRange()->sampleHolder.loopEndPos;

if (loopEnd + loopLength < end) {
loopLength = loopLength * 2;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this right? This reads like it's doubling/halfing the loop length when you turn the knob instead of incrementing it which is not how I read the conversation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's right. I did think we might be at different viewpoints here. The intention is that you'll set a loop length related to the tempo of the sample or track then doubling or halving the loop length will keep it rhythmically intact. Being able to arbitrarily adjust the loop length with SHIFT+TURN<> is fine but I'd still want a want to exactly double or half it. It's a magic way to find cool and unusual looping sections within samples.

Maybe SHIFT+PUSH+TURN<> for doubling/halving? Then use SHIFT+TURN<> for continuous change.

@@ -67,6 +67,9 @@ Synchronization modes accessible through the "LFO SYNC" shortcut.
### Audio Clip View
- ([#141]) Holding the vertical encoder down while turning the horizontal encoder will shift the clip along the underlying audio file, similar to the same interface for instrument clips.

### Sample Waveform View
- ([#293]) When a sample has loop start and loop end points set, holding down loop start and tapping loop end will lock the loop points together. Moving one will move the other, keeping them the same distance apart. Use the same process to unlock the loop points. Use SHIFT+TURN<> to double or half the loop length.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be shift+turn to edit loop length, shift+press to double. It feels weird having this little control over length if the loop is longer than a few samples

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my response above about doubling/halving.

@m-m-adams
Copy link
Collaborator

Mostly good, but doubling and halfing by turning the knob feels wrong with longer loops where that adjustment range is really coarse. It also doesn't match the clip loop length adjustment. I think it should adjust length by one pad at the current zoom level, and if doubling length feels necessary for quick adjustments then put that on shift+push <>.

Trying to move the loop by selecting a new start/end pad that would put loop end past sample end/start also feels weird. I think that should temporarily shorten the loop by truncating at the start/end position without changing the loop length

@weavermedia
Copy link
Contributor Author

weavermedia commented Aug 4, 2023

The intention behind the feature is that you would set a loop length which is related to the tempo of the sample, or the song, and then move the loop around to find cool looping sections. Doubling and halving the loop length keeps the loop rhythmically intact so both of those features are crucial.

As such I wouldn't want to change the loop length without user intent either. If I got a good loop going then the loop length changed because I tried to move the loop out of bounds it would kill the flow. I'd rather just see a CANT message.

We can use SHIFT+TURN<> for continuous loop length adjustment and SHIFT+PUSH+TURN<> for doubling/halving.

@m-m-adams
Copy link
Collaborator

Ahh ok that makes more sense to me then, I was playing with it more like a granular synth where the loop length wouldn't be linked to tempo (also made me really wish we could modulate start position!)

What about keeping your current doubling/halfing on the turn but allowing the start/end position to be moved freely by holding the marker and turning <> (like moving a clip in the arranger)? That would keep the tempo matching you want while also allowing the length of a loop to be adjusted more finely if needed

@@ -51,6 +51,9 @@ extern "C" {

const uint8_t zeroes[] = {0, 0, 0, 0, 0, 0, 0, 0};

int loopLength = 0;
bool loopLocked = false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these would probably benefit from being members of SampleMarkerEditor rather than globals

@sichtbeton
Copy link
Contributor

could this get in before the proposed feature cutoff this week for a comunity release? it looks ready but no pressure. it's a very cool feature.

@weavermedia
Copy link
Contributor Author

@sichtbeton Still trying to figure out how to assign the controls for fine-adjusting the loop length and doubling/halving the loop length. Any input is appreciated 😀

@sichtbeton
Copy link
Contributor

@sichtbeton Still trying to figure out how to assign the controls for fine-adjusting the loop length and doubling/halving the loop length. Any input is appreciated 😀

turn <> to shift the loop
shift and turn <> to double or halven (analog to lenght of a clip)

or does this collide in any way with other functions?

@m-m-adams
Copy link
Collaborator

Looking back at this I think fine adjustments could be a separate PR. Unlocking the loop, adjusting one end, and relocking is ok for now, we should just add this as a separate issue for our pre release bug fixes

Copy link
Collaborator

@m-m-adams m-m-adams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Future work: fine editing

@bobtwinkles suggestion to move the global to class member would be nice but there's only one loop editor at a time

The long term will likely involve moving that parameter into the sample synth as part of a bigger change to allow modulating the start/end/loop positions so I'm not particularly concerned about it's current location

@m-m-adams m-m-adams added the merge conflict github reports a merge conflict that should be resolved. label Aug 12, 2023
@weavermedia
Copy link
Contributor Author

@m-m-adams What about the doubling and halving of the loop length? Would you rather I remove it from this PR and add as another follow up? Or leave it in here as-is? Currently using SHIIFT+TURN<> as in the first post.

@weavermedia
Copy link
Contributor Author

I'll fix the merge conflicts today.

@m-m-adams
Copy link
Collaborator

The doubling and halting is fine, it's analogous to changing clip length with the same controls and just locked to sizes that are convenient for loop samples

@m-m-adams m-m-adams removed the merge conflict github reports a merge conflict that should be resolved. label Aug 12, 2023
@weavermedia weavermedia changed the title Waveform loop lock Feature: Waveform loop lock Aug 13, 2023
@jamiefaye jamiefaye added this pull request to the merge queue Aug 14, 2023
Merged via the queue into SynthstromAudible:community with commit 902fb0b Aug 14, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants