Page 1 of 1
Posted: 15 Jan 2017, 12:34
by joffo78
Bonjour à tous.
Ceci est une question assez rudimentaire pour les matheux je pense.
Je connais la formule pour déduire le pourcentage de vitesse en fonction du pitch :
Il s'agit de pitch=p vitesse=v
(P/12)exp2 * 100
qu'en est il de l'inverse ? A savoir déduire la valeur du pitch en fonction de la vitesse ?
Merci
Posted: 17 Jan 2017, 14:48
by SylvainT
Salut Joffo,
J'avais fait un petit script pour avoir une nouvelle vitesse quand on change le pitch.
En entree, le tempo original et le pitch, en sortie le nouveau tempo.
J'espere que ca t'aidera.
Sylvain
//////////////////////////////////////////////////////
// Paramters declaration
//////////////////////////////////////////////////////
var input : Tparameter;
var output: Tparameter;
var inpitch : Tparameter;
//////////////////////////////////////////////////////
// initialisation procedure
//////////////////////////////////////////////////////
procedure init;
begin
input := CreateParam('original BPM',ptDatafader);
SetIsOutput(input,false);
SetMin(input,0);
SetMax(input,500);
inpitch := CreateParam('pitch',ptDatafader);
SetIsOutput(inpitch,false);
SetMin(inpitch,-24);
SetMax(inpitch,24);
output := CreateParam('new BPM',ptDataFader );
SetIsInput(output,false);
SetMin(output,0);
SetMax(output,500);
end;
// Global Variables
var inval, inpitchval : single;
var a, outval : single;
//////////////////////////////////////////////////////
// Main Loop procedure
//////////////////////////////////////////////////////
Procedure Process;
begin
inval := getValue(input);
inpitchval := getValue(inpitch);
a := inpitchval/12;
outval := inval * exp(a*ln(2));
setvalue(output,outval);
end;
//////////////////////////////////////////////////////
Posted: 17 Jan 2017, 16:53
by joffo78
Merci Sylvain.
Ca je sais faire.
C'est l'inverse que je cherche
Posted: 17 Jan 2017, 17:01
by joffo78
PS: comment fait on pour copier le texte dans un script avec l'éditeur mac ?
Posted: 17 Jan 2017, 17:54
by SylvainT
Oups, voici
//////////////////////////////////////////////////////
// Paramters declaration
//////////////////////////////////////////////////////
var input1 : Tparameter;
var input2 : Tparameter;
var output: Tparameter;
//////////////////////////////////////////////////////
// initialisation procedure
//////////////////////////////////////////////////////
procedure init;
begin
input1 := CreateParam('original BPM',ptDatafader);
SetIsOutput(input1,false);
SetMin(input1,0);
SetMax(input1,500);
input2 := CreateParam('new BPM',ptDatafader);
SetIsOutput(input2,false);
SetMin(input2,0);
SetMax(input2,500);
output := CreateParam('pitch',ptDataFader );
SetIsInput(output,false);
SetMin(output,-24);
SetMax(output,24);
end;
// Global Variables
var inval1, inval2 : single;
var a, outval : single;
//////////////////////////////////////////////////////
// Main Loop procedure
//////////////////////////////////////////////////////
Procedure Process;
begin
inval1 := getValue(input1);
inval2 := getValue(input2);
outval := 12*ln(inval2/inval1)/ln(2);
setvalue(output,outval);
end;
Posted: 17 Jan 2017, 18:06
by SylvainT
Pour copie/colle un texte dans le script, c'est un peu tricky (en fait j'avais jamais essaye, seulement d'un script a un autre script).
En fait, ca met tout sur un seule ligne, si tu remets les enters (retour a la ligne), ca peut fonctionner, mais c'est pas genial.
Je vais en toucher un mot a Senso.
Posted: 17 Jan 2017, 21:32
by joffo78
Désolé mais c'est impossibe de copier le script sous mac
Un petit export dans l'uploader peut être...
Posted: 17 Jan 2017, 22:01
by nay-seven
Posted: 19 Jan 2017, 16:48
by joffo78
Merci nay. Entre temps j'ai retrouvé une version patch :
