sr = 96000
kr = 96000
nchnls = 2
0dbfs = 1
zakinit 2, 1
vbaplsinit 2, 2, -30.0, 30.0
gi_origin = -25.946882
gi_integer_width = 4.324480
gi_distance_to_speakers = 1.27
gi_vh_amplitude_MAX0102 ftgen 0, 0, 17, -2, 0.035508, 0.018941, 0.017063, 0.016732, 0.015738, 0.016842, 0.018057, 0.019493, 0.020708, 0.022807, 0.024574, 0.027556, 0.029654, 0.033630, 0.038269, 0.042908, 0.045558
gi_vh_panning_MAX0102 ftgen 0, 0, 17, -2, -25.12190, -22.24778, -18.62853, -15.64796, -12.77384, -9.793285, -6.599822, -3.243360, 0, 3.512807, 6.599821, 10.21907, 13.73188, 17.56404, 20.33170, 23.73806, 26.71863
gi_wavetable_0_MAX0102 ftgen 0, 0, 0, 1, "lip_flapping_seven.wav", 0, 0, 0
gi_lowest_integer = 1
gi_highest_integer = 13
gi_base_frequency = 98.000000
gi_attack_from = .0055
gi_attack_to = .0034
gi_release_from = .0089
gi_release_to = .0055
instr MAX0102
i_duration = p3
i_integer = p4
i_frequency = gi_base_frequency*i_integer
i_attack = gi_attack_from+(i_integer-gi_lowest_integer)*((gi_attack_to-gi_attack_from)/(gi_highest_integer-gi_lowest_integer))
i_release = gi_release_from+(i_integer-gi_lowest_integer)*((gi_release_to-gi_attack_from)/(gi_highest_integer-gi_lowest_integer))
i_azimuth = gi_origin+(i_integer-gi_lowest_integer)*gi_integer_width
k_amplitude table3 (i_integer-gi_lowest_integer)*(16/(gi_highest_integer-gi_lowest_integer)), gi_vh_amplitude_MAX0102
k_panning table3 (i_integer-gi_lowest_integer)*(16/(gi_highest_integer-gi_lowest_integer)), gi_vh_panning_MAX0102
i_wavetable_0_MAX0102 ftgenonce 0, 0, 8192, 30, gi_wavetable_0_MAX0102, 1, floor((sr/2)/i_frequency)
a_signal poscil3 k_amplitude, i_frequency, i_wavetable_0_MAX0102
a_attack linen 1.0, i_attack, i_duration, 0.0
a_release linen 1.0, 0.0, i_duration, i_release
a_signal = a_signal*a_attack
a_panning = 1.0
vbapz 2, 0, a_panning, k_panning
a_0, a_1 delayst a_signal, i_azimuth, gi_distance_to_speakers
a_p0 zar 0
a_p1 zar 1
a_0 = a_0*a_p0
a_1 = a_1*a_p1
outs a_0*a_release, a_1*a_release
endin