1 //Parameters for piano.dsp
2 //©Romain Michon (rmichon@ccrma.stanford.edu), 2011
5 #include "instrument.h"
7 #define _LOOKUP_TABLE_H_
9 //**********************************************************************
11 extern LookupTable noteOffDelayTime
;
16 extern LookupTable singleStringDecayRate
;
17 extern LookupTable singleStringZero
;
18 extern LookupTable singleStringPole
;
19 extern LookupTable releaseLoopGain
;
20 extern LookupTable detuningHz
;
21 extern LookupTable stiffnessCoefficient
;
22 extern LookupTable strikePosition
;
23 extern LookupTable EQGain
;
24 extern LookupTable EQBandwidthFactor
;
28 extern LookupTable loudPole
;
29 extern LookupTable softPole
;
30 extern LookupTable normalizedVelocity
;
31 extern LookupTable loudGain
;
32 extern LookupTable softGain
;
36 extern LookupTable sustainPedalLevel
;
37 extern LookupTable DryTapAmpT60
;
38 extern double DryTapAmpCurrent
;
39 extern LookupTable DCBa1
;
44 extern LookupTable secondStageAmpRatio
;
45 extern LookupTable r1_1db
;
46 extern LookupTable r1_2db
;
47 extern LookupTable r2db
;
48 extern LookupTable r3db
;
49 extern LookupTable secondPartialFactor
;
50 extern LookupTable thirdPartialFactor
;
51 extern LookupTable bq4_gEarBalled
;
53 //***************************************************************
56 double noteOffDelayTime_points
[5*2] = {
63 LookupTable
noteOffDelayTime(¬eOffDelayTime_points
[0], 5);
68 double singleStringDecayRate_points
[17*2] = {
87 LookupTable
singleStringDecayRate(&singleStringDecayRate_points
[0], 17);
89 double singleStringZero_points
[17*2] = {
107 LookupTable
singleStringZero(&singleStringZero_points
[0], 17);
109 double singleStringPole_points
[17*2] = {
127 LookupTable
singleStringPole(&singleStringPole_points
[0], 17);
129 double releaseLoopGain_points
[10*2] = {
140 LookupTable
releaseLoopGain(&releaseLoopGain_points
[0], 10);
142 double detuningHz_points
[18*2] = {
161 LookupTable
detuningHz(&detuningHz_points
[0], 18);
163 double stiffnessCoefficient_points
[10*2] = {
174 LookupTable
stiffnessCoefficient(&stiffnessCoefficient_points
[0], 10);
176 double strikePosition_points
[12*2] = {
189 LookupTable
strikePosition(&strikePosition_points
[0], 12);
191 double EQGain_points
[14*2] = {
206 LookupTable
EQGain(&EQGain_points
[0], 14);
208 double EQBandwidthFactor_points
[13*2] = {
222 LookupTable
EQBandwidthFactor(&EQBandwidthFactor_points
[0], 13);
228 double loudPole_points
[19*2] = {
248 LookupTable
loudPole(&loudPole_points
[0], 19);
250 double softPole_points
[16*2] = {
267 LookupTable
softPole(&softPole_points
[0], 16);
269 double normalizedVelocity_points
[8*2] = {
278 LookupTable
normalizedVelocity(&normalizedVelocity_points
[0], 8);
280 double loudGain_points
[16*2] = {
297 LookupTable
loudGain(&loudGain_points
[0], 16);
299 double softGain_points
[15*2] = {
315 LookupTable
softGain(&softGain_points
[0], 15);
320 double sustainPedalLevel_points
[13*2] = {
334 LookupTable
sustainPedalLevel(&sustainPedalLevel_points
[0], 13);
336 double DryTapAmpT60_points
[16*2] = {
353 LookupTable
DryTapAmpT60(&DryTapAmpT60_points
[0], 16);
355 double DryTapAmpCurrent
= 0.15;
357 double DCBa1_points
[18*2] = {
376 LookupTable
DCBa1(&DCBa1_points
[0], 18);
381 double secondStageAmpRatio_points
[6*2] = {
388 LookupTable
secondStageAmpRatio(&secondStageAmpRatio_points
[0], 6);
390 double r1_1db_points
[3*2] = {
394 LookupTable
r1_1db(&r1_1db_points
[0], 3);
396 double r1_2db_points
[4*2] = {
401 LookupTable
r1_2db(&r1_2db_points
[0], 4);
403 double r2db_points
[2*2] = {
406 LookupTable
r2db(&r2db_points
[0], 2);
408 double r3db_points
[2*2] = {
411 LookupTable
r3db(&r3db_points
[0], 2);
413 double secondPartialFactor_points
[2*2] = {
416 LookupTable
secondPartialFactor(&secondPartialFactor_points
[0], 2);
418 double thirdPartialFactor_points
[2*2] = {
421 LookupTable
thirdPartialFactor(&thirdPartialFactor_points
[0], 2);
423 double bq4_gEarBalled_points
[6*2] = {
430 LookupTable
bq4_gEarBalled(&bq4_gEarBalled_points
[0], 6);
432 //************************************************************************
434 float getValueDryTapAmpT60 (float index
){
435 return DryTapAmpT60
.getValue(index
);
438 float getValueSustainPedalLevel (float index
){
439 return sustainPedalLevel
.getValue(index
);
442 float getValueLoudPole(float index
){
443 return loudPole
.getValue(index
);
446 float getValuePoleValue(float index
){
447 return softPole
.getValue(index
);
450 float getValueLoudGain(float index
){
451 return loudGain
.getValue(index
);
454 float getValueSoftGain(float index
){
455 return softGain
.getValue(index
);
458 float getValueDCBa1(float index
){
459 return DCBa1
.getValue(index
);
462 float getValuer1_1db(float index
){
463 return r1_1db
.getValue(index
);
466 float getValuer1_2db(float index
){
467 return r1_2db
.getValue(index
);
470 float getValuer2db(float index
){
471 return r2db
.getValue(index
);
474 float getValuer3db(float index
){
475 return r3db
.getValue(index
);
478 float getValueSecondStageAmpRatio(float index
){
479 return secondStageAmpRatio
.getValue(index
);
482 float getValueSecondPartialFactor(float index
){
483 return secondPartialFactor
.getValue(index
);
486 float getValueThirdPartialFactor(float index
){
487 return thirdPartialFactor
.getValue(index
);
490 float getValueBq4_gEarBalled(float index
){
491 return bq4_gEarBalled
.getValue(index
);
494 float getValueStrikePosition(float index
){
495 return strikePosition
.getValue(index
);
498 float getValueEQBandWidthFactor(float index
){
499 return EQBandwidthFactor
.getValue(index
);
502 float getValueEQGain(float index
){
503 return EQGain
.getValue(index
);
506 float getValueDetuningHz(float index
){
507 return detuningHz
.getValue(index
);
510 float getValueSingleStringDecayRate(float index
){
511 return singleStringDecayRate
.getValue(index
);
514 float getValueSingleStringZero(float index
){
515 return singleStringZero
.getValue(index
);
518 float getValueSingleStringPole(float index
){
519 return singleStringPole
.getValue(index
);
522 float getValueStiffnessCoefficient(float index
){
523 return stiffnessCoefficient
.getValue(index
);
526 float getValueReleaseLoopGain(float index
){
527 return releaseLoopGain
.getValue(index
);
532 double loopFilterb0_points
[18*2] = {
552 extern LookupTable loopFilterb0
;
553 LookupTable
loopFilterb0(&loopFilterb0_points
[0], 18);
555 float getValueLoopFilterb0(float index
){
556 return loopFilterb0
.getValue(index
);
559 double loopFilterb1_points
[18*2] = {
579 extern LookupTable loopFilterb1
;
580 LookupTable
loopFilterb1(&loopFilterb1_points
[0], 18);
582 float getValueLoopFilterb1(float index
){
583 return loopFilterb1
.getValue(index
);
586 double loopFilterb2_points
[18*2] = {
606 extern LookupTable loopFilterb2
;
607 LookupTable
loopFilterb2(&loopFilterb2_points
[0], 18);
609 float getValueLoopFilterb2(float index
){
610 return loopFilterb2
.getValue(index
);
613 double loopFiltera1_points
[18*2] = {
633 extern LookupTable loopFiltera1
;
634 LookupTable
loopFiltera1(&loopFiltera1_points
[0], 18);
636 float getValueLoopFiltera1(float index
){
637 return loopFiltera1
.getValue(index
);
640 double loopFiltera2_points
[18*2] = {
660 extern LookupTable loopFiltera2
;
661 LookupTable
loopFiltera2(&loopFiltera2_points
[0], 18);
663 float getValueLoopFiltera2(float index
){
664 return loopFiltera2
.getValue(index
);
669 double bassLoopFilterb0_points
[19*2] = {
690 extern LookupTable bassLoopFilterb0
;
691 LookupTable
bassLoopFilterb0(&bassLoopFilterb0_points
[0], 18);
693 float getValueBassLoopFilterb0(float index
){
694 return bassLoopFilterb0
.getValue(index
);
697 double bassLoopFilterb1_points
[19*2] = {
718 extern LookupTable bassLoopFilterb1
;
719 LookupTable
bassLoopFilterb1(&bassLoopFilterb1_points
[0], 18);
721 float getValueBassLoopFilterb1(float index
){
722 return bassLoopFilterb1
.getValue(index
);
725 double bassLoopFiltera1_points
[19*2] = {
746 extern LookupTable bassLoopFiltera1
;
747 LookupTable
bassLoopFiltera1(&bassLoopFiltera1_points
[0], 18);
749 float getValueBassLoopFiltera1(float index
){
750 return bassLoopFiltera1
.getValue(index
);