Für Elise | Piano Contest

My Für Elise submission, played on my own piano code. You can swap in any MIDI data and it plays it back with a realistic piano sound.

Log in to post a comment.

ditty.bpm = 60;

const VOICE_LOOPS = 4;
const fürEliseData = fürElise();


const RelHiZone = 11;
const Life24ZoneCount = 11;
const Life24ZoneBase = 0;
const Life24PartialCount = 115;
const Life24Zone = [27.0,0.0,19.0,0.0,33.0,19.0,19.0,1.0,39.0,38.0,20.0,2.0,45.0,58.0,14.0,3.0,51.0,72.0,11.0,4.0,57.0,83.0,8.0,5.0,63.0,91.0,7.0,6.0,69.0,98.0,5.0,7.0,75.0,103.0,5.0,8.0,81.0,108.0,4.0,9.0,87.0,112.0,3.0,10.0];
const Life24Freq = [38.5253,77.0124,115.6324,154.3545,193.0311,232.0743,271.1835,349.7605,389.2862,429.0743,509.0742,549.3545,589.8578,630.8563,838.7029,880.8446,1099.0082,1185.8289,1600.4777,54.7258,109.5306,164.4686,219.5736,274.4209,329.4389,384.1968,494.5313,550.1579,605.7628,661.3974,717.279,773.5726,829.9263,1000.9888,1058.4614,1116.3318,1174.2273,1644.9079,77.2714,154.8998,233.0945,310.7093,387.9598,466.2659,544.0466,700.5686,778.9774,857.8971,937.0003,1016.0916,1095.4306,1175.0972,1254.9115,1415.9248,1496.555,1577.8163,1659.1129,1906.1138,109.5888,220.1564,330.0763,440.1333,550.2932,660.3413,770.4188,992.4577,1103.7341,1215.3805,1439.3882,1551.8781,1664.336,2005.3629,155.4087,310.3973,466.3793,621.9714,777.8265,933.5507,1090.7717,1404.4018,1562.7677,1721.0971,1880.1257,220.1042,439.6538,660.4878,880.9554,1102.6223,1324.5635,1547.9734,1996.4427,311.3683,622.2676,934.6115,1247.388,1562.0663,1879.2006,2196.2975,440.0559,881.0665,1323.8125,1768.8206,2218.7232,623.046,1248.6034,1878.691,2514.4737,3157.9092,881.9178,1771.2919,2666.211,3575.7094,1251.4207,2513.6896,3800.4431];
const Life24EnvScale = [0.0251922607,0.196533203,0.23034668,0.136108398,0.266601562,0.0577087402,0.139770508,0.0267181396,0.0471801758,0.0339355469,0.0445861816,0.14855957,0.0635986328,0.029296875,0.0313415527,0.050994873,0.094543457,0.0297698975,0.0487670898,0.0205383301,0.250488281,0.233886719,0.0875244141,0.177612305,0.0539855957,0.063659668,0.0325622559,0.0484924316,0.0723876953,0.048248291,0.0405883789,0.0436706543,0.0257720947,0.0469055176,0.0282440186,0.0858154297,0.0401916504,0.0452880859,0.267578125,0.399658203,0.133300781,0.104797363,0.0791625977,0.0487365723,0.0581970215,0.0441894531,0.041015625,0.037689209,0.0333862305,0.0393066406,0.0511474609,0.0654907227,0.0342102051,0.0200500488,0.016494751,0.0247039795,0.0385742188,0.0621032715,0.285400391,0.231201172,0.166748047,0.0927124023,0.0805053711,0.142700195,0.0693969727,0.0552368164,0.0894775391,0.0888671875,0.0312194824,0.121520996,0.048614502,0.0526428223,0.473144531,0.328125,0.347167969,0.0848388672,0.0524291992,0.0673217773,0.0682373047,0.0803222656,0.0656738281,0.0330505371,0.0917358398,0.387939453,0.424804688,0.135131836,0.143920898,0.117980957,0.0452575684,0.067565918,0.087890625,0.400390625,0.4453125,0.080078125,0.0872192383,0.0893554688,0.0545043945,0.0914306641,0.739257812,0.272949219,0.130249023,0.0612792969,0.0326538086,0.794921875,0.112854004,0.129150391,0.10723877,0.165527344,0.709960938,0.235717773,0.14465332,0.101623535,0.543945312,0.134277344,0.0500793457];
const Life24Env = [3133876758,3117033749,2982618642,1336813066,437295125,654375163,3269639867,1263187810,2965526355,2645842264,2746900068,2963840864,1094497094,1060681285,976337986,841206078,654893637,2885743848,3390759656,3138578147,3239764195,3206470879,3089748693,2805514945,2703414971,2719996349,2769935809,2953832140,3238064863,3523734252,3389842662,3423528165,3323321823,3240219607,3040199109,2673125033,3369549027,3420011494,3521001707,3722917109,4025365502,4126091513,4041610736,3923842797,3756005865,3503956190,3184472016,2663269308,2881177904,2914863405,2948679464,3049931294,3251977486,3570479872,3227264768,2688626189,2588359714,2439075905,1902863970,1836749460,1243821019,1176580574,1042165219,773137898,504765169,339087589,102894831,2297581,69868010,288958175,692271815,1414615211,3041647032,3058293946,3041256128,2990533834,1362426842,858848988,959642073,1094513365,1178789836,1397478076,2472456866,2641664618,2702524381,2635218144,1846425573,1292316400,755183358,352860153,403287795,420405751,588634865,824496867,1127595461,1481472081,920246367,886888800,820108644,686613642,486140548,369026884,318696243,335211049,435481126,585819174,786158900,1019590494,1245456680,1245324838,1278550304,1345132566,2803960839,3306754816,3323138304,3306098691,2987396873,2987726610,3123127065,3264954154,3644736926,3694936733,3795401885,3979685523,4197522524,4264896086,4130479433,4080736830,3862437697,3695323721,3444392527,3096750168,643838028,610282826,526526789,375988284,195629098,231801122,383451193,1069886632,765575516,732671057,883140699,1101090157,3710571827,3743930418,3810581807,3910526761,4010077732,3925994545,4009815870,3993230432,3843147191,3592446919,2889960901,1553837227,3015841751,3049330137,3099463900,3249342691,3375235302,3138912482,3122790884,2737375207,1345784547,1128928476,1615209675,3041280934,641709486,591312815,490454451,305580220,104127175,104456138,4383944,23587522,28895426,98084054,1530875871,859745621,3520258230,3553944502,3621382328,3739414971,3857645245,3823893950,3958109360,4008045891,4007253301,3585435201,1354484674,3049705904,764781656,765044315,765568613,816684968,2830774983,3777954014,3424585665,779026644,761142474,1085091254,2304725138,2526913636,1008674603,941368617,823599140,621615132,251857165,403243015,269094145,168562698,268902936,454503977,1027486775,2846184784,3277380917,3310870323,3394757935,3512069673,3696884771,3779132965,3913021479,3946376754,3946568516,3645815983,3108986548,2791011167,3773312531,3790220560,3857590795,3823902466,4026438434,733864169,3099737278,3234181056,2428525495,3317845948,3267513528,2914999473,3074698531,3091212575,3157860631,3257602570,3088778240,3072199431,3273721861,3257075974,3072658957,2788171551,2806922298,2692241492,942092752,908340691,874456537,806623202,1091175917,3405779948,2869305317,3003783910,2484477923,1078014166,1839833665,2959516503,3620741041,3671071925,3754825406,3938192841,4062971598,4029482427,3981901917,4037543869,4020574401,3728881586,3415755085,2862263966,716487846,649641380,515882396,281786202,14171460,97724750,114371428,231744688,482812093,917122494,1230912162,3093845907,3392648474,3426073111,3442590738,3391869449,1193602826,505347606,522577161,474140423,668289305,1487444547,1321952831,1380078029,641155276,590560974,522861780,404371677,369310441,335557113,487278845,638598135,840844524,1329615817,3032393268,2744818247,448354968,397972367,280409444,112251478,89977417,347405895,499121729,564788533,748615225,2992886099,765342900,984696674,3911963848,3962165706,4045856972,4162907855,4113366741,3779918824,3644062179,3257856994,1110430128,3419168436,2472792012,3065983648,2914857522,2948541999,3032753705,3184335136,3537437974,3806330904,3856925472,3940814884,3823184722,3385078695,3266620854,1027561563,456702141,389397438,271696319,86756541,2414500,120045901,69775264,136858473,338576718,692473461,1381124205,2963491429,4006010168,4056539191,4140754483,4275499565,4208654885,4074043411,3875944483,3474244130,3408118317,2705238599,1569821278,2657917804,607824683,557231400,472756260,320714780,50840095,33601597,235327654,403953103,827117511,842749771,1247395000,1431869548,3777240019,3827308756,3877180119,3909880024,3775135944,3289186998,3759083980,4011396825,3593347287,2923999044,3292347061,1102289766,3089028703,3105610333,3121995867,3171609687,2919298894,2634216096,1091298634,991288371,792249131,2002885802,1380367693,1773358181,3789830345,3840423117,3924635603,4059376096,4009369583,3858044657,3807382516,3203334384,3186493406,1205740223,1486973847,3107570853,741131357,690603612,589548380,404345690,168680270,971579,51567414,169531450,337884722,1298227272,1447740599,1348619853,3117561274,3100914365,3017354691,1726096331,871306448,855444947,1090391758,820911573,635379380,836577643,1153908658,2525454770,3459335635,3509536213,3643491801,3844424675,4263073511,4022340347,753191982,3545710270,3677606238,3182125985,2962795345,2489082020,3251681981,3319118782,3437149372,3656036187,3757058837,1264130560,2704220192,995302679,1010249759,1279604779,1363888448,1700882279,3016267302,3117196065,3319116056,3672427019,3991397638,4024819712,4049657613,3936535581,3376827195,2711786328,2724095060,1667592098,3629833426,3680035286,3781094105,3818976994,3584881881,3125082087,941096664,890172889,792252622,1313845176,1364171364,2708313717,1129263915,1095577127,1045177632,944183062,862849552,1027805211,987037734,668074515,1909593890,2915183687,1689137230,3114880159,1101775826,1068287959,984535006,917298409,926737904,942206458,3157979134,3448826618,3722626529,1655271780,2864101313,2476254809,3889049141,3956550450,4057999150,4176750374,4143856937,4093199125,4059441712,3808179782,3723612491,1809623991,2998490452,1623289166,1439555743,1607656102,2765874604,3421234115,3572946609,3556301875,3640576555,3790652459,3572278588,3636151217,2638394694,1388623264,625750840,541929524,441526831,227876905,111744051,4134955,206114610,206375225,1046618546,1077721260,1821987679,2726931577,3762373167,3845996334,3962911021,4146671417,4263262692,4228201719,4228298728,4111642339,3278519745,2848726992,2422318679,3008911025,984472036,951180521,884597744,750317050,446951418,190509310,86632935,255119343,707775192,978374863,1297520557,2880202838,891238665,907687686,974271744,3103992068,3728151850,3604988490,3653330111,3636257222,1079957148,3031872859,2879499173,1549767016,3554265628,3604795159,3722499856,3890603269,3856658453,3724274971,3439257402,2901584328,3821517982,3251879249,2949038912,1554682538,2965256418,3015914470,3133812206,3386450681,3622314750,3437438200,3302168562,3518304688,3320719950,2932812728,2723696567,2943005865,3123042093,3189889835,3323650855,3574722854,3793025837,3693674030,3475569955,3058953000,3778925478,3460414825,1851245387,2908336988,1122721982,1139760834,1156998345,1258202066,1341675481,1542806233,1643032274,1340125881,1507630122,2579523144,1472619328,2639433039,1532156966,1850925345,2823809049,3327062284,3341349637,3088966656,1059187223,990231835,3440761358,1210040873,2655108407,2510395243,807084877,806821711,823137869,1023674188,2735472681,3273526050,3553311539,145733112,656876237,557266907,1112098492,1768118384,2848922640,2748323853,1523716103,986580224,463341315,398329106,496961588,604970802,371732263,825192605,1347633977,1347509146,887736021,804112856,653512669,402577635,32890081,15194597,400077283,802350150,651547581,835571884,1319806888,2594218343,625719385,558283094,457162834,389199943,1396173371,777059889,967963449,1162529094,833665120,1583651935,2409202542,2322428556,1133991995,996299057,759908640,254033664,269660674,572368399,538260750,320423181,521579542,808036140,1026731838,1783866273,3116028478,3217021498,3351767087,3233676851,403305774,420799260,302840351,673898550,1061081146,1363395405,1503814493,2321196385,3199706959,3267343436,3335440966,2816862264,570095891,721026576,703394576,1105913910,837143244,1370992041,1403351474,2593297490,1237237703,1204077518,1037224667,837539056,938727411,2917259518,3220062718,1204538874,1042923490,1414767029,1984586419,1571710282,816197049,699279548,448208838,80942798,14031459,72294724,331423927,548605755,2858622631,1235636835,3210559659,1885113974,1027454644,892712889,673626052,353063898,452994776,637675703,771894992,806499526,757357771,1010585290,3115160899,1687447639,2940971723,3075191762,3292971486,3611943410,3509973751,3626294006,3541881078,3677264382,3168551152,1523226052,1992333229,2690018210,1067598158,967588422,766978619,399839523,49545515,16059714,183243063,81599271,215555363,918764613,1755731051,2724762527,3491966526,3558615100,3658423353,3506442340,453447114,386605263,488517324,557852367,929642194,1363627961,1651413659,2489607521,1010523062,942756015,874396246,989863970,1091313441,1326325542,1007952160,959456282,3026331720,2756267075,2963631949,1654236068,3149189421,3216103207,3333677848,3475763712,3205626380,3223779885,957673515,773118099,1093583670,2723524692,1264103501,2560906900,1388858958,1288653898,1121732674,871450427,889081160,989614665,905791045,989018554,1356742318,1891783593,2393795677,1805021851,3567639094,3685604658,3904758058,4207729710,4272283572,4173649466,4272546111,4080724287,3577461353,1166922410,2742200925,1569811606,1263096885,1195659310,1077626914,891893774,807153665,892087040,1975526154,3160031562,1025615424,1362971446,1565938248,2053085039,1093095598,974997938,738867640,436216400,320155210,302852771,303640670,404897628,707938956,1212570736,1650365542,1872000132,3318635443,3419756476,3621472969,3873585865,3892186200,2985233436,3002080315,3185710626,3016894006,2864724808,1688425814,1801820043,1078306379,977379649,792483889,541799709,448667658,550182144,782117140,951925292,1265407817,1448187739,2543545203,1768264588,2948805321,3117231051,3403750602,3908962123,4260957471,4210755884,4009624332,3992001810,3772920620,3199817037,2796313690,2509151907,791097909,639707948,404429601,220207120,253111040,436611853,740369932,420750874,925249577,1665032247,1365480798,2422827635,3006084423,3039047252,3105235899,3288929503,3641380580,3623882457,3305506530,857479653,1011241928,2839630259,1570998942,2424802417,1204202205,1003206628,668061676,114683874,36560855,69781470,4049352,206394045,727594689,1179557550,1516852583,2692967788,1052887893,952357975,717612373,530577958,559413029,825556534,2921789530,3660048085,3300214484,1253162922,2510200216,1701344404,1271546831,1137655254,836383201,703472113,1022370807,1038886398,1006252786,1224162529,1424186018,2377489307,1722912353,2455408478,3091649513,3209026287,3443254520,3679774717,3721518334,3687569661,3620917492,3537353448,3133694665,2679152566,2510121316,1785106834,2803844700,2836873306,2869639258,2936025669,3204523176,3087344079,1393368797,724315115,985770428,1615487071,1705153184,2389078131,2982102598,3117234751,2296717620,1241386899,2715621091,954473686,1507730766,1222582970,1423387579,1724070578,1521897834,1788438418,1465206172,1347567007,1095837865,322179668,2239185,263074257,345979335,699875531,968074674,1418762908,2274793868,2423024491,1270528721,1018870751,960379371,3894948049,4261826260,4244979369,4094052279,3760150227,3215805651,1137595335,1717854379,2573963376,2746895177,2797814851,3000188742,3119196748,2716536878,3185508391,1490293548,918693166,1217553730,2841661537,1502318445,2543029365,1119798073,935841067,634183699,776332800,3627468039,3325477386,3256990731,3273964581,3259935917,2763432880,2408738713,2241228908,3410514730,3627961117,3812503310,1276885013,1342759179,1493234698,1007414799,2584851504,1412123816,1466208104,2475586205,1919258472,2690428871,2706815954,2890969316,2898988778,3404993790,2885562109,1373247738,2480681961,1154703307,1420909485,2539883898,2322043496,1942002090,1691130283,1373658720,989418654,1123979435,1090372154,1006291757,1642514209,2763631415,2594346329,2020371347,2003668080,859324986,522924335,120332601,156110867,171119104,52708364,573586954,808797981,1218423350,1219387742,2624217235,1787992684,3074994384,3174089183,2418204393,836042477,498922695,716567768,1086580958,2882785733,2661788834,1212847547,1722329259,2491968871,759213856,709211407,792146440,652017703,1056442895,1458245138,921177100,834343964,1237397544,1521062461,1721209701,2373414520,3469030834,3788058055,4198638565,4262793699,4130412777,4029879262,3734835667,3468304067,2997042869,2694471061,2255973001,2390462854,2680333528,2966270696,3320498167,1878942428,1408067298,2716641759,3220027613,3336984034,3084733133,2494064291,2288423320,1886941031,3173561373,3256728850,3541156870,3845117956,3725579532,3809467940,3542521088,1412720671,3114485567,2707002965,1872597395,2037479027,1189107625,955208085,670866983,418856479,318652196,318550545,501929743,1791152921,2678493259,2022666351,1821731730,2339275909,1010977850,808402985,756362544,237354690,5036066,137814300,472576327,3175275421,2941037923,2606667164,2408934292,1886358124,3461656021,3727148779,3893319920,3708965089,3607127538,3356507134,3308205562,1287272672,1449638809,2940703666,2472908687,2322957932,1210297938,1040624306,3389569484,3440884214,3791698163,3759296495,3575010260,3508642245,2722454202,1871289448,2456580465,1888325258,1137356877,904250070,652594648,405915176,357919507,844666624,791135503,3155998240,1346517306,1936365458,2440005743,2305783691,3153282268,3254666721,3737144298,869668317,535174650,3049854967,3978307290,3737439769,2562434979,2846336093,1852992116,2324402033,3042789540,2806394832,3134266340,3913418712,2998273500,1406271709,533729084,826748491,1012110495,1432066655,2392037520,1718445167,640563650,555356614,422119588,279642370,203751474,18746144,302655576,606357071,1264801437,2795980112,1616813171,2577097079,2923999423,3322857631,1127600450,3050454776,3468408062,1462551274,1026148063,3353294020,1482990494,1604684376,2459072661,1937149551,1085582773,532132152,4142132,138622739,232015625,645217291,1002128913,1232965694,2891032999,1650302056,1853001331,2373480311,2948044897,3319827258,3422378268,3472793120,3405603875,3337788473,3117461584,1532469923,1615682386,2406575461,2054125948,1972275332,1640276562,3136480319,3401973308,2497638678,1152509627,2798513211,3602498075,1042630984,1855698054,1515824226,1802670735,2022674319,2485302847,3138899235,3373253396,3425817363,3054362371,3541160704,1026563080,555235407,1465631156,2559612570,1852736627,2374923919,2580243111,3152490033,3354800145,3271440158,3254269737,3387309367,3343206346,1616073661,2493864538,1871933027,2341308557,1987344500,2889569449,3559087174,3759321243,3525095118,3172612423,587219154,1483524029,2914669737,2610864540,2289005453,2104854128,2206628234,878195548,2951873745,3808231884,3892970984,3638427861,3854896331,3738310620,1296973133,2809357668,2389927534,1854827157,2323025775,3795108007,1235937296,819282963,2914360833,3774003712,3402686513,944915228,1228192550,1666687887,1650101137,2476052369,1869509489,3668622929,4006929074,4242797378,4093573327,3136156662,3097945575,640598469,1536642895,2439948714,2392235667,2357620077,1987743117];
const Life24HF = [77268005,78382099,74122130,77399199,77595824,125437342,90702869,46268780,13893770,3407908,4325445,655369,10289335,9765031,8650893,5832798,10223770,18612461,5505123,3014704,2949171,2687016,3473458,327685,2752590,2621507,2555961,2752559,4915281,7405671,2883632,2490412,2424870,2097182,2752553,131074,3014721,3145790,2752564,1835042,2097190,2687011,2359330,1966108,2162719,2293789,2293799,131074,1900577,1966116,2359337,2424868,2228258,2228265,2490401,2228265,2293792,2031653,2949161,131074,3342391,3276852,3670073,3735604,3407934,3211313,3342390,3407925,3735603,3276846,4063293,196612,267652425,260246795,224463980,231214072,217189079,220138138,187631937,134809274,71303901,17563799,4128830,1376280,101189149,102237718,90178829,80807284,76153816,37487324,37814796,14680312,5046358,2883635,3866690,786436,15007993,13304012,11731116,8716455,11534470,6094956,5177428,2949167,3145769,2818086,3014701,262149,4325434,4325429,3932208,2818085,3538991,2621475,2752554,2228258,2359330,2424868,2424874,131075,2162720,2359330,2752552,2883623,2555944,2621479,2359334,2687013,2883625,2359330,3211314,196610,3145774,2949167,3080242,3473459,2818090,3211312,2883628,3211311,3276844,3211306,3473464,196611,180686207,190057817,178261076,182913456,197725470,202246604,165743191,144640200,47252506,16449862,14024815,8586027,1777,1181153,1164,14222424,35980094,24314442,19661144,12976381,12189885,12255422,12386398,3670560,1637,66599,624,262386,207,7012491,7340152,7798917,8454269,7798932,8847453,5243355,1382,905,565,131227,124,1441888,5701716,5308507,5505102,5832804,5898280,2949480,1327,871,497,139,131169,67,3211320,3866679,3801149,4194381,4325398,2883905,1174,769,440,65662,91,786499,3407931,3670077,4063284,3604551,4194324,2162972,241372916,268505099,270209135,213913288,246681081,189795239,178064522,136513608,77923966,28902048,9371663,24773418,153881722,131533294,112461712,61342500,67371937,56558294,50594427,23396711,13435102,14483647,10813627,0,125,393417,279,6684936,32243970,21692678,16449730,12779681,10092690,10158224,9633956,0,1,0,65548,215,10092700,9044136,9044123,9699468,9699490,9240729,8781949,0,0,1,0,33,1835143,8978561,8781958,8126587,7798909,8650895,8192134,0,0,0,0,2,655475,5767260,6553696,6029413,6488167,6226017,6488172,131075,341578410,353571654,336728458,333386177,270536604,256577235,228658211,150669146,86639954,14483711,5767248,786518,152963322,159320512,161417764,159124025,145295866,146540893,110298938,38470254,17039614,12058806,5505063,524515,51119058,63505323,64947103,70124383,56820324,56427211,26673674,10813600,9699493,11731138,5242927,65643,398,655664,192,12976394,12124332,10617029,11206829,11206826,9830573,11796708,4194359,262233,297,524610,294,10027214,14483659,13762771,14745797,15663309,13828289,14876923,5111870,458834,209,458948,220,10748183,16056547,15335657,16384244,16777459,14811385,18612509,6225998,524369,274470001,351606168,343740952,342889041,342627582,329257753,290722100,222104849,65667855,45417113,48,35717166,134350238,130615011,124258248,102959185,91424448,89654821,76809480,23527858,11272368,11665600,5701716,589828,8454355,18547162,32506613,40436615,32113414,22741715,19202419,11206847,10813610,10289321,4456520,262150,7208960,11534340,12648448,16252990,14090522,9371828,11206832,10748059,10289288,10813581,3801142,196611,0,0,0,10944546,11206871,11665592,11927731,11141296,11403450,13172903,4390978,262147,0,0,196608,15138887,13500646,13500633,13631688,14418115,13893853,13762758,5046348,196611,323163018,311694019,295637210,279055875,286985911,255397663,186780254,115476305,39846391,38470243,7340032,438,297275578,297472436,303305327,274665833,220204694,142215375,111544393,52560818,31457665,35455572,6684708,196866,141101345,127404409,119015780,113903824,70255464,58917879,42468152,33620475,28770689,33489475,5308463,65652,3277468,13042255,16450111,22741654,32834010,31261188,32702913,34079218,26870145,37290540,4915271,65586,12321215,25166385,34538130,38339152,35979805,33948217,40436314,39125457,35258947,38601276,6357069,43,12845424,21889553,35717879,51315356,40895127,48956055,45548256,44106460,49414825,48628435,7077985,65592,474093342,410260978,343218021,353309334,404820693,143921544,87952762,190253111,47448420,26804731,0,77791955,345445200,344069196,337974415,301339740,292164746,252383609,198576044,66782626,32899561,29426170,2555978,22937768,291377336,294850756,293867703,229707973,205196985,120982009,52691589,33686032,25297290,33882624,131172,23330816,159647739,178325820,201263887,188025459,56951921,47776690,31982008,30605722,26870141,33882616,1376323,14942209,65733197,48693774,45875811,36766248,32833994,34210337,35193325,30605821,35062301,37225012,2490451,12779523,46924318,44892704,39977502,35324369,38863378,38142584,42467983,41157275,35783264,50266873,2293866,13500416,595993936,560538272,517741968,394335649,382014154,298783024,229837912,132187645,9634306,68223931,0,184618060,409475271,419961172,431167861,395057198,317396055,340529938,217452497,117376998,44368430,60293950,3276800,35455988,306122197,292491341,296096267,271454384,277220735,265751745,105776429,48169674,41157271,55640899,6422635,262144,337514657,323424287,297406307,281611888,225119538,203163794,97911536,38666924,45744826,52757334,5898315,65,78972315,72811884,86115469,105317581,51577706,53674854,54657944,54789016,57541432,64750523,7536746,0,16515895,32310197,41485397,58131283,63243162,70124493,70190166,68551680,71304132,82576574,8192129,0,207033595,261428493,368449029,400819808,299963202,330501532,211029263,2752512,143328923,87295679,9896056,407,437524506,453515614,455809684,455481890,362484633,247794938,222563347,105645623,134743900,137299999,7733342,28705476,338038837,335286536,322179526,272503082,196873094,165808271,116721698,135137274,99747232,127076376,2293781,23265653,140378910,132646024,139266077,137103604,134612833,113641441,101123687,110888610,110102236,137234546,7274560,135,163317858,156960940,152635732,140708151,139659093,127141786,129239202,141494278,131729396,147392649,7733338,127,162335331,154929518,142870594,153749688,149817692,143919266,150276356,153094351,146999474,164039306,7995468,124,408753999,393156348,361830168,318181986,238096198,240522310,237310134,17891837,46727168,70517877,44,76087562,417863823,417536164,419174680,323294015,194644702,268767653,84740111,45875878,47186761,65405945,11075756,0,302387503,311955492,313855687,285018329,218237305,141493621,58655572,50725761,59572959,70321157,5439573,0,160958920,164759772,163514334,108202486,133891822,60753184,50791182,57475986,47055592,68158536,4325441,0,189861087,188353433,174459110,134612433,68093184,72942451,63570948,62915668,60687324,84477230,4587582,0,31523840,52364410,68027432,67503156,81331312,79496353,88999212,83494264,81855637,101254752,3670076,0];
const Life24Low = [597041235,594354245,589635601,579346434,572530670,447880563,420093250,338368546,249630843,278335811,199559602,387324125,458433439,455811969,451421112,443163453,438510264,399843427,404823632,228332659,221319124,195562699,184028253,255397628,551755824,549724194,548217020,541991172,539500967,438116710,508175132,460529182,296687072,284235159,246025404,269291383,507584488,505683945,502734835,496967616,495460765,477504165,471081205,349510188,267587956,218108090,229379844,199888438,551035836,549266351,546579302,540156646,538845844,460922758,418782418,312547317,242487589,199756809,202378431,158534834,541663531,539959596,537665856,527442131,522330379,439885955,401415612,288102308,225251767,220400971,218828666,214764191,537796260,535699125,530849458,520494642,513547743,412949813,421928172,326506500,214373134,213323791,151783968,134613024,485105222,483270259,480583261,473243165,471539108,368843888,406723719,305469451,244453385,224858036,164825511,135530739,618864768,617160812,613818443,608575587,604250260,483204943,437394529,383195741,237966086,181276616,139790659,88802077,562242004,560734655,557261178,550510939,547299675,493625407,500048196,407378505,300750442,296555861,203034159,32112758,574629581,573187761,569255540,567944697,559752632,513352410,501490055,380836430,292230316,220926232,211815672,0];


