Changing pitch in semitones

Started by atza, 13 Aug '16 - 07:07

atza

How do you change pitch in semitones using BASS_BFX_PITCHSHIFT ?
Because fPitchShift is given in octave where 0.5 is octave down and 2 is an octave up.

So:
fPitchShift= 0.5  results in -12 semitones
fPitchShift= 2     results in +12 semitones
but what in between?

For example how I shift 3 semitones or 3.25 semitones (3 semitones and 25 cents).



Chris

#1
in the BASS_BFX_PITCHSHIFT Record you can set the Semitones.
BASS_BFX_PITCHSHIFT.fSemitones


QuentinC

Just in case: ratio = pow(2, semitones/12.0)
and in the opposite direction: semitones = 12 * log(ratio)/log(2)

atza

No in help file it says that BASS_BFX_PITCHSHIFT.fSemitones  does nothing and is ignored.

atza

Quote from: atza on 14 Aug '16 - 06:54No in help file it says that BASS_BFX_PITCHSHIFT.fSemitones  does nothing and is ignored.

Thanks. What is ratio by the way?

(: JOBnik! :)

#5
Hi,

You can set pitch by semitones using fSemitones param, but you can't use both fPitchShift and fSemitones at the same time:

if (fPitchShift)
pitchShift=fPitchShift;
else
pitchShift=pow(2.,fSemitones/12.); // convert semitones to factor

Also in docs there is no ignorance :)

QuotefPitchShift - A factor value which is between 0.5 (one octave down) and 2 (one octave up) (1 won't change the pitch) (fSemitones is not in use, fPitchShift has a priority over fSemitones)
fSemitones - Semitones (0 won't change the pitch)

Cafony

In case this help I found this values for trasnpose:


//Pitchshift Values for Transposing : -6   -5  -4   -3    -2   -1   0   1    2     3      4      5      6
       double[] _pitchArrayIndex = { 0.70,0.75,0.80,0.85,0.90,0.95, 1, 1.05, 1.10, 1.15, 1.25, 1.30, 1.40 };
 //=====Trackbar Values         0    1    2    3    4    5   6    7     8     9    10    11    12