Author Topic: Changing pitch in semitones  (Read 2531 times)

atza

  • Posts: 127
Changing pitch in semitones
« on: 13 Aug '16 - 07:07 »
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

  • Posts: 2217
Re: Changing pitch in semitones
« Reply #1 on: 13 Aug '16 - 10:57 »
in the BASS_BFX_PITCHSHIFT Record you can set the Semitones.
Code: [Select]
BASS_BFX_PITCHSHIFT.fSemitones

« Last Edit: 13 Aug '16 - 11:04 by Chris »

QuentinC

  • Posts: 78
Re: Changing pitch in semitones
« Reply #2 on: 13 Aug '16 - 19:42 »
Just in case: ratio = pow(2, semitones/12.0)
and in the opposite direction: semitones = 12 * log(ratio)/log(2)

atza

  • Posts: 127
Re: Changing pitch in semitones
« Reply #3 on: 14 Aug '16 - 06:54 »
No in help file it says that BASS_BFX_PITCHSHIFT.fSemitones  does nothing and is ignored.

atza

  • Posts: 127
Re: Changing pitch in semitones
« Reply #4 on: 14 Aug '16 - 06:55 »
No in help file it says that BASS_BFX_PITCHSHIFT.fSemitones  does nothing and is ignored.

Thanks. What is ratio by the way?

(: JOBnik! :)

  • Posts: 1080
Re: Changing pitch in semitones
« Reply #5 on: 15 Aug '16 - 21:55 »
Hi,

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

Code: [Select]
if (fPitchShift)
pitchShift=fPitchShift;
else
pitchShift=pow(2.,fSemitones/12.); // convert semitones to factor

Also in docs there is no ignorance :)

Quote
fPitchShift - 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)
« Last Edit: 15 Aug '16 - 21:59 by (: JOBnik! :) »

Cafony

  • Posts: 33
Re: Changing pitch in semitones
« Reply #6 on: 8 May '24 - 08:31 »
In case this help I found this values for trasnpose:

Code: [Select]

//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