-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
Add ability to trim audio clips from start position #3291
base: community
Are you sure you want to change the base?
Add ability to trim audio clips from start position #3291
Conversation
- 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.
…s, 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.
This is the first iteration. Ideally I would like to change the behaviour slightly so that when you trigger Start Trimming Mode and click a new column to the right, the view doesn't jump to make that new start column one. Instead you'd see the columns to the left greyed out - the same behaviour as when editing the end. But it's a little bit tricky to work out how that would affect playback. It introduces the concept of columns before the start of playback i.e. minus (<0) columns. I need to think about that. I know that the green column always jumping to be col one is a bit of a jaunting experience. However, as undo is implemented, it's pretty natural to quickly step back if you've cropped too much audio. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a true review, just some little style and QoL things I saw on a quick browse
} | ||
|
||
// Or if yes Sample... | ||
else { | ||
AudioClip* clip = getCurrentAudioClip(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If clip is assumed to be valid (i.e. not nullptr) after this point, it should be a reference.
AudioClip* clip = getCurrentAudioClip(); | |
AudioClip& clip = *getCurrentAudioClip(); |
Note that all uses of it will need to be changed from arrow syntax to dot syntax
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it needs to be checked before making a reference - we shouldn't end up here without the current clip being an audio clip but it's probably possible, in which case getCurrentAudioClip returns a nullptr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not super familiar with C++, I've given it a go updating to use references where possible and ensure we have checked for null, see what you think.
Recommended changes implemented |
…ing recommended changes in audio_clip_view. SynthstromAudible#3291 (comment)
Add ability to trim audio clips from their start position
Feature Description
Adds the ability to trim audio clips from their start position in Audio Clip View, similar to the existing end-position trimming functionality. This gives users more control over audio sample editing directly from the grid interface.
Currently to trim the beginning of an audio clip you need a workaround by reversing the clip, see:
https://www.youtube.com/watch?v=iWhVUsx40Mg&t=108s&ab_channel=RonCavagnaro
Implementation Details
changeUnderlyingSampleStart()
method to handle start position adjustmentsTrimFromStartOfAudioClip
to control availability of this featureChanges
Acceptance Criteria
Testing Notes
Demo
https://youtu.be/9S2BkhaB50c