repitch | a MIDI-controlled audio harmonizer | Audio Utils library
kandi X-RAY | repitch Summary
kandi X-RAY | repitch Summary
a MIDI-controlled audio harmonizer
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of repitch
repitch Key Features
repitch Examples and Code Snippets
Community Discussions
Trending Discussions on repitch
QUESTION
I have written a very basic script to repitch an audio file, which I import using simpleaudio. I am not worried about preserving audio speed; all I need is a simple pitch-shift.
What I am doing is resampling the audio using linear interpolation, and from what I've read, this should be enough. For example, you can see here that the pitch of the audio is shifted, but it retains a very similar shape:
The blue line is the initial waveform, the orange is the pitch-shifted waveform. It all looks exactly how I would expect.
So far so good. However, when playing it back through simpleaudio's interface, the shifted wave is really really noisy. Interestingly though, this doesn't happen if I shift by an integer ratio.
See the code below for my implementation (there's not much, I promise):
...ANSWER
Answered 2020-Dec-01 at 11:53wav files are little-endian, not big-endian.
struct
should be using "
, not ">h"
.
This wasn't a problem when using integer pitch-shift ratios, because there wasn't actually any interpolation happening in that case - it was just selecting every nth sample. And since each conversion function was the reverse of the other, it was like nothing had every changed.
But as soon as you start to interpolate, you get problems, because you're now working with 'reversed' data in a non-reversed way.
Anyway, my algorithm now works perfectly.
QUESTION
According to the documentation of scipy.signal.resample
, the speed should vary according to the length of input:
As noted, resample uses FFT transformations, which can be very slow if the number of input samples is large and prime, see scipy.fftpack.fft.
But I have very different timings (factor x14) with the same input, and only a small variation of desired output size:
...ANSWER
Answered 2018-Sep-14 at 19:59The docstring, somewhat misleadingly, states one part of the story. The resampling process consists of FFT (input size), zero-padding, and inverse FFT (output size). So an inconvenient output size will slow it down just as much as an inconvenient input size will.
Cris Luengo suggested using direct interpolation in the spatial domain, which should be faster here. For example, ndimage.zoom
uses it (cubic spline interpolation by default):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install repitch
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page