115
138
#define NON_DEF_DETUNE 100
140
static int asc, emStart = 0, midiHandle = -1;
142
volatile sig_atomic_t ladiRequest = 0;
147
if (global.synths->flags & LADI_ENABLE && global.synths->ladimode)
156
if (global.synths->flags & LADI_ENABLE && global.synths->ladimode)
163
brightonFindEmulation(int argc, char **argv)
165
int argCount, i, found = -1;
167
for (argCount = 1; argCount < argc; argCount++)
169
if (argv[argCount][0] != '-')
172
for (i = 0 ; i < BRISTOL_SYNTHCOUNT; i++)
174
if (synthesisers[i] == NULL)
177
if (strcmp(synthesisers[i]->name, &argv[argCount][1]) == 0)
178
found = global.synths->synthtype = i;
183
* Global.synths->synthtype will now either be the last emulator found or
184
* will be the usual default (b3). Stuff this back into i, that is nicely
185
* confusing but makes the lines shorter. Hm.
187
i = global.synths->synthtype;
190
printf("%s emulation defaults:\n", synthesisers[i]->name);
192
printf("emulation defaults:\n");
194
if ((global.synths->voices = synthesisers[i]->emulate.voices)
197
printf(" -voices %i\n", BRISTOL_VOICECOUNT);
198
global.synths->voices = BRISTOL_VOICECOUNT;
200
printf(" -voices %i\n",synthesisers[i]->emulate.voices);
201
if (global.synths->voices == 1)
203
printf(" -retrig\n");
207
global.synths->lwf = 2;
208
global.synths->legatovelocity = 1;
209
global.synths->notepref = BRIGHTON_HNP;
210
global.synths->notetrig = 1;
212
if (i == BRISTOL_2600)
213
printf(" -multi 4\n");
214
printf(" -detune %i\n", synthesisers[i]->emulate.detune);
215
printf(" -gain %i\n", synthesisers[i]->emulate.gain);
216
printf(" -pwd %i\n", synthesisers[i]->emulate.pwd);
217
printf(" -glide %i\n", synthesisers[i]->emulate.glide);
218
printf(" -curve %i\n", synthesisers[i]->emulate.velocity);
220
global.synths->detune = synthesisers[i]->emulate.detune;
221
global.synths->gain = synthesisers[i]->emulate.gain * 16;
222
global.synths->pwd = synthesisers[i]->emulate.pwd;
223
global.synths->glide = synthesisers[i]->emulate.glide;
224
global.synths->velocity = synthesisers[i]->emulate.velocity;
225
if (synthesisers[i]->emulate.opacity != 0)
226
printf(" -opacity %i\n",
227
opacity = synthesisers[i]->emulate.opacity);
118
231
* Need to make this multithreaded?
121
234
main(int argc, char **argv)
123
int argCount = 1, midiHandle = -1, cFD = -1, midiFD = -1, i, j, asc = 0;
236
int argCount = 1, i, j, logtype = BRISTOL_LOG_BRIGHTON;
237
pthread_t emgrThread, logthread;
238
char appname[65], *devname = defname;
127
240
signal(SIGINT, cleanupBristol);
128
241
signal(SIGPIPE, cleanupBristolQuietly);
129
242
signal(SIGHUP, cleanupBristol);
243
signal(SIGUSR1, savehandler);
244
signal(SIGUSR2, loadhandler);
131
246
global.home = getenv("BRISTOL");
203
351
printf("You probably prefer to use the startBristol script.\n");
207
printf("bristol version %s\n", VERSION);
356
&& ((strcmp(argv[argCount], "--help") == 0)
357
|| (strcmp(argv[argCount], "-help") == 0)
358
|| (strcmp(argv[argCount], "-h") == 0)
359
|| (strcmp(argv[argCount], "--h") == 0)))
362
if (BRISTOL_BUILD == 0)
363
printf("bristol %i.%i.%i: ",
364
BRISTOL_MAJOR, BRISTOL_MINOR, BRISTOL_PATCH);
366
printf("bristol %i.%i.%i-%i: ",
367
BRISTOL_MAJOR, BRISTOL_MINOR, BRISTOL_PATCH, BRISTOL_BUILD);
369
printf("bristol %s\n", VERSION);
371
printf("%s", helptext);
376
printf("%s", gplnotice);
378
global.synths->location = 0;
380
if ((getenv("BRISTOL_LOG_CONSOLE") != NULL)
381
&& (strcmp(getenv("BRISTOL_LOG_CONSOLE"), "true") == 0))
382
logtype = BRISTOL_LOG_CONSOLE;
384
cli_fd[0] = 0;//dup(0);
385
cli_fd[1] = 1;//dup(1);
387
logthread = bristolOpenStdio(logtype);
389
/* Set up a default SYSEX ID, may get changed later */
390
bristolMidiOption(0, BRISTOL_NRP_SYSID_H, 0x534C);
391
bristolMidiOption(0, BRISTOL_NRP_SYSID_L, 0x6162);
393
brightonFindEmulation(argc, argv);
210
396
* close our standard input, create a pipe which will never be used.
212
398
while (argc > argCount)
214
if ((strcmp(argv[argCount], "--help") == 0)
215
|| (strcmp(argv[argCount], "-help") == 0)
216
|| (strcmp(argv[argCount], "-h") == 0)
217
|| (strcmp(argv[argCount], "--h") == 0))
220
if (BRISTOL_BUILD == 0)
221
printf("bristol %i.%i.%i: ",
222
BRISTOL_MAJOR, BRISTOL_MINOR, BRISTOL_PATCH);
224
printf("bristol %i.%i.%i-%i: ",
225
BRISTOL_MAJOR, BRISTOL_MINOR, BRISTOL_PATCH, BRISTOL_BUILD);
227
printf("bristol %s\n", VERSION);
229
printf("%s", helptext);
400
if (strcmp(argv[argCount], "-log") == 0)
401
bristolOpenStdio(BRISTOL_LOG_DAEMON);
403
if (strcmp(argv[argCount], "-syslog") == 0)
404
bristolOpenStdio(BRISTOL_LOG_SYSLOG);
233
406
if ((strcmp(argv[argCount], "-V") == 0)
234
407
&& (strlen(argv[argCount]) == 2))
236
409
#ifdef BRISTOL_BUILD
237
410
if (BRISTOL_BUILD == 0)
238
printf("bristol version %i.%i.%i\n",
411
printf("brighton version %i.%i.%i\n",
239
412
BRISTOL_MAJOR, BRISTOL_MINOR, BRISTOL_PATCH);
241
printf("bristol version %i.%i.%i-%i\n",
414
printf("brighton version %i.%i.%i-%i\n",
242
415
BRISTOL_MAJOR, BRISTOL_MINOR, BRISTOL_PATCH, BRISTOL_BUILD);
544
if ((strcmp(argv[argCount], "-jsmuuid") == 0) && (argCount < argc))
546
global.synths->ladimem += atoi(argv[argCount + 1]);
552
* LADI level 1 options:
554
if ((strcmp(argv[argCount], "-ladi") == 0) && (argCount < argc))
556
global.synths->flags |= LADI_ENABLE;
558
if (strcmp(argv[argCount + 1], "both") == 0)
559
global.synths->ladimode = 1;
560
else if (strcmp(argv[argCount + 1], "bristol") == 0)
561
global.synths->ladimode = 0;
562
else if (strcmp(argv[argCount + 1], "brighton") == 0)
563
global.synths->ladimode = 1;
565
if ((global.synths->ladimem = atoi(argv[argCount + 1])) <= 0)
567
global.synths->ladimem = 1024;
568
global.synths->ladiStateFile = argv[argCount + 1];
573
* We also need to force the startup to open this memory location
574
* as well, that can get overridden if there is a -load option
575
* anywhere later on the command line.
577
global.synths->location = global.synths->ladimem;
579
global.synths->mbi = (global.synths->location / 1000) * 1000;
580
global.synths->location = global.synths->location % 1000;
586
if ((strcmp(argv[argCount], "-audiodev") == 0) && (argCount < argc))
589
devname = argv[argCount];
592
if ((strcmp(argv[argCount], "-lowkey") == 0) && (argCount < argc))
595
global.synths->lowkey = atoi(argv[argCount]);
598
if ((strcmp(argv[argCount], "-highkey") == 0) && (argCount < argc))
601
global.synths->highkey = atoi(argv[argCount]);
364
604
if (strcmp(argv[argCount], "-rate") == 0)
366
606
if ((sampleRate = atoi(argv[argCount + 1])) <= 0)
516
775
if (argCount < argc)
517
776
global.synths->location = atoi(argv[argCount + 1]);
518
if (global.synths->location > 999)
778
global.synths->mbi = (global.synths->location / 1000) * 1000;
779
global.synths->location = global.synths->location % 1000;
784
/* SYSEX System ID */
785
if ((strcmp(argv[argCount], "-sysid") == 0) && (argCount < argc))
787
unsigned int sysid = 0x534C6162, o = argCount + 1;
790
* We will get 0x534C6162 for example
792
if ((argv[o][0] == '0') || (argv[o][1] == 'x')
793
|| (strlen(argv[o]) == 10))
520
global.synths->mbi = (global.synths->location / 1000) * 1000;
521
global.synths->location = global.synths->location % 1000;
795
sscanf(argv[o], "0x%x", &sysid);
797
bristolMidiOption(0, BRISTOL_NRP_SYSID_H, sysid >> 16);
798
bristolMidiOption(0, BRISTOL_NRP_SYSID_L, sysid & 0x0000ffff);
799
printf("fixing sysex system id at 0x%x\n", sysid);
803
if ((strcmp(argv[argCount], "-nrpcc") == 0) && (argCount < argc))
805
nrpcc = atoi(argv[argCount + 1]);
806
printf("Reserving %i NRP controllers\n", nrpcc);
568
863
|| (strcmp(argv[argCount], "-mididbg1") == 0))
569
864
global.synths->flags |= REQ_MIDI_DEBUG;
571
if ((strcmp(argv[argCount], "-midinrp") == 0)
572
|| (strcmp(argv[argCount], "-nrp") == 0))
866
if (strcmp(argv[argCount], "-debug") == 0)
868
if ((argCount < argc) && (argv[argCount + 1][0] != '-'))
872
if ((i = atoi(argv[argCount + 1])) > 15)
873
global.synths->flags |= REQ_DEBUG_MASK;
875
global.synths->flags &= ~REQ_DEBUG_MASK;
876
global.synths->flags |= (i << 12);
880
* If we only have -debug and no value then increment the debug
883
global.synths->flags = (global.synths->flags & ~REQ_DEBUG_MASK)
884
| (((global.synths->flags & REQ_DEBUG_MASK) + REQ_DEBUG_1)
888
if (global.synths->flags & REQ_DEBUG_MASK)
889
printf("debuging level set to %i\n",
890
(global.synths->flags&REQ_DEBUG_MASK)>>12);
893
if (strcmp(argv[argCount], "-gnrp") == 0)
894
global.synths->flags |= GUI_NRP;
895
if (strcmp(argv[argCount], "-enrp") == 0)
573
896
global.synths->flags |= MIDI_NRP;
897
if (strcmp(argv[argCount], "-nrp") == 0)
898
global.synths->flags |= MIDI_NRP|GUI_NRP;
575
900
if ((strcmp(argv[argCount], "-channel") == 0) && (argCount < argc))
607
929
if (strcmp(argv[argCount], "-host") == 0)
608
930
global.host = argv[++argCount];
932
if (strcmp(argv[argCount], "-window") == 0)
933
synthesisers[global.synths->synthtype]->flags ^= BRIGHTON_WINDOW;
935
if (strcmp(argv[argCount], "-cli") == 0)
938
brightonCLIinit(&global, cli_fd);
939
//synthesisers[global.synths->synthtype]->flags ^= BRIGHTON_WINDOW;
942
if (strcmp(argv[argCount], "-nwf") == 0)
943
global.synths->lwf = 0;
610
944
if (strcmp(argv[argCount], "-lwf") == 0)
611
945
global.synths->lwf = 1;
946
if (strcmp(argv[argCount], "-lwf2") == 0)
947
global.synths->lwf = 2;
948
if (strcmp(argv[argCount], "-wwf") == 0)
949
global.synths->lwf = 2;
950
if (strcmp(argv[argCount], "-hwf") == 0)
951
global.synths->lwf = 3;
613
953
if (strcmp(argv[argCount], "-lnp") == 0)
614
global.synths->notepref = 1;
954
global.synths->notepref = BRIGHTON_LNP;
615
955
if (strcmp(argv[argCount], "-hnp") == 0)
616
global.synths->notepref = 2;
956
global.synths->notepref = BRIGHTON_HNP;
617
957
if (strcmp(argv[argCount], "-nnp") == 0)
618
global.synths->notepref = 0;
958
global.synths->notepref = BRIGHTON_POLYPHONIC;
619
959
if (strcmp(argv[argCount], "-retrig") == 0)
620
global.synths->notetrig = 1;
960
global.synths->notetrig = 1 - global.synths->notetrig;
621
961
if (strcmp(argv[argCount], "-lvel") == 0)
622
global.synths->legatovelocity = 1;
962
global.synths->legatovelocity = 1 - global.synths->legatovelocity;
625
965
* And finally all the different synths
1325
char statfile[1024];
1326
struct stat statres;
1328
sprintf(statfile, "%s/%s.gz", getenv("BRISTOL"),
1329
synthesisers[global.synths->synthtype]->resources[0].image);
1331
if ((synthesisers[global.synths->synthtype]->resources[0].image != 0) &&
1332
(stat(statfile, &statres) != 0))
1334
sprintf(statfile, "%s/%s", getenv("BRISTOL"),
1335
synthesisers[global.synths->synthtype]->resources[0].image);
1337
if (stat(statfile, &statres) != 0)
1339
printf("unknown emulator\n");
1347
printBrightonHelp(global.synths->synthtype);
1351
printf("brighton version %s\n", VERSION);
1355
printf(" %s", argv[0]);
1356
for (i = 1; i < argc; i++) {
1357
if (argv[i][0] == '-')
1358
printf("\n %s", argv[i]);
1360
printf(" %s", argv[i]);
983
* Hm, this is a joke really. The Tandy, Realistic, whatever is an old
984
* synth, and this mimics random slider changes. Should not really do it
985
* but its fun. The original used to lose its white caps.
986
* Once the gui is created its more work to change the image.
1365
* Hm, this is a joke really. The Tandy, Realistic, whatever, is an old
1366
* synth and this mimics random slider changes. Should not really do it
1367
* but its fun: the original used to lose its white caps. Once the gui is
1368
* created its more work to change the image.
988
1370
if (global.synths->synthtype == BRISTOL_REALISTIC)
1012
1394
global.synths->resources = synthesisers[global.synths->synthtype];
1013
1396
synthesisers[global.synths->synthtype]->width *= scale;
1014
1397
synthesisers[global.synths->synthtype]->height *= scale;
1400
* Finally go and let the event manager handle our interface. Going to
1401
* create a separate GUI thread, which will allow us to handle things like
1402
* MIDI events from the engine, timed operations, etc, from there.
1404
if (pthread_create(&emgrThread, NULL, eventMgr, &global) != 0)
1405
printf("Could not create GUI thread\n");
1408
* We should not detach the thread, we should wait for it later before exit
1409
if (pthread_detach(thread) != 0)
1410
printf("Could not detach GUI thread\n");
1017
1414
* win is actually set by the configuration routines, but we use it
1018
1415
* here anyway. The configuration options are a structure, they were a
1019
1416
* list of parameters however that became unwieldy.
1418
if ((global.synths->flags & REQ_DEBUG_MASK) >= (REQ_DEBUG_4|REQ_DEBUG_1))
1419
aliastype |= BRIGHTON_LIB_DEBUG;
1420
synthesisers[global.synths->synthtype]->flags |= bwflags;
1423
* We play around with the names here so that the window title gets filled
1424
* with more information than just the emulator name. This enhancement was
1425
* added for JSM but could be any Jack installation. If multiple instances
1426
* of the same emulator are started then it is not clear which is which:
1427
* both have the same title bar but different names in Jack. What we do here
1428
* is add the Jack registration name to the title bar.
1430
snprintf(appname, 64, "%s (%s)",
1431
synthesisers[global.synths->synthtype]->name, devname);
1432
devname = synthesisers[global.synths->synthtype]->name;
1433
synthesisers[global.synths->synthtype]->name = appname;
1021
1434
global.synths->win =
1022
1435
brightonInterface(synthesisers[global.synths->synthtype],
1023
1436
quality, library, aliastype, antialias, gs);
1437
synthesisers[global.synths->synthtype]->name = devname;
1438
global.synths->resources->name = devname;
1441
* We now need to decide which memory to load. There are a few choices.
1442
* If we had a LADI declaration it will have been copied to both ladimem
1443
* and to the emulator memory. If they are still the same then use it.
1445
* If the emulator location has change then we should look and see if the
1446
* LADI memory actually exists, if so, use it (overwrite the emulator
1447
* memory location again). If it does not exist we will then continue to
1448
* access the emulator memory and it becomes the template for the eventual
1449
* LADI state information.
1451
if ((global.synths->flags & LADI_ENABLE) &&
1452
(global.synths->ladimem
1453
!= (global.synths->location + global.synths->mbi)))
1455
int memHold = global.synths->location + global.synths->mbi;
1457
global.synths->mbi = 0;
1458
global.synths->location = global.synths->ladimem;
1460
/* Location has changed. Stat the ladimem */
1461
if (loadMemory(global.synths, global.synths->resources->name, 0,
1462
global.synths->ladimem,
1463
global.synths->mem.active, 0, BRISTOL_STAT) < 0)
1466
global.synths->location = memHold;
1468
global.synths->mbi = (global.synths->location / 1000) * 1000;
1469
global.synths->location = global.synths->location % 1000;
1471
printf("did not find LADI memory %i, using %i\n",
1472
global.synths->ladimem, memHold);
1474
printf("using LADI state memory %i\n", global.synths->ladimem);
1477
if (global.flags & REQ_EXIT)
1479
printf("early termination logging thread (%i)\n", global.controlfd);
1481
bristolOpenStdio(BRISTOL_LOG_TERMINATE);
1483
if ((logthread != 0) && (pthread_join(logthread, NULL) != 0))
1486
exit(global.controlfd < 0? 1: 0);
1025
1489
global.synths->win->dcTimeout = dcTimeout;
1491
global.synths->win->flags |= rlflags;
1494
global.synths->win->flags |= BRIGHTON_AUTOZOOM;
1496
if (deswidth >= 100)
1498
global.synths->win->minw = deswidth;
1499
global.synths->win->minh =
1500
deswidth * global.synths->win->template->height
1501
/ global.synths->win->template->width;
1502
global.synths->win->maxw =
1503
synthesisers[global.synths->synthtype]->width * scale;
1504
global.synths->win->maxh =
1505
synthesisers[global.synths->synthtype]->height * scale;
1507
global.synths->win->minw
1508
= global.synths->win->maxw
1509
= global.synths->win->minh
1510
= global.synths->win->maxh = 0;
1028
1514
global.synths->win->flags |= BRIGHTON_NO_ASPECT;
1031
* Finally go and let the event manager handle our interface. Going to
1032
* create a separate GUI thread, which will allow us to handle things like
1033
* MIDI events from the engine, timed operations, etc, from there.
1035
if (pthread_create(&thread, NULL, eventMgr, NULL) != 0)
1036
printf("Could not create GUI thread\n");
1037
if (pthread_detach(thread) != 0)
1038
printf("Could not detach GUI thread\n");
1040
1516
brightonOpacity(global.synths->win, ((float) opacity) / 100.0f);
1053
1529
printf("user r %i/%i, e %i/%i\n", getuid(), getgid(), geteuid(), getegid());
1531
global.synths->win->nrpcount = nrpcc;
1532
global.synths->win->nrpcontrol =
1533
malloc(sizeof(brightonNRPcontrol) * nrpcc);
1534
memset(global.synths->win->nrpcontrol, 0,
1535
sizeof(brightonNRPcontrol) * nrpcc);
1537
brightonReadConfiguration(global.synths->win,
1538
synthesisers[global.synths->synthtype],
1539
global.synths->midichannel,
1540
synthesisers[global.synths->synthtype]->name);
1542
if (bristolMidiSendMsg(global.controlfd, global.synths->sid,
1543
BRISTOL_ACTIVE_SENSE, 0, activeSense == 0? 0:16383) != 0)
1545
printf("Active sense transmit failure\n");
1548
} if (global.synths->flags & REQ_MIDI_DEBUG)
1549
printf("Sent Active sense\n");
1551
if ((global.synths->sid2 > 0) &&
1552
(bristolMidiSendMsg(global.manualfd, global.synths->sid2,
1553
BRISTOL_ACTIVE_SENSE, 0, activeSense == 0? 0:16383) != 0))
1555
printf("Active sense transmit failure\n");
1558
} if (global.synths->flags & REQ_MIDI_DEBUG)
1559
printf("Sent Active sense on second channel\n");
1563
if (global.libtest != 1)
1565
if (global.synths->flags & REQ_FORWARD)
1566
bristolMidiOption(0, BRISTOL_NRP_FORWARD, 1);
1568
if (global.synths->flags & NO_KEYTRACK)
1569
bristolMidiOption(0, BRISTOL_NRP_MIDI_GO, 0);
1571
bristolMidiOption(0, BRISTOL_NRP_MIDI_GO, 1);
1574
* The Hammond needs a note event on the upper manual to kick the
1575
* gearbox into action.
1577
if (global.synths->synthtype == BRISTOL_HAMMONDB3)
1580
bristolMidiSendMsg(global.controlfd, global.synths->midichannel,
1581
BRISTOL_EVENT_KEYON, 0, 10 + global.synths->transpose);
1583
bristolMidiSendMsg(global.controlfd, global.synths->midichannel,
1584
BRISTOL_EVENT_KEYOFF, 0, 10 + global.synths->transpose);
1588
/* if we are CLI, somebody needs to force this to happen */
1589
if (synthesisers[global.synths->synthtype]->flags & BRIGHTON_WINDOW)
1590
brightonWorldChanged(global.synths->win, 500, 500);
1600
while (~global.flags & REQ_EXIT)
1603
* Do whatever we want. Will turn into a wait routine on the MIDI
1604
* channel. This could be merged with the UI heartbeat code.
1607
if (brightonCLIcheck(&global) < 0)
1611
* This was never operational anyway:
1612
if (vuInterval != 0) {
1614
if (global.synths->flags & OPERATIONAL)
1616
} else if (cli == 0)
1622
if (pthread_join(emgrThread, NULL) != 0)
1623
printf("brighton event thread exit error\n");
1625
printf("brighton event thread exited\n");
1627
/* Now that the event manager thread has exit, put key repeat back on */
1628
BAutoRepeat(global.synths->win->display, 1);
1630
printf("terminating logging thread (%i)\n", global.controlfd);
1632
if (global.libtest == 0)
1635
bristolOpenStdio(BRISTOL_LOG_TERMINATE);
1637
if ((logthread != 0) && (pthread_join(logthread, NULL) != 0))
1640
exit(global.controlfd < 0? 1: 0);
1650
/* This will send activesense as soon as the interface initialises */
1651
asc = activeSense * 4;
1653
printf("starting event management thread\n");
1056
1656
* Here we should open an ALSA SEQ interface. We want to get an index back
1057
1657
* and pass that to the event handler for selection. This should not really
1058
1658
* be a SEQ interface, it should depend on the flags given to the GUI.
1060
if (global.libtest != 1)
1660
if (gmc && (global.libtest != 1))
1062
1662
if ((midiHandle = bristolMidiOpen("brighton",
1063
BRISTOL_CONN_SEQ|BRISTOL_DUPLEX,
1064
-1, BRISTOL_REQ_NSX, brightonMidiInput, &global)) < 0)
1663
BRISTOL_CONN_SEQ|BRISTOL_RDONLY,
1664
-1, -1, brightonMidiInput, &global)) < 0)
1065
1665
printf("Error opening midi device %s\n", "0.0");
1067
midiFD = bristolGetMidiFD(midiHandle);
1068
// cFD = bristolMidiDupFD(global.controlfd, BRISTOL_REQ_NSX,
1069
// brightonMidiInput, &global);
1070
// cFD = bristolGetMidiFD(cFD);
1072
printf("opened GUI midi handles: %i, %i\n", midiFD, cFD);
1075
brightonReadConfiguration(global.synths->win,
1076
synthesisers[global.synths->synthtype],
1077
global.synths->midichannel,
1078
synthesisers[global.synths->synthtype]->name);
1081
i = brightonEventMgr();
1668
while (global.synths->win == NULL)
1671
printf("waiting for window creation\n");
1674
midiFD = bristolGetMidiFD(midiHandle);
1675
cFD = bristolGetMidiFD(global.controlfd);
1677
printf("opened GUI midi handles: %i, %i\n", midiFD, cFD);
1680
if (global.libtest != 1)
1682
if (global.synths->flags & REQ_FORWARD)
1683
bristolMidiOption(0, BRISTOL_NRP_FORWARD, 1);
1685
if (global.synths->flags & NO_KEYTRACK)
1686
bristolMidiOption(0, BRISTOL_NRP_MIDI_GO, 0);
1688
bristolMidiOption(0, BRISTOL_NRP_MIDI_GO, 1);
1690
bristolMidiSendMsg(global.controlfd, global.synths->midichannel,
1691
BRISTOL_EVENT_KEYON, 0, 10 + global.synths->transpose);
1692
bristolMidiSendMsg(global.controlfd, global.synths->midichannel,
1693
BRISTOL_EVENT_KEYOFF, 0, 10 + global.synths->transpose);
1697
while ((global.flags & REQ_EXIT) == 0) {
1699
i = brightonEventMgr();
1084
1704
* This will now become a select on the ALSA SEQ socket looking for
1145
1791
BRISTOL_ACTIVE_SENSE, 0, activeSensePeriod) != 0)
1147
1793
printf("Active sense transmit failure\n");
1150
1797
if ((global.synths->sid2 > 0) &&
1151
(bristolMidiSendMsg(global.controlfd, global.synths->sid2,
1798
(bristolMidiSendMsg(global.manualfd, global.synths->sid2,
1152
1799
BRISTOL_ACTIVE_SENSE, 0, activeSensePeriod) != 0))
1154
1801
printf("Active sense transmit failure\n");
1806
if ((ladiRequest == 1) && global.synths->flags & LADI_ENABLE) {
1807
int memHold = global.synths->cmem;
1811
printf("LADI save state signalled\n");
1813
global.synths->cmem = global.synths->ladimem;
1814
brightonControlKeyInput(global.synths->win, 's', 0);
1816
global.synths->cmem = memHold;
1819
if ((ladiRequest == 2) && global.synths->flags & LADI_ENABLE) {
1820
int memHold = global.synths->cmem;
1824
printf("LADI load state signalled\n");
1826
global.synths->cmem = global.synths->ladimem;
1827
brightonControlKeyInput(global.synths->win, 'l', 0);
1829
global.synths->cmem = memHold;
1159
1833
* We are going to piggyback the slow event timer onto this code.
1160
1834
* It means the slow events will be related to the activeSensing