const Tau      = 2 * Math.PI;
const Gain     = 0.245945;
const Clip     = 0.89;
const FitFade  = 0.6;
const EnvAttack = 0.00299998;
const EnvHold   = 0.800145;
const EnvDecay  = 100.022;
const EnvSus    = 0.707945784384138;
const Life24KnotCount = 12;
const Life24HFBandCount = 6;
const Life24WarpTau = 0.0015;
const Life24WarpMax = 6.0;
const Life24WarpScale = 11.0 / Math.log2(1.0 + 6.0 / 0.0015);
const Life24HFMargin = 0.08;
const Life24HFMidGain = [0.96, 0.82, 0.88, 0.95, 1.0, 1.0];
const Life24HFSideGain = [0.8, 0.92, 0.86, 0.62, 1.0, 1.0];
const Life24HFMidAttack = [1.020621, 1.104315, 1.066004, 1.025978, 1.0, 1.0];
const Life24HFSideAttack = [1.118034, 1.042572, 1.078328, 1.270001, 1.0, 1.0];
const Life24HFLo = [6000, 8000, 10000, 12000, 14000, 17000];
const Life24HFHi = [8000, 10000, 12000, 14000, 17000, 21000];
const Life24LowGain = [1.62, 1.14];
const VelFcCount = 7;
const VelFc = [749.904, 999.846, 1999.69, 4499.54, 5999.23, 8999.08, 11998.5];


