%script Newinit
% pitch and delay parms, e is sine's exponent,
% hz is the "sweep period" for the delay or pitch warble
% to go positive and  negative.  AMP is how many seconds
% of delay we're talking for delay (20-30 ms I'm told).
% Units are fraction of a sample time for the pitch...doubling
%or halving moves an octave.  2^(1/12) would drop 1/2 step,
% 2^(2/12) 1 step...
%Assuming stereo here.

global N Fs;
global DEL_ABS DEL_E DEL_HZ DEL_MIN DEL_MAX DEL_PH DEL_AMP;
global PIT_E PIT_HZ PIT_SWAMP PIT_PH PIT_AMP;
global VIB_HZ VIB_SWAMP VIB_PH VIB_AMP;
global DELAYS PITCHES VIBS;


DEL_ABS = 1; %constant delay
DEL_E = 2;  %sweep sine exponent
DEL_HZ= 3;  %delay sweep rate. even no. means return to 0
DEL_MIN = 4; % minimum delay for flanging --in secs
DEL_MAX= 5; % max delay in sweep -- in seconds
DEL_PH=  6; % delay sweep phase  -- in angle  0 --2pi
DEL_AMP =7; % how loud this voice?

PIT_E= 1;   %  smaller <0  mean quick transitions
PIT_HZ= 2;  % warble sweep rate -- sweeps thru zero
PIT_SWAMP = 3; % sweep amplitude in halfsteps
PIT_PH = 4;    % sweep phase
PIT_AMP = 5;    % how loud this voice


VIB_HZ =1;  %'vib', really just volume modulation
VIB_SWAMP = 2; % e.g. 1.05 for 5% louder  max
VIB_PH = 3;
VIB_AMP = 4; % how loud is this voice?

DELAYS = zeros(10,7);
PITCHES = zeros(10,5);
VIBS = zeros(10,4);

%halfstep = 2^(1/12);
% first delays and pitches are for singing,
% then a couple of flangers in delays

%           D_ABS  D_Exp D_Hz D_min D_max D_Ph, vol
DELAYS = [ .025, 0,0,0,0,0, 1;   % simple delay
           .00, 1,1,.030,.050,0,1; % big    delay
           0, 1, 2, .010, .020, pi/4, 1  % big delay
             0,    1, .5, .001, .004, 0, 1; % flanger??
             0,    1, .5,.002, .010, pi/4, 1; % flanger??
];
%             PIT_exp, Sw-Hz, Sw-Amp, Phase, vol
PITCHES = [
    1,       1,   2^(1/24),  pi/2, 1;
    1,       1.25,   2^(1/30),  pi/2, 1
    ];
%     hz,  vol.mult,  phase, voice vol

VIBS = [ 8, 0.1, 0, 1.1;
         10, 0.2, pi/2, .8
    ];



