Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[af50ae]: src / rkrMIDI.C Maximize Restore History

Download this file

rkrMIDI.C    2445 lines (1872 with data), 48.5 kB

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
/*
rakarrack - a guitar effects software
rkrMIDI.C - MIDI functions
Copyright (C) 2008-2010 Josep Andreu
Author: Josep Andreu
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License (version 2) for more details.
You should have received a copy of the GNU General Public License
(version2) along with this program; if not, write to the Free Software
Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "global.h"
void
RKR::InitMIDI ()
{
// Open Alsa Seq
int err = snd_seq_open (&midi_in, "default", SND_SEQ_OPEN_INPUT, 0);
if (err < 0)
printf ("Cannot activate ALSA seq client\n");
snd_seq_set_client_name (midi_in, "rakarrack");
snd_config_update_free_global ();
char portname[50];
// Create Alsa Seq Client
sprintf (portname, "rakarrack IN");
snd_seq_create_simple_port (midi_in, portname,
SND_SEQ_PORT_CAP_WRITE |
SND_SEQ_PORT_CAP_SUBS_WRITE,
SND_SEQ_PORT_TYPE_SYNTH);
}
void
RKR::miramidi ()
{
if (snd_seq_event_input_pending (midi_in, 1))
{
do
{
midievents ();
}
while (snd_seq_event_input_pending (midi_in, 0));
}
};
void
RKR::midievents()
{
int i;
snd_seq_event_t *midievent;
midievent = NULL;
snd_seq_event_input (midi_in, &midievent);
if (midievent == NULL)
return;
if (midievent->type == 42)
return;
if((Tap_Bypass) && (Tap_Selection == 3) && (midievent->type == SND_SEQ_EVENT_CLOCK))
{
mtc_counter++;
if (mtc_counter >= 24)
{
Tap_TempoSet=TapTempo();
mtc_counter= 0;
}
}
if((Looper_Bypass) && (Tap_Selection==3))
{
if (midievent->type == SND_SEQ_EVENT_START)
{
efx_Looper->changepar(1,1);
stecla=5;
}
if (midievent->type == SND_SEQ_EVENT_STOP)
{
efx_Looper->changepar(2,1);
stecla=5;
}
}
if ((midievent->type == SND_SEQ_EVENT_NOTEON)
|| (midievent->type == SND_SEQ_EVENT_NOTEOFF))
{
int cmdnote = midievent->data.note.note;
int cmdvelo = midievent->data.note.velocity;
if((Tap_Bypass) && (Tap_Selection == 1) && (midievent->type == SND_SEQ_EVENT_NOTEON) && (cmdvelo != 0))
Tap_TempoSet=TapTempo();
if (midievent->data.note.channel == HarCh)
{
for (i = 0; i < POLY; i++)
{
if ((midievent->type == SND_SEQ_EVENT_NOTEON) && (cmdvelo != 0))
{
if (note_active[i] == 0)
{
note_active[i] = 1;
rnote[i] = cmdnote;
gate[i] = 1;
RC->MiraChord ();
break;
}
}
if ((midievent->type == SND_SEQ_EVENT_NOTEON) && (cmdvelo == 0))
{
if ((note_active[i]) && (rnote[i] == cmdnote))
{
note_active[i] = 0;
gate[i] = 0;
break;
}
}
if (midievent->type == SND_SEQ_EVENT_NOTEOFF)
{
if ((note_active[i]) && (rnote[i] == cmdnote))
{
note_active[i] = 0;
gate[i] = 0;
break;
}
}
}
}
}
if (midievent->type == SND_SEQ_EVENT_PGMCHANGE)
{
if (midievent->data.control.channel == MidiCh)
{
if(!midi_table)
{
if ((midievent->data.control.value > 0)
&& (midievent->data.control.value < 61))
preset = midievent->data.control.value;
if (midievent->data.control.value == 81)
if (Selected_Preset >1) preset = Selected_Preset-1;
if (midievent->data.control.value == 82)
if (Selected_Preset<60) preset = Selected_Preset+1;
}
else
preset = midievent->data.control.value;
}
}
if (midievent->type == SND_SEQ_EVENT_CONTROLLER)
{
if (midievent->data.control.channel == MidiCh)
{
if(RControl)
{
ControlGet = (int)midievent->data.control.param;
return;
}
if(MIDIway)
{
for(i=0; i<20;i++)
{
if (XUserMIDI[(int)midievent->data.control.param][i])
process_midi_controller_events(XUserMIDI[(int)midievent->data.control.param][i],
(int)midievent->data.control.value);
else break;
}
}
else
process_midi_controller_events((int)midievent->data.control.param,
(int)midievent->data.control.value);
}
}
};
void
RKR::ActOnOff()
{
if(OnOffC<63) OnOffC++;
}
void
RKR::ActiveUn(int value)
{
int numef;
int inoff=0;
int miraque=0;
if(value < 20)
{
numef = value / 2;
inoff = checkonoff(efx_order[numef]); // value % 2;
miraque = efx_order[numef];
ActOnOff();
Mnumeff[OnOffC] = numef;
}
else
if(value < 121)
{
numef = value-20;
inoff = checkonoff(numef);
miraque = numef;
ActOnOff();
Mnumeff[OnOffC] = 1000 + numef;
}
else
{
numef = value;
inoff = checkonoff(numef);
miraque = numef;
ActOnOff();
Mnumeff[OnOffC] = 2000 + numef;
}
switch(miraque)
{
case 0:
if (inoff) EQ1_Bypass=1; else EQ1_Bypass=0;
break;
case 1:
if (inoff) Compressor_Bypass=1; else Compressor_Bypass=0;
break;
case 2:
if (inoff) Distorsion_Bypass=1; else Distorsion_Bypass=0;
break;
case 3:
if (inoff) Overdrive_Bypass=1; else Overdrive_Bypass=0;
break;
case 4:
if (inoff) Echo_Bypass=1; else Echo_Bypass=0;
break;
case 5:
if (inoff) Chorus_Bypass=1; else Chorus_Bypass=0;
break;
case 6:
if (inoff) Phaser_Bypass=1; else Phaser_Bypass=0;
break;
case 7:
if (inoff) Flanger_Bypass=1; else Flanger_Bypass=0;
break;
case 8:
if (inoff) Reverb_Bypass=1; else Reverb_Bypass=0;
break;
case 9:
if (inoff) EQ2_Bypass=1; else EQ2_Bypass=0;
break;
case 10:
if (inoff) WhaWha_Bypass=1; else WhaWha_Bypass=0;
break;
case 11:
if (inoff) Alienwah_Bypass=1; else Alienwah_Bypass=0;
break;
case 12:
if (inoff) Cabinet_Bypass=1; else Cabinet_Bypass=0;
break;
case 13:
if (inoff) Pan_Bypass=1; else Pan_Bypass=0;
break;
case 14:
if (inoff) Harmonizer_Bypass=1; else Harmonizer_Bypass=0;
break;
case 15:
if (inoff) MusDelay_Bypass=1; else MusDelay_Bypass=0;
break;
case 16:
if (inoff) Gate_Bypass=1; else Gate_Bypass=0;
break;
case 17:
if (inoff) NewDist_Bypass=1; else NewDist_Bypass=0;
break;
case 18:
if (inoff) APhaser_Bypass=1; else APhaser_Bypass=0;
break;
case 19:
if (inoff) Valve_Bypass=1; else Valve_Bypass=0;
break;
case 20:
if (inoff) DFlange_Bypass=1; else DFlange_Bypass=0;
break;
case 21:
if (inoff) Ring_Bypass=1; else Ring_Bypass=0;
break;
case 22:
if (inoff) Exciter_Bypass=1; else Exciter_Bypass=0;
break;
case 23:
if (inoff) MBDist_Bypass=1; else MBDist_Bypass=0;
break;
case 24:
if (inoff) Arpie_Bypass=1; else Arpie_Bypass=0;
break;
case 25:
if (inoff) Expander_Bypass=1; else Expander_Bypass=0;
break;
case 26:
if (inoff) Shuffle_Bypass=1; else Shuffle_Bypass=0;
break;
case 27:
if (inoff) Synthfilter_Bypass=1; else Synthfilter_Bypass=0;
break;
case 28:
if (inoff) MBVvol_Bypass=1; else MBVvol_Bypass=0;
break;
case 29:
if (inoff) Convol_Bypass=1; else Convol_Bypass=0;
break;
case 30:
if(inoff) Looper_Bypass=1; else Looper_Bypass=0;
break;
case 31:
if(inoff) RyanWah_Bypass=1; else RyanWah_Bypass=0;
break;
case 32:
if(inoff) RBEcho_Bypass=1; else RBEcho_Bypass=0;
break;
case 33:
if(inoff) CoilCrafter_Bypass=1; else CoilCrafter_Bypass=0;
break;
case 34:
if(inoff) ShelfBoost_Bypass=1; else ShelfBoost_Bypass=0;
break;
case 35:
if(inoff) Vocoder_Bypass=1; else Vocoder_Bypass=0;
break;
case 36:
if(inoff) Sustainer_Bypass=1; else Sustainer_Bypass=0;
break;
case 37:
if(inoff) Sequence_Bypass=1; else Sequence_Bypass=0;
break;
case 38:
if(inoff) Shifter_Bypass=1; else Shifter_Bypass=0;
break;
case 39:
if(inoff) StompBox_Bypass=1; else StompBox_Bypass=0;
break;
case 40:
if(inoff) Reverbtron_Bypass=1; else Reverbtron_Bypass=0;
break;
case 41:
if(inoff) Echotron_Bypass=1; else Echotron_Bypass=0;
break;
case 42:
if(inoff) StereoHarm_Bypass=1; else StereoHarm_Bypass=0;
break;
case 43:
if(inoff) CompBand_Bypass=1; else CompBand_Bypass=0;
break;
case 44:
if(inoff) Opticaltrem_Bypass=1; else Opticaltrem_Bypass=0;
break;
case 45:
if(inoff) Vibe_Bypass=1; else Vibe_Bypass=0;
break;
case 46:
if(inoff) Infinity_Bypass=1; else Infinity_Bypass=0;
break;
case 121:
if(inoff) Tap_Bypass = 1; else Tap_Bypass = 0;
break;
case 122:
if(inoff) MIDIConverter_Bypass = 1; else MIDIConverter_Bypass = 0;
break;
case 123:
if(inoff) Tuner_Bypass = 1; else Tuner_Bypass = 0;
break;
case 124:
if(inoff) Bypass = 1; else Bypass = 0;
break;
}
}
int
RKR::checkonoff(int miraque)
{
switch(miraque)
{
case 0:
if(EQ1_Bypass) return(0);
break;
case 1:
if (Compressor_Bypass) return(0);
break;
case 2:
if (Distorsion_Bypass) return(0);
break;
case 3:
if (Overdrive_Bypass)return(0);
break;
case 4:
if (Echo_Bypass)return(0);
break;
case 5:
if (Chorus_Bypass) return(0);
break;
case 6:
if (Phaser_Bypass) return(0);
break;
case 7:
if (Flanger_Bypass) return(0);
break;
case 8:
if (Reverb_Bypass) return(0);
break;
case 9:
if (EQ2_Bypass) return(0);
break;
case 10:
if (WhaWha_Bypass) return(0);
break;
case 11:
if (Alienwah_Bypass) return(0);
break;
case 12:
if (Cabinet_Bypass) return(0);
break;
case 13:
if (Pan_Bypass) return(0);
break;
case 14:
if (Harmonizer_Bypass) return(0);
break;
case 15:
if (MusDelay_Bypass) return(0);
break;
case 16:
if (Gate_Bypass) return(0);
break;
case 17:
if (NewDist_Bypass) return(0);
break;
case 18:
if (APhaser_Bypass) return(0);
break;
case 19:
if (Valve_Bypass) return(0);
break;
case 20:
if (DFlange_Bypass) return(0);
break;
case 21:
if (Ring_Bypass) return(0);
break;
case 22:
if (Exciter_Bypass) return(0);
break;
case 23:
if (MBDist_Bypass) return(0);
break;
case 24:
if (Arpie_Bypass) return(0);
break;
case 25:
if (Expander_Bypass) return(0);
break;
case 26:
if (Shuffle_Bypass) return(0);
break;
case 27:
if (Synthfilter_Bypass) return(0);
break;
case 28:
if (MBVvol_Bypass) return(0);
break;
case 29:
if (Convol_Bypass) return(0);
break;
case 30:
if (Looper_Bypass) return(0);
break;
case 31:
if (RyanWah_Bypass) return(0);
break;
case 32:
if (RBEcho_Bypass) return(0);
break;
case 33:
if (CoilCrafter_Bypass) return(0);
break;
case 34:
if (ShelfBoost_Bypass) return(0);
break;
case 35:
if (Vocoder_Bypass) return(0);
break;
case 36:
if (Sustainer_Bypass) return(0);
break;
case 37:
if (Sequence_Bypass) return(0);
break;
case 38:
if (Shifter_Bypass) return(0);
break;
case 39:
if (StompBox_Bypass) return(0);
break;
case 40:
if (Reverbtron_Bypass) return(0);
break;
case 41:
if (Echotron_Bypass) return(0);
break;
case 42:
if (StereoHarm_Bypass) return(0);
break;
case 43:
if (CompBand_Bypass) return(0);
break;
case 44:
if (Opticaltrem_Bypass) return(0);
break;
case 45:
if (Vibe_Bypass) return(0);
break;
case 46:
if (Infinity_Bypass) return(0);
break;
case 121:
if (Tap_Bypass) return 0;
break;
case 122:
if (MIDIConverter_Bypass) return 0;
break;
case 123:
if (Tuner_Bypass) return 0;
break;
case 124:
if (Bypass) return 0;
break;
}
return(1);
}
void
RKR::Conecta ()
{
FILE *fp;
int client = 0;
int puerto = 0;
char temp[128];
char temp1[128];
char temp2[128];
char *nume;
if (IsCoIn)
disconectaaconnect ();
if ((fp = fopen ("/proc/asound/seq/clients", "r")) != NULL)
{
memset (temp, 0, sizeof (temp));
while (fgets (temp, sizeof temp, fp) != NULL)
{
if (strstr (temp, "Client") != NULL)
{
strcpy (temp1, temp);
strtok (temp1, " ");
nume = strtok (NULL, "\"");
sscanf (nume, "%d", &client);
}
if (strstr (temp, "Port") != NULL)
{
strcpy (temp2, temp);
strtok (temp2, " ");
nume = strtok (NULL, " ");
sscanf (nume, "%d", &puerto);
if (strstr (temp, "rakarrack IN") != 0)
{
Cyoin = client;
Pyoin = puerto;
}
if (strstr (temp, MID) != 0)
{
Ccin = client;
Pcin = puerto;
}
}
}
}
fclose (fp);
conectaaconnect ();
};
void
RKR::conectaaconnect ()
{
char tempi[128];
if (MID != NULL)
{
memset (tempi, 0, sizeof (tempi));
sprintf (tempi, "aconnect %d:%d %d:%d", Ccin, Pcin, Cyoin, Pyoin);
system (tempi);
IsCoIn = 1;
}
};
void
RKR::disconectaaconnect ()
{
char tempi[128];
if (MID != NULL)
{
memset (tempi, 0, sizeof (tempi));
sprintf (tempi, "aconnect -d %d:%d %d:%d", Ccin, Pcin, Cyoin, Pyoin);
system (tempi);
IsCoIn = 0;
}
};
void
RKR::jack_process_midievents (jack_midi_event_t *midievent)
{
int i;
int type = midievent->buffer[0]>>4;
if((Tap_Bypass) && (Tap_Selection == 3) && (midievent->buffer[0] == 0xf8))
{
mtc_counter++;
if (mtc_counter >= 24)
{
Tap_TempoSet=TapTempo();
mtc_counter= 0;
}
}
if ((type == 8) || (type == 9))
{
int cmdnote = midievent->buffer[1];
int cmdvelo = midievent->buffer[2];
int cmdchan = midievent->buffer[0]&15;
if((Tap_Bypass) && (Tap_Selection==1) && (type==9) && (cmdvelo != 0)) Tap_TempoSet = TapTempo();
if (cmdchan == HarCh)
{
for (i = 0; i < POLY; i++)
{
if ((type==9) && (cmdvelo != 0))
{
if (note_active[i] == 0)
{
note_active[i] = 1;
rnote[i] = cmdnote;
gate[i] = 1;
RC->MiraChord ();
break;
}
}
if ((type==9) && (cmdvelo == 0))
{
if ((note_active[i]) && (rnote[i] == cmdnote))
{
note_active[i] = 0;
gate[i] = 0;
break;
}
}
if (type==8)
{
if ((note_active[i]) && (rnote[i] == cmdnote))
{
note_active[i] = 0;
gate[i] = 0;
break;
}
}
}
}
}
if (type == 12)
{
int cmdvalue= midievent->buffer[1];
int cmdchan = midievent->buffer[0]&15;
if (cmdchan == MidiCh)
{
if(!midi_table)
{
if ((cmdvalue > 0)
&& (cmdvalue < 61))
preset = cmdvalue;
if (cmdvalue==81) if (Selected_Preset>1) preset = Selected_Preset-1;
if (cmdvalue==82) if (Selected_Preset<60) preset = Selected_Preset+1;
}
else
preset = cmdvalue;
}
}
if (type == 11)
{
int cmdcontrol = midievent->buffer[1];
int cmdvalue= midievent->buffer[2];
int cmdchan = midievent->buffer[0]&15;
if (cmdchan == MidiCh)
{
if(RControl)
{
ControlGet = cmdcontrol;
return;
}
if(MIDIway)
{
for(i=0; i<20;i++)
{
if (XUserMIDI[cmdcontrol][i])
process_midi_controller_events(XUserMIDI[cmdcontrol][i],cmdvalue);
else break;
}
}
else
process_midi_controller_events(cmdcontrol, cmdvalue);
}
}
};
/*
* process MIDI controller events
*/
void
RKR::process_midi_controller_events(int parameter, int value)
{
int i;
// for real parameter changes, flag need for a GUI update
if(parameter > 0)
{
Mcontrol[parameter]=1;
Mvalue = 1;
}
switch (parameter)
{
case 7:
Master_Volume =
(float) value / 128.0f;
calculavol (2);
break;
case 1:
efx_WhaWha->changepar (6, value);
break;
case 20:
efx_Alienwah->changepar (6,value);
break;
case 21:
efx_Phaser->changepar (6, value);
break;
case 22:
efx_Flanger->changepar (6, value);
break;
case 23:
efx_Chorus->changepar (6, value);
break;
case 24:
efx_MusDelay->changepar (11, value);
break;
case 25:
efx_MusDelay->changepar (12, value);
break;
case 26:
efx_Har->changepar (4, value);
break;
case 27:
if (Harmonizer_Bypass)
{
Harmonizer_Bypass = 0;
efx_Har->changepar (3, value);
Harmonizer_Bypass = 1;
}
break;
case 28:
efx_WhaWha->changepar (0, value);
break;
case 29:
efx_Overdrive->changepar (0, value);
break;
case 30:
efx_Distorsion->changepar (0, value);
break;
case 31:
efx_Har->changepar (0, value);
break;
case 52:
efx_Chorus->changepar (0, value);
break;
case 53:
efx_Flanger->changepar (0, value);
break;
case 54:
efx_Phaser->changepar (0, value);
break;
case 55:
efx_Alienwah->changepar (0, value);
break;
case 56:
efx_MusDelay->changepar (0, value);
break;
case 57:
efx_Rev->changepar (0, value);
break;
case 58:
efx_Pan->changepar (0, value);
break;
case 59:
efx_Echo->changepar (0, value);
break;
case 46:
efx_Echo->changepar (1, value);
break;
case 47:
efx_Overdrive->changepar (1, value);
break;
case 48:
efx_Distorsion->changepar (1, value);
break;
case 49:
efx_Har->changepar (1, value);
break;
case 50:
efx_Chorus->changepar (1, value);
break;
case 51:
efx_Flanger->changepar (1,value);
break;
case 60:
efx_Phaser->changepar (1, value);
break;
case 61:
efx_Alienwah->changepar (1, value);
break;
case 62:
efx_MusDelay->changepar (1, value);
break;
case 63:
efx_Rev->changepar (1, value);
break;
case 65:
efx_MusDelay->changepar (7, value);
break;
case 66:
efx_WhaWha->changepar (1, value);
break;
case 67:
efx_Pan->changepar (1, value);
break;
case 68:
efx_Overdrive->changepar (3, value);
break;
case 69:
efx_Distorsion->changepar (3, value);
break;
case 70:
efx_Overdrive->changepar (4, value);
break;
case 71:
efx_Distorsion->changepar (4, value);
break;
case 72:
efx_Chorus->changepar (2, ret_Tempo(value));
break;
case 73:
efx_Flanger->changepar (2,ret_Tempo(value));
break;
case 74:
efx_Phaser->changepar (2, ret_Tempo(value));
break;
case 75:
efx_WhaWha->changepar (2,ret_Tempo(value));
break;
case 76:
efx_Alienwah->changepar (2, ret_Tempo(value));
break;
case 77:
efx_Pan->changepar (2, ret_Tempo(value));
break;
case 78:
efx_Echo->changepar (5, value);
break;
case 79:
efx_Chorus->changepar (8, value);
break;
case 80:
efx_Flanger->changepar (8, value);
break;
case 81:
efx_Phaser->changepar (7, value);
break;
case 82:
efx_Alienwah->changepar (7, value);
break;
case 83:
efx_MusDelay->changepar (5, value);
break;
case 84:
efx_MusDelay->changepar (9, value);
break;
case 85:
efx_Overdrive->changepar (7, ret_LPF(value));
break;
case 86:
efx_Distorsion->changepar (7, ret_LPF(value));
break;
case 87:
efx_Rev->changepar (7, ret_LPF(value));
break;
case 88:
efx_Overdrive->changepar (8, ret_HPF(value));
break;
case 89:
efx_Distorsion->changepar (8, ret_HPF(value));
break;
case 90:
efx_Rev->changepar (8, ret_HPF(value));
break;
case 91:
efx_Chorus->changepar (9, value);
break;
case 92:
efx_Flanger->changepar (9, value);
break;
case 93:
efx_Phaser->changepar (9, value);
break;
case 94:
efx_Overdrive->changepar (2, value);
break;
case 95:
efx_Distorsion->changepar (2, value);
break;
case 96:
efx_Alienwah->changepar (9,value);
break;
case 97:
efx_Echo->changepar (4, value);
break;
case 98:
efx_MusDelay->changepar (4,value);
break;
case 99:
efx_Chorus->changepar (5, value);
break;
case 100:
efx_Flanger->changepar (5, value);
break;
case 101:
efx_Phaser->changepar (5, value);
break;
case 102:
efx_WhaWha->changepar (5, value);
break;
case 103:
efx_Alienwah->changepar (5,value);
break;
case 104:
efx_Pan->changepar (5, value);
break;
case 105:
efx_Chorus->changepar (3, value);
break;
case 106:
efx_Flanger->changepar (3,value);
break;
case 107:
efx_Phaser->changepar (3, value);
break;
case 108:
efx_WhaWha->changepar (3, value);
break;
case 109:
efx_Alienwah->changepar (3, value);
break;
case 110:
efx_Pan->changepar (3, value);
break;
case 111:
efx_WhaWha->changepar (7, value);
break;
case 112:
efx_WhaWha->changepar (8, value);
break;
case 113:
efx_WhaWha->changepar (9, value);
break;
case 114:
efx_Phaser->changepar (11, value);
break;
case 115:
efx_Alienwah->changepar (10, value);
break;
case 116:
ActiveUn(value);
break;
case 117:
efx_APhaser->changepar (0, value);
break;
case 118:
efx_APhaser->changepar (1, value);
break;
case 119:
efx_APhaser->changepar (2, value);
break;
case 120:
efx_APhaser->changepar (11, value);
break;
case 121:
efx_APhaser->changepar (6, value);
break;
case 122:
efx_APhaser->changepar (7, value);
break;
case 123:
efx_APhaser->changepar (9, value);
break;
case 124:
efx_APhaser->changepar (5, value);
break;
case 125:
efx_NewDist->changepar (0, value);
break;
case 126:
efx_NewDist->changepar (1, value);
break;
case 127:
efx_NewDist->changepar (2, value);
break;
case 2:
efx_NewDist->changepar (3, value);
break;
case 3:
efx_NewDist->changepar (4, value);
break;
case 4:
efx_NewDist->changepar (7, ret_LPF(value));
break;
case 5:
efx_NewDist->changepar (8, ret_HPF(value));
break;
case 6:
efx_NewDist->changepar (9, value);
break;
case 8:
efx_NewDist->changepar (11, value);
break;
case 9:
efx_NewDist->changepar (12, value);
break;
case 12:
Fraction_Bypass = (float) value / 127.0f;
break;
case 14:
Input_Gain =
(float) value / 128.0f;
calculavol (1);
break;
case 130:
efx_EQ1->changepar(0, value);
break;
case 131:
for(i=0;i<10;i++) efx_EQ1->changepar(i*5+13, value);
break;
case 132:
efx_EQ1->changepar(12, value);
break;
case 133:
efx_EQ1->changepar(5+12, value);
break;
case 134:
efx_EQ1->changepar(10+12, value);
break;
case 135:
efx_EQ1->changepar(15+12, value);
break;
case 136:
efx_EQ1->changepar(20+12, value);
break;
case 137:
efx_EQ1->changepar(25+12, value);
break;
case 138:
efx_EQ1->changepar(30+12, value);
break;
case 139:
efx_EQ1->changepar(35+12, value);
break;
case 140:
efx_EQ1->changepar(40+12, value);
break;
case 141:
efx_EQ1->changepar(45+12, value);
break;
case 142:
efx_Compressor->Compressor_Change(4, 10+(int) ((float) value * 1.890f));
break;
case 143:
efx_Compressor->Compressor_Change(5, 10+(int) ((float) value * 3.858f));
break;
case 144:
efx_Compressor->Compressor_Change(2, 2+ (int) ((float) value * .314f));
break;
case 145:
efx_Compressor->Compressor_Change(7, (int) ((float) value * .787f));
break;
case 146:
efx_Compressor->Compressor_Change(1, -60 + (int) ((float) value * .448f));
break;
case 147:
efx_Compressor->Compressor_Change(3, -40 + (int) ((float) value * .314f));
break;
case 148:
efx_EQ2->changepar(0, value);
break;
case 149:
efx_EQ2->changepar(11, 20+(int)((float)value*7.7165f ));
break;
case 150:
efx_EQ2->changepar(12, value);
break;
case 151:
efx_EQ2->changepar(13, value);
break;
case 152:
efx_EQ2->changepar(16, 800 + (int)((float)value*56.692f));
break;
case 153:
efx_EQ2->changepar(17, value);
break;
case 154:
efx_EQ2->changepar(18, value);
break;
case 155:
efx_EQ2->changepar(21, 20000 + (int)((float)value*157.48f));
break;
case 156:
efx_EQ2->changepar(22, value);
break;
case 157:
efx_EQ2->changepar(23, value);
break;
case 158:
efx_DFlange->changepar(0,value-64);
break;
case 159:
efx_DFlange->changepar(1,value-64);
break;
case 160:
efx_DFlange->changepar(2,value);
break;
case 161:
efx_DFlange->changepar(3,20+(int)((float)value*3.7795f));
break;
case 162:
efx_DFlange->changepar(4,(int)((float)value*23.622f));
break;
case 163:
efx_DFlange->changepar(5,(int)((float)value*0.7874f));
break;
case 164:
efx_DFlange->changepar(6,value-64);
break;
case 165:
efx_DFlange->changepar(7,20+(int)((float)value*157.32f));
break;
case 166:
efx_DFlange->changepar(10,1+(int)((float)value*4.716f));
break;
case 167:
efx_DFlange->changepar(11,value);
break;
case 168:
efx_DFlange->changepar(13,value);
break;
case 169:
efx_Valve->changepar(0,value);
break;
case 170:
efx_Valve->changepar(2,value);
break;
case 171:
efx_Valve->changepar(1,value);
break;
case 172:
efx_Valve->changepar(4,value);
break;
case 173:
efx_Valve->changepar(3,value);
break;
case 174:
efx_Valve->changepar(10,value);
break;
case 175:
efx_Valve->changepar(12,(int)((float)value*.7874f));
break;
case 176:
efx_Valve->changepar(6,ret_LPF(value));
break;
case 177:
efx_Valve->changepar(7,ret_HPF(value));
break;
case 178:
efx_Ring->changepar(0,value-64);
break;
case 179:
efx_Ring->changepar(2,value-64);
break;
case 180:
efx_Ring->changepar(11,value);
break;
case 181:
efx_Ring->changepar(3,value);
break;
case 182:
efx_Ring->changepar(1,value-64);
break;
case 183:
efx_Ring->changepar(4,(int)((float)value*.7874f));
break;
case 184:
efx_Ring->changepar(5,1 + (int)((float)value*157.472f));
break;
case 185:
efx_Ring->changepar(7,(int)((float)value*.7874f));
break;
case 186:
efx_Ring->changepar(8,(int)((float)value*.7874f));
break;
case 187:
efx_Ring->changepar(9,(int)((float)value*.7874f));
break;
case 188:
efx_Ring->changepar(10,(int)((float)value*.7874f));
break;
case 189:
efx_Exciter->changepar(0,value);
break;
case 190:
efx_Exciter->changepar(11,20+(int)((float)value *157.3228f));
break;
case 191:
efx_Exciter->changepar(12,20+(int)((float)value *157.3228f));
break;
case 192:
efx_Exciter->changepar(1,value-64);
break;
case 193:
efx_Exciter->changepar(2,value-64);
break;
case 194:
efx_Exciter->changepar(3,value-64);
break;
case 195:
efx_Exciter->changepar(4,value-64);
break;
case 196:
efx_Exciter->changepar(5,value-64);
break;
case 197:
efx_Exciter->changepar(6,value-64);
break;
case 198:
efx_Exciter->changepar(7,value-64);
break;
case 199:
efx_Exciter->changepar(8,value-64);
break;
case 200:
efx_Exciter->changepar(9,value-64);
break;
case 201:
efx_Exciter->changepar(10,value-64);
break;
case 202:
efx_MBDist->changepar(0,value);
break;
case 203:
efx_MBDist->changepar(2,value);
break;
case 204:
efx_MBDist->changepar(3,value);
break;
case 205:
efx_MBDist->changepar(4,value);
break;
case 206:
efx_MBDist->changepar(8,(int)((float)value*.7874f));
break;
case 207:
efx_MBDist->changepar(9,(int)((float)value*.7874f));
break;
case 208:
efx_MBDist->changepar(10,(int)((float)value*.7874f));
break;
case 209:
efx_MBDist->changepar(12,40+(int)((float)value*7.559f));
break;
case 210:
efx_MBDist->changepar(13,1000+(int)((float)value*55.1181f));
break;
case 211:
efx_MBDist->changepar(1,value);
break;
case 212:
efx_Arpie->changepar(0,value-64);
break;
case 213:
efx_Arpie->changepar(7,value);
break;
case 214:
efx_Arpie->changepar(1,value-64);
break;
case 215:
efx_Arpie->changepar(2,ret_Tempo(value));
break;
case 216:
efx_Arpie->changepar(3,value);
break;
case 217:
efx_Arpie->changepar(4,value-64);
break;
case 218:
efx_Arpie->changepar(5,value);
break;
case 219:
efx_Arpie->changepar(6,value);
break;
case 220:
efx_Expander->Expander_Change(3,10+(int)((float)value*15.669291f));
break;
case 221:
efx_Expander->Expander_Change(4,10+(int)((float)value*3.8582677f));
break;
case 222:
efx_Expander->Expander_Change(2,1+(int)((float)value*.3858f));
break;
case 223:
efx_Expander->Expander_Change(1,(int)((float)value*-.629921f));
break;
case 224:
efx_Expander->Expander_Change(7,value);
break;
case 225:
efx_Expander->Expander_Change(5,ret_LPF(value));
break;
case 226:
efx_Expander->Expander_Change(6,ret_HPF(value));
break;
case 227:
efx_Shuffle->changepar(0,value);
break;
case 228:
efx_Shuffle->changepar(5,20+(int)((float)value*7.7165));
break;
case 229:
efx_Shuffle->changepar(1,value-64);
break;
case 230:
efx_Shuffle->changepar(6,400+(int)((float)value*28.3464));
break;
case 231:
efx_Shuffle->changepar(2,value-64);
break;
case 232:
efx_Shuffle->changepar(7,1200+(int)((float)value*53.5433));
break;
case 233:
efx_Shuffle->changepar(3,value-64);
break;
case 234:
efx_Shuffle->changepar(8,6000+(int)((float)value*157.48031));
break;
case 235:
efx_Shuffle->changepar(4,value-64);
break;
case 236:
efx_Shuffle->changepar(9,value-64);
break;
case 237:
efx_Synthfilter->changepar(0,value);
break;
case 238:
efx_Synthfilter->changepar(1,value);
break;
case 239:
efx_Synthfilter->changepar(2,ret_Tempo(value));
break;
case 240:
efx_Synthfilter->changepar(5,value);
break;
case 241:
efx_Synthfilter->changepar(6,value);
break;
case 242:
efx_Synthfilter->changepar(7,value-64);
break;
case 243:
efx_Synthfilter->changepar(11,value);
break;
case 244:
efx_Synthfilter->changepar(12,value-64);
break;
case 245:
efx_Synthfilter->changepar(13,5+(int)((float)value*7.83464));
break;
case 246:
efx_Synthfilter->changepar(14,5+(int)((float)value*3.8976378));
break;
case 247:
efx_Synthfilter->changepar(15,value);
break;
case 248:
efx_MBVvol->changepar(0,value);
break;
case 249:
efx_MBVvol->changepar(1,ret_Tempo(value));
break;
case 250:
efx_MBVvol->changepar(3,value);
break;
case 251:
efx_MBVvol->changepar(4,ret_Tempo(value));
break;
case 252:
efx_MBVvol->changepar(6,value);
break;
case 253:
efx_MBVvol->changepar(7,20+(int)((float)value*7.71653));
break;
case 254:
efx_MBVvol->changepar(8,1000+(int)((float)value*55.11811));
break;
case 255:
efx_MBVvol->changepar(9,2000+(int)((float)value*188.97638));
break;
case 256:
efx_RyanWah->changepar(0,value);
break;
case 257:
efx_RyanWah->changepar(10,value-64);
break;
case 258:
efx_RyanWah->changepar(11,value-64);
break;
case 259:
efx_RyanWah->changepar(12,value-64);
break;
case 260:
efx_RyanWah->changepar(6,value);
break;
case 261:
efx_RyanWah->changepar(2,ret_Tempo(value));
break;
case 262:
efx_RyanWah->changepar(1,value);
break;
case 263:
efx_RyanWah->changepar(14,10+(int)((float)value*47.165354f));
break;
case 264:
efx_RyanWah->changepar(8,value);
break;
case 265:
efx_RyanWah->changepar(7,value-64);
break;
case 266:
efx_RyanWah->changepar(9,value);
break;
case 267:
efx_Looper->changepar(0,value);
break;
case 268:
efx_Looper->changepar(6,value);
break;
case 269:
efx_Looper->changepar(10,value);
break;
case 270:
if(value) i=1; else i=0;
efx_Looper->changepar(5,i);
break;
case 271:
if(value) i=1; else i=0;
efx_Looper->changepar(9,i);
break;
case 272:
if(value) i=1; else i=0;
efx_Looper->changepar(1,i);
break;
case 273:
if(value) i=1; else i=0;
efx_Looper->changepar(2,i);
break;
case 274:
if(value) i=1; else i=0;
efx_Looper->changepar(3,i);
break;
case 275:
if(value) i=1; else i=0;
efx_Looper->changepar(11,i);
break;
case 276:
if(value) i=1; else i=0;
efx_Looper->changepar(12,i);
break;
case 277:
if(value) i=1; else i=0;
efx_Looper->changepar(7,i);
break;
case 278:
if(value) i=1; else i=0;
efx_Looper->changepar(8,i);
break;
case 279:
if(value) i=1; else i=0;
efx_Looper->changepar(4,i);
break;
case 280:
efx_Convol->changepar(0,value);
break;
case 281:
efx_Convol->changepar(1,value);
break;
case 282:
efx_Convol->changepar(7,value);
break;
case 283:
efx_Convol->changepar(6,value);
break;
case 284:
efx_Convol->changepar(10,value-64);
break;
case 285:
efx_Convol->changepar(3,5+(int)((float)value*1.9291339f));
break;
case 286:
efx_CoilCrafter->changepar(0,value);
break;
case 287:
efx_CoilCrafter->changepar(7,20+(int)((float)value*34.488189f));
break;
case 288:
efx_CoilCrafter->changepar(3,2600+(int)((float)value*14.96063f));
break;
case 289:
efx_CoilCrafter->changepar(4,10+(int)((float)value*.43307087f));
break;
case 290:
efx_CoilCrafter->changepar(0,2600+(int)((float)value*14.96063f));
break;
case 291:
efx_CoilCrafter->changepar(6,10+(int)((float)value*.43307087f));
break;
case 292:
efx_ShelfBoost->changepar(0,value);
break;
case 293:
efx_ShelfBoost->changepar(4,1+(int)((float)value*.992125f));
break;
case 294:
efx_ShelfBoost->changepar(2,220+(int)((float)value*124.25197f));
break;
case 295:
efx_ShelfBoost->changepar(1,value-64);
break;
case 296:
efx_Vocoder->changepar(0,value);
break;
case 297:
efx_Vocoder->changepar(1,value);
break;
case 298:
efx_Vocoder->changepar(4,value);
break;
case 299:
efx_Vocoder->changepar(2,1+(int)((float)value*.992125f));
break;
case 300:
efx_Vocoder->changepar(3,40+(int)((float)value*1.023622f));
break;
case 301:
efx_Vocoder->changepar(6,value);
break;
case 302:
efx_Vocoder->changepar(5,value);
break;
case 303:
efx_RBEcho->changepar(0,value);
break;
case 304:
efx_RBEcho->changepar(7,value);
break;
case 305:
efx_RBEcho->changepar(1,value);
break;
case 306:
efx_RBEcho->changepar(2,ret_Tempo(value));
break;
case 307:
efx_RBEcho->changepar(3,value);
break;
case 308:
efx_RBEcho->changepar(5,value);
break;
case 309:
efx_RBEcho->changepar(6,value);
break;
case 310:
efx_RBEcho->changepar(9,value);
break;
case 311:
efx_RBEcho->changepar(4,value);
break;
case 312:
efx_Sustainer->changepar(0,value);
break;
case 313:
efx_Sustainer->changepar(1,value);
break;
case 314:
efx_Sequence->changepar(8,value);
break;
case 315:
efx_Sequence->changepar(0,value);
break;
case 316:
efx_Sequence->changepar(1,value);
break;
case 317:
efx_Sequence->changepar(2,value);
break;
case 318:
efx_Sequence->changepar(3,value);
break;
case 319:
efx_Sequence->changepar(4,value);
break;
case 320:
efx_Sequence->changepar(5,value);
break;
case 321:
efx_Sequence->changepar(6,value);
break;
case 322:
efx_Sequence->changepar(7,value);
break;
case 323:
efx_Sequence->changepar(9,ret_Tempo(value));
break;
case 324:
efx_Sequence->changepar(10,value);
break;
case 325:
efx_Sequence->changepar(12,(int)((float)value*.05511811f));
break;
case 326:
efx_Shifter->changepar(0,value);
break;
case 327:
efx_Shifter->changepar(6,(int)((float)value*.094488189f));
break;
case 328:
efx_Shifter->changepar(2,value);
break;
case 329:
efx_Shifter->changepar(1,value);
break;
case 330:
efx_Shifter->changepar(3,1 + (int)((float)value*15.748031f));
break;
case 331:
efx_Shifter->changepar(4,1 + (int)((float)value*15.748031f));
break;
case 332:
efx_Shifter->changepar(4,-70 + (int)((float)value*.70866142f));
break;
case 333:
efx_Shifter->changepar(9,value);
break;
case 334:
efx_StompBox->changepar(0,value);
break;
case 335:
efx_StompBox->changepar(4,value);
break;
case 336:
efx_StompBox->changepar(3,value);
break;
case 337:
efx_StompBox->changepar(2,value);
break;
case 338:
efx_StompBox->changepar(1,value);
break;
case 339:
efx_Reverbtron->changepar(0,value);
break;
case 340:
efx_Reverbtron->changepar(11,value);
break;
case 341:
efx_Reverbtron->changepar(7,value);
break;
case 342:
efx_Reverbtron->changepar(6,value);
break;
case 343:
efx_Reverbtron->changepar(10,value);
break;
case 344:
efx_Reverbtron->changepar(3,20 + (int)((float)value*11.653543f));
break;
case 345:
efx_Reverbtron->changepar(9,value);
break;
case 346:
efx_Reverbtron->changepar(5,(int)((float)value*3.9370079f));
break;
case 347:
efx_Reverbtron->changepar(1,value);
break;
case 348:
efx_Echotron->changepar(0,value);
break;
case 349:
efx_Echotron->changepar(11,value);
break;
case 350:
efx_Echotron->changepar(5,ret_Tempo(value));
break;
case 351:
efx_Echotron->changepar(6,value);
break;
case 352:
efx_Echotron->changepar(10,value);
break;
case 353:
efx_Echotron->changepar(7,value);
break;
case 354:
efx_Echotron->changepar(2,value);
break;
case 355:
efx_Echotron->changepar(1,value);
break;
case 356:
efx_Echotron->changepar(9,value);
break;
case 357:
efx_Echotron->changepar(3,1+ (int)((float)value*.99212598f));
break;
case 358:
efx_StereoHarm->changepar(0,value);
break;
case 359:
efx_StereoHarm->changepar(2,-12+(int)((float)value*.18897638f));
break;
case 360:
efx_StereoHarm->changepar(3,-2000+(int)((float)value*31.496063f));
break;
case 361:
efx_StereoHarm->changepar(1,value);
break;
case 362:
efx_StereoHarm->changepar(5,-12+(int)((float)value*.18897638f));
break;
case 363:
efx_StereoHarm->changepar(6,-2000+(int)((float)value*31.496063f));
break;
case 364:
efx_StereoHarm->changepar(4,value);
break;
case 365:
efx_StereoHarm->changepar(11,value);
break;
case 366:
efx_StereoHarm->changepar(8,(int)((float)value*.18110236f));
break;
case 367:
efx_StereoHarm->changepar(9,(int)((float)value*.25984252f));
break;
case 368:
efx_CompBand->changepar(0,value);
break;
case 369:
efx_CompBand->changepar(12,value);
break;
case 370:
efx_CompBand->changepar(1,2+(int)((float)value*.31496063f));
break;
case 371:
efx_CompBand->changepar(2,2+(int)((float)value*.31496063f));
break;
case 372:
efx_CompBand->changepar(3,2+(int)((float)value*.31496063f));
break;
case 373:
efx_CompBand->changepar(4,2+(int)((float)value*.31496063f));
break;
case 374:
efx_CompBand->changepar(5,-70+(int)((float)value*.74015748f));
break;
case 375:
efx_CompBand->changepar(6,-70+(int)((float)value*.74015748f));
break;
case 376:
efx_CompBand->changepar(7,-70+(int)((float)value*.74015748f));
break;
case 377:
efx_CompBand->changepar(8,-70+(int)((float)value*.74015748f));
break;
case 378:
efx_CompBand->changepar(9,20+(int)((float)value*7.71653f));
break;
case 379:
efx_CompBand->changepar(10,1000+(int)((float)value*55.11811f));
break;
case 380:
efx_CompBand->changepar(11,2000+(int)((float)value*188.97638f));
break;
case 381:
efx_Opticaltrem->changepar(0,value);
break;
case 382:
efx_Opticaltrem->changepar(1,ret_Tempo(value));
break;
case 383:
efx_Opticaltrem->changepar(2,value);
break;
case 384:
efx_Opticaltrem->changepar(4,value);
break;
case 385:
efx_Opticaltrem->changepar(5,value);
break;
case 386:
efx_Vibe->changepar(6,value);
break;
case 387:
efx_Vibe->changepar(0,value);
break;
case 388:
efx_Vibe->changepar(8,value);
break;
case 389:
efx_Vibe->changepar(1,ret_Tempo(value));
break;
case 390:
efx_Vibe->changepar(2,value);
break;
case 391:
efx_Vibe->changepar(4,value);
break;
case 392:
efx_Vibe->changepar(7,value);
break;
case 393:
efx_Vibe->changepar(9,value);
break;
case 394:
efx_Vibe->changepar(5,value);
break;
case 395:
efx_Infinity->changepar(0,value);
break;
case 396:
efx_Infinity->changepar(9,-1000+(int)((float)value*15.748031f));
break;
case 397:
efx_Infinity->changepar(15,value);
break;
case 398:
efx_Infinity->changepar(13,value);
break;
case 399:
efx_Infinity->changepar(10,value);
break;
case 400:
efx_Infinity->changepar(11,value);
break;
case 401:
efx_Infinity->changepar(12,ret_Tempo(value));
break;
case 402:
efx_Infinity->changepar(14,-16+(int)((float)value*.2518685f));
break;
}
}
int
RKR::ret_Tempo(int value)
{
return( 1+(int)((float)value*4.724f));
}
int
RKR::ret_LPF(int value)
{
return( 20+(int)((float)value*204.566f));
}
int
RKR::ret_HPF(int value)
{
return( 20+(int)((float)value*157.322f));
}