-
Notifications
You must be signed in to change notification settings - Fork 712
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
A better method for "Close Regions Gaps" #385
base: master
Are you sure you want to change the base?
Conversation
The actual method for "Close Region Gaps" can be improved. Indeed, in the current code, each region is stretched of "pull back length" to the left, the region on the left is stretched to overlap this one of "Fade Length". The problem arises when using this method after split a region at onsets and snap to grid all new regions (Rhytme ferret). If after "split at Onsets", a gap between two regions is bigger than "Pull Back Length", then the right region will be stretched of Pull Back Lenght to the left, and the left region will be stretched to the right until overlap the right one. And what can we ear on the right side of the left region ? The attack present at the beggining of the right region. To avoid this, I propose this code which retains the same behavior except that it never stretch the left region to the right. If the left region is not close enought, the right one will be stretched to the left until the end of the left one. This avoids double attacks. So, we can rename "Pull Back Length", in "Minimum Pull Back Lenght" and set it by defaut to 10ms instead of 30ms, by experience it seems reasonable for drums or guitars. Also, the code I propose uses truely the fade duration defined by user instead of a simple overlap (for audio regions only). If "Fade Length" is set on 0ms, the default fade will be used (64samples), I think it's good the set it to 0 by default. To test this, take an audio region of rhytmic guitar or drum, apply Rhytme Ferret, analyze region, split region at Onsets, select all new regions and "snap to grid". Then use "Close Gaps".
Is this still relevant ? (or can it be closed?) |
Sorry for the late answer. IIRC, no, because @pauldavisthefirst was not agree to rework this action this way. I may have done things in the wrong order, implementing before to discuss with upstream devs. I am still interested by this complete feature : something working well to auto-snap to grid percussive impacts even with many tracks. Maybe I should first propose a plan, and discuss to the way it can be implemented. |
Because there is no issue tracker here, I propose the plan in this discussion directly. improve rhythm ferret to can easily snap onsets to grid on a multitrack percussive instrumentThis idea retakes the two old pull requests I submited several years ago (#385 and #388). Theses PRs are of course too old to be merged easily, but I still think that the global idea is good, and if you see the interest, I would like to rework on it. user stepsThe function should work in 4 steps, once the user selects regions to proceed and goes to rhythm ferret in context menu. 1 ) Onsets detection ("Analyze")It is important to filter the onsets in order to have maximum one onset per grid division, Otherwise we will have multiple regions at same points when we will snap regions to grid. It is also important that onsets are shared between equivalent regions, because we need to still have equivalent regions after split. For this reason, it is nicer that when user moves an onset, onsets with same position on equivalent regions are also moved (let's call them equivalent onsets). In the PR #388, the filtered onset was the closest from grid and not the more powerful one. Because it was easier to code, and in the end it worked quite well. It also had the advantage to ignore some offset between grid division. 2 ) split regions on onsetsNicer if splitted regions are selected once they are splitted. 3 ) snap regions on gridMaybe a 'swing' option could be nice to apply some groove (not developed in #388) 4 ) fill holes between regionsIt is important that regions are stretched to the left only, and never to the right, because they could contain the next attack on their right, then we could hear double attacks. GUI dialog and othersMaybe steps 3 and 4 could be done in one step, we could also propose to join regions at end. On GUI side, it would be nice to have a very clear ferret dialog. For example, we could have at bottom of the dialog, the following buttons : [ Analyze ] at startup, only "Analyze" is Enabled Pull requestsIf you agree with a such plan, I suppose that you will appreciate multiple PRs, I suggest to split them this way: |
The actual method for "Close Region Gaps" can be improved.
Indeed, in the current code, each region is stretched of "pull back length" to the left,
the region on the left is stretched to overlap this one of "Fade Length".
The problem arises when using this method after split a region at onsets and snap to grid all new regions (Rhytme ferret).
If after "split at Onsets", a gap between two regions is bigger than "Pull Back Length", then the right region will be stretched of Pull Back Lenght to the left, and the left region will be stretched to the right until overlap the right one. And what can we ear on the right side of the left region ? The attack present at the beggining of the right region.
To avoid this, I propose this code which retains the same behavior except that it never stretch the left region to the right. If the left region is not close enought, the right one will be stretched to the left until the end of the left one. This avoids double attacks.
So, we can rename "Pull Back Length", in "Minimum Pull Back Lenght" and set it by defaut to 10ms instead of 30ms, by experience it seems reasonable for drums or guitars.
Also, the code I propose uses truely the fade duration defined by user instead of a simple overlap (for audio regions only). If "Fade Length" is set on 0ms, the default fade will be used (64samples), I think it's good the set it to 0 by default.
To test this, take an audio region of rhytmic guitar or drum, apply Rhytme Ferret, analyze region, split region at Onsets, select all new regions and "snap to grid". Then use "Close Gaps".