function hash01(j, salt) {
    const x = (j + 1) * 0.6180339887 + salt * 0.7548776662;
    return x - Math.floor(x);
}

function lowHashLife24(j, zi, side, phase) {
    return hash01(j, (side ? 71 : 61) * zi + (phase ? 19 : 5));
}

function smooth01(e0, e1, x) {
    const t = clamp((x - e0) / (e1 - e0), 0, 1);
    return t * t * (3 - 2 * t);
}

function halfToFloat(h) {
    const s = h & 0x8000 ? -1 : 1, e = (h >> 10) & 0x1f, m = h & 0x3ff;
    if (e === 0) return s * m * Math.pow(2, -24);
    if (e === 31) return m ? NaN : s * Infinity;
    return s * (1 + m / 1024) * Math.pow(2, e - 15);
}

function zoneOf(key) {
    return clamp(Math.trunc((key - 24) / 6) - Life24ZoneBase, 0, Life24ZoneCount - 1);
}

function rateOf(key, zi) {
    return Math.pow(2, (key - Life24Zone[zi * 4]) / 12);
}

function undamped(key) {
    return Math.trunc((key - 24) / 6) >= RelHiZone;
}


const Life24Coeff = new Float64Array(Life24PartialCount * Life24KnotCount * 4);
for (let pi = 0; pi < Life24PartialCount; pi++) {
    for (let k = 0; k < Life24KnotCount; k++) {
        const w = Life24Env[pi * Life24KnotCount + k];
        for (let c = 0; c < 4; c++) {
            const v = (((w >>> (8 * c)) & 255) - 127) / 127;
            Life24Coeff[(pi * Life24KnotCount + k) * 4 + c] = v * v * v * Life24EnvScale[pi];
        }
    }
}

