source: buchla-68k/ram/instdsp.c@ 33b5477

Last change on this file since 33b5477 was 33b5477, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Fixed argument order.

  • Property mode set to 100644
File size: 21.4 KB
Line 
1/*
2 =============================================================================
3 instdsp.c -- instrument definition display driver and support functions
4 Version 181 -- 1988-10-06 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#define D_EXECKI 0 /* debug execins() */
9
10#include "ram.h"
11
12#define LSPCH 2 /* pitch source scale factor */
13#define MAXRAND (0x00FFFFFFL) /* largest random number */
14
15int16_t idbox[][8] = { /* display box parameters */
16
17 { 1, 1, 84, 26, CFBX00, CBBX00, 0, 1}, /* 0: Freq 1 */
18 { 86, 1, 169, 26, CFBX01, CBBX01, 0, 11}, /* 1: Freq 2 */
19 {171, 1, 254, 26, CFBX02, CBBX02, 0, 22}, /* 2: Freq 3 */
20 {256, 1, 339, 26, CFBX03, CBBX03, 0, 33}, /* 3: Freq 4 */
21 {341, 1, 424, 26, CFBX04, CBBX04, 0, 44}, /* 4: Filter / Resonance */
22 {426, 1, 509, 26, CFBX05, CBBX05, 0, 54}, /* 5: Location */
23
24 { 1, 29, 84, 54, CFBX06, CBBX06, 2, 1}, /* 6: Index 1 */
25 { 86, 29, 169, 54, CFBX07, CBBX07, 2, 11}, /* 7: Index 2 */
26 {171, 29, 254, 54, CFBX08, CBBX08, 2, 22}, /* 8: Index 3 */
27 {256, 29, 339, 54, CFBX09, CBBX09, 2, 33}, /* 9: Index 4 */
28 {341, 29, 424, 54, CFBX10, CBBX10, 2, 44}, /* 10: Index 5 */
29 {426, 29, 509, 54, CFBX11, CBBX11, 2, 54}, /* 11: Index 6 */
30
31 { 1, 56, 509, 208, CFBX12, CBBX12, 4, 54}, /* 12: Level */
32
33 { 1, 210, 110, 236, CFBX13, CBBX13, 15, 1}, /* 13: Source- Mlt */
34 {112, 210, 142, 236, CFBX14, CBBX14, 15, 15}, /* 14: Pt */
35 {144, 210, 206, 236, CFBX15, CBBX15, 15, 19}, /* 15: Time */
36 {208, 210, 366, 236, CFBX16, CBBX16, 15, 27}, /* 16: Value */
37 {368, 210, 509, 236, CFBX17, CBBX17, 15, 47}, /* 17: Action */
38
39 { 1, 238, 131, 348, CFBX18, CBBX18, 17, 2}, /* 18: Configuration */
40 {133, 238, 267, 251, CFBX19, CBBX19, 17, 17}, /* 19: Voice & Inst */
41 {269, 238, 379, 306, CFBX20, CBBX20, 17, 35}, /* 20: Oscillators */
42 {381, 238, 509, 348, CFBX21, CBBX21, 17, 48}, /* 21: Waveshape */
43
44 {133, 308, 379, 348, CFBX22, CBBX22, 22, 17}, /* 22: (messages) */
45
46 {133, 252, 267, 306, CFBX23, CBBX23, 18, 17} /* 23: Name & comments */
47};
48
49/*
50
51*/
52
53/* instrument function to FPU function table */
54
55int16_t fnoff[NFINST] = {
56
57 1, /* 0: Freq 1 */
58 3, /* 1: Freq 2 */
59 5, /* 2: Freq 3 */
60 7, /* 3: Freq 4 */
61 10, /* 4: Filter / Resonance */
62 4, /* 5: Location */
63 9, /* 6: Index 1 */
64 11, /* 7: Index 2 */
65 12, /* 8: Index 3 */
66 13, /* 9: Index 4 */
67 14, /* 10: Index 5 */
68 15, /* 11: Index 6 */
69 2 /* 12: Level */
70};
71
72int16_t inspal[16][3] = { /* instrument display color palette */
73
74 {0, 0, 0}, /* 0 */
75 {3, 3, 3}, /* 1 */
76 {2, 2, 2}, /* 2 */
77 {3, 0, 0}, /* 3 */
78 {0, 3, 2}, /* 4 */
79 {0, 0, 1}, /* 5 */
80 {0, 1, 1}, /* 6 */
81 {1, 0, 1}, /* 7 */
82 {3, 2, 0}, /* 8 */
83 {1, 1, 2}, /* 9 */
84 {2, 3, 0}, /* 10 */
85 {2, 3, 3}, /* 11 */
86 {3, 0, 2}, /* 12 */
87 {0, 2, 3}, /* 13 */
88 {0, 3, 0}, /* 14 */
89 {3, 3, 0} /* 15 */
90};
91
92/*
93
94*/
95
96int8_t *idbxlbl[] = { /* display box labels */
97
98 " Frq 1", /* 0 */
99 " Frq 2", /* 1 */
100 " Frq 3", /* 2 */
101 " Frq 4", /* 3 */
102 " Filtr", /* 4 */
103 " Loctn", /* 5 */
104 " Ind 1", /* 6 */
105 " Ind 2", /* 7 */
106 " Ind 3", /* 8 */
107 " Ind 4", /* 9 */
108 " Ind 5", /* 10 */
109 " Ind 6", /* 11 */
110 " Level", /* 12 */
111 "Source Mult", /* 13 */
112 "Pt", /* 14 */
113 "Time ", /* 15 */
114 "Value Source Mult", /* 16 */
115 "Conditioned Acts", /* 17 */
116 " Config #", /* 18 */
117 "Voice Inst", /* 19 */
118 "Oscillators", /* 20 */
119 "Wavshpe", /* 21 */
120 "", /* 22 */
121 "" /* 23 */
122};
123
124int8_t idhlbl[] = /* main function time axis label */
125 " \324\302 \325\305 \326 \301 \302 \304 \310 \321\306 \323\302";
126
127
128int8_t *osclbl[] = { /* oscillator mode labels */
129 /* NOTE: must match values in instdsp.h */
130
131 "Int", /* 0: OC_INT - Interval */
132 "Rat", /* 1: OC_RAT - Ratio */
133 "Frq", /* 2: OC_FRQ - Frequency */
134 "Pch" /* 3: OC_PCH - Pitch */
135};
136
137/*
138
139*/
140
141int32_t rngdiv[] = { /* divisors for ranges of 0..9 */
142
143 MAXRAND, /* 0..0 */
144 MAXRAND / 2, /* 0..1 */
145 MAXRAND / 3, /* 0..2 */
146 MAXRAND / 4, /* 0..3 */
147 MAXRAND / 5, /* 0..4 */
148 MAXRAND / 6, /* 0..5 */
149 MAXRAND / 7, /* 0..6 */
150 MAXRAND / 8, /* 0..7 */
151 MAXRAND / 9, /* 0..8 */
152 MAXRAND / 10 /* 0..9 */
153};
154
155/*
156
157*/
158
159/*
160 =============================================================================
161 drawpt() -- draw a point as a cross
162 =============================================================================
163*/
164
165void drawpt(int16_t px, int16_t py, int16_t pc)
166{
167 register int16_t tmp;
168
169 tmp = px - 1;
170
171 if (tmp > 7)
172 idpoint(tmp, py, pc);
173
174 tmp = px + 1;
175
176 if (tmp < 509)
177 idpoint(tmp, py, pc);
178
179 tmp = py - 1;
180
181 if (tmp > 55)
182 idpoint(px, tmp, pc);
183
184 tmp = py + 1;
185
186 if (tmp < 196)
187 idpoint(px, tmp, pc);
188
189 idpoint(px, py, pc);
190}
191
192/*
193
194*/
195
196/*
197 =============================================================================
198 drawfn() -- draw a function
199 =============================================================================
200*/
201
202void drawfn(int16_t fn, int16_t how, int16_t pen, int16_t wn)
203{
204 struct idfnhdr *fp;
205 struct instdef *ip;
206 register struct instpnt *pt1, *pt2;
207 register int16_t i, npt1, npt2, xp;
208 register uint16_t color;
209 int16_t np, ptx, pty, ptc;
210
211 ip = &vbufs[curvce];
212 fp = &ip->idhfnc[fn];
213 point = idpoint;
214
215 np = fp->idfpif; /* number of points in the function */
216 xp = subj; /* edit point */
217
218 npt1 = 0; /* left endpoint of line */
219 npt2 = 1; /* right endpoint of line */
220
221 pt1 = &ip->idhpnt[fp->idfpt1]; /* left endpoint of line */
222 pt2 = pt1 + 1; /* right endpoint of line */
223
224 color = exp_c(pen); /* replicate 4 bit 'pen' for 16 bit 'color' */
225
226/*
227
228*/
229 ptx = ttox(timeto(fn, npt1), wn);
230 pty = vtoy((pt1->ipval >> 5), wn);
231
232 ptc = how ? ID_SELD :
233 ((pt1->ipact OR pt1->ipvsrc) ?
234 ID_ACTP : ID_CPNT);
235
236 if (np EQ 1) { /* single point ? */
237
238 if (wn EQ 12)
239 drawpt(ptx, pty, ptc);
240 else
241 idpoint(ptx, pty, ptc);
242
243 return;
244 }
245
246 if (how AND (xp EQ 0))
247 if (wn EQ 12)
248 drawpt(ptx, pty, ID_SELD);
249 else
250 idpoint(ptx, pty, ID_SELD);
251
252 for (i = 1; i < np; i++) {
253
254 ptx = ttox(timeto(fn, npt2), wn);
255 pty = vtoy((pt2->ipval >> 5), wn);
256
257 ptc = (pt2->ipact OR pt2->ipvsrc) ?
258 ID_ACTP : ID_CPNT;
259
260 if (how AND (xp EQ (i - 1))) {
261
262
263 if (wn EQ 12)
264 drawpt(ptx, pty, ptc);
265 else
266 idpoint(ptx, pty, ptc);
267
268 } else if (how AND (xp EQ i)) {
269
270 ptc = ID_SELD;
271
272 if (wn EQ 12)
273 drawpt(ptx, pty, ptc);
274 else
275 idpoint(ptx, pty, ptc);
276/*
277
278*/
279 } else {
280
281 lseg(ttox(timeto(fn, npt1), wn),
282 vtoy((pt1->ipval >> 5), wn),
283 ptx, pty, color);
284
285 if (wn EQ 12) {
286
287 drawpt(ttox(timeto(fn, npt1), wn),
288 vtoy((pt1->ipval >> 5), wn),
289 (pt1->ipact OR pt1->ipvsrc) ?
290 ID_ACTP : ID_CPNT);
291
292 drawpt(ptx, pty, ptc);
293
294 } else {
295
296 idpoint(ttox(timeto(fn, npt1), wn),
297 vtoy((pt1->ipval >> 5), wn),
298 (pt1->ipact OR pt1->ipvsrc) ?
299 ID_ACTP : ID_CPNT);
300
301 idpoint(ptx, pty, ptc);
302 }
303 }
304
305 npt1++;
306 npt2++;
307 pt1++;
308 pt2++;
309 }
310
311 return;
312}
313
314/*
315
316*/
317
318/*
319 =============================================================================
320 addpch() -- add an offset to a pitch function value
321 =============================================================================
322*/
323
324int16_t addpch(int16_t p1, int16_t p2)
325{
326 register int32_t pl;
327
328 pl = ((((int32_t)p1 >> 5) - 500L) << LSPCH) + (int32_t)p2;
329
330 if (pl > PITCHMAX)
331 pl = PITCHMAX;
332
333 return((int16_t)pl);
334}
335
336/*
337
338*/
339
340/*
341 =============================================================================
342 irand() -- develop a random number in a given range
343 =============================================================================
344*/
345
346int16_t irand(int16_t range)
347{
348 if (range LE 0) /* limit things to 'reasonable' values */
349 return(0);
350
351 if (range > 9) /* limit things to 'reasonable' values */
352 range = 9;
353
354 return((int16_t)(rand24() / rngdiv[range]));
355}
356
357/*
358
359*/
360
361/*
362 =============================================================================
363 xgetran() -- develop a random number
364 =============================================================================
365*/
366
367int16_t xgetran(int16_t mlt)
368{
369 register int16_t sltmp;
370
371 sltmp = (int16_t)rand24();
372
373 if (mlt < 0)
374 sltmp += (int16_t)rand24();
375
376 return(sltmp);
377}
378
379/*
380
381*/
382
383/*
384 =============================================================================
385 dosync() -- update sync and configuration register
386 =============================================================================
387*/
388
389void dosync(int16_t vce)
390{
391 register int16_t sync;
392 register struct instdef *ip;
393
394 ip = &vbufs[vce];
395 sync = ip->idhcfg << 8;
396
397 if (ip->idhos1c & OC_SYN)
398 sync |= 0x2000;
399
400 if (ip->idhos2c & OC_SYN)
401 sync |= 0x4000;
402
403 if (ip->idhos3c & OC_SYN)
404 sync |= 0x8000;
405
406 *(io_fpu + vce + (int32_t)FPU_OCFG) = sync;
407}
408
409/*
410
411*/
412
413/*
414 =============================================================================
415 oscdsp() -- display an oscillator frequency specification
416 =============================================================================
417*/
418
419void oscdsp(int16_t row, int16_t val, int16_t n, int8_t *lbl, int16_t frq)
420{
421 register int16_t fh, fl;
422
423 tsplot4(instob, 64, idbox[n][4], row, 34, lbl, 14);
424 tsplot4(instob, 64, idbox[n][4], row, 36, osclbl[val & 3], 14);
425
426 switch (val & 3) {
427
428 case OC_INT: /* interval */
429
430 sprintf(idbuf, "%c%04d", (frq < 0 ? '-' : '+'),
431 ((frq < 0 ? -frq : frq) >> 1));
432
433 break;
434
435 case OC_RAT: /* ratio */
436
437 int2rat(frq >> 1);
438
439 ebflag = FALSE;
440
441 idbuf[0] = ebuf[0];
442 idbuf[1] = ebuf[1];
443 idbuf[2] = ebuf[2];
444 idbuf[3] = '\0';
445
446 break;
447
448 case OC_FRQ: /* frequency */
449
450 fh = (frq >> 1) / 10;
451 fl = (frq >> 1) - (fh * 10);
452
453 sprintf(idbuf, "%02d.%d ", fh, fl);
454 break;
455/*
456
457*/
458 case OC_PCH:
459
460 cnvc2p(idbuf, (frq >> 1));
461 idbuf[0] += '0';
462 idbuf[1] += 'A';
463 idbuf[2] = sfdsp[idbuf[2]];
464 idbuf[3] += '0';
465 idbuf[4] += '0';
466 idbuf[5] = '\0';
467 break;
468 }
469
470 tsplot4(instob, 64, idbox[n][4], row, 40, idbuf, 14);
471
472 if (row NE 21)
473 tsplot4(instob, 64, idbox[n][4], row, 46,
474 ((val & OC_SYN) ? "S" : "s"), 14);
475}
476
477/*
478
479*/
480
481/*
482 =============================================================================
483 pltws() -- plot a small waveshape display
484 =============================================================================
485*/
486
487void pltws(uint16_t ws[], int16_t pen)
488{
489 register int16_t i, x, y;
490
491 for (i = 1; i < 254; i++) {
492
493 x = 382 + (i >> 1);
494 y = 348 - ((ws[i] ^ 0x8000) / 676);
495
496 idpoint(x, y, pen);
497 }
498}
499
500/*
501
502*/
503
504/*
505 =============================================================================
506 dswin() -- display a window
507 =============================================================================
508*/
509
510void dswin(int16_t n)
511{
512 int16_t th, tl, vh, vl, vv, mltval, lboff;
513 int8_t *s1, mltstr[6], mltsgn;
514 int32_t tt, sc;
515 register int16_t cx, pnt, par;
516 register struct instdef *ip;
517 register struct idfnhdr *fp;
518 register struct instpnt *pp;
519
520 if (wcflag NE -1)
521 return;
522
523 if (idimsw AND (n NE 19) AND (n < 22))
524 return;
525
526 ip = &vbufs[curvce];
527
528 fp = &ip->idhfnc[n LE 12 ? n : curfunc];
529
530 curpnt = subj + fp->idfpt1;
531 pp = &ip->idhpnt[curpnt];
532
533 cx = idbox[n][5];
534 cx |= cx << 4;
535 cx |= cx << 8;
536
537/*
538
539*/
540
541 /* first, fill the box with the background color */
542
543 if (v_regs[5] & 0x0180)
544 vbank(0);
545
546 vbfill4(instob, 128, idbox[n][0], idbox[n][1], idbox[n][2], idbox[n][3], cx);
547
548 if (n < 12) /* draw the function if it's a label window */
549 drawfn(n, 0, ID_CLIN, n);
550
551 /* put in the box label */
552
553 if (n GT 12) {
554
555 tsplot4(instob, 64, idbox[n][4], idbox[n][6], idbox[n][7],
556 idbxlbl[n], 14);
557
558 } else {
559
560 tsplot4(instob, 64,
561 ((ip->idhfnc[n].idftmd & I_TM_KEY) ? idbox[n][4] : ID_INST),
562 idbox[n][6], idbox[n][7], idbxlbl[n], 14);
563 }
564
565/*
566
567*/
568 switch (n) { /* final text - overlays above stuff */
569
570 case 12: /* level */
571
572 /* x labels */
573
574 tsplot4(instob, 64, TGRID, 14, 0, idhlbl, 14);
575
576 /* y labels */
577
578 tsplot4(instob, 64, TGRID, 14, 0, "\300", 14);
579 tsplot4(instob, 64, TGRID, 12, 0, "\302", 14);
580 tsplot4(instob, 64, TGRID, 10, 0, "\304", 14);
581 tsplot4(instob, 64, TGRID, 8, 0, "\306", 14);
582 tsplot4(instob, 64, TGRID, 6, 0, "\310", 14);
583 tsplot4(instob, 64, TGRID, 4, 0, "\312", 14);
584
585 lseg( 7, 56, 7, 196, LGRID); /* draw the grid */
586 lseg( 7, 196, 509, 196, LGRID);
587
588 drawfn(12, 0, ID_CLIN, 12); /* draw the function */
589
590 return;
591
592 case 13: /* source - multiplier */
593
594 dsimlt(bfs, fp->idfsrc, fp->idfmlt);
595
596 tsplot4(instob, 64, idbox[n][4],
597 idbox[n][6]+1, idbox[n][7], bfs, 14);
598 return;
599
600 case 14: /* point number */
601
602 sprintf(bfs, "%02d", subj);
603
604 tsplot4(instob, 64, idbox[n][4], idbox[n][6]+1, idbox[n][7], bfs, 14);
605
606 return;
607/*
608
609*/
610 case 15: /* time */
611
612 sc = 1000L;
613 tt = timeto(curfunc, subj);
614 th = tt / sc;
615 tl = tt - (th * sc);
616
617 sprintf(bfs, "%02d.%03d", th, tl);
618 tsplot4(instob, 64, idbox[n][4], idbox[n][6] + 1,
619 idbox[n][7], bfs, 14);
620
621 return;
622
623 case 16: /* value */
624
625 vv = pp->ipval >> 5;
626 vh = vv / 100;
627 vl = vv - (vh * 100);
628
629 sprintf(bfs, "%02d.%02d ", vh, vl);
630
631 dsimlt(&bfs[6], pp->ipvsrc, pp->ipvmlt);
632
633 tsplot4(instob, 64, idbox[n][4], idbox[n][6] + 1,
634 idbox[n][7], bfs, 14);
635
636 return;
637
638/*
639
640*/
641 case 17: /* action */
642
643 pnt = pp->ippar1;
644 par = pp->ippar2;
645
646 switch (pp->ipact) {
647
648 case AC_NULL:
649
650 s1 = " ";
651 break;
652
653 case AC_SUST:
654
655 sprintf(bfs, "Pause if key %c ", SP_DNA);
656 s1 = bfs;
657 break;
658
659 case AC_ENBL:
660
661 sprintf(bfs, "Stop if key %c ", SP_UPA);
662 s1 = bfs;
663 break;
664
665 case AC_JUMP:
666
667 sprintf(bfs, "GoTo %02d forever ", pnt);
668 s1 = bfs;
669 break;
670
671/*
672
673*/
674 case AC_LOOP:
675
676 sprintf(bfs, "GoTo %02d %02d times", pnt, par);
677
678 if (bfs[8] EQ '9') /* random */
679 bfs[8] = 'R';
680
681 s1 = bfs;
682 break;
683
684 case AC_KYUP:
685
686 sprintf(bfs, "GoTo %02d if key %c",
687 pnt, SP_UPA);
688 s1 = bfs;
689 break;
690
691 case AC_KYDN:
692
693 sprintf(bfs, "GoTo %02d if key %c",
694 pnt, SP_DNA);
695 s1 = bfs;
696 break;
697
698 default:
699
700 s1 = "????????????????";
701 break;
702 }
703
704 tsplot4(instob, 64, idbox[n][4], idbox[n][6] + 1,
705 idbox[n][7], s1, 14);
706
707 return;
708
709/*
710
711*/
712
713 case 18: /* configuration */
714
715 showcfg(ip->idhcfg);
716 return;
717
718 case 19: /* voice & instrument */
719
720 sprintf(idbuf, "%02d", curvce + 1);
721 tsplot4(instob, 64, idbox[n][4], 17, 23, idbuf, 14);
722
723 sprintf(idbuf, "%02d", curinst);
724 tsplot4(instob, 64, (instmod[curvce] ? ID_CHGD :idbox[n][4]),
725 17, 31, idbuf, 14);
726
727 return;
728
729 case 20: /* oscillators */
730
731 oscdsp(18, ip->idhos1c, n, "1", ip->idhos1v);
732 oscdsp(19, ip->idhos2c, n, "2", ip->idhos2v);
733 oscdsp(20, ip->idhos3c, n, "3", ip->idhos3v);
734 oscdsp(21, ip->idhos4c, n, "4", ip->idhos4v);
735
736 return;
737
738 case 21: /* waveshapes */
739
740 sprintf(idbuf, "A%02d", ip->idhwsa + 1);
741 tsplot4(instob, 64, WSAFC, 17, 56, idbuf, 14);
742 pltws(ip->idhwvaf, WSAFC);
743
744 sprintf(idbuf, "B%02d", ip->idhwsb + 1);
745 tsplot4(instob, 64, WSBFC, 17, 60, idbuf, 14);
746 pltws(ip->idhwvbf, WSBFC);
747
748 return;
749/*
750
751*/
752 case 22: /* message window */
753
754 tsplot4(instob, 64, idbox[n][4], 22, 17, vlbptr[0], 14);
755 tsplot4(instob, 64, idbox[n][4], 23, 17, vlbptr[1], 14);
756 tsplot4(instob, 64, idbox[n][4], 24, 17, vlbptr[2], 14);
757
758 if (idsrcsw) {
759
760 point = idpoint;
761
762 lseg(196, 308, 196, 348, CBORD);
763 lseg(260, 308, 260, 348, CBORD);
764 lseg(324, 308, 324, 348, CBORD);
765 }
766
767 return;
768
769 case 23: /* Name and comments */
770
771 tsplot4(instob, 64, idbox[n][4], 18, 17, ip->idhname, 14);
772 tsplot4(instob, 64, idbox[n][4], 19, 17, ip->idhcom1, 14);
773 tsplot4(instob, 64, idbox[n][4], 20, 17, ip->idhcom2, 14);
774 tsplot4(instob, 64, idbox[n][4], 21, 17, ip->idhcom3, 14);
775
776 return;
777 }
778}
779
780/*
781
782*/
783
784/*
785 =============================================================================
786 allwins() -- display all windows
787 =============================================================================
788*/
789
790void allwins(void)
791{
792 register int16_t i;
793
794 for (i = 0; i < 24; i++)
795 dswin(i);
796}
797
798/*
799 =============================================================================
800 idpoint() -- plot a point for the lseg function
801 =============================================================================
802*/
803
804void idpoint(int16_t x, int16_t y, int16_t pen)
805{
806 if (v_regs[5] & 0x0180)
807 vbank(0);
808
809 vputp(idoct, x, y, pen);
810}
811
812/*
813
814*/
815
816/*
817 =============================================================================
818 idbord() -- draw the border for the instrument display
819 =============================================================================
820*/
821
822void idbord(void)
823{
824 point = idpoint;
825
826 lseg( 0, 0, 510, 0, CBORD); /* outer border */
827 lseg(510, 0, 510, 349, CBORD);
828 lseg(510, 349, 0, 349, CBORD);
829 lseg( 0, 349, 0, 0, CBORD);
830
831 lseg( 0, 27, 510, 27, CBORD); /* label widows - H lines */
832 lseg( 0, 55, 510, 55, CBORD);
833
834 lseg( 85, 1, 85, 54, CBORD); /* label windows - V lines */
835 lseg(170, 1, 170, 54, CBORD);
836 lseg(255, 1, 255, 54, CBORD);
837 lseg(340, 1, 340, 54, CBORD);
838 lseg(425, 1, 425, 54, CBORD);
839
840 lseg( 0, 209, 510, 209, CBORD); /* S/M, Time, Val - H lines */
841 lseg( 0, 237, 510, 237, CBORD);
842
843 lseg(111, 210, 111, 236, CBORD); /* S/M, Time, Val - V lines */
844 lseg(143, 210, 143, 236, CBORD);
845 lseg(207, 210, 207, 236, CBORD);
846 lseg(367, 210, 367, 236, CBORD);
847
848 lseg(132, 238, 132, 349, CBORD); /* Voice, Osc, Vars */
849 lseg(380, 238, 380, 349, CBORD);
850 lseg(132, 307, 380, 307, CBORD);
851 lseg(268, 238, 268, 306, CBORD);
852}
853
854/*
855
856*/
857
858/*
859 =============================================================================
860 idvlblc() -- clear the message window
861 =============================================================================
862*/
863
864void idvlblc(void)
865{
866 vlbtype = 0; /* nothing in the message window */
867
868 vlbptr[0] = vlbptr[1] = vlbptr[2] = " ";
869}
870
871/*
872 =============================================================================
873 idvlbld() -- put the labels in the message window
874 =============================================================================
875*/
876
877void idvlbld(void)
878{
879 vlbtype = 1; /* variable labels */
880
881/* "123456789012345678901234567890" */
882
883 vlbptr[0] = "PchW/HT Pch/Frq Random GPC/V1";
884 vlbptr[1] = "ModW/VT Key Vel Pedal 1 ";
885 vlbptr[2] = "Brth/LP Key Prs ";
886}
887
888/*
889
890*/
891
892/*
893 =============================================================================
894 idvtyp() -- display the virtual typewriter in the message window
895 =============================================================================
896*/
897
898void idvtyp(void)
899{
900 vlbtype = 2; /* virtual typewriter */
901
902 vlbptr[0] = vtlin1;
903 vlbptr[1] = vtlin2;
904 vlbptr[2] = vtlin3;
905}
906
907/*
908 =============================================================================
909 idcpfch() -- display the copy / fetch menu in the message window
910 =============================================================================
911*/
912
913void idcpfch(void)
914{
915 vlbtype = 3; /* copy / fetch menu */
916
917/* "123456789012345678901234567890" */
918
919 vlbptr[0] = "Fetch from library Escape ";
920 vlbptr[1] = "Copy to library ";
921 vlbptr[2] = " ";
922}
923
924/*
925
926*/
927
928/*
929 =============================================================================
930 instdsp() -- put up the instrument display
931 =============================================================================
932*/
933
934void instdsp(void)
935{
936 register struct instdef *ip;
937 register struct idfnhdr *fp;
938
939 instob = &v_score[0]; /* setup object pointer */
940 idoct = &v_obtab[INSTOBJ]; /* setup object control table pointer */
941 obj0 = &v_curs0[0]; /* setup cursor object pointer */
942 obj2 = &v_tcur[0]; /* setup typewriter cursor pointer */
943
944 idnamsw = FALSE; /* typewriter not up */
945 idsrcsw = FALSE; /* source menu not up */
946 idcfsw = FALSE; /* copy / fetch menu not up */
947 idimsw = FALSE; /* instrument menu not up */
948 submenu = FALSE; /* submenu cursor not enabled */
949 wcflag = -1; /* no menu page up */
950 wcpage = 0; /* initial ws/cf page */
951
952 setinst(); /* setup editing variables */
953
954 dswap(); /* initialize display */
955
956 vbank(0); /* clear the display */
957 memsetw(instob, 0, 32767);
958 memsetw(instob+32767L, 0, 12033);
959
960 SetObj(INSTOBJ, 0, 0, instob, 512, 350, 0, 0, INSTFL, -1);
961 SetObj(0, 0, 1, obj0, 16, 16, ICURX, ICURY, OBFL_00, -1);
962 SetObj(TTCURS, 0, 1, obj2, 16, 16, 0, 0, TTCCFL, -1);
963
964 arcurs(ID_NCUR); /* setup arrow cursor object */
965 itcini(ID_TCUR); /* setup text cursor object */
966 ttcini(ID_TCUR); /* setup typewriter cursor object */
967
968 vbank(0);
969 idbord(); /* draw the border */
970 idvlblc(); /* no initial label */
971 allwins(); /* fill in the windows */
972
973 SetPri(INSTOBJ, INSTPRI);
974 SetPri(0, GCPRI); /* display the graphic cursor */
975
976 setgc(ICURX, ICURY);
977
978 vsndpal(inspal); /* set the palette */
979}
980
981/*
982
983*/
984
985/*
986 =============================================================================
987 reshowi() -- redisplay the instrument
988 =============================================================================
989*/
990
991void reshowi(void)
992{
993 idfield(); /* fix up field table, etc. */
994
995 wcflag = -1; /* no menu page up */
996 wcpage = 0; /* first page of waveshapes */
997
998 dswap(); /* initialize display */
999
1000 vbank(0); /* clear the display */
1001 memsetw(instob, 0, 32767);
1002 memsetw(instob+32767L, 0, 12033);
1003
1004 SetObj(INSTOBJ, 0, 0, instob, 512, 350, 0, 0, INSTFL, -1);
1005 SetObj(0, 0, 1, obj0, 16, 16, ICURX, ICURY, OBFL_00, -1);
1006 SetObj(TTCURS, 0, 1, obj2, 16, 16, 0, 0, TTCCFL, -1);
1007
1008 arcurs(ID_NCUR); /* setup arrow cursor object */
1009 itcini(ID_TCUR); /* setup text cursor object */
1010 ttcini(ID_TCUR); /* setup typewriter cursor object */
1011
1012 vbank(0);
1013 idbord(); /* draw the border */
1014 idvlblc(); /* no initial label */
1015 allwins(); /* fill in the windows */
1016
1017 SetPri(INSTOBJ, INSTPRI);
1018 SetPri(0, GCPRI); /* enable the cursor */
1019
1020 if (cyval > curslim)
1021 settc(stcrow, stccol);
1022 else
1023 setgc(cxval, cyval);
1024
1025 vsndpal(inspal); /* set the palette */
1026}
1027
Note: See TracBrowser for help on using the repository browser.