source: buchla-68k/orig/RAM/SWINIT.C@ 73dd55f

Last change on this file since 73dd55f was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 8 years ago

Imported original source code.

  • Property mode set to 100755
File size: 8.6 KB
Line 
1/*
2 =============================================================================
3 swinit.c -- MIDAS-VII -- more variable definitions and initializations
4 Version 12 -- 1988-10-12 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#define FET_DEFS 1 /* so fields.h gets things right */
9
10#include "stddefs.h"
11#include "scwheel.h"
12#include "score.h"
13#include "fields.h"
14#include "vsdd.h"
15#include "vsddsw.h"
16#include "vsddvars.h"
17
18#include "midas.h"
19
20#include "scdsp.h"
21#include "libdsp.h"
22#include "wsdsp.h"
23
24extern short swctrl;
25extern short swdir;
26extern short swfiin;
27extern short swflag;
28
29extern short swfifo[NSWFIFO];
30
31/*
32
33*/
34
35BOOL se_chg; /* Score free list changed flag */
36
37PFS (*oldsw)[]; /* saved swpt value */
38PFS (*swpt)[]; /* switch dispatch table pointer */
39
40PFS aswtbl[14]; /* assignment switch table */
41
42short (*curmove)(); /* cursor move function */
43short (*curtype)(); /* cursor type function */
44short (*cx_key)(); /* x rate calculation */
45short (*cx_upd)(); /* x update */
46short (*cy_key)(); /* y rate calculation */
47short (*cy_upd)(); /* y update */
48short (*d_key)(); /* in-field data key processor */
49short (*e_key)(); /* E key processor */
50short (*m_key)(); /* M key processor */
51short (*itxput)(); /* instrument menu text put function */
52short (*not_fld)(); /* not-in-field data key processor */
53short (*olddkey)(); /* saved d_key value */
54short (*oldekey)(); /* saved e_key value */
55short (*oldmkey)(); /* saved m_key value */
56short (*oldxkey)(); /* saved x_key value */
57short (*premove)(); /* cursor pre-move function */
58short (*pstmove)(); /* cursor post-move function */
59short (*vt_adv)(); /* vtyper data cursor advance function */
60short (*vt_bsp)(); /* vtyper data cursor backspace function */
61short (*vt_cdn)(); /* vtyper data cursor down function */
62short (*vt_cup)(); /* vtyper data cursor up function */
63short (*vt_dsp)(); /* vtyper display function */
64short (*vt_stop)(); /* vtyper exit function */
65short (*x_key)(); /* X key processor */
66short (*xy_dn)(); /* cursor - finger on (down) */
67short (*xy_up)(); /* cursor - finger off (up) */
68
69short *cratex; /* cursor x rate table pointer */
70short *cratey; /* cursor x rate table pointer */
71
72short BotEdge; /* configuration box bottom edge */
73short LftEdge; /* configuration box left edge */
74short RgtEdge; /* configuration box right edge */
75short TopEdge; /* configuration box top edge */
76
77short BarBcur[14]; /* current bottom-zero bar values */
78short BarCcur[14]; /* current centered-zero bar values */
79short BGeq[14]; /* current EQ bar settings */
80short BGother[14]; /* current other pot bar settings */
81short BGprmtr[14]; /* current parameter pot bar settings */
82
83short articen[12]; /* voice articulation enable status */
84short grpdyn[12]; /* group dynamics table (0..9) */
85short grploc[12]; /* group location table (0..8) */
86short grpmode[12]; /* group mode - 0 = play, 1 = stdby, 2 = rec */
87short grpsel[12]; /* group select status for instrument selection */
88short grpstat[12]; /* group status - 0 = off, non-0 = on */
89short grptmap[12]; /* group map */
90short gtctab[12]; /* group to color table */
91short ins2grp[12]; /* instrument to group table (00..NINST-1) */
92short instmod[12]; /* intrument data modified */
93short key2grp[88]; /* port 1 key to group assignment table */
94short lastart[16]; /* last articulation values (by parameter) */
95short lastvce[12]; /* last voice assigned in each group */
96short lastvel[12]; /* last velocity sent to group */
97short ldmap[N_SCORES]; /* gather read map */
98short mctlnum[4]; /* MIDI controller number table (-1, 00..99) */
99short mpbend[48]; /* MIDI pitch bend data, by port and channel */
100short msmstv[3]; /* MIDI state machine state variables */
101short offsets[NUMWPCAL]; /* offsets for current waveshape */
102short oldtun[128]; /* previous tuning table for undo */
103short prstab[NTRIGS]; /* pressure */
104short s_inst[12]; /* instrument selections */
105short s_trns[12]; /* current transposition values */
106short swfifo[NSWFIFO]; /* scroll wheel fifo */
107short txfifo[NTKFIFO]; /* trackball X fifo */
108short tyfifo[NTKFIFO]; /* trackball Y fifo */
109short tuntab[128]; /* current tuning table */
110short vce2grp[12]; /* voice to group table (-1, 1..12)*/
111short vce2trg[12]; /* voice to trigger map (-1 EQ NULL) */
112short veltab[NTRIGS]; /* velocity */
113short vmtab[NUMHARM]; /* harmonics for current waveshape */
114short wsbuf[NUMWPCAL]; /* final values for current waveshape */
115
116/*
117
118*/
119
120char *lmln22; /* message window line 22 */
121char *lmln23; /* message window line 23 */
122char *lmln24; /* message window line 24 */
123char *vtdeptr; /* virtual typewriter data entry pointer */
124
125char *funcndx[256][2]; /* function header pointers */
126char *vlbptr[3]; /* variable label pointers */
127
128char bfs[128]; /* display generation buffer */
129char caname[16]; /* current assignment table name */
130char dspbuf[65]; /* display generation buffer */
131char ebuf[MAXEBUF+1]; /* edit data entry buffer */
132char errbuf[65]; /* error message build area */
133char idbuf[65]; /* display format conversion work area */
134char keystat[24]; /* front panel key status */
135char ldcmnt[38]; /* comment field */
136char ldfile[9]; /* file name field */
137char ldmsg1[65]; /* messsage build area 1 */
138char ldmsg2[65]; /* messsage build area 2 */
139char ldmsg3[65]; /* messsage build area 3 */
140char loadedc[NLTYPES][37]; /* loaded file comments */
141char loadedf[NLTYPES][8]; /* loaded file names */
142char masens[3]; /* MIDI port active sensing flags */
143char mctlval[NCTRLS]; /* MIDI controller values */
144char mdbyte[3]; /* MIDI data byte buffers */
145char mpsust[48]; /* MIDI sustain status, by port and channel */
146char mrstat[3]; /* MIDI running status */
147char scname[N_SCORES][16]; /* Score names */
148char trgtab[NTRIGS]; /* trigger status */
149char tuncurn[33]; /* current tuning table name */
150char tunname[NTUNS][32]; /* tuning table names */
151
152/*
153
154*/
155
156long *pspool; /* Score storage pool pointer */
157
158long afi; /* analog processor FIFO value */
159long curtime; /* current sqscan time */
160long ctime; /* time at cursor */
161long dvwork; /* divide work area */
162long frags; /* Score storage pool fragment count */
163long iotime; /* saved lcdtime value */
164long lcdontm; /* LCD backlight on time */
165long lcdtime; /* LCD backlight timer */
166long lcsum; /* library checksum */
167long ndbytes; /* bytes needed for storage */
168long noteoff; /* note off time */
169long noteon; /* note on time */
170long noteper; /* note period */
171long noteval; /* note value */
172long nrest; /* number of rests */
173long schksum; /* Score checksum */
174long se1_cnt; /* Score - free list E_SIZE1 entry count */
175long se2_cnt; /* Score - free list E_SIZE2 entry count */
176long se3_cnt; /* Score - free list E_SIZE3 entry count */
177long snbreq; /* Score - disk bytes required */
178long snlreq; /* Score - score bytes required */
179long sntbreq; /* Score - total disk bytes required */
180long sntlreq; /* Score - total score bytes required */
181long spcount; /* Score - storage pool free entry count */
182long swcount; /* scroll wheel counter */
183long swrate; /* scroll wheel rate */
184long swtemp; /* scroll wheel work area */
185long t_bak; /* time at p_bak */
186long t_cbgn; /* time at p_cbgn */
187long t_cend; /* time at p_cend */
188long t_cur; /* time at p_cur */
189long t_ctr; /* time at p_ctr */
190long t_fwd; /* time at p_fwd */
191long t_ins; /* time at peg */
192long t_note; /* note duration between p_nbeg and p_nend */
193long t_sbgn; /* time at p_sbgn */
194long t_sec1; /* time at p_sec1 */
195long t_sec2; /* time at p_sec2 */
196long t_sect; /* section time */
197long t_send; /* time at p_send */
198long wshfac; /* waveshape scale factor */
199
200long hwave[NUMWPCAL]; /* harmonic waveshape generation buffer */
201long nlpersc[N_SCORES]; /* number of longs per score */
202long scsums[N_SCORES]; /* score checksums */
203long spool[MAX_SE]; /* Score storage pool */
204
205long vknm[NUMHARM][NUMWPCAL]; /* scaled harmonics for current ws */
206
207long swrmin = SWRMIN; /* scroll wheel rate threshold */
208
209/*
210
211*/
212
213/*
214 =============================================================================
215 swinit() -- initialize scroll wheel variables
216 =============================================================================
217*/
218
219swinit()
220{
221 swflag = FALSE; /* stop the scroll wheel */
222 swctrl = FALSE; /* ... */
223 swdir = D_FWD; /* ... */
224 swrate = 0; /* ... */
225 swcount = 0; /* ... */
226
227 memsetw(swfifo, 0, NSWFIFO); /* clear scroll wheel fifo */
228 swfiin = 0; /* ... */
229
230 tkinit(); /* initialize the trackball */
231}
Note: See TracBrowser for help on using the repository browser.