const Life24HFGain = new Float64Array(Life24HF.length * 2);
for (let i = 0; i < Life24HF.length; i++) {
    Life24HFGain[i * 2]     = halfToFloat(Life24HF[i] & 0xffff);
    Life24HFGain[i * 2 + 1] = halfToFloat(Life24HF[i] >>> 16);
}

const Life24LowG = new Float64Array(Life24Low.length * 2);
for (let i = 0; i < Life24Low.length; i++) {
    Life24LowG[i * 2]     = halfToFloat(Life24Low[i] & 0xffff);
    Life24LowG[i * 2 + 1] = halfToFloat(Life24Low[i] >>> 16);
}


const pedal = fürEliseData.sustainPedal;
function noteOff(n) {
    const keyUp = n.time + n.duration;
    if (!pedal) return n.sustain ? Math.max(keyUp, n.time + n.sustainMaxDuration) : keyUp;
    for (let i = 0; i < pedal.length; i += 2) {
        const up = i + 1 < pedal.length ? pedal[i + 1] : Infinity;
        if (pedal[i] <= keyUp && keyUp < up) return Math.min(up, fürEliseData.duration);
    }
    return keyUp;
}

const score = [];
let songEnd = 0;
{
    const notes = fürEliseData.notes;
    const off = notes.map(noteOff);
    const nextStrike = {};
    for (let i = notes.length - 1; i >= 0; i--) {
        const key = notes[i].midi;
        if (nextStrike[key] !== undefined) off[i] = Math.min(off[i], nextStrike[key]);
        nextStrike[key] = notes[i].time;
    }
    notes.forEach((n, i) => {
        const zi = zoneOf(n.midi);
        const dur = Math.max(off[i] - n.time, 0.02);
        const tail = undamped(n.midi) ? 7.7 : 1.7;
        const life = Math.min(dur + tail, Life24WarpMax / rateOf(n.midi, zi));
        score.push({ t: n.time, key: n.midi, vel: n.velocity, dur, life });
        songEnd = Math.max(songEnd, n.time + life);
    });
}
const loopEnd = Math.max(fürEliseData.duration, songEnd);


const parts = [];
{
    const ends = [];
    for (let i = 0; i < VOICE_LOOPS; i++) { parts.push([]); ends.push([]); }
    for (const n of score) {
        let best = 0;
        for (let i = 0; i < VOICE_LOOPS; i++) {
            ends[i] = ends[i].filter(e => e > n.t);
            if (ends[i].length < ends[best].length) best = i;
        }
        parts[best].push(n);
        ends[best].push(n.t + n.life);
    }
}

