110
float antialias = 0.0;
113
int dcTimeout = 500000;
114
int sampleRate = 44100;
115
int sampleCount = 256;
117
int activeSense = 2000;
118
int activeSensePeriod = 15000;
119
int bwflags = BRIGHTON_POST_WINDOW;
120
int rlflags = BRIGHTON_SET_RAISE|BRIGHTON_SET_LOWER;
121
int nrpcc = BRIGHTON_NRP_COUNT;
101
static int readMe = 0;
103
static int opacity = 60;
106
static int azoom = 0;
107
static int quality = 6;
108
static int deswidth = -1;
109
static float scale = 1.0;
110
static float antialias = 0.0;
111
static int aliastype = 0;
112
static int library = 1;
113
static int dcTimeout = 500000;
114
static int sampleRate = 44100;
115
static int sampleCount = 256;
116
static int mwt = 50000;
117
static int activeSense = 2000;
118
static int activeSensePeriod = 15000;
119
static int bwflags = BRIGHTON_POST_WINDOW;
120
static int rlflags = BRIGHTON_SET_RAISE|BRIGHTON_SET_LOWER;
121
static int nrpcc = BRIGHTON_NRP_COUNT;
123
static int cli_fd[2];
125
static char *BRISTOL_DEF_HOST = "localhost";
125
static char defaultcdev[16];
127
127
extern int vuInterval;
128
128
void printBrightonHelp(int);
167
for (i = 0 ; i < BRISTOL_SYNTHCOUNT; i++)
169
if ((synthesisers[i] != NULL)
170
&& (synthesisers[i]->name != NULL)
171
&& (synthesisers[i]->name[0] != '\0'))
172
printf("%s ", synthesisers[i]->name);
163
178
brightonFindEmulation(int argc, char **argv)
165
180
int argCount, i, found = -1;
174
189
if (synthesisers[i] == NULL)
192
/* Check for a few aliases */
193
if (strcmp("-2600", argv[argCount]) == 0)
194
found = global.synths->synthtype = BRISTOL_2600;
195
if (strcmp("-mg1", argv[argCount]) == 0)
196
found = global.synths->synthtype = BRISTOL_REALISTIC;
197
if (strcmp("-bme700", argv[argCount]) == 0)
198
found = global.synths->synthtype = BRISTOL_BME700;
199
if (strcmp("-pro10", argv[argCount]) == 0)
200
found = global.synths->synthtype = BRISTOL_PROPHET10;
201
if (strcmp("-pro52", argv[argCount]) == 0)
202
found = global.synths->synthtype = BRISTOL_PRO52;
203
if ((strcmp("-poly6", argv[argCount]) == 0)
204
|| (strcmp("-polysix", argv[argCount]) == 0))
205
found = global.synths->synthtype = BRISTOL_POLY6;
206
if ((strcmp("-memmoog", argv[argCount]) == 0)
207
|| (strcmp("-memorymoog", argv[argCount]) == 0))
208
found = global.synths->synthtype = BRISTOL_MEMMOOG;
177
210
if ((strcmp("-emulate", argv[argCount]) == 0)
178
211
&& (argCount < (argc - 1)))
197
230
printf("%s emulation defaults:\n", synthesisers[i]->name);
199
232
printf("emulation defaults:\n");
201
if ((global.synths->voices = synthesisers[i]->emulate.voices)
235
if ((global.synths->voices = synthesisers[i]->emulate.voices) < 0)
204
237
printf(" -voices %i\n", BRISTOL_VOICECOUNT);
205
238
global.synths->voices = BRISTOL_VOICECOUNT;
245
278
int argCount = 1, i, j, logtype = BRISTOL_LOG_BRIGHTON;
246
279
pthread_t emgrThread, logthread;
247
280
char appname[65], *devname = defname;
281
int reqW = 0, reqH = 0, reqX = 0, reqY = 0;
249
283
signal(SIGINT, cleanupBristol);
250
284
signal(SIGPIPE, cleanupBristolQuietly);
273
307
global.synths->notepref = BRIGHTON_POLYPHONIC;
274
308
global.synths->notetrig = 0;
275
309
global.synths->win = NULL;
276
global.synths->flags = REQ_FORWARD|REQ_LOCAL_FORWARD|REQ_REMOTE_FORWARD;
310
global.synths->flags =
311
REQ_FORWARD|REQ_LOCAL_FORWARD|REQ_REMOTE_FORWARD|NO_LATCHING_KEYS;
277
312
global.port = 5028;
278
global.host = BRISTOL_DEF_HOST;
313
snprintf(defaultcdev, 16, "localhost");
314
global.host = defaultcdev;
280
316
memset(synthesisers, 0, sizeof(synthesisers));
390
if ((argc > 1) && (strcmp(argv[1], "--summary") == 0))
354
395
if ((argc > 1) && (strcmp(argv[1], "-summary") == 0))
356
printf("%s", summarytext);
397
printf("%s\n", summarytext);
533
if (((strcmp(argv[argCount], "-geometry") == 0)
534
|| (strcmp(argv[argCount], "-geom") == 0))
535
&& (argCount < argc))
544
* If we only have +-x+-y then don't apply w.h
545
* If we have H+x+y then use H as a width and use it to scale
546
* the image to a given bitmap. If we have W+H then automatically
551
* Start looking for width
553
while ((argv[argCount][i] != '-')
554
&& (argv[argCount][i] != '+')
555
&& (argv[argCount][i] != '\0')
556
&& (argv[argCount][i] != 'x'))
558
reqW = reqW * 10 + argv[argCount][i] - 48;
562
if (argv[argCount][i] == 'x')
565
/* Look for height */
566
while ((argv[argCount][i] != '-')
567
&& (argv[argCount][i] != '+')
568
&& (argv[argCount][i] != '\0')
569
&& (argv[argCount][i] != 'x'))
571
reqH = reqH * 10 + argv[argCount][i] - 48;
575
/* Take an X if it is available */
576
if (argv[argCount][i] != '\0')
577
reqX = atoi(&argv[argCount][i]);
578
if ((reqX == 0) && (argv[argCount][i] == '-'))
581
if ((yp = strchr(&argv[argCount][++i], '+')))
583
else if ((yp = strchr(&argv[argCount][++i], '-')))
585
if ((reqY == 0) && (argv[argCount][i] == '-'))
492
589
if (strcmp(argv[argCount], "-iconify") == 0)
493
590
bwflags &= ~BRIGHTON_POST_WINDOW;
794
891
/* Need to add in PitchWheel Depth (done), Find and Coarse tuning*/
893
if (strcmp(argv[argCount], "-neutral") == 0)
894
global.synths->location = -1;
796
896
if ((strcmp(argv[argCount], "-load") == 0) && (argCount < argc))
798
898
if (argCount < argc)
861
961
if ((strcmp(argv[argCount], "-voices") == 0) && (argCount < argc))
863
if (((global.synths->voices = atoi(argv[argCount + 1])) == 1)
963
if ((atoi(argv[argCount + 1]) > 0)
964
&& ((global.synths->voices = atoi(argv[argCount + 1])) == 1)
864
965
&& (global.synths->notepref == BRIGHTON_POLYPHONIC))
865
966
global.synths->notepref = BRIGHTON_HNP;
967
else if (atoi(argv[argCount + 1]) == 0)
968
global.synths->voices = BRISTOL_VOICECOUNT;
942
1045
global.synths->flags |= NO_KEYTRACK;
1048
if (strcmp(argv[argCount], "-keytoggle") == 0)
1049
global.synths->flags &= ~NO_LATCHING_KEYS;
946
1051
if (strcmp(argv[argCount], "-port") == 0)
953
1058
if (strcmp(argv[argCount], "-host") == 0)
954
global.host = argv[++argCount];
1059
snprintf(defaultcdev, 16, "%s", argv[++argCount]);
956
1061
if (strcmp(argv[argCount], "-window") == 0)
957
1062
synthesisers[global.synths->synthtype]->flags ^= BRIGHTON_WINDOW;
1459
if (strncmp("unix:", defaultcdev, 5) == 0)
1461
if (strlen(defaultcdev) == 5)
1462
snprintf(defaultcdev, 16, "unix:%i", global.port);
1464
global.port = atoi(&defaultcdev[5]);
1348
1467
#ifndef BRIGHTON_HAS_X11
1349
1468
/* Reverse the window logic */
1350
1469
synthesisers[global.synths->synthtype]->flags ^= BRIGHTON_WINDOW;
1474
/* Width is a scaler */
1477
scale = ((float) reqW) / synthesisers[global.synths->synthtype]->width;
1479
/* Have been given some width value */
1483
synthesisers[global.synths->synthtype]->width = reqW;
1484
synthesisers[global.synths->synthtype]->height = reqH;
1486
synthesisers[global.synths->synthtype]->width = reqW;
1487
synthesisers[global.synths->synthtype]->height *= scale;
1490
if ((scale > 1.1) || (scale < 0.9))
1354
1497
char statfile[1024];
1355
1498
struct stat statres;
1462
1605
synthesisers[global.synths->synthtype]->name = appname;
1463
1606
if ((global.synths->win =
1464
1607
brightonInterface(synthesisers[global.synths->synthtype],
1465
quality, library, aliastype, antialias, gs)) == NULL)
1608
quality, library, aliastype, antialias, gs, reqX, reqY)) == NULL)
1467
1610
printf("could not create window\n");
1570
1713
brightonReadConfiguration(global.synths->win,
1571
1714
synthesisers[global.synths->synthtype],
1572
1715
global.synths->midichannel,
1573
synthesisers[global.synths->synthtype]->name);
1716
synthesisers[global.synths->synthtype]->name,
1575
1719
if (bristolMidiSendMsg(global.controlfd, global.synths->sid,
1576
1720
BRISTOL_ACTIVE_SENSE, 0, activeSense == 0? 0:16383) != 0)