ModPlug Central

OpenMPT => Help and Questions => Topic started by: Grid on January 24, 2021, 23:34:24

Title: Pitch sample without affecting length/speed?
Post by: Grid on January 24, 2021, 23:34:24
Hey! I've tried searching on the forums on and off before and on the internet and I haven't been able to find an answer that helps with my workflow or that tells me a process with good results.
I'm trying to find if there's a way I can pitch up certain samples without altering their speed too badly, e.g. certain kicks or stabs, which in theory should be easier to work for pitching up & down without affecting them too much as opposed to straight up long loops & samples. I haven't been able to find anything that works other than bouncing the samples to another program like a DAW then bouncing them back in, but I'd like to do this purely in OpenMPT. Is there a way around this? Thanks!
Title: Re: Pitch sample without affecting length/speed?
Post by: Rakib on January 24, 2021, 23:58:09
In the sample view,  pitch shift/ time stretching.
Title: Re: Pitch sample without affecting length/speed?
Post by: Grid on January 25, 2021, 00:04:09
Doing this will usually make it sound echoed/reverbed and rather strange for me. I'm using the .IT format for most of my work and attempting to pitch stuff with that never sounds like the 'original' but pitched, it sounds like an off recording of the original sample.
Title: Re: Pitch sample without affecting length/speed?
Post by: Rakib on January 25, 2021, 00:07:52
Buy autotune and load the samples there? The pitch engine in openmpt is not the best but is usable for many applications.
Title: Re: Pitch sample without affecting length/speed?
Post by: Saga Musix on January 25, 2021, 08:15:57
Please note that it is simply mathematically impossible to build a perfect pitch shifter or time stretcher. There are a few commercial ones that work surprisingly well despite these physical limitations, but it will never be perfect. Autotune may for example work well with vocals but I have doubts it would get the job done for kicks and stabs. You can give Rubberband (https://breakfastquay.com/rubberband/) a try (which is free, but not compatible with OpenMPT's license so we don't use it), but I can tell you that both "classic" ways of implementing pitch shifting and time stretching (namely resynthesizing the frequency spectrum with fast fourier transformation, and temporal overlapping of small snippets of audio, both used by the pitch shifter and time stretcher in OpenMPT respectively) do not handle drums very well. It's just in the nature of time stretching to smear transients.

What may be more helpful in your specific case is editing the samples by hand, e.g. to apply a fadeout to make a kick shorter, or delete small bits of it, or copy&paste bits to make it sound longer. I personally would never use a time stretcher for that.
Title: Re: Pitch sample without affecting length/speed?
Post by: peterpiper0815 on January 25, 2021, 16:35:50
To avoid destroying the original Attack of (for example) a kick you can copy the sample cut away the trasient, pitchshit (I noticed that a high quality and low FFT setting works good for kicks) and copy/paste it back to the end of the original sample. Now cut away the original release part of the sample. Yes, its not a one click solution but it can give good (at least interesting) results.



Title: Re: Pitch sample without affecting length/speed?
Post by: Saga Musix on January 25, 2021, 18:35:23
And to make this solution even better, you can also apply the Pitch Shift operation to sample selections starting from the next OpenMPT update. :) I completely forgot that I only implemented that option for time stretch, not pitch shift.

Other pitch shifters like Rubberband do something similar and re-sychronize at transients.