const piano = synth.def(class {
    constructor(options) {
        const key = options.note, vel = options.vel;
        const zi = zoneOf(key), rate = rateOf(key, zi);
        const sr = ditty.sampleRate;

        this.n = 0;
        this.dt = 1 / sr;
        this.zi = zi;
        this.rate = rate;
        this.dur = options.dur;
        this.rel = undamped(key) ? 5 : 1;
        this.gain = Math.pow(vel, 1.1) * Gain;
        const p = clamp((vel * 127 - 2) / 16 - 1.375, 0, VelFcCount - 1);
        const v0 = Math.floor(p), v1 = Math.min(v0 + 1, VelFcCount - 1);
        const fc = VelFc[v0] * Math.pow(VelFc[v1] / VelFc[v0], p - v0);

        const off = Life24Zone[zi * 4 + 1], cnt = Life24Zone[zi * 4 + 2];
        this.pc = new Float64Array(cnt * Life24KnotCount * 4);
        this.pRe = new Float64Array(cnt);
        this.pIm = new Float64Array(cnt);
        this.pCr = new Float64Array(cnt);
        this.pCi = new Float64Array(cnt);
        let np = 0;
        for (let j = 0; j < cnt; j++) {
            const pi = off + j, f = Life24Freq[pi] * rate;
            if (f > 18000) continue;
            const x = f / fc, nrm = 1 / (1 + x * x);
            for (let k = 0; k < Life24KnotCount; k++) {
                const s = (pi * Life24KnotCount + k) * 4, d = (np * Life24KnotCount + k) * 4;
                const lr = Life24Coeff[s], rr = Life24Coeff[s + 1];
                const li = Life24Coeff[s + 2], ri = Life24Coeff[s + 3];
                this.pc[d]     = (lr + x * li) * nrm;
                this.pc[d + 1] = (li - x * lr) * nrm;
                this.pc[d + 2] = (rr + x * ri) * nrm;
                this.pc[d + 3] = (ri - x * rr) * nrm;
            }
            this.pRe[np] = 1;
            this.pIm[np] = 0;
            this.pCr[np] = Math.cos(Tau * f / sr);
            this.pCi[np] = Math.sin(Tau * f / sr);
            np++;
        }
        this.np = np;

        const max = 2 * Life24HFBandCount * 8 + 16;
        this.sRe = new Float64Array(max);
        this.sIm = new Float64Array(max);
        this.sCr = new Float64Array(max);
        this.sCi = new Float64Array(max);
        this.sW = new Float64Array(max);
        this.gStart = new Int32Array(15);
        this.gSum = new Float64Array(14);
        let ns = 0;
        for (let g = 0; g < 14; g++) {
            this.gStart[g] = ns;
            for (let j = 0; j < 8; j++) {
                let f, ph, w = 1;
                if (g < 12) {
                    const bi = g % 6, side = g >= 6;
                    const innerLo = lerp(Life24HFLo[bi], Life24HFHi[bi], Life24HFMargin);
                    const innerHi = lerp(Life24HFHi[bi], Life24HFLo[bi], Life24HFMargin);
                    f = lerp(innerLo, innerHi, hash01(j, side ? 29 * zi + bi + 7 : 17 * zi + bi)) * rate;
                    if (f >= 21000) continue;
                    w = 1 / Math.sqrt(1 + (f / fc) * (f / fc));
                    ph = Tau * hash01(j, side ? 53 * zi + bi + 3 : 41 * zi + bi);
                } else {
                    const side = g === 13;
                    f = lerp(20, 80, lowHashLife24(j, zi, side, false)) * rate;
                    ph = Tau * lowHashLife24(j, zi, side, true);
                }
                this.sRe[ns] = Math.cos(ph);
                this.sIm[ns] = Math.sin(ph);
                this.sCr[ns] = Math.cos(Tau * f / sr);
                this.sCi[ns] = Math.sin(Tau * f / sr);
                this.sW[ns] = w;
                ns++;
            }
        }
        this.gStart[14] = ns;

        this.out = [0, 0];
    }

    process(note, env, tick, options) {
        const out = this.out;
        const age = this.n++ * this.dt;

        let e;
        if (age < EnvAttack) {
            e = age / EnvAttack;
        } else {
            const d = age - EnvAttack - EnvHold;
            e = d > 0 ? EnvSus + (1 - EnvSus) * Math.exp(-6.9 * d / EnvDecay) : 1;
            if (age > this.dur) e *= Math.exp(-6.9 * (age - this.dur) / this.rel);
            if (e < 1e-5) e = 0;
        }

        const sa = age * this.rate;
        if ((e <= 0 && age >= EnvAttack) || sa > Life24WarpMax) {
            out[0] = out[1] = 0;
            return out;
        }
        if (sa > Life24WarpMax - FitFade) e *= 0.5 + 0.5 * Math.cos(Math.PI * (sa - (Life24WarpMax - FitFade)) / FitFade);

        const u = clamp(Math.log2(1 + sa / Life24WarpTau) * Life24WarpScale, 0, 11);
        const k = Math.min(Math.floor(u), 10);
        const a = clamp(u - k, 0, 1), b = 1 - a;

        const pc = this.pc, pRe = this.pRe, pIm = this.pIm, pCr = this.pCr, pCi = this.pCi;
        let sumL = 0, sumR = 0;
        for (let j = 0, np = this.np; j < np; j++) {
            const o = (j * Life24KnotCount + k) * 4;
            const cs = pRe[j], sn = pIm[j];
            sumL += (pc[o] * b + pc[o + 4] * a) * cs - (pc[o + 1] * b + pc[o + 5] * a) * sn;
            sumR += (pc[o + 2] * b + pc[o + 6] * a) * cs - (pc[o + 3] * b + pc[o + 7] * a) * sn;
            pRe[j] = cs * pCr[j] - sn * pCi[j];
            pIm[j] = cs * pCi[j] + sn * pCr[j];
        }

        const sRe = this.sRe, sIm = this.sIm, sCr = this.sCr, sCi = this.sCi, sW = this.sW;
        const gStart = this.gStart, gSum = this.gSum;
        for (let g = 0; g < 14; g++) {
            let s = 0;
            for (let c = gStart[g], end = gStart[g + 1]; c < end; c++) {
                const x = sRe[c], y = sIm[c];
                s += sW[c] * y;
                sRe[c] = x * sCr[c] - y * sCi[c];
                sIm[c] = x * sCi[c] + y * sCr[c];
            }
            gSum[g] = s;
        }

        const cal = smooth01(0.080, 0.300, sa);
        let mid = 0, side = 0;
        for (let bi = 0; bi < Life24HFBandCount; bi++) {
            const o = ((this.zi * Life24HFBandCount + bi) * Life24KnotCount + k) * 2;
            const mAt = Life24HFMidAttack[bi], sAt = Life24HFSideAttack[bi];
            mid  += (Life24HFGain[o] * b + Life24HFGain[o + 2] * a) * Life24HFMidGain[bi] * (mAt + (1 - mAt) * cal) * gSum[bi];
            side += (Life24HFGain[o + 1] * b + Life24HFGain[o + 3] * a) * Life24HFSideGain[bi] * (sAt + (1 - sAt) * cal) * gSum[6 + bi];
        }
        const lo = (this.zi * Life24KnotCount + k) * 2;
        mid  += (Life24LowG[lo] * b + Life24LowG[lo + 2] * a) * Life24LowGain[0] * gSum[12];
        side += (Life24LowG[lo + 1] * b + Life24LowG[lo + 3] * a) * Life24LowGain[1] * gSum[13];

        const g = this.gain * e;
        out[0] = (sumL + (mid + side) * 0.7071067811865476) * g;
        out[1] = (sumR + (mid - side) * 0.7071067811865476) * g;
        return out;
    }
}, { env: one, vel: 0.5, dur: 1 });

const clipper = filter.def(class {
    constructor(options) {
        this.out = [0, 0];
    }
    process(input, options) {
        if (input) {
            this.out[0] = clamp(input[0], -options.limit, options.limit);
            this.out[1] = clamp(input[1], -options.limit, options.limit);
            return this.out;
        }
    }
}, { limit: Clip });

const master = clipper.createShared({ limit: Clip });

for (let li = 0; li < VOICE_LOOPS; li++) {
    const part = parts[li];
    loop(() => {
        let t = 0;
        for (const n of part) {
            if (n.t > t) {
                sleep(second_to_tick(n.t - t));
                t = n.t;
            }
            piano.play(n.key, { vel: n.vel, dur: n.dur, duration: second_to_tick(n.life) });
        }
        sleep(second_to_tick(loopEnd - t));
    }, { name: `Piano ${li + 1}` }).connect(master);
}


function fürElise() {
    const data = {notes:[76,.2,1.02,.496,75,.15,1.22,.496,76,.15,1.39,.512,75,.15,1.55,.512,76,.16,1.71,.543,71,.15,1.87,.528,74,.16,2.03,.52,72,.19,2.19,.535,69,.17,2.36,.52,45,.21,2.36,.52,52,.29,2.54,.496,57,.1,2.71,.528,60,.15,2.88,.52,64,.14,3.05,.496,69,.16,3.2,.551,40,.13,3.36,.551,71,.14,3.36,.559,52,.17,3.54,.528,56,.07,3.71,.488,64,.17,3.88,.504,68,.15,4.03,.543,71,.18,4.21,.535,45,.21,4.36,.52,72,.27,4.38,.583,52,.2,4.57,.457,57,.16,4.74,.52,64,.13,4.94,.496,76,.17,5.1,.575,75,.15,5.28,.575,76,.18,5.44,.551,75,.17,5.6,.575,76,.17,5.77,.551,71,.15,5.94,.504,74,.16,6.09,.52,72,.2,6.25,.504,45,.18,6.42,.52,69,.15,6.42,.496,52,.28,6.6,.504,57,.1,6.78,.496,60,.18,6.93,.504,64,.15,7.1,.512,69,.19,7.27,.528,40,.1,7.42,.535,71,.16,7.43,.583,52,.19,7.6,.496,56,.08,7.8,.488,64,.19,7.98,.488,72,.18,8.17,.543,71,.2,8.36,.496,69,.49,8.56,.48,45,.23,8.58,.496,52,.26,8.82,.425,57,.43,9.07,.472,76,.18,9.61,.488,75,.18,9.79,.52,76,.17,9.97,.528,75,.18,10.13,.575,76,.17,10.3,.559,71,.17,10.45,.512,74,.17,10.61,.551,72,.19,10.77,.559,45,.2,10.94,.512,69,.17,10.94,.528,52,.32,11.12,.504,57,.13,11.31,.504,60,.17,11.47,.504,64,.16,11.64,.52,69,.19,11.8,.543,40,.12,11.95,.535,71,.16,11.97,.606,52,.17,12.15,.528,56,.09,12.32,.48,64,.19,12.5,.52,68,.17,12.66,.535,71,.21,12.83,.535,72,.27,13,.591,45,.22,13.01,.48,52,.23,13.22,.488,57,.23,13.4,.52,64,.14,13.59,.512,76,.17,13.77,.591,75,.18,13.93,.575,76,.18,14.11,.567,75,.16,14.27,.583,76,.2,14.42,.535,71,.17,14.59,.528,74,.16,14.77,.551,72,.17,14.92,.543,69,.18,15.08,.528,45,.18,15.1,.504,52,.3,15.28,.512,57,.13,15.46,.512,60,.17,15.63,.512,64,.15,15.8,.504,69,.18,15.97,.535,40,.13,16.14,.543,71,.17,16.14,.583,52,.19,16.32,.52,56,.09,16.51,.48,64,.21,16.68,.504,72,.17,16.86,.575,71,.18,17.04,.488,69,.3,17.22,.504,45,.23,17.24,.488,52,.24,17.44,.496,57,.17,17.65,.512,71,.21,17.81,.551,72,.19,17.98,.598,74,.2,18.16,.598,76,.24,18.34,.622,48,.21,18.36,.606,55,.31,18.55,.528,60,.11,18.72,.528,67,.2,18.91,.551,77,.19,19.07,.606,76,.23,19.25,.528,43,.14,19.41,.543,74,.19,19.42,.606,55,.2,19.6,.52,59,.1,19.77,.488,65,.19,19.96,.528,76,.21,20.15,.551,74,.24,20.32,.543,45,.2,20.49,.528,72,.17,20.5,.559,52,.35,20.68,.52,57,.14,20.87,.512,64,.2,21.05,.48,74,.21,21.23,.559,72,.19,21.41,.535,71,.18,21.58,.535,40,.13,21.59,.559,52,.08,21.79,.512,64,.05,21.99,.52,64,.18,22.17,.512,76,.17,22.36,.591,64,.2,22.52,.496,76,.11,22.74,.465,76,.26,22.95,.512,88,.15,23.17,.543,75,.22,23.38,.488,76,.16,23.58,.512,75,.18,23.77,.504,76,.18,23.94,.512,75,.18,24.1,.543,76,.18,24.29,.543,75,.16,24.45,.528,76,.17,24.61,.543,75,.15,24.77,.567,76,.19,24.93,.528,75,.18,25.09,.528,76,.18,25.27,.543,71,.18,25.44,.504,74,.17,25.61,.528,72,.2,25.78,.528,45,.2,25.93,.504,69,.2,25.94,.528,52,.3,26.13,.48,57,.13,26.31,.52,60,.16,26.47,.52,64,.16,26.64,.504,69,.17,26.8,.551,40,.11,26.96,.551,71,.16,26.96,.598,52,.2,27.14,.528,56,.08,27.32,.488,64,.18,27.48,.528,68,.18,27.64,.543,71,.21,27.81,.543,45,.21,27.98,.496,72,.28,27.99,.591,52,.21,28.19,.457,57,.19,28.38,.496,64,.15,28.56,.504,76,.17,28.73,.559,75,.18,28.91,.559,76,.19,29.08,.551,75,.18,29.24,.575,76,.2,29.41,.551,71,.17,29.58,.528,74,.19,29.74,.551,72,.19,29.91,.543,45,.18,30.08,.543,69,.18,30.08,.535,52,.3,30.25,.52,57,.11,30.43,.512,60,.19,30.59,.512,64,.16,30.77,.48,69,.2,30.94,.512,40,.14,31.09,.559,71,.17,31.1,.575,52,.21,31.29,.52,56,.09,31.48,.48,64,.2,31.65,.512,72,.19,31.82,.575,71,.19,32,.512,69,.31,32.19,.48,45,.26,32.2,.488,52,.22,32.44,.417,57,.19,32.63,.48,71,.22,32.8,.543,72,.2,32.97,.583,74,.19,33.16,.559,48,.24,33.33,.559,76,.23,33.33,.63,55,.3,33.53,.512,60,.11,33.71,.52,67,.22,33.87,.575,77,.21,34.05,.614,76,.23,34.22,.559,43,.14,34.38,.535,74,.19,34.39,.622,55,.23,34.56,.512,59,.09,34.76,.52,65,.18,34.93,.528,76,.2,35.1,.559,74,.22,35.26,.559,45,.2,35.43,.543,72,.19,35.43,.575,52,.36,35.63,.512,57,.13,35.83,.528,64,.21,36.01,.496,74,.21,36.18,.567,72,.19,36.36,.528,40,.13,36.52,.567,71,.18,36.53,.559,52,.07,36.71,.528,64,.07,36.91,.535,64,.18,37.08,.535,76,.16,37.27,.559,64,.19,37.43,.504,76,.1,37.64,.504,76,.27,37.83,.504,88,.15,38.05,.559,75,.23,38.24,.52,76,.15,38.45,.551,75,.18,38.65,.512,76,.17,38.82,.551,75,.18,38.98,.567,76,.18,39.16,.551,75,.15,39.32,.543,76,.19,39.49,.575,75,.16,39.66,.575,76,.21,39.81,.504,75,.18,39.99,.567,76,.21,40.16,.551,71,.17,40.34,.535,74,.17,40.51,.551,72,.19,40.67,.543,45,.21,40.84,.535,69,.2,40.84,.528,52,.3,41.03,.488,57,.12,41.2,.488,60,.18,41.35,.488,64,.17,41.53,.535,69,.19,41.69,.543,40,.16,41.85,.551,71,.17,41.86,.591,52,.22,42.05,.496,56,.11,42.24,.425,64,.19,42.4,.496,68,.17,42.57,.528,71,.22,42.74,.528,45,.23,42.92,.528,72,.23,42.93,.583,52,.23,43.12,.449,57,.22,43.29,.496,64,.14,43.47,.504,76,.19,43.64,.575,75,.16,43.82,.559,76,.18,43.99,.535,75,.16,44.16,.551,76,.17,44.33,.559,71,.16,44.5,.528,74,.19,44.67,.551,72,.2,44.84,.535,45,.21,45.01,.528,69,.17,45.01,.528,52,.28,45.19,.465,57,.11,45.36,.496,60,.17,45.52,.496,64,.17,45.69,.504,69,.2,45.86,.535,40,.12,46.02,.543,71,.18,46.04,.567,52,.2,46.21,.496,56,.09,46.39,.465,64,.19,46.56,.457,72,.2,46.73,.551,71,.19,46.92,.488,45,.26,47.11,.504,69,.44,47.11,.496,52,.24,47.33,.449,57,.15,47.57,.496,64,.1,48.03,.535,58,.09,48.03,.52,60,.09,48.03,.512,72,.09,48.04,.543,65,.08,48.28,.559,57,.08,48.28,.543,60,.08,48.28,.535,72,.08,48.28,.591,60,.1,48.49,.535,58,.1,48.5,.567,72,.13,48.5,.551,55,.1,48.51,.512,64,.07,48.51,.575,67,.08,48.52,.528,65,.45,48.69,.598,69,.33,48.78,.591,53,.25,48.81,.622,72,.38,48.82,.638,57,.18,49.03,.575,60,.2,49.22,.559,57,.17,49.41,.543,60,.26,49.6,.535,77,.18,49.61,.622,57,.11,49.8,.551,76,.04,49.88,.559,53,.28,49.98,.551,76,.35,49.99,.654,58,.2,50.19,.543,74,.4,50.38,.583,62,.19,50.4,.559,58,.2,50.58,.575,82,.17,50.78,.614,62,.23,50.8,.559,58,.11,50.99,.559,81,.04,51.08,.559,53,.23,51.17,.551,81,.2,51.18,.693,64,.22,51.37,.535,79,.13,51.39,.575,58,.17,51.56,.551,55,.21,51.57,.512,53,.21,51.57,.472,77,.22,51.57,.567,64,.19,51.77,.528,76,.22,51.79,.543,58,.27,51.97,.512,74,.18,51.97,.583,53,.21,51.97,.409,55,.21,51.97,.488,64,.14,52.18,.52,72,.23,52.18,.575,53,.25,52.36,.535,70,.4,52.38,.606,57,.19,52.58,.528,60,.19,52.79,.535,69,.18,52.79,.543,57,.15,52.98,.488,70,.07,53.05,.559,69,.09,53.14,.504,60,.21,53.16,.504,67,.1,53.25,.575,57,.18,53.34,.504,69,.11,53.35,.488,70,.08,53.45,.583,53,.3,53.55,.543,72,.74,53.58,.614,57,.18,53.77,.528,60,.21,53.94,.551,57,.2,54.14,.559,60,.23,54.33,.551,74,.24,54.33,.622,57,.14,54.53,.528,75,.14,54.53,.654,52,.29,54.73,.512,76,.45,54.73,.646,57,.19,54.93,.543,60,.21,55.13,.559,57,.14,55.31,.551,76,.18,55.32,.606,77,.18,55.51,.669,50,.16,55.51,.52,62,.23,55.51,.614,53,.05,55.71,.496,69,.19,55.71,.559,55,.26,55.91,.622,72,.67,55.93,.677,64,.2,56.13,.543,55,.29,56.33,.591,65,.16,56.54,.606,55,.27,56.73,.504,74,.21,56.73,.638,65,.07,56.94,.528,71,.08,57.01,.551,60,.07,57.14,.661,64,.06,57.14,.614,72,.08,57.15,.622,79,.07,57.27,.614,67,.08,57.37,.583,79,.07,57.48,.614,69,.07,57.59,.535,79,.06,57.7,.551,67,.07,57.78,.567,65,.07,57.79,.535,71,.08,57.81,.551,79,.08,57.93,.543,67,.08,58.01,.559,64,.08,58.02,.567,72,.07,58.03,.606,79,.1,58.14,.535,67,.08,58.23,.614,62,.08,58.24,.512,74,.08,58.24,.614,65,.06,58.25,.48,79,.08,58.36,.496,67,.09,58.46,.717,64,.1,58.47,.598,60,.15,58.47,.614,76,.09,58.48,.622,79,.1,58.6,.551,84,.13,58.7,.654,83,.12,58.82,.535,57,.35,58.92,.646,53,.33,58.92,.591,81,.11,58.93,.567,79,.1,59.05,.559,77,.07,59.15,.551,76,.11,59.27,.551,59,.17,59.38,.559,74,.13,59.38,.559,55,.17,59.38,.543,79,.14,59.51,.575,77,.16,59.6,.543,74,.1,59.74,.559,60,.09,59.86,.638,64,.09,59.86,.543,72,.1,59.87,.685,79,.08,60,.63,67,.07,60.12,.535,79,.08,60.23,.646,69,.08,60.34,.504,79,.09,60.47,.622,65,.08,60.56,.575,67,.07,60.57,.551,71,.09,60.57,.543,79,.08,60.7,.512,64,.08,60.8,.575,67,.08,60.8,.583,72,.09,60.81,.63,79,.12,60.93,.575,65,.07,61.03,.543,67,.07,61.03,.583,62,.07,61.04,.52,74,.09,61.05,.638,79,.08,61.17,.504,64,.12,61.27,.614,60,.16,61.27,.685,76,.11,61.28,.622,79,.12,61.41,.575,84,.13,61.51,.646,83,.13,61.64,.528,53,.38,61.73,.606,57,.39,61.73,.638,81,.12,61.75,.598,79,.1,61.87,.559,77,.08,61.97,.551,76,.12,62.08,.551,55,.51,62.21,.543,59,.47,62.21,.559,74,.13,62.21,.575,79,.14,62.33,.583,77,.16,62.44,.535,74,.13,62.59,.559,59,2.41,62.72,.409,56,2.35,62.73,.543,76,.1,62.73,.535,77,.16,62.86,.512,76,.12,63.01,.496,75,.15,63.14,.543,76,.13,63.3,.496,71,.18,63.45,.48,76,.15,63.64,.37,75,.17,63.83,.496,76,.21,64.03,.441,71,.23,64.24,.433,76,.24,64.48,.362,75,.3,64.74,.402,76,.72,65.09,.362,71,.26,66.38,.496,76,.32,66.64,.433,75,.41,66.97,.378,76,.74,67.41,.291,71,.28,68.76,.488,76,.21,69.03,.457,75,.17,69.24,.512,76,.16,69.43,.441,75,.14,69.61,.504,76,.16,69.76,.551,75,.15,69.91,.559,76,.16,70.07,.551,75,.16,70.23,.559,76,.16,70.39,.543,75,.18,70.55,.567,76,.2,70.72,.559,71,.15,70.91,.504,74,.16,71.07,.551,72,.18,71.23,.543,45,.18,71.38,.504,69,.17,71.39,.543,52,.24,71.56,.472,57,.09,71.72,.488,60,.16,71.88,.504,64,.15,72.03,.528,69,.19,72.19,.535,40,.11,72.33,.559,71,.16,72.34,.559,52,.19,72.51,.488,56,.07,72.69,.441,64,.19,72.86,.512,68,.17,73.02,.52,71,.18,73.2,.496,45,.22,73.34,.449,72,.26,73.38,.559,52,.2,73.57,.417,57,.16,73.75,.472,64,.14,73.92,.528,76,.17,74.09,.575,75,.15,74.26,.591,76,.16,74.42,.575,75,.18,74.57,.598,76,.16,74.73,.63,71,.14,74.9,.543,74,.17,75.05,.559,72,.18,75.2,.583,45,.19,75.34,.535,69,.14,75.36,.559,52,.24,75.54,.488,57,.1,75.7,.504,60,.16,75.84,.504,64,.12,76.01,.535,69,.18,76.17,.591,40,.11,76.33,.567,71,.16,76.33,.622,52,.19,76.5,.504,56,.09,76.67,.465,64,.18,76.83,.535,72,.16,77,.606,71,.18,77.17,.496,69,.29,77.35,.496,45,.24,77.37,.496,52,.2,77.56,.465,57,.16,77.73,.488,71,.19,77.9,.543,72,.18,78.06,.614,74,.18,78.23,.583,48,.22,78.38,.535,76,.21,78.4,.614,55,.35,78.58,.496,60,.14,78.75,.504,67,.18,78.91,.567,77,.19,79.08,.622,76,.21,79.25,.551,43,.13,79.4,.559,74,.17,79.41,.654,55,.21,79.59,.488,59,.08,79.77,.496,65,.18,79.92,.528,76,.19,80.09,.598,74,.22,80.26,.559,45,.18,80.42,.567,72,.16,80.43,.591,52,.3,80.61,.512,57,.1,80.79,.52,64,.22,80.95,.528,74,.2,81.13,.622,72,.19,81.3,.559,40,.11,81.45,.638,71,.15,81.47,.559,52,.07,81.65,.512,64,.05,81.84,.48,64,.17,82.02,.48,76,.14,82.2,.551,64,.21,82.34,.512,76,.08,82.56,.425,76,.23,82.74,.472,88,.14,82.96,.559,75,.19,83.16,.543,76,.13,83.35,.528,75,.19,83.53,.559,76,.18,83.71,.535,75,.16,83.88,.543,76,.16,84.05,.535,75,.15,84.21,.528,76,.16,84.37,.551,75,.15,84.53,.543,76,.17,84.69,.52,75,.18,84.85,.528,76,.18,85.04,.543,71,.15,85.22,.496,74,.17,85.38,.52,72,.17,85.54,.559,45,.2,85.69,.528,69,.18,85.7,.551,52,.24,85.88,.488,57,.1,86.05,.496,60,.2,86.19,.52,64,.14,86.36,.543,69,.19,86.52,.575,40,.16,86.65,.591,71,.16,86.7,.638,52,.18,86.88,.52,56,.09,87.03,.543,64,.2,87.21,.528,68,.19,87.36,.575,71,.15,87.55,.535,45,.21,87.71,.52,72,.26,87.71,.622,52,.2,87.89,.504,57,.17,88.06,.528,64,.13,88.24,.543,76,.17,88.4,.638,75,.15,88.56,.583,76,.18,88.73,.583,75,.16,88.9,.575,76,.18,89.06,.591,71,.17,89.22,.543,74,.16,89.39,.559,72,.18,89.56,.551,45,.15,89.73,.543,69,.16,89.73,.543,52,.26,89.9,.488,57,.09,90.07,.52,60,.16,90.23,.512,64,.14,90.4,.52,69,.16,90.56,.559,40,.11,90.71,.575,71,.17,90.72,.598,52,.2,90.89,.504,56,.09,91.07,.488,64,.17,91.23,.528,72,.22,91.41,.614,71,.24,91.58,.535,45,.07,91.77,.575,69,.36,91.77,.559,45,.07,91.96,.52,45,.08,92.15,.528,45,.09,92.33,.535,45,.09,92.53,.52,45,.09,92.7,.512,45,.11,92.9,.543,70,.46,92.91,.591,73,.47,92.91,.701,64,.43,92.91,.559,67,.4,92.91,.567,45,.09,93.1,.535,45,.09,93.3,.535,45,.1,93.49,.543,45,.09,93.67,.543,45,.08,93.85,.512,45,.09,94.05,.496,74,.41,94.06,.598,65,.36,94.06,.512,69,.32,94.06,.48,45,.09,94.26,.449,45,.08,94.45,.504,45,.08,94.64,.52,45,.08,94.82,.535,73,.09,94.83,.622,76,.11,94.83,.614,45,.09,95.01,.528,77,.1,95.01,.717,74,.11,95.02,.63,74,.47,95.21,.693,68,.45,95.21,.638,77,.45,95.21,.591,45,.09,95.22,.575,45,.09,95.41,.504,45,.09,95.6,.52,45,.09,95.79,.504,77,.21,95.98,.693,68,.2,95.98,.598,74,.25,95.98,.575,45,.08,95.99,.488,45,.08,96.19,.512,45,.08,96.41,.543,69,.8,96.41,.559,76,.73,96.41,.575,72,.76,96.41,.575,45,.08,96.61,.528,45,.09,96.78,.512,45,.07,96.97,.52,45,.07,97.16,.52,45,.08,97.34,.528,74,.31,97.56,.717,45,.09,97.56,.598,65,.38,97.56,.654,38,.09,97.57,.638,38,.08,97.77,.488,45,.07,97.78,.496,38,.08,97.96,.504,45,.08,97.96,.512,45,.07,98.16,.512,38,.07,98.16,.512,64,.1,98.34,.575,45,.07,98.34,.551,72,.08,98.34,.724,38,.08,98.35,.543,38,.08,98.52,.512,45,.07,98.53,.543,62,.08,98.53,.661,71,.07,98.53,.685,45,.1,98.72,.575,69,.57,98.72,.701,39,.09,98.72,.638,60,.57,98.72,.654,66,.59,98.73,.646,39,.08,98.93,.606,45,.1,98.93,.496,45,.1,99.11,.512,39,.08,99.13,.567,39,.07,99.3,.575,45,.08,99.3,.512,39,.07,99.51,.622,45,.08,99.51,.512,69,.22,99.51,.661,60,.19,99.52,.685,45,.08,99.71,.535,39,.07,99.71,.669,60,.16,99.91,.701,45,.09,99.91,.622,69,.19,99.91,.724,40,.08,99.92,.654,45,.08,100.11,.504,40,.07,100.12,.559,45,.07,100.32,.551,64,.17,100.32,.63,40,.07,100.33,.575,72,.14,100.33,.732,40,.08,100.52,.567,45,.07,100.52,.535,62,.19,100.71,.654,44,.06,100.72,.693,71,.16,100.72,.74,40,.07,100.73,.575,40,.09,100.9,.543,44,.05,100.92,.504,60,.84,101.11,.701,69,.89,101.11,.724,45,.09,101.12,.677,33,.1,101.13,.661,45,.08,101.32,.559,45,.08,101.52,.52,45,.07,101.72,.512,45,.08,101.92,.551,45,.07,102.12,.52,64,.6,102.33,.591,67,.58,102.34,.575,73,.63,102.34,.677,70,.61,102.34,.575,45,.09,102.34,.567,45,.08,102.55,.504,45,.09,102.74,.52,45,.08,102.94,.528,45,.09,103.14,.535,45,.08,103.33,.512,45,.09,103.53,.52,65,.33,103.53,.575,69,.29,103.53,.535,74,.38,103.53,.669,45,.09,103.74,.528,45,.08,103.93,.512,45,.08,104.12,.528,45,.08,104.31,.543,73,.1,104.32,.638,76,.13,104.32,.638,45,.09,104.51,.543,77,.1,104.52,.685,74,.09,104.52,.693,77,.55,104.7,.559,45,.1,104.71,.567,74,.55,104.71,.638,45,.09,104.92,.551,45,.09,105.1,.528,45,.08,105.3,.496,74,.32,105.52,.63,77,.3,105.52,.63,45,.08,105.52,.551,45,.08,105.73,.52,46,.1,106.01,.575,74,.74,106.01,.606,77,.71,106.01,.614,46,.07,106.25,.512,46,.07,106.45,.575,46,.08,106.65,.575,46,.07,106.85,.543,46,.07,107.04,.512,46,.1,107.25,.598,67,.32,107.27,.559,75,.24,107.27,.677,46,.08,107.47,.52,46,.07,107.66,.551,46,.06,107.86,.512,46,.08,108.05,.575,74,.13,108.06,.638,65,.08,108.06,.52,46,.07,108.24,.559,63,.08,108.26,.591,72,.08,108.27,.575,46,.09,108.45,.583,70,.41,108.45,.669,65,.44,108.45,.606,62,.41,108.46,.638,46,.07,108.66,.504,46,.07,108.84,.504,46,.08,109.04,.535,62,.21,109.22,.614,69,.23,109.22,.583,46,.08,109.23,.512,65,.2,109.23,.559,46,.07,109.43,.512,68,.52,109.63,.677,62,.48,109.63,.606,65,.51,109.64,.551,47,.11,109.64,.614,47,.09,109.85,.488,47,.09,110.05,.465,47,.08,110.26,.457,68,.19,110.47,.591,47,.09,110.47,.52,62,.21,110.47,.559,65,.18,110.48,.512,47,.08,110.68,.465,69,.63,110.94,.583,48,.55,110.94,.543,60,.56,110.94,.567,64,.58,110.95,.496,71,.56,112.29,.591,64,.59,112.3,.535,52,.61,112.3,.441,56,.53,112.3,.48,57,.13,113.59,.622,33,.08,113.6,.677,60,.14,113.75,.528,64,.05,113.9,.496,69,.09,114.03,.559,72,.13,114.15,.583,76,.14,114.28,.575,60,.14,114.39,.543,57,.15,114.4,.535,64,.14,114.4,.512,74,.14,114.4,.575,72,.09,114.53,.575,71,.09,114.64,.551,60,.53,114.77,.551,64,.53,114.77,.543,69,.1,114.77,.52,57,.52,114.78,.543,72,.11,114.9,.551,76,.06,115.03,.559,81,.08,115.16,.63,84,.1,115.27,.622,88,.14,115.39,.638,86,.14,115.51,.559,60,.14,115.52,.559,64,.14,115.52,.543,57,.14,115.53,.551,84,.1,115.63,.598,83,.09,115.73,.567,81,.1,115.85,.591,64,.54,115.87,.575,57,.53,115.88,.591,60,.54,115.88,.567,84,.1,115.98,.598,88,.07,116.1,.606,93,.07,116.23,.622,96,.13,116.35,.638,100,.2,116.48,.693,98,.19,116.61,.63,57,.14,116.63,.583,64,.14,116.63,.551,60,.13,116.64,.575,96,.14,116.74,.685,95,.17,116.88,.638,94,.16,117.03,.677,60,.2,117.04,.591,64,.21,117.04,.559,57,.21,117.04,.614,93,.14,117.2,.559,92,.15,117.35,.646,91,.15,117.5,.559,90,.18,117.65,.583,89,.18,117.81,.543,88,.17,117.98,.528,87,.17,118.16,.559,86,.18,118.34,.528,85,.2,118.52,.543,84,.19,118.72,.551,83,.24,118.91,.496,82,.22,119.14,.496,81,.23,119.37,.512,80,.21,119.6,.512,79,.28,119.82,.496,78,.29,120.08,.496,77,.26,120.38,.488,76,.25,120.65,.441,75,.25,120.93,.472,76,.21,121.2,.48,71,.2,121.41,.488,74,.17,121.61,.52,72,.22,121.79,.52,45,.22,121.96,.488,69,.2,121.96,.496,52,.23,122.16,.441,57,.1,122.33,.472,60,.14,122.48,.496,64,.14,122.65,.504,69,.18,122.81,.551,40,.12,122.96,.551,71,.14,122.97,.575,52,.16,123.14,.504,56,.07,123.31,.472,64,.16,123.46,.504,68,.18,123.61,.551,71,.18,123.78,.528,45,.2,123.94,.512,72,.26,123.94,.575,52,.22,124.13,.441,57,.15,124.31,.488,64,.12,124.49,.488,76,.16,124.66,.591,75,.15,124.84,.535,76,.16,125,.543,75,.17,125.15,.575,76,.18,125.32,.559,71,.13,125.49,.504,74,.15,125.64,.528,72,.18,125.8,.551,69,.16,125.96,.543,45,.17,125.98,.512,52,.26,126.16,.48,57,.09,126.32,.496,60,.16,126.47,.496,64,.15,126.64,.512,69,.16,126.8,.543,40,.12,126.95,.551,71,.16,126.96,.575,52,.19,127.14,.504,56,.06,127.31,.472,64,.18,127.45,.52,72,.18,127.62,.591,71,.22,127.8,.496,45,.21,127.96,.496,69,.24,127.98,.52,52,.2,128.17,.457,57,.17,128.34,.48,71,.2,128.51,.543,72,.17,128.67,.591,74,.19,128.83,.583,76,.22,129,.622,48,.2,129.01,.591,55,.3,129.2,.48,60,.11,129.38,.52,67,.18,129.55,.559,77,.18,129.71,.606,76,.23,129.88,.528,43,.13,130.03,.528,74,.16,130.04,.583,55,.21,130.21,.488,59,.08,130.38,.488,65,.19,130.55,.512,76,.21,130.72,.543,74,.2,130.9,.535,45,.17,131.05,.52,72,.15,131.07,.551,52,.28,131.24,.496,57,.11,131.42,.528,64,.2,131.58,.52,74,.2,131.76,.598,72,.17,131.94,.543,40,.11,132.09,.575,71,.17,132.1,.575,52,.06,132.29,.528,64,.07,132.48,.52,64,.16,132.66,.496,76,.13,132.83,.559,64,.17,133.01,.52,76,.1,133.18,.528,76,.26,133.38,.512,88,.15,133.59,.606,75,.2,133.79,.559,76,.14,133.97,.543,75,.17,134.15,.559,76,.17,134.31,.551,75,.16,134.48,.52,76,.16,134.63,.52,75,.16,134.79,.567,76,.14,134.97,.528,75,.16,135.13,.512,76,.17,135.29,.512,75,.17,135.45,.52,76,.16,135.63,.504,71,.16,135.78,.496,74,.17,135.95,.535,72,.2,136.11,.504,45,.2,136.28,.504,69,.17,136.29,.504,52,.29,136.47,.496,57,.1,136.64,.512,60,.18,136.8,.512,64,.19,136.97,.528,69,.18,137.14,.551,71,.15,137.3,.591,40,.11,137.31,.567,52,.21,137.48,.528,56,.08,137.65,.504,64,.21,137.81,.551,68,.18,137.97,.575,71,.2,138.14,.535,45,.19,138.29,.504,72,.29,138.3,.622,52,.22,138.47,.512,57,.16,138.65,.535,64,.14,138.83,.512,76,.17,138.98,.575,75,.15,139.15,.575,76,.17,139.32,.551,75,.17,139.46,.575,76,.18,139.64,.559,71,.17,139.8,.512,74,.18,139.96,.543,72,.2,140.14,.528,45,.2,140.29,.512,69,.16,140.31,.528,52,.33,140.49,.512,57,.1,140.69,.512,60,.16,140.86,.504,64,.19,141.04,.504,69,.19,141.21,.52,40,.13,141.39,.591,71,.2,141.39,.583,52,.24,141.58,.528,56,.19,141.8,.512,62,.7,142.03,.559,72,.43,142.31,.598,71,.55,142.67,.535,60,2.89,143.19,.559,69,2.89,143.19,.551,45,2.89,143.2,.441,33,2.85,143.2,.496],sustainPedal:[1.09,2.21,2.42,3.22,3.42,4.31,4.53,6.32,6.51,7.27,7.48,8.61,8.8,10.89,11.08,11.86,12.06,12.97,13.17,15.05,15.24,16.04,16.22,17.27,17.43,18.36,18.54,19.36,19.53,20.49,20.66,21.46,21.64,25.86,26.03,26.81,26.99,27.95,28.13,30.07,30.22,30.95,31.1,32.23,32.4,33.3,33.46,34.3,34.47,35.43,35.57,36.45,36.59,40.81,40.98,41.77,41.94,42.91,43.08,44.95,45.12,45.93,46.09,47.09,47.31,48.73,48.93,49.93,50.1,51.14,51.32,52.35,52.51,53.55,53.7,54.58,54.79,55.44,55.59,55.85,56.02,57.13,58.55,58.78,59.47,59.91,61.38,61.63,68.96,71.29,71.48,72.19,72.41,73.25,73.47,75.2,75.44,76.19,76.4,77.38,77.61,78.35,78.52,79.25,79.47,80.39,80.6,81.31,81.53,85.62,85.82,86.5,86.73,87.66,87.87,89.61,89.84,90.57,90.79,91.63,91.82,92.92,93.04,94.06,94.22,95.21,95.39,96.41,96.58,97.53,97.71,98.7,98.87,99.83,99.99,100.65,100.76,101.03,101.22,103.54,103.67,104.71,104.84,105.96,106.15,107.24,107.41,108.46,108.6,109.59,109.78,110.94,111.29,111.58,112.58,113.24,113.61,121.89,122.1,122.83,123.03,123.9,124.07,125.88,126.09,126.85,127.04,127.96,128.14,128.98,129.17,129.89,130.07,131,131.17,131.95,132.14,136.2,136.41,137.13,137.34,138.17,138.39,140.24,140.45,141.33,141.48,143.23,143.67,145.98]};
    const ret = { notes: [], duration: 150 };

    for (let i=0, ip=0, n=data.notes, p=data.sustainPedal, sustain=false; i<n.length; i+=4) {
        if (n[i+2] > p[ip]) ip++, sustain=!sustain;
        ret.notes.push({
            midi: n[i+0], 
            duration: n[i+1], 
            time: n[i+2], 
            dt: i>0?n[i+2]-n[i-2]:n[i+2],
            velocity: n[i+3], 
            sustain, 
            sustainMaxDuration: p[ip]-n[i+2],
        });
    }

    return ret;
}