[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | lcdlbls.c -- MIDAS-VII front panel support functions
|
---|
| 4 | Version 48 -- 1989-12-19 -- D.N. Lynx Crowe
|
---|
| 5 | =============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | #define ROMPOK 1 /* non-zero enables the ROMP switch */
|
---|
| 9 |
|
---|
| 10 | #include "stddefs.h"
|
---|
| 11 | #include "biosdefs.h"
|
---|
| 12 | #include "graphdef.h"
|
---|
| 13 | #include "glcfns.h"
|
---|
| 14 | #include "glcdefs.h"
|
---|
| 15 | #include "lcdline.h"
|
---|
| 16 | #include "vsdd.h"
|
---|
| 17 | #include "vsddvars.h"
|
---|
| 18 | #include "hwdefs.h"
|
---|
| 19 | #include "memory.h"
|
---|
| 20 | #include "cmeta.h"
|
---|
| 21 | #include "fields.h"
|
---|
| 22 | #include "fpu.h"
|
---|
| 23 | #include "macros.h"
|
---|
| 24 | #include "panel.h"
|
---|
| 25 | #include "patch.h"
|
---|
| 26 | #include "smdefs.h"
|
---|
| 27 | #include "sclock.h"
|
---|
| 28 |
|
---|
| 29 | #include "midas.h"
|
---|
| 30 | #include "instdsp.h"
|
---|
| 31 | #include "libdsp.h"
|
---|
| 32 | #include "score.h"
|
---|
| 33 | #include "scdsp.h"
|
---|
| 34 | #include "scfns.h"
|
---|
| 35 |
|
---|
[e225e77] | 36 | #include "stdio.h"
|
---|
| 37 | #include "strings.h"
|
---|
| 38 | #include "vsddsw.h"
|
---|
| 39 |
|
---|
[f40a309] | 40 | #define ARTIVAL(x) (x << 5)
|
---|
| 41 | #define SL2GAIN(x) (sl2gain[(x >> 11) + 16])
|
---|
| 42 |
|
---|
| 43 | #if ROMPOK
|
---|
| 44 | #define ROMPFN trapper /* ROMP switch table entry */
|
---|
| 45 | #else
|
---|
[60288f5] | 46 | #define ROMPFN l_none /* ROMP switch table entry */
|
---|
[f40a309] | 47 | #endif
|
---|
| 48 |
|
---|
| 49 | #define PCHMAX 21920L /* maximum pitch value */
|
---|
| 50 |
|
---|
| 51 | /* |
---|
| 52 |
|
---|
[7258c6a] | 53 | */
|
---|
[f40a309] | 54 | extern int8_t gain2eq(int16_t gain);
|
---|
[7258c6a] | 55 |
|
---|
[f40a309] | 56 | extern uint16_t setsr(uint16_t sr);
|
---|
[7258c6a] | 57 |
|
---|
[0c834c5] | 58 | extern void (*d_key)(int16_t k);
|
---|
| 59 | extern void (*e_key)(void);
|
---|
| 60 | extern void (*m_key)(void);
|
---|
[7258c6a] | 61 | extern void (*x_key)(void);
|
---|
[0c834c5] | 62 | extern void (*olddkey)(int16_t k);
|
---|
| 63 | extern void (*oldekey)(void);
|
---|
| 64 | extern void (*oldmkey)(void);
|
---|
[7258c6a] | 65 | extern void (*oldxkey)(void);
|
---|
[f40a309] | 66 | extern void (*point)(int16_t x, int16_t y, int16_t pen);
|
---|
[60288f5] | 67 |
|
---|
| 68 | extern LPF (*oldsw)[];
|
---|
[f40a309] | 69 | extern LPF (*swpt)[];
|
---|
[60288f5] | 70 |
|
---|
[f40a309] | 71 | extern LPF aswtbl[14];
|
---|
[7258c6a] | 72 |
|
---|
| 73 | extern int16_t asig;
|
---|
| 74 | extern int16_t asmode;
|
---|
| 75 | extern int16_t astat;
|
---|
| 76 | extern int16_t aval;
|
---|
| 77 | extern int16_t clkrun;
|
---|
| 78 | extern int16_t ctrsw;
|
---|
| 79 | extern int16_t curasg;
|
---|
| 80 | extern int16_t gomode;
|
---|
| 81 | extern int16_t ismode;
|
---|
| 82 | extern int16_t lampio;
|
---|
| 83 | extern int16_t lampsw;
|
---|
| 84 | extern int16_t loadrow;
|
---|
| 85 | extern int16_t loadsw;
|
---|
| 86 | extern int16_t ltagged;
|
---|
| 87 | extern int16_t ndisp;
|
---|
| 88 | extern int16_t oldpk;
|
---|
| 89 | extern int16_t oldsl;
|
---|
| 90 | extern int16_t pkctrl;
|
---|
| 91 | extern int16_t recsw;
|
---|
| 92 | extern int16_t sliders;
|
---|
| 93 | extern int16_t tagslot;
|
---|
| 94 | extern int16_t tmpomlt;
|
---|
| 95 | extern int16_t tmpoval;
|
---|
| 96 | extern int16_t tuneval;
|
---|
| 97 |
|
---|
| 98 | extern uint16_t seqdupd;
|
---|
| 99 |
|
---|
| 100 | extern int16_t BGeq[];
|
---|
| 101 | extern int16_t BGother[];
|
---|
| 102 | extern int16_t BGprmtr[];
|
---|
| 103 |
|
---|
| 104 | extern int16_t articen[];
|
---|
| 105 | extern int16_t grpmode[];
|
---|
| 106 | extern int16_t grpsel[];
|
---|
| 107 | extern int16_t grpstat[];
|
---|
| 108 | extern int16_t ins2grp[];
|
---|
| 109 | extern int16_t lastart[];
|
---|
| 110 | extern int16_t s_trns[];
|
---|
| 111 | extern int16_t vce2grp[];
|
---|
| 112 | extern int16_t vce2trg[];
|
---|
| 113 |
|
---|
| 114 | extern int16_t anrs[][16];
|
---|
| 115 |
|
---|
| 116 | extern int32_t iotime;
|
---|
| 117 | extern int32_t lcdontm;
|
---|
[f40a309] | 118 | extern int32_t lcdtime;
|
---|
| 119 |
|
---|
| 120 | extern struct gdsel *gdstbc[];
|
---|
| 121 |
|
---|
| 122 | extern struct valent valents[];
|
---|
| 123 |
|
---|
| 124 | /* |
---|
| 125 |
|
---|
| 126 | */
|
---|
| 127 |
|
---|
[7258c6a] | 128 | /* forward references */
|
---|
| 129 |
|
---|
| 130 | void l_none(int16_t _1, int16_t _2);
|
---|
| 131 | void l_prmtr(int16_t stat, int16_t sig);
|
---|
| 132 | void l_other(int16_t stat, int16_t sig);
|
---|
| 133 | void l_voice(int16_t stat, int16_t vce);
|
---|
| 134 | void l_init(int16_t stat, int16_t sig);
|
---|
| 135 | void l_clock(int16_t stat, int16_t _2);
|
---|
| 136 | void l_eq(int16_t stat, int16_t sig);
|
---|
| 137 | void trapper(int16_t stat, int16_t _2);
|
---|
| 138 | void setlamp(int16_t stat, int16_t _2);
|
---|
| 139 | void rpctl(int16_t stat, int16_t _2);
|
---|
| 140 | void quiet(int16_t _1, int16_t _2);
|
---|
| 141 | void l_group(int16_t stat, int16_t grp);
|
---|
| 142 | void l_dflt(int16_t stat, int16_t _2);
|
---|
| 143 | void l_inst(int16_t stat, int16_t _2);
|
---|
| 144 | void l_goto(int16_t stat, int16_t _2);
|
---|
| 145 | void l_asgn(int16_t stat, int16_t _2);
|
---|
[f40a309] | 146 | void l_adfl(int16_t stat, int16_t _2);
|
---|
[e225e77] | 147 | void l_load(int16_t stat, int16_t _2);
|
---|
| 148 |
|
---|
| 149 | void lcdlbls(void);
|
---|
| 150 | void sendart(int16_t vce, int16_t par, int16_t ival);
|
---|
| 151 |
|
---|
| 152 | extern int16_t addpch(int16_t p1, int16_t p2);
|
---|
| 153 | extern int16_t lcancel(int16_t lct);
|
---|
| 154 | extern uint16_t exp_c(uint16_t c);
|
---|
| 155 | extern uint16_t setipl(uint16_t arg);
|
---|
| 156 | extern void BarBadj(int16_t bar, int16_t val);
|
---|
| 157 | extern void BarBset(int16_t bar, int16_t val);
|
---|
| 158 | extern void BarCadj(int16_t bar, int16_t val);
|
---|
| 159 | extern void BarCset(int16_t bar, int16_t val);
|
---|
| 160 | extern void clkset(int16_t st);
|
---|
| 161 | extern void dclkmd(void);
|
---|
| 162 | extern void dslslot(int16_t slot, uint16_t fg, int16_t row);
|
---|
| 163 | extern void dsrpmod(void);
|
---|
| 164 | extern void getasg(int16_t n);
|
---|
| 165 | extern void loadem(int16_t key);
|
---|
| 166 | extern void mpcupd(void);
|
---|
| 167 | extern void scupd(void);
|
---|
| 168 | extern void se_disp(struct s_entry *ep, int16_t sd, struct gdsel *gdstb[], int16_t cf);
|
---|
| 169 | extern void sendeq(int8_t band, int8_t gain);
|
---|
| 170 | extern void sendval(int16_t voice, int16_t par, int16_t ival);
|
---|
| 171 | extern void setinst(void);
|
---|
| 172 | extern void setleds(void);
|
---|
| 173 | extern void setv2gi(int16_t group);
|
---|
| 174 | extern void stmproc(uint16_t trg);
|
---|
[f40a309] | 175 | extern void xtrap15(void);
|
---|
| 176 |
|
---|
| 177 | /* initialized stuff */
|
---|
| 178 |
|
---|
[7258c6a] | 179 | /* BarType -- LCD slider bar graph type table -- 0 = bottom, 1 = centered */
|
---|
[f40a309] | 180 |
|
---|
[7258c6a] | 181 | int16_t BarType[14] = { 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0 };
|
---|
[f40a309] | 182 |
|
---|
| 183 | int16_t artitab[] = { /* articulation pot initialization values */
|
---|
| 184 |
|
---|
| 185 | ARTIVAL(500), /* locn */
|
---|
| 186 | ARTIVAL(0), /* level */
|
---|
| 187 | ARTIVAL(0), /* ind 1 */
|
---|
| 188 | ARTIVAL(0), /* ind 2 */
|
---|
| 189 | ARTIVAL(0), /* ind 3 */
|
---|
| 190 | ARTIVAL(500), /* frq 1 */
|
---|
| 191 | ARTIVAL(500), /* frq 2 */
|
---|
| 192 | ARTIVAL(500), /* frq 3 */
|
---|
| 193 | ARTIVAL(500), /* frq 4 */
|
---|
| 194 | ARTIVAL(0), /* ind 4 */
|
---|
| 195 | ARTIVAL(0), /* ind 5 */
|
---|
| 196 | ARTIVAL(0), /* ind 6 */
|
---|
| 197 | ARTIVAL(500), /* filtr */
|
---|
| 198 | ARTIVAL(0) /* reson */
|
---|
| 199 | };
|
---|
[9519422] | 200 |
|
---|
[f40a309] | 201 | /* arpar[] -- articulation parameter map */
|
---|
[7258c6a] | 202 | /* sigtab[ 25 26 27 28 29 30 31 32 33 34 35 36 37 38] */
|
---|
[f40a309] | 203 |
|
---|
| 204 | int16_t arpar[] = { 4, 2, 9, 11, 12, 1, 3, 5, 7, 13, 14, 15, 10, 6};
|
---|
| 205 |
|
---|
| 206 | /* |
---|
[7258c6a] | 207 |
|
---|
[f40a309] | 208 | */
|
---|
| 209 |
|
---|
| 210 | int16_t sl2gain[32] = { /* slider value to EQ gain conversion table */
|
---|
| 211 |
|
---|
| 212 | -12, -12, -12, -12, -12, -11, -10, -9 ,-8 ,-7, -6, -5, -4, -3, -2, -1,
|
---|
[7258c6a] | 213 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12, 12, 12
|
---|
[f40a309] | 214 | };
|
---|
| 215 |
|
---|
| 216 | int16_t vmasks[16] = { /* variable resolution masks */
|
---|
| 217 |
|
---|
| 218 | 0x8000, 0xC000, 0xE000, 0xF000,
|
---|
| 219 | 0xF800, 0xFC00, 0xFE00, 0xFF00,
|
---|
| 220 | 0xFF80, 0xFFC0, 0xFFE0, 0xFFF0,
|
---|
[7258c6a] | 221 | 0xFFF8, 0xFFFC, 0xFFFE, 0xFFFF
|
---|
[f40a309] | 222 | };
|
---|
| 223 |
|
---|
| 224 | int16_t src2var[14] = { /* source number to analog variable number map */
|
---|
[7258c6a] | 225 |
|
---|
[f40a309] | 226 | -1, -1, 3, -1, -1, -1, 5, -1, 4, -1, -1, 0, 1, 2 };
|
---|
| 227 |
|
---|
| 228 | int8_t *potlbls[] = { /* LCD pot labels */
|
---|
| 229 |
|
---|
| 230 | /* Pot: 25 26 27 28 29 30 31 32 33 34 35 36 37 38 */
|
---|
| 231 |
|
---|
| 232 | /* 0 */ "Locn Level Ind 1 Ind 2 Ind 3 Frq 1 Frq 2 Frq 3 Frq 4 Ind 4 Ind 5 Ind 6 Filtr Reson",
|
---|
| 233 | /* 1 */ "Locn Level Ind 1 Ind 2 Ind 3 Frq 1 Frq 2 Frq 3 Frq 4 Ind 4 Ind 5 Ind 6 Filtr Reson",
|
---|
| 234 | /* 2 */ " Aux Depth Rate Inten CV 1 CV 2 CV 3 CV 4 ",
|
---|
| 235 | /* 3 */ " 50 150 400 1k 2.5k 6k 15k 50 150 400 1k 2.5k 6k 15k ",
|
---|
| 236 | /* 4 */ "Locn Level Ind 1 Ind 2 Ind 3 Frq 1 Frq 2 Frq 3 Frq 4 Ind 4 Ind 5 Ind 6 Filtr Reson",
|
---|
| 237 | /* 5 */ "Locn Level Ind 1 Ind 2 Ind 3 Frq 1 Frq 2 Frq 3 Frq 4 Ind 4 Ind 5 Ind 6 Filtr Reson",
|
---|
| 238 | /* 6 */ "Locn Level Ind 1 Ind 2 Ind 3 Frq 1 Frq 2 Frq 3 Frq 4 Ind 4 Ind 5 Ind 6 Filtr Reson",
|
---|
| 239 | /* 7 */ "Locn Level Ind 1 Ind 2 Ind 3 Frq 1 Frq 2 Frq 3 Frq 4 Ind 4 Ind 5 Ind 6 Filtr Reson"
|
---|
[7258c6a] | 240 | };
|
---|
[f40a309] | 241 |
|
---|
| 242 | #if ROMPOK
|
---|
| 243 | int8_t *swtlbls[] = { /* LCD switch labels -- ROMP ENABLED */
|
---|
| 244 |
|
---|
| 245 | /* 0 */ "Quiet ROMP Lamp Clock P/R Go To Instr Asgmt Load Other Voice Init ",
|
---|
| 246 | /* 1 */ " Voice Init ",
|
---|
| 247 | /* 2 */ "Quiet ROMP Lamp Clock P/R Go To Instr Asgmt Load EQ Voice Init ",
|
---|
| 248 | /* 3 */ "Quiet ROMP Lamp Clock P/R Go To Instr Asgmt Load Prmtr Voice Init ",
|
---|
| 249 | /* 4 */ " +00 Deflt",
|
---|
| 250 | /* 5 */ "Quiet ROMP Lamp Clock P/R Go To Instr Asgmt Load Other Voice Deflt",
|
---|
| 251 | /* 6 */ "Quiet ROMP Lamp Clock P/R ",
|
---|
| 252 | /* 7 */ "Quiet ROMP Lamp Load "
|
---|
| 253 | };
|
---|
| 254 | #else
|
---|
| 255 | char *swtlbls[] = { /* LCD switch labels -- ROMP DISABLED */
|
---|
| 256 |
|
---|
| 257 | /* 0 */ "Quiet Lamp Clock P/R Go To Instr Asgmt Load Other Voice Init ",
|
---|
| 258 | /* 1 */ " Voice Init ",
|
---|
| 259 | /* 2 */ "Quiet Lamp Clock P/R Go To Instr Asgmt Load EQ Voice Init ",
|
---|
| 260 | /* 3 */ "Quiet Lamp Clock P/R Go To Instr Asgmt Load Prmtr Voice Init ",
|
---|
| 261 | /* 4 */ " +00 Deflt",
|
---|
| 262 | /* 5 */ "Quiet Lamp Clock P/R Go To Instr Asgmt Load Other Voice Deflt",
|
---|
| 263 | /* 6 */ "Quiet Lamp Clock P/R ",
|
---|
| 264 | /* 7 */ "Quiet Lamp Load "
|
---|
[7258c6a] | 265 | };
|
---|
[f40a309] | 266 | #endif
|
---|
| 267 |
|
---|
| 268 | int8_t *aslbls[] = { /* Assignment select key labels */
|
---|
| 269 |
|
---|
| 270 | "Asgmt", /* 0 */
|
---|
| 271 | " +00 ", /* 1 */
|
---|
| 272 | " +20 ", /* 2 */
|
---|
| 273 | " +40 ", /* 3 */
|
---|
| 274 | " +60 ", /* 4 */
|
---|
| 275 | " +80 " /* 5 */
|
---|
| 276 | };
|
---|
| 277 |
|
---|
[60288f5] | 278 | /* |
---|
[f40a309] | 279 |
|
---|
| 280 | */
|
---|
| 281 |
|
---|
| 282 | LPF t_prmtr[] = { /* switch assignments for LS_PRMTR */
|
---|
| 283 |
|
---|
| 284 | quiet, /* 0: Quiet */
|
---|
| 285 | ROMPFN, /* 1: ROMP */
|
---|
| 286 |
|
---|
| 287 | setlamp, /* 2: Lamp */
|
---|
| 288 | l_clock, /* 3: Clock */
|
---|
| 289 | rpctl, /* 4: R/P */
|
---|
| 290 |
|
---|
| 291 | l_goto, /* 5: Go To */
|
---|
[60288f5] | 292 | l_inst, /* 6: Instr */
|
---|
| 293 | l_asgn, /* 7: Asgmt */
|
---|
[f40a309] | 294 | l_load, /* 8: Load */
|
---|
| 295 |
|
---|
| 296 | l_none, /* 9: -unused- */
|
---|
| 297 | l_none, /* 10: -unused- */
|
---|
| 298 | l_other, /* 11: Other */
|
---|
| 299 |
|
---|
[60288f5] | 300 | l_prmtr, /* 12: Prmtr */
|
---|
[f40a309] | 301 | l_init /* 13: Init */
|
---|
| 302 | };
|
---|
| 303 |
|
---|
| 304 | LPF t_voice[] = { /* switch assignments for LS_VOICE */
|
---|
| 305 |
|
---|
| 306 | l_voice, /* 0: toggle voice status */
|
---|
| 307 | l_voice, /* 1: toggle voice status */
|
---|
| 308 |
|
---|
| 309 | l_voice, /* 2: toggle voice status */
|
---|
| 310 | l_voice, /* 3: toggle voice status */
|
---|
| 311 | l_voice, /* 4: toggle voice status */
|
---|
| 312 |
|
---|
| 313 | l_voice, /* 5: toggle voice status */
|
---|
| 314 | l_voice, /* 6: toggle voice status */
|
---|
| 315 | l_voice, /* 7: toggle voice status */
|
---|
| 316 | l_voice, /* 8: toggle voice status */
|
---|
| 317 |
|
---|
| 318 | l_voice, /* 9: toggle voice status */
|
---|
| 319 | l_voice, /* 10: toggle voice status */
|
---|
| 320 | l_voice, /* 11: toggle voice status */
|
---|
| 321 |
|
---|
| 322 | l_prmtr, /* 12: Prmtr */
|
---|
| 323 | l_init /* 13: Init */
|
---|
| 324 | };
|
---|
[60288f5] | 325 |
|
---|
[f40a309] | 326 | /* |
---|
| 327 |
|
---|
| 328 | */
|
---|
| 329 |
|
---|
| 330 | LPF t_other[] = { /* switch assignments for LS_OTHER */
|
---|
| 331 |
|
---|
| 332 | quiet, /* 0: Quiet */
|
---|
| 333 | ROMPFN, /* 1: ROMP */
|
---|
| 334 |
|
---|
| 335 | setlamp, /* 2: Lamp */
|
---|
| 336 | l_clock, /* 3: Clock */
|
---|
| 337 | rpctl, /* 4: R/P */
|
---|
| 338 |
|
---|
[60288f5] | 339 | l_goto, /* 5: Go To */
|
---|
| 340 | l_inst, /* 6: Instr */
|
---|
[f40a309] | 341 | l_asgn, /* 7: Asgmt */
|
---|
| 342 | l_load, /* 8: Load */
|
---|
| 343 |
|
---|
| 344 | l_none, /* 9: -unused- */
|
---|
| 345 | l_none, /* 10: -unused- */
|
---|
| 346 | l_eq, /* 11: EQ */
|
---|
[60288f5] | 347 |
|
---|
[f40a309] | 348 | l_prmtr, /* 12: Prmtr */
|
---|
| 349 | l_init /* 13: Init */
|
---|
| 350 | };
|
---|
| 351 |
|
---|
| 352 | LPF t_eq[] = { /* switch assignments for LS_EQ */
|
---|
| 353 |
|
---|
| 354 | quiet, /* 0: Quiet */
|
---|
| 355 | ROMPFN, /* 1: ROMP */
|
---|
| 356 |
|
---|
| 357 | setlamp, /* 2: Lamp */
|
---|
| 358 | l_clock, /* 3: Clock */
|
---|
| 359 | rpctl, /* 4: R/P */
|
---|
| 360 |
|
---|
[60288f5] | 361 | l_goto, /* 5: Go To */
|
---|
| 362 | l_inst, /* 6: Instr */
|
---|
[f40a309] | 363 | l_asgn, /* 7: Asgmt */
|
---|
| 364 | l_load, /* 8: Load */
|
---|
| 365 |
|
---|
| 366 | l_none, /* 9: -unused- */
|
---|
| 367 | l_none, /* 10: -unused- */
|
---|
| 368 | l_eq, /* 11: Prmtr */
|
---|
| 369 |
|
---|
| 370 | l_prmtr, /* 12: Voice */
|
---|
| 371 | l_init /* 13: Init */
|
---|
[60288f5] | 372 | };
|
---|
[f40a309] | 373 |
|
---|
| 374 | /* |
---|
| 375 |
|
---|
| 376 | */
|
---|
| 377 |
|
---|
| 378 | LPF t_inst[] = { /* switch assignments for LS_INST */
|
---|
| 379 |
|
---|
| 380 | l_group, /* 0: toggle group status */
|
---|
| 381 | l_group, /* 1: toggle group status */
|
---|
| 382 |
|
---|
| 383 | l_group, /* 2: toggle group status */
|
---|
| 384 | l_group, /* 3: toggle group status */
|
---|
| 385 | l_group, /* 4: toggle group status */
|
---|
| 386 |
|
---|
| 387 | l_group, /* 5: toggle group status */
|
---|
| 388 | l_group, /* 6: toggle group status */
|
---|
| 389 | l_group, /* 7: toggle group status */
|
---|
| 390 | l_group, /* 8: toggle group status */
|
---|
| 391 |
|
---|
| 392 | l_group, /* 9: toggle group status */
|
---|
| 393 | l_group, /* 10: toggle group status */
|
---|
[60288f5] | 394 | l_group, /* 11: toggle group status */
|
---|
[f40a309] | 395 |
|
---|
| 396 | l_inst, /* 12: 01-20 / 21-40 */
|
---|
| 397 | l_dflt /* 13: Deflt */
|
---|
| 398 | };
|
---|
| 399 |
|
---|
| 400 | LPF t_libr[] = { /* switch assignments for LS_LIBR */
|
---|
| 401 |
|
---|
| 402 | quiet, /* 0: Quiet */
|
---|
[60288f5] | 403 | ROMPFN, /* 1: ROMP */
|
---|
| 404 |
|
---|
| 405 | setlamp, /* 2: Lamp */
|
---|
| 406 | l_clock, /* 3: Clock */
|
---|
[f40a309] | 407 | rpctl, /* 4: R/P */
|
---|
[60288f5] | 408 |
|
---|
| 409 | l_none, /* 5: -unused- */
|
---|
| 410 | l_none, /* 6: -unused- */
|
---|
[f40a309] | 411 | l_none, /* 7: -unused- */
|
---|
[60288f5] | 412 | l_none, /* 8: -unused- */
|
---|
| 413 |
|
---|
[f40a309] | 414 | l_none, /* 9: -unused- */
|
---|
| 415 | l_none, /* 10: -unused- */
|
---|
| 416 | l_none, /* 11: -unused- */
|
---|
| 417 |
|
---|
| 418 | l_none, /* 12: -unused- */
|
---|
[60288f5] | 419 | l_none /* 13: -unused- */
|
---|
[f40a309] | 420 | };
|
---|
| 421 |
|
---|
| 422 | /* |
---|
| 423 |
|
---|
| 424 | */
|
---|
| 425 |
|
---|
| 426 | LPF t_ngrp[] = { /* switch assignments for LS_NGRP */
|
---|
| 427 |
|
---|
[60288f5] | 428 | quiet, /* 0: Quiet */
|
---|
| 429 | ROMPFN, /* 1: ROMP */
|
---|
| 430 |
|
---|
| 431 | setlamp, /* 2: Lamp */
|
---|
[f40a309] | 432 | l_clock, /* 3: Clock */
|
---|
[60288f5] | 433 | rpctl, /* 4: R/P */
|
---|
| 434 |
|
---|
| 435 | l_none, /* 5: -unused- */
|
---|
[f40a309] | 436 | l_none, /* 6: -unused- */
|
---|
[60288f5] | 437 | l_none, /* 7: -unused- */
|
---|
| 438 | l_none, /* 8: -unused- */
|
---|
[f40a309] | 439 |
|
---|
| 440 | l_none, /* 9: -unused- */
|
---|
[60288f5] | 441 | l_none, /* 10: -unused- */
|
---|
[f40a309] | 442 | l_none, /* 11: -unused- */
|
---|
| 443 |
|
---|
| 444 | l_none, /* 12: -unused- */
|
---|
| 445 | l_none /* 13: -unused- */
|
---|
| 446 | };
|
---|
[60288f5] | 447 |
|
---|
| 448 | LPF t_load[] = { /* switch assignments for LS_LOAD */
|
---|
[f40a309] | 449 |
|
---|
[60288f5] | 450 | quiet, /* 0: Quiet */
|
---|
| 451 | ROMPFN, /* 1: ROMP */
|
---|
| 452 |
|
---|
[f40a309] | 453 | setlamp, /* 2: Lamp */
|
---|
| 454 | l_none, /* 3: -unused- */
|
---|
[60288f5] | 455 | l_none, /* 4: -unused- */
|
---|
| 456 |
|
---|
| 457 | l_none, /* 5: -unused- */
|
---|
[f40a309] | 458 | l_none, /* 6: -unused- */
|
---|
[60288f5] | 459 | l_none, /* 7: -unused- */
|
---|
| 460 | l_load, /* 8: Load */
|
---|
[f40a309] | 461 |
|
---|
| 462 | l_none, /* 9: -unused- */
|
---|
| 463 | l_none, /* 10: -unused- */
|
---|
| 464 | l_none, /* 11: -unused- */
|
---|
| 465 |
|
---|
[60288f5] | 466 | l_none, /* 12: -unused- */
|
---|
| 467 | l_none /* 13: -unused- */
|
---|
| 468 | };
|
---|
| 469 |
|
---|
| 470 | /* |
---|
| 471 |
|
---|
[7258c6a] | 472 | */
|
---|
[60288f5] | 473 |
|
---|
| 474 | /*
|
---|
| 475 | =============================================================================
|
---|
| 476 | l_none() -- null function
|
---|
| 477 | =============================================================================
|
---|
| 478 | */
|
---|
[f40a309] | 479 |
|
---|
| 480 | void l_none(int16_t _1, int16_t _2)
|
---|
| 481 | {
|
---|
| 482 | }
|
---|
| 483 |
|
---|
| 484 | /* |
---|
[7258c6a] | 485 |
|
---|
[f40a309] | 486 | */
|
---|
[7258c6a] | 487 |
|
---|
[f40a309] | 488 | /*
|
---|
| 489 | =============================================================================
|
---|
| 490 | quiet() -- quiet the instrument
|
---|
| 491 | =============================================================================
|
---|
| 492 | */
|
---|
| 493 |
|
---|
| 494 | void quiet(int16_t _1, int16_t _2)
|
---|
| 495 | {
|
---|
| 496 | register int16_t vce;
|
---|
| 497 |
|
---|
| 498 | for (vce = 0; vce < 12; vce++) /* for each voice ... */
|
---|
| 499 | sendval(vce, 2, 0); /* ... set level = 0 */
|
---|
| 500 |
|
---|
| 501 | memsetw(seqflag, 0, 16); /* stop the sequences */
|
---|
| 502 | memsetw(seqtime, 0, 16); /* ... */
|
---|
| 503 |
|
---|
| 504 | memsetw(trstate, 0, 16); /* reset the triggers */
|
---|
| 505 |
|
---|
| 506 | seqdupd = 0xFFFF; /* request display update */
|
---|
| 507 |
|
---|
[7258c6a] | 508 | stmproc(NULL_DEF); /* trigger the blank definer */
|
---|
[f40a309] | 509 | }
|
---|
| 510 |
|
---|
| 511 | /*
|
---|
| 512 | =============================================================================
|
---|
| 513 | rpctl() -- toggle record/play switch
|
---|
| 514 | =============================================================================
|
---|
| 515 | */
|
---|
| 516 |
|
---|
| 517 | void rpctl(int16_t stat, int16_t _2)
|
---|
| 518 | {
|
---|
| 519 | if (NOT stat)
|
---|
| 520 | return;
|
---|
| 521 |
|
---|
| 522 | recsw = NOT recsw;
|
---|
| 523 | dsrpmod();
|
---|
| 524 | }
|
---|
| 525 |
|
---|
[7258c6a] | 526 | /* |
---|
[f40a309] | 527 |
|
---|
| 528 | */
|
---|
| 529 |
|
---|
| 530 | /*
|
---|
| 531 | =============================================================================
|
---|
| 532 | trapper() -- trap to ROMP
|
---|
| 533 | =============================================================================
|
---|
| 534 | */
|
---|
| 535 |
|
---|
| 536 | void trapper(int16_t stat, int16_t _2)
|
---|
| 537 | {
|
---|
[7258c6a] | 538 | if (stat)
|
---|
[f40a309] | 539 | xtrap15();
|
---|
| 540 | }
|
---|
| 541 |
|
---|
| 542 | /*
|
---|
| 543 | =============================================================================
|
---|
| 544 | l_clock() -- process 'Clock' switch
|
---|
| 545 | =============================================================================
|
---|
| 546 | */
|
---|
| 547 |
|
---|
| 548 | void l_clock(int16_t stat, int16_t _2)
|
---|
| 549 | {
|
---|
| 550 | if (NOT stat)
|
---|
| 551 | return;
|
---|
| 552 |
|
---|
[0580615] | 553 | clkset(NOT clkrun);
|
---|
[f40a309] | 554 | dclkmd();
|
---|
| 555 | }
|
---|
| 556 |
|
---|
| 557 | /*
|
---|
| 558 | =============================================================================
|
---|
| 559 | ulamp() -- underline lamp if forced on
|
---|
| 560 | =============================================================================
|
---|
| 561 | */
|
---|
| 562 |
|
---|
| 563 | void ulamp(void)
|
---|
| 564 | {
|
---|
| 565 | if ((sliders EQ LS_VOICE) OR (sliders EQ LS_INST))
|
---|
| 566 | return;
|
---|
| 567 |
|
---|
| 568 | point = GLCplot; /* setup to draw line */
|
---|
| 569 | GLCcurs(G_ON);
|
---|
| 570 |
|
---|
| 571 | if (lampsw)
|
---|
| 572 | lseg (LAMP_XL, LAMP_Y, LAMP_XR, LAMP_Y, 1);
|
---|
| 573 | else
|
---|
| 574 | lseg (LAMP_XL, LAMP_Y, LAMP_XR, LAMP_Y, 0);
|
---|
| 575 |
|
---|
| 576 | GLCcurs(G_OFF);
|
---|
| 577 | }
|
---|
[0580615] | 578 |
|
---|
[f40a309] | 579 | /* |
---|
[7258c6a] | 580 |
|
---|
[f40a309] | 581 | */
|
---|
| 582 |
|
---|
| 583 | /*
|
---|
| 584 | =============================================================================
|
---|
| 585 | preio() -- turn off LCD backlight before disk I/O
|
---|
| 586 | =============================================================================
|
---|
| 587 | */
|
---|
| 588 |
|
---|
| 589 | void preio(void)
|
---|
| 590 | {
|
---|
| 591 | int16_t oldipl;
|
---|
| 592 |
|
---|
| 593 | oldipl = setipl(TIM_DI);
|
---|
| 594 |
|
---|
| 595 | lampio = lampsw;
|
---|
| 596 | iotime = lcdtime;
|
---|
| 597 | lampsw = FALSE;
|
---|
[0580615] | 598 | io_leds = 0x1F;
|
---|
[f40a309] | 599 |
|
---|
[7258c6a] | 600 | setipl(oldipl);
|
---|
[f40a309] | 601 | }
|
---|
| 602 |
|
---|
| 603 | /*
|
---|
| 604 | =============================================================================
|
---|
| 605 | postio() -- restore LCD backlight state after disk I/O
|
---|
| 606 | =============================================================================
|
---|
| 607 | */
|
---|
| 608 |
|
---|
| 609 | void postio(void)
|
---|
| 610 | {
|
---|
| 611 | int16_t oldipl;
|
---|
| 612 |
|
---|
| 613 | oldipl = setipl(TIM_DI);
|
---|
| 614 |
|
---|
| 615 | lampsw = lampio;
|
---|
| 616 |
|
---|
| 617 | if (iotime OR lampsw) {
|
---|
| 618 |
|
---|
| 619 | lcdtime = lcdontm;
|
---|
| 620 | io_leds = 0x9F;
|
---|
| 621 | }
|
---|
| 622 |
|
---|
| 623 | setipl(oldipl);
|
---|
[7258c6a] | 624 | }
|
---|
[f40a309] | 625 |
|
---|
[7258c6a] | 626 | /* |
---|
[f40a309] | 627 |
|
---|
| 628 | */
|
---|
| 629 |
|
---|
| 630 | /*
|
---|
| 631 | =============================================================================
|
---|
| 632 | setlamp() -- toggle LCD backlight mode
|
---|
| 633 | =============================================================================
|
---|
| 634 | */
|
---|
| 635 |
|
---|
| 636 | void setlamp(int16_t stat, int16_t _2)
|
---|
| 637 | {
|
---|
| 638 | register int16_t oldi;
|
---|
| 639 |
|
---|
| 640 | if (NOT stat) /* only act on key closures */
|
---|
| 641 | return;
|
---|
| 642 |
|
---|
| 643 | oldi = setipl(TIM_DI); /* disable interrupts to keep out the timer */
|
---|
| 644 |
|
---|
| 645 | lcdtime = lcdontm; /* set the LCD backlight timer */
|
---|
| 646 |
|
---|
| 647 | if (lampsw) {
|
---|
| 648 |
|
---|
| 649 | lampsw = FALSE; /* enable LCD timeouts */
|
---|
| 650 | io_leds = 0x1F; /* turn off the LCD backlight */
|
---|
| 651 |
|
---|
| 652 | } else {
|
---|
| 653 |
|
---|
| 654 | lampsw = TRUE; /* disable LCD timeouts */
|
---|
| 655 | io_leds = 0x9F; /* turn on the LCD backlight */
|
---|
| 656 | }
|
---|
[0580615] | 657 |
|
---|
[f40a309] | 658 | setipl(oldi); /* turn interrupts back on */
|
---|
[7258c6a] | 659 |
|
---|
[f40a309] | 660 | ulamp(); /* update underline on lamp key label */
|
---|
| 661 | }
|
---|
| 662 |
|
---|
| 663 | /*
|
---|
| 664 | =============================================================================
|
---|
| 665 | lcd_on() -- turn on the LCD backlight
|
---|
| 666 | =============================================================================
|
---|
| 667 | */
|
---|
| 668 |
|
---|
| 669 | void lcd_on(void)
|
---|
| 670 | {
|
---|
| 671 | register int16_t oldi;
|
---|
| 672 |
|
---|
| 673 | oldi = setipl(TIM_DI); /* disable interrupts to keep out the timer */
|
---|
| 674 |
|
---|
| 675 | lcdtime = lcdontm; /* set the LCD backlight timer */
|
---|
| 676 | io_leds = 0x9F; /* turn on the LCD backlight */
|
---|
| 677 |
|
---|
[7258c6a] | 678 | setipl(oldi); /* turn interrupts back on */
|
---|
[f40a309] | 679 | }
|
---|
| 680 |
|
---|
| 681 | /* |
---|
| 682 |
|
---|
| 683 | */
|
---|
| 684 |
|
---|
| 685 | /*
|
---|
| 686 | =============================================================================
|
---|
| 687 | loadkey() -- process data keys in load mode
|
---|
| 688 | =============================================================================
|
---|
| 689 | */
|
---|
| 690 |
|
---|
| 691 | void loadkey(int16_t key)
|
---|
| 692 | {
|
---|
| 693 | if (NOT astat)
|
---|
| 694 | return;
|
---|
| 695 |
|
---|
| 696 | if (loadsw) { /* if it's load time */
|
---|
| 697 |
|
---|
| 698 | if (key < 7) { /* ... and the key is valid */
|
---|
| 699 |
|
---|
| 700 | loadem(key + 'A'); /* ... load the files */
|
---|
| 701 |
|
---|
| 702 | loadsw = FALSE;
|
---|
| 703 | ltagged = FALSE;
|
---|
| 704 | d_key = olddkey;
|
---|
| 705 | x_key = oldxkey;
|
---|
| 706 | e_key = oldekey;
|
---|
| 707 | m_key = oldmkey;
|
---|
| 708 | pkctrl = oldpk;
|
---|
| 709 | sliders = oldsl;
|
---|
| 710 | swpt = oldsw;
|
---|
| 711 | lcdlbls();
|
---|
| 712 | }
|
---|
| 713 |
|
---|
[7258c6a] | 714 | return;
|
---|
[f40a309] | 715 | }
|
---|
| 716 | }
|
---|
| 717 |
|
---|
| 718 | /* |
---|
| 719 |
|
---|
| 720 | */
|
---|
| 721 |
|
---|
| 722 | /*
|
---|
[9519422] | 723 | =============================================================================
|
---|
[f40a309] | 724 | pcancel() -- cancel panel modes
|
---|
| 725 | =============================================================================
|
---|
| 726 | */
|
---|
| 727 |
|
---|
| 728 | void pcancel(int16_t pm)
|
---|
| 729 | {
|
---|
| 730 | point = GLCplot; /* setup to plot on LCD */
|
---|
| 731 | GLCcurs(G_ON);
|
---|
| 732 |
|
---|
| 733 | if ((pm NE 0) AND asmode) {
|
---|
| 734 |
|
---|
| 735 | /* cancel assignment mode */
|
---|
| 736 |
|
---|
| 737 | asmode = 0;
|
---|
| 738 | pkctrl = oldpk;
|
---|
| 739 | swpt = oldsw;
|
---|
| 740 | lseg(ASGN_XL, ASGN_Y, ASGN_XR, ASGN_Y, 0);
|
---|
| 741 | }
|
---|
| 742 |
|
---|
| 743 | if ((pm NE 1) AND (gomode NE GO_NULL)) {
|
---|
| 744 |
|
---|
| 745 | /* cancel Go To mode */
|
---|
| 746 |
|
---|
| 747 | gomode = GO_NULL;
|
---|
| 748 | pkctrl = oldpk;
|
---|
| 749 | lseg(GOTO_XL, GOTO_Y, GOTO_XR, GOTO_Y, 0);
|
---|
| 750 | }
|
---|
| 751 |
|
---|
| 752 | if ((pm NE 2) AND (ismode NE IS_NULL)) {
|
---|
| 753 |
|
---|
| 754 | /* cancel instrument select mode */
|
---|
| 755 |
|
---|
| 756 | ismode = IS_NULL;
|
---|
| 757 | pkctrl = oldpk;
|
---|
| 758 | sliders = oldsl;
|
---|
| 759 | swpt = oldsw;
|
---|
| 760 | lcdlbls();
|
---|
| 761 | }
|
---|
[7258c6a] | 762 |
|
---|
[f40a309] | 763 | GLCcurs(G_OFF);
|
---|
| 764 | setleds();
|
---|
| 765 | }
|
---|
| 766 |
|
---|
| 767 | /* |
---|
| 768 |
|
---|
| 769 | */
|
---|
| 770 |
|
---|
| 771 | /*
|
---|
| 772 | =============================================================================
|
---|
| 773 | l_load() -- process "Load" key
|
---|
| 774 | =============================================================================
|
---|
| 775 | */
|
---|
| 776 |
|
---|
| 777 | void l_load(int16_t stat, int16_t _2)
|
---|
| 778 | {
|
---|
| 779 | if (NOT stat)
|
---|
| 780 | return;
|
---|
| 781 |
|
---|
| 782 | pcancel(3); /* cancel panel selections */
|
---|
| 783 | lcancel(3); /* cancel librarian selections */
|
---|
| 784 |
|
---|
| 785 | point = GLCplot; /* setup to plot on LCD */
|
---|
| 786 | GLCcurs(G_ON);
|
---|
| 787 |
|
---|
| 788 | if (loadsw) { /* if load is selected, deselect */
|
---|
| 789 |
|
---|
| 790 | d_key = olddkey;
|
---|
| 791 | e_key = oldekey;
|
---|
| 792 | m_key = oldmkey;
|
---|
| 793 | x_key = oldxkey;
|
---|
| 794 |
|
---|
| 795 | pkctrl = oldpk;
|
---|
| 796 | sliders = oldsl;
|
---|
| 797 | swpt = oldsw;
|
---|
| 798 |
|
---|
| 799 | loadsw = FALSE;
|
---|
| 800 |
|
---|
| 801 | lcdlbls();
|
---|
| 802 | /* |
---|
| 803 |
|
---|
| 804 | */
|
---|
| 805 | } else { /* setup for load mode */
|
---|
| 806 |
|
---|
| 807 | clkset(0); /* stop the clock */
|
---|
[6dd74a9] | 808 |
|
---|
[f40a309] | 809 | if (ltagged) { /* cancel tag mode */
|
---|
| 810 |
|
---|
| 811 | dslslot(tagslot, exp_c(LCFBX01), loadrow);
|
---|
| 812 | ltagged = FALSE;
|
---|
| 813 | }
|
---|
| 814 |
|
---|
| 815 | if ((pkctrl EQ PK_PFRM) OR (pkctrl EQ PK_NOTE))
|
---|
| 816 | oldpk = pkctrl;
|
---|
| 817 |
|
---|
| 818 | if (sliders NE LS_LOAD)
|
---|
| 819 | oldsl = sliders;
|
---|
| 820 |
|
---|
| 821 | pkctrl = PK_LOAD;
|
---|
| 822 | sliders = LS_LOAD;
|
---|
| 823 | oldsw = swpt;
|
---|
| 824 | swpt = &t_load;
|
---|
| 825 |
|
---|
| 826 | olddkey = d_key;
|
---|
| 827 | oldxkey = x_key;
|
---|
| 828 | oldekey = e_key;
|
---|
| 829 | oldmkey = m_key;
|
---|
| 830 | d_key = loadkey;
|
---|
| 831 | x_key = l_load;
|
---|
| 832 | e_key = l_load;
|
---|
| 833 | m_key = l_load;
|
---|
| 834 |
|
---|
| 835 | loadsw = TRUE;
|
---|
| 836 |
|
---|
| 837 | lcdlbls();
|
---|
[0580615] | 838 | lseg(LOAD_XL, LOAD_Y, LOAD_XR, LOAD_Y, 1);
|
---|
[f40a309] | 839 | }
|
---|
[7258c6a] | 840 |
|
---|
| 841 | GLCcurs(G_OFF);
|
---|
| 842 | setleds();
|
---|
[f40a309] | 843 | }
|
---|
| 844 |
|
---|
| 845 | /* |
---|
| 846 |
|
---|
| 847 | */
|
---|
| 848 |
|
---|
| 849 | /*
|
---|
| 850 | =============================================================================
|
---|
| 851 | lcdlbls() -- put up the labels on the LCD display
|
---|
| 852 | =============================================================================
|
---|
| 853 | */
|
---|
| 854 |
|
---|
| 855 | void lcdlbls(void)
|
---|
| 856 | {
|
---|
| 857 | register int16_t i, barval;
|
---|
| 858 | int8_t buf[8];
|
---|
| 859 | int8_t dsp[86];
|
---|
| 860 |
|
---|
| 861 | point = GLCplot; /* set up to plot on the LCD */
|
---|
| 862 |
|
---|
| 863 | GLCinit(); /* clear the LCD display */
|
---|
| 864 | GLCcurs(G_ON);
|
---|
| 865 |
|
---|
| 866 | /* label the switches */
|
---|
| 867 |
|
---|
| 868 | switch (sliders) {
|
---|
| 869 |
|
---|
| 870 | case LS_PRMTR: /* parameter articulation */
|
---|
| 871 | case LS_OTHER: /* other stuff */
|
---|
| 872 | case LS_EQ: /* equalization */
|
---|
| 873 |
|
---|
| 874 | GLCtext(0, 1, swtlbls[sliders]);
|
---|
| 875 |
|
---|
| 876 | switch (gomode) {
|
---|
| 877 |
|
---|
| 878 | case GO_SECT:
|
---|
| 879 |
|
---|
| 880 | GLCtext(0, 31, "Sectn");
|
---|
| 881 | lseg(GOTO_XL, GOTO_Y, GOTO_XR, GOTO_Y, 1);
|
---|
| 882 | break;
|
---|
| 883 |
|
---|
| 884 | case GO_SCOR:
|
---|
| 885 |
|
---|
| 886 | GLCtext(0, 31, "Score");
|
---|
| 887 | lseg(GOTO_XL, GOTO_Y, GOTO_XR, GOTO_Y, 1);
|
---|
| 888 | break;
|
---|
| 889 |
|
---|
| 890 | default:
|
---|
| 891 |
|
---|
| 892 | GLCtext(0, 31, "Go To");
|
---|
| 893 | lseg(GOTO_XL, GOTO_Y, GOTO_XR, GOTO_Y, 0);
|
---|
| 894 | break;
|
---|
| 895 | }
|
---|
| 896 |
|
---|
| 897 | break;
|
---|
| 898 | /* |
---|
| 899 |
|
---|
| 900 | */
|
---|
| 901 | case LS_VOICE: /* voice selection */
|
---|
| 902 |
|
---|
| 903 | dsp[0] = '\0';
|
---|
| 904 |
|
---|
| 905 | for (i = 0; i < 12; i++) {
|
---|
| 906 |
|
---|
| 907 | sprintf(buf, "%c%2d %c ",
|
---|
| 908 | (articen[i] ? '\176' : ' '), i + 1,
|
---|
| 909 | (articen[i] ? '\177' : ' '));
|
---|
| 910 |
|
---|
| 911 | strcat(dsp, buf);
|
---|
| 912 | }
|
---|
| 913 |
|
---|
| 914 | strcat(dsp, "Voice Init ");
|
---|
| 915 |
|
---|
| 916 | GLCtext(0, 1, dsp);
|
---|
| 917 | break;
|
---|
| 918 |
|
---|
| 919 | case LS_INST: /* instrument selection */
|
---|
| 920 |
|
---|
| 921 | dsp[0] = '\0';
|
---|
| 922 |
|
---|
| 923 | for (i = 0; i < 12; i++) {
|
---|
| 924 |
|
---|
| 925 | sprintf(buf, "%c%2d %c ",
|
---|
| 926 | (grpsel[i] ? '\176' : ' '), i + 1,
|
---|
| 927 | (grpsel[i] ? '\177' : ' '));
|
---|
| 928 |
|
---|
| 929 | strcat(dsp, buf);
|
---|
| 930 | }
|
---|
| 931 |
|
---|
| 932 | if (ismode EQ IS_HORC)
|
---|
| 933 | strcat(dsp, " +20 "); /* hi orc */
|
---|
| 934 | else
|
---|
| 935 | strcat(dsp, " +00 "); /* lo orc */
|
---|
| 936 |
|
---|
| 937 | strcat(dsp, " Deflt");
|
---|
| 938 |
|
---|
| 939 | GLCtext(0, 1, dsp);
|
---|
| 940 | break;
|
---|
| 941 |
|
---|
| 942 | case LS_LIBR:
|
---|
| 943 | case LS_NGRP:
|
---|
| 944 | case LS_LOAD:
|
---|
| 945 |
|
---|
| 946 | GLCtext(0, 1, swtlbls[sliders]);
|
---|
| 947 | break;
|
---|
| 948 | }
|
---|
| 949 |
|
---|
| 950 | /* |
---|
| 951 |
|
---|
| 952 | */
|
---|
| 953 | GLCtext(7, 1, potlbls[sliders]); /* label the pots */
|
---|
| 954 |
|
---|
| 955 | for (i = 0; i < 13; i++)
|
---|
| 956 | lseg(39 + (i * 36), 0, 39 + (i * 36), 63, 1);
|
---|
| 957 |
|
---|
| 958 | switch (sliders) { /* draw the slider bars */
|
---|
| 959 |
|
---|
| 960 | case LS_PRMTR: /* parameter articulation */
|
---|
| 961 | case LS_VOICE: /* voice articulation enable */
|
---|
| 962 | case LS_INST: /* instrument select */
|
---|
| 963 | case LS_LIBR: /* library select */
|
---|
| 964 | case LS_NGRP: /* group select */
|
---|
[9519422] | 965 | case LS_LOAD: /* load select */
|
---|
[f40a309] | 966 |
|
---|
| 967 | for (i = 0; i < 14; i++) {
|
---|
| 968 |
|
---|
| 969 | if (BarType[i]) {
|
---|
| 970 |
|
---|
| 971 | barval = (((BGprmtr[i] >> 5) - 500) << 6) / 252;
|
---|
| 972 | BarCset(i, barval);
|
---|
| 973 |
|
---|
| 974 | } else {
|
---|
| 975 |
|
---|
| 976 | barval = BGprmtr[i] / 252;
|
---|
| 977 | BarBset(i, barval);
|
---|
| 978 | }
|
---|
| 979 | }
|
---|
| 980 |
|
---|
| 981 | break;
|
---|
| 982 |
|
---|
| 983 | case LS_OTHER:
|
---|
| 984 |
|
---|
| 985 | for (i = 0; i < 14; i++)
|
---|
| 986 | BarBset(i, (BGother[i] / 252));
|
---|
| 987 |
|
---|
| 988 | break;
|
---|
| 989 |
|
---|
| 990 | case LS_EQ:
|
---|
| 991 |
|
---|
| 992 | for (i = 0; i < 14; i++)
|
---|
| 993 | BarCset(i, BGeq[i]);
|
---|
| 994 |
|
---|
| 995 | break;
|
---|
| 996 |
|
---|
| 997 | default:
|
---|
[7258c6a] | 998 |
|
---|
[f40a309] | 999 | break;
|
---|
| 1000 | }
|
---|
| 1001 |
|
---|
| 1002 | GLCcurs(G_OFF);
|
---|
| 1003 | dsrpmod();
|
---|
| 1004 | dclkmd();
|
---|
| 1005 | ulamp();
|
---|
| 1006 | }
|
---|
| 1007 |
|
---|
| 1008 | /* |
---|
| 1009 |
|
---|
| 1010 | */
|
---|
| 1011 |
|
---|
| 1012 | /*
|
---|
| 1013 | =============================================================================
|
---|
| 1014 | selasg() -- select assignment table
|
---|
| 1015 | =============================================================================
|
---|
| 1016 | */
|
---|
| 1017 |
|
---|
| 1018 | void selasg(int16_t n)
|
---|
| 1019 | {
|
---|
| 1020 | register struct s_entry *ep;
|
---|
| 1021 |
|
---|
| 1022 | getasg(curasg = n); /* set the assignment */
|
---|
| 1023 |
|
---|
| 1024 | if (recsw) { /* if we're recording ... */
|
---|
| 1025 |
|
---|
| 1026 | if (E_NULL NE (ep = findev(p_cur, t_cur, EV_ASGN, -1, -1))) {
|
---|
| 1027 |
|
---|
| 1028 | ep->e_data1 = n; /* update old event */
|
---|
| 1029 |
|
---|
| 1030 | } else if (E_NULL NE (ep = e_alc(E_SIZE2))) {
|
---|
| 1031 |
|
---|
| 1032 | ep->e_type = EV_ASGN; /* create new event */
|
---|
| 1033 | ep->e_data1 = n;
|
---|
| 1034 | ep->e_time = t_cur;
|
---|
| 1035 | p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
|
---|
| 1036 | eh_ins(ep, EH_ASGN);
|
---|
| 1037 |
|
---|
| 1038 | if (ndisp EQ 2) { /* if the score is up ... */
|
---|
| 1039 |
|
---|
| 1040 | ctrsw = TRUE;
|
---|
| 1041 | se_disp(ep, D_FWD, gdstbc, 1);
|
---|
| 1042 | scupd();
|
---|
| 1043 | }
|
---|
| 1044 | }
|
---|
| 1045 | }
|
---|
| 1046 |
|
---|
| 1047 | asmode = 0; /* drop out of assignment mode */
|
---|
| 1048 | pkctrl = oldpk; /* restore previous mode */
|
---|
| 1049 | swpt = oldsw;
|
---|
[7258c6a] | 1050 |
|
---|
[f40a309] | 1051 | point = GLCplot; /* update the LCD */
|
---|
| 1052 | GLCcurs(G_ON);
|
---|
| 1053 | lseg(ASGN_XL, ASGN_Y, ASGN_XR, ASGN_Y, 0);
|
---|
| 1054 | GLCtext(0, 1, swtlbls[sliders]);
|
---|
| 1055 | GLCcurs(G_OFF);
|
---|
| 1056 |
|
---|
| 1057 | mpcupd(); /* update the video display ... */
|
---|
| 1058 | setleds(); /* ... and the LEDs */
|
---|
| 1059 | }
|
---|
| 1060 |
|
---|
| 1061 | /* |
---|
| 1062 |
|
---|
| 1063 | */
|
---|
| 1064 |
|
---|
| 1065 | /*
|
---|
| 1066 | =============================================================================
|
---|
[7258c6a] | 1067 | l_adfl() -- select default assignment table
|
---|
[f40a309] | 1068 | =============================================================================
|
---|
| 1069 | */
|
---|
| 1070 |
|
---|
| 1071 | void l_adfl(int16_t stat, int16_t _2)
|
---|
| 1072 | {
|
---|
| 1073 | if (NOT stat)
|
---|
| 1074 | return;
|
---|
| 1075 |
|
---|
| 1076 | selasg(0);
|
---|
| 1077 | }
|
---|
| 1078 |
|
---|
| 1079 | /* |
---|
| 1080 |
|
---|
| 1081 | */
|
---|
| 1082 |
|
---|
| 1083 | /*
|
---|
| 1084 | =============================================================================
|
---|
| 1085 | l_asgn() -- select assignment
|
---|
| 1086 | =============================================================================
|
---|
| 1087 | */
|
---|
| 1088 |
|
---|
| 1089 | void l_asgn(int16_t stat, int16_t _2)
|
---|
| 1090 | {
|
---|
| 1091 | if (NOT stat) /* only do this on key closure */
|
---|
| 1092 | return;
|
---|
| 1093 |
|
---|
| 1094 | point = GLCplot; /* set up to plot on the LCD */
|
---|
| 1095 | GLCcurs(G_ON);
|
---|
| 1096 |
|
---|
| 1097 | if (ismode NE IS_NULL) { /* cancel instrument select mode */
|
---|
| 1098 |
|
---|
| 1099 | ismode = IS_NULL;
|
---|
| 1100 | pkctrl = oldpk;
|
---|
| 1101 | sliders = oldsl;
|
---|
| 1102 | swpt = oldsw;
|
---|
[6dd74a9] | 1103 | lcdlbls();
|
---|
[f40a309] | 1104 | }
|
---|
| 1105 |
|
---|
| 1106 | if (gomode NE GO_NULL) { /* cancel Go To mode */
|
---|
| 1107 |
|
---|
| 1108 | gomode = GO_NULL;
|
---|
| 1109 | pkctrl = oldpk;
|
---|
| 1110 | lseg(GOTO_XL, GOTO_Y, GOTO_XR, GOTO_Y, 0);
|
---|
| 1111 | }
|
---|
| 1112 | /* |
---|
| 1113 |
|
---|
| 1114 | */
|
---|
| 1115 | switch (asmode) {
|
---|
| 1116 |
|
---|
| 1117 | case 0: /* initial actuation */
|
---|
| 1118 |
|
---|
| 1119 | if ((pkctrl EQ PK_PFRM) OR (pkctrl EQ PK_NOTE))
|
---|
| 1120 | oldpk = pkctrl;
|
---|
| 1121 |
|
---|
| 1122 | asmode = (curasg ? ((curasg - 1) / 20) : 0) + 1;
|
---|
| 1123 | pkctrl = PK_ASGN;
|
---|
| 1124 | memcpy(aswtbl, swpt, sizeof t_prmtr);
|
---|
| 1125 | oldsw = swpt;
|
---|
| 1126 | swpt = &aswtbl;
|
---|
| 1127 | aswtbl[13] = l_adfl;
|
---|
| 1128 | lseg(ASGN_XL, ASGN_Y, ASGN_XR, ASGN_Y, 1);
|
---|
| 1129 | GLCtext(0, 79, "Deflt");
|
---|
| 1130 | break;
|
---|
| 1131 |
|
---|
| 1132 | case 1: /* +00 -- 01..20 to +20 */
|
---|
| 1133 | case 2: /* +20 -- 21..40 to +40 */
|
---|
| 1134 | case 3: /* +40 -- 41..60 to +60 */
|
---|
| 1135 | case 4: /* +60 -- 61..80 to +80 */
|
---|
| 1136 |
|
---|
| 1137 | ++asmode;
|
---|
[7258c6a] | 1138 | break;
|
---|
[f40a309] | 1139 |
|
---|
| 1140 | case 5: /* +80 -- 81..99 to +00 */
|
---|
| 1141 |
|
---|
| 1142 | asmode = 1;
|
---|
| 1143 | break;
|
---|
| 1144 |
|
---|
| 1145 | }
|
---|
| 1146 |
|
---|
| 1147 | GLCtext(0, 43, aslbls[asmode]);
|
---|
[9519422] | 1148 | GLCcurs(G_OFF);
|
---|
[f40a309] | 1149 | setleds();
|
---|
| 1150 | }
|
---|
| 1151 |
|
---|
| 1152 | /* |
---|
| 1153 |
|
---|
| 1154 | */
|
---|
| 1155 |
|
---|
| 1156 | /*
|
---|
| 1157 | =============================================================================
|
---|
| 1158 | l_inst() -- set select instrument mode
|
---|
| 1159 | =============================================================================
|
---|
| 1160 | */
|
---|
| 1161 |
|
---|
| 1162 | void l_inst(int16_t stat, int16_t _2)
|
---|
| 1163 | {
|
---|
| 1164 | if (NOT stat)
|
---|
| 1165 | return;
|
---|
| 1166 |
|
---|
| 1167 | point = GLCplot; /* set up to plot on the LCD */
|
---|
| 1168 | GLCcurs(G_ON);
|
---|
| 1169 |
|
---|
| 1170 | if (asmode) { /* cancel assignment mode */
|
---|
| 1171 |
|
---|
| 1172 | asmode = 0;
|
---|
| 1173 | pkctrl = oldpk;
|
---|
| 1174 | swpt = oldsw;
|
---|
[6dd74a9] | 1175 | lseg(ASGN_XL, ASGN_Y, ASGN_XR, ASGN_Y, 0);
|
---|
[f40a309] | 1176 | }
|
---|
| 1177 |
|
---|
| 1178 | if (gomode NE GO_NULL) { /* cancel Go To mode */
|
---|
| 1179 |
|
---|
| 1180 | gomode = GO_NULL;
|
---|
| 1181 | pkctrl = oldpk;
|
---|
| 1182 | lseg(GOTO_XL, GOTO_Y, GOTO_XR, GOTO_Y, 0);
|
---|
| 1183 | }
|
---|
| 1184 |
|
---|
| 1185 | GLCcurs(G_OFF);
|
---|
| 1186 | /* |
---|
| 1187 |
|
---|
| 1188 | */
|
---|
| 1189 | switch (ismode) {
|
---|
| 1190 |
|
---|
| 1191 | case IS_NULL: /* select +00 -- low orchestra */
|
---|
| 1192 |
|
---|
| 1193 | if ((pkctrl EQ PK_PFRM) OR (pkctrl EQ PK_NOTE))
|
---|
| 1194 | oldpk = pkctrl;
|
---|
| 1195 |
|
---|
| 1196 | if (sliders NE LS_INST)
|
---|
| 1197 | oldsl = sliders;
|
---|
| 1198 |
|
---|
| 1199 | oldsw = swpt;
|
---|
| 1200 | swpt = &t_inst;
|
---|
| 1201 | pkctrl = PK_INST;
|
---|
| 1202 | ismode = IS_LORC;
|
---|
| 1203 | sliders = LS_INST;
|
---|
| 1204 | lcdlbls();
|
---|
| 1205 | break;
|
---|
| 1206 |
|
---|
| 1207 | case IS_LORC: /* select +20 -- high orchestra */
|
---|
| 1208 |
|
---|
| 1209 | ismode = IS_HORC;
|
---|
| 1210 | GLCcurs(G_ON);
|
---|
| 1211 | GLCtext(0, 73, " +20 ");
|
---|
| 1212 | GLCcurs(G_OFF);
|
---|
[7258c6a] | 1213 | break;
|
---|
[f40a309] | 1214 |
|
---|
[7258c6a] | 1215 | case IS_HORC: /* deselect */
|
---|
[f40a309] | 1216 | default:
|
---|
| 1217 |
|
---|
| 1218 | ismode = IS_NULL;
|
---|
| 1219 | pkctrl = oldpk;
|
---|
| 1220 | sliders = oldsl;
|
---|
| 1221 | swpt = oldsw;
|
---|
| 1222 | lcdlbls();
|
---|
| 1223 | break;
|
---|
| 1224 | }
|
---|
| 1225 |
|
---|
| 1226 | setleds();
|
---|
| 1227 | }
|
---|
| 1228 |
|
---|
| 1229 | /* |
---|
| 1230 |
|
---|
| 1231 | */
|
---|
| 1232 |
|
---|
| 1233 | /*
|
---|
| 1234 | =============================================================================
|
---|
| 1235 | selins() -- select an instrument
|
---|
| 1236 | =============================================================================
|
---|
| 1237 | */
|
---|
| 1238 |
|
---|
| 1239 | void selins(int16_t ival)
|
---|
| 1240 | {
|
---|
| 1241 | register int16_t n;
|
---|
| 1242 | register struct s_entry *ep;
|
---|
| 1243 |
|
---|
| 1244 | for (n = 0; n < 12; n++) {
|
---|
| 1245 |
|
---|
| 1246 | if (FALSE EQ grpsel[n])
|
---|
| 1247 | continue;
|
---|
| 1248 |
|
---|
| 1249 | ins2grp[n] = ival | (ins2grp[n] & 0xFF00);
|
---|
| 1250 | setv2gi(n);
|
---|
| 1251 |
|
---|
| 1252 | if (recsw AND grpstat[n] AND (2 EQ grpmode[n])) {
|
---|
| 1253 |
|
---|
| 1254 | if (E_NULL NE (ep = findev(p_cur, t_cur, EV_INST, n, -1))) {
|
---|
| 1255 |
|
---|
| 1256 | ep->e_data2 = ival;
|
---|
| 1257 |
|
---|
| 1258 | } else if (E_NULL NE (ep = e_alc(E_SIZE2))) {
|
---|
| 1259 |
|
---|
| 1260 | ep->e_type = EV_INST;
|
---|
| 1261 | ep->e_data1 = n;
|
---|
| 1262 | ep->e_data2 = ival;
|
---|
| 1263 | ep->e_time = t_cur;
|
---|
| 1264 | p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
|
---|
| 1265 | eh_ins(ep, EH_INST);
|
---|
| 1266 |
|
---|
| 1267 | if (ndisp EQ 2) {
|
---|
| 1268 |
|
---|
| 1269 | ctrsw = TRUE;
|
---|
| 1270 | se_disp(ep, D_FWD, gdstbc, 1);
|
---|
| 1271 | scupd();
|
---|
| 1272 | }
|
---|
[7258c6a] | 1273 | }
|
---|
[f40a309] | 1274 | }
|
---|
| 1275 | }
|
---|
| 1276 |
|
---|
| 1277 | setinst();
|
---|
| 1278 |
|
---|
| 1279 | /* |
---|
| 1280 |
|
---|
| 1281 | */
|
---|
| 1282 | ismode = IS_NULL;
|
---|
| 1283 | pkctrl = oldpk;
|
---|
| 1284 | sliders = oldsl;
|
---|
| 1285 | swpt = oldsw;
|
---|
| 1286 | lcdlbls();
|
---|
| 1287 | setleds();
|
---|
| 1288 | mpcupd();
|
---|
| 1289 | }
|
---|
[7258c6a] | 1290 |
|
---|
[f40a309] | 1291 | /* |
---|
| 1292 |
|
---|
| 1293 | */
|
---|
| 1294 |
|
---|
| 1295 | /*
|
---|
| 1296 | =============================================================================
|
---|
| 1297 | l_dflt() -- select default isntrument
|
---|
| 1298 | =============================================================================
|
---|
| 1299 | */
|
---|
[9519422] | 1300 |
|
---|
[f40a309] | 1301 | void l_dflt(int16_t stat, int16_t _2)
|
---|
| 1302 | {
|
---|
| 1303 | if (NOT stat)
|
---|
| 1304 | return;
|
---|
| 1305 |
|
---|
| 1306 | selins(0);
|
---|
| 1307 | }
|
---|
| 1308 |
|
---|
| 1309 | /* |
---|
| 1310 |
|
---|
| 1311 | */
|
---|
| 1312 |
|
---|
| 1313 | /*
|
---|
| 1314 | =============================================================================
|
---|
| 1315 | l_goto() -- go to (section / score)
|
---|
| 1316 | =============================================================================
|
---|
| 1317 | */
|
---|
| 1318 |
|
---|
| 1319 | void l_goto(int16_t stat, int16_t _2)
|
---|
| 1320 | {
|
---|
| 1321 | if (NOT stat) /* only do this on key closure */
|
---|
| 1322 | return;
|
---|
| 1323 |
|
---|
| 1324 | point = GLCplot; /* set up to plot on the LCD */
|
---|
| 1325 | GLCcurs(G_ON);
|
---|
| 1326 |
|
---|
| 1327 | if (asmode) { /* cancel assignment mode */
|
---|
| 1328 |
|
---|
| 1329 | asmode = 0;
|
---|
| 1330 | pkctrl = oldpk;
|
---|
| 1331 | swpt = oldsw;
|
---|
| 1332 | lseg(ASGN_XL, ASGN_Y, ASGN_XR, ASGN_Y, 0);
|
---|
| 1333 | }
|
---|
| 1334 |
|
---|
| 1335 | if (ismode NE IS_NULL) { /* cancel instrument select mode */
|
---|
| 1336 |
|
---|
| 1337 | ismode = IS_NULL;
|
---|
| 1338 | sliders = oldsl;
|
---|
| 1339 | pkctrl = oldpk;
|
---|
| 1340 | swpt = oldsw;
|
---|
| 1341 | lcdlbls();
|
---|
| 1342 | }
|
---|
| 1343 |
|
---|
| 1344 | recsw = FALSE; /* force play mode */
|
---|
| 1345 | dsrpmod();
|
---|
| 1346 | /* |
---|
| 1347 |
|
---|
| 1348 | */
|
---|
| 1349 | switch (gomode) { /* select Go To mode */
|
---|
| 1350 |
|
---|
| 1351 | case GO_NULL:
|
---|
| 1352 |
|
---|
| 1353 | if ((pkctrl EQ PK_PFRM) OR (pkctrl EQ PK_NOTE))
|
---|
| 1354 | oldpk = pkctrl;
|
---|
| 1355 |
|
---|
| 1356 | pkctrl = PK_GOTO;
|
---|
| 1357 | gomode = GO_SECT;
|
---|
| 1358 | GLCtext(0, 31, "Sectn");
|
---|
| 1359 | lseg(GOTO_XL, GOTO_Y, GOTO_XR, GOTO_Y, 1);
|
---|
| 1360 | break;
|
---|
| 1361 |
|
---|
[7258c6a] | 1362 | case GO_SECT:
|
---|
[f40a309] | 1363 |
|
---|
| 1364 | gomode = GO_SCOR;
|
---|
[7258c6a] | 1365 | GLCtext(0, 31, "Score");
|
---|
| 1366 | lseg(GOTO_XL, GOTO_Y, GOTO_XR, GOTO_Y, 1);
|
---|
| 1367 | break;
|
---|
| 1368 |
|
---|
| 1369 | case GO_SCOR:
|
---|
[f40a309] | 1370 | default:
|
---|
| 1371 |
|
---|
| 1372 | pkctrl = oldpk;
|
---|
| 1373 | gomode = GO_NULL;
|
---|
| 1374 | GLCtext(0, 31, "Go To");
|
---|
| 1375 | lseg(GOTO_XL, GOTO_Y, GOTO_XR, GOTO_Y, 0);
|
---|
| 1376 | break;
|
---|
| 1377 | }
|
---|
| 1378 |
|
---|
| 1379 | GLCcurs(G_OFF);
|
---|
| 1380 | setleds();
|
---|
| 1381 | }
|
---|
| 1382 |
|
---|
| 1383 | /* |
---|
| 1384 |
|
---|
| 1385 | */
|
---|
| 1386 |
|
---|
| 1387 | /*
|
---|
| 1388 | =============================================================================
|
---|
| 1389 | newpps() -- send out new polyphonic pressure source value
|
---|
| 1390 | =============================================================================
|
---|
| 1391 | */
|
---|
| 1392 |
|
---|
| 1393 | void newpps(int16_t trg, int16_t grp, int16_t src, int16_t ival)
|
---|
| 1394 | {
|
---|
| 1395 | register struct sment *smf, *smp;
|
---|
[7258c6a] | 1396 | register uint16_t *fpu;
|
---|
[f40a309] | 1397 | register int32_t ltmp;
|
---|
[7258c6a] | 1398 | register int16_t val;
|
---|
| 1399 | register int16_t vce;
|
---|
| 1400 | int16_t gs, oldi;
|
---|
| 1401 |
|
---|
[f40a309] | 1402 | gs = (grp << 4) | src; /* calculate group/source index */
|
---|
[7258c6a] | 1403 | fpu = io_fpu + FPU_OFNC; /* point at FPU base */
|
---|
[f40a309] | 1404 | valents[gs].val = ival; /* update value in table */
|
---|
| 1405 | smp = smf = (struct sment *)&valents[gs];
|
---|
| 1406 |
|
---|
| 1407 | /* |
---|
| 1408 |
|
---|
| 1409 | */
|
---|
| 1410 | while (smf NE (smp = smp->nxt)) { /* for each function ... */
|
---|
| 1411 |
|
---|
| 1412 | vce = (smp->vp >> 4) & 0x0F; /* extract voice number */
|
---|
| 1413 |
|
---|
| 1414 | if (vce2trg[vce] EQ trg) { /* for each key that matches ... */
|
---|
| 1415 |
|
---|
| 1416 | switch (smp->vp & 0x000F) {
|
---|
| 1417 |
|
---|
| 1418 | case 1: /* frq 1 */
|
---|
| 1419 | case 3: /* frq 2 */
|
---|
| 1420 | case 5: /* frq 3 */
|
---|
| 1421 | case 7: /* frq 4 */
|
---|
| 1422 |
|
---|
| 1423 | val = ival >> 3;
|
---|
| 1424 | break;
|
---|
| 1425 |
|
---|
| 1426 | case 10: /* filtr */
|
---|
| 1427 |
|
---|
| 1428 | ltmp = ((int32_t)ival >> 1) + ((int32_t)ival >> 2);
|
---|
| 1429 |
|
---|
| 1430 | if (ltmp > (int32_t)VALMAX)
|
---|
| 1431 | ltmp = (int32_t)VALMAX;
|
---|
| 1432 | else if (ltmp < (int32_t)VALMIN)
|
---|
| 1433 | ltmp = (int32_t)VALMIN;
|
---|
[7258c6a] | 1434 |
|
---|
[f40a309] | 1435 | val = (int16_t)ltmp;
|
---|
| 1436 | break;
|
---|
[7258c6a] | 1437 |
|
---|
| 1438 | default:
|
---|
| 1439 |
|
---|
| 1440 | val = ival;
|
---|
| 1441 | }
|
---|
| 1442 |
|
---|
[f40a309] | 1443 | oldi = setipl(FPU_DI);
|
---|
| 1444 |
|
---|
| 1445 | /* ++++++++++++++++++++++++++++ FPU interrupts disabled +++++++++++++++++++++ */
|
---|
| 1446 |
|
---|
| 1447 | *(fpu + (smp->vp << 4) + FPU_TCV1) = val;
|
---|
| 1448 |
|
---|
| 1449 | setipl(oldi);
|
---|
| 1450 |
|
---|
| 1451 | /* ++++++++++++++++++++++++++++ Interrupts restored +++++++++++++++++++++++++ */
|
---|
| 1452 |
|
---|
| 1453 | }
|
---|
| 1454 | }
|
---|
| 1455 | }
|
---|
| 1456 |
|
---|
| 1457 | /* |
---|
| 1458 |
|
---|
| 1459 | */
|
---|
| 1460 |
|
---|
| 1461 | /*
|
---|
| 1462 | =============================================================================
|
---|
| 1463 | newsv() -- send out new source value if it's changed
|
---|
| 1464 | =============================================================================
|
---|
| 1465 | */
|
---|
| 1466 |
|
---|
| 1467 | int16_t newsv(int16_t grp, int16_t src, int16_t ival)
|
---|
| 1468 | {
|
---|
| 1469 | register struct sment *smf, *smp;
|
---|
| 1470 | register uint16_t *fpu;
|
---|
| 1471 | register int32_t ltmp;
|
---|
| 1472 | register int16_t val;
|
---|
| 1473 | register int16_t gs;
|
---|
| 1474 | register int16_t oldi;
|
---|
| 1475 | int16_t vmask, var;
|
---|
| 1476 |
|
---|
| 1477 | gs = (grp << 4) | src; /* calculate grp/src index */
|
---|
| 1478 |
|
---|
| 1479 | if (-1 NE (var = src2var[src])) { /* see if its a variable */
|
---|
| 1480 |
|
---|
| 1481 | vmask = vmasks[anrs[var][grp]]; /* setup resolution mask */
|
---|
| 1482 |
|
---|
| 1483 | /* see if we have a change in the selected significant bits */
|
---|
[7258c6a] | 1484 |
|
---|
[f40a309] | 1485 | if (((val = valents[gs].val) & vmask) EQ (ival & vmask)) {
|
---|
[7258c6a] | 1486 |
|
---|
| 1487 | /* make sure we always see a change to zero */
|
---|
| 1488 |
|
---|
| 1489 | if (NOT ((ival EQ 0) AND val)) /* if not becoming zero */
|
---|
[f40a309] | 1490 | return(FALSE); /* ... it didn't change enough */
|
---|
[7258c6a] | 1491 | }
|
---|
[f40a309] | 1492 | }
|
---|
| 1493 |
|
---|
| 1494 | fpu = io_fpu + FPU_OFNC; /* point to FPU */
|
---|
| 1495 |
|
---|
| 1496 | valents[gs].val = ival; /* update value in table */
|
---|
| 1497 |
|
---|
| 1498 | smf = (struct sment *)&valents[gs]; /* point at value table */
|
---|
| 1499 | smp = smf;
|
---|
| 1500 |
|
---|
| 1501 | /* |
---|
| 1502 |
|
---|
| 1503 | */
|
---|
| 1504 | while (smf NE (smp = smp->nxt)) { /* update functions */
|
---|
| 1505 |
|
---|
| 1506 | switch (smp->vp & 0x000F) {
|
---|
| 1507 |
|
---|
| 1508 | case 1: /* frq 1 */
|
---|
| 1509 | case 3: /* frq 2 */
|
---|
| 1510 | case 5: /* frq 3 */
|
---|
| 1511 | case 7: /* frq 4 */
|
---|
| 1512 |
|
---|
| 1513 | val = ival >> 3;
|
---|
| 1514 | break;
|
---|
| 1515 |
|
---|
| 1516 | case 10: /* filtr */
|
---|
| 1517 |
|
---|
| 1518 | ltmp = ((int32_t)ival >> 1) + ((int32_t)ival >> 2);
|
---|
| 1519 |
|
---|
| 1520 | if (ltmp > (int32_t)VALMAX)
|
---|
| 1521 | ltmp = (int32_t)VALMAX;
|
---|
| 1522 | else if (ltmp < (int32_t)VALMIN)
|
---|
[7258c6a] | 1523 | ltmp = (int32_t)VALMIN;
|
---|
[f40a309] | 1524 |
|
---|
| 1525 | val = (int16_t)ltmp;
|
---|
[7258c6a] | 1526 | break;
|
---|
| 1527 |
|
---|
| 1528 | default:
|
---|
| 1529 |
|
---|
| 1530 | val = ival;
|
---|
[f40a309] | 1531 | }
|
---|
| 1532 |
|
---|
| 1533 | oldi = setipl(FPU_DI);
|
---|
| 1534 |
|
---|
| 1535 | /* ++++++++++++++++++++++++++++ FPU interrupts disabled +++++++++++++++++++++ */
|
---|
| 1536 |
|
---|
| 1537 | *(fpu + (smp->vp << 4) + FPU_TCV1) = val;
|
---|
| 1538 |
|
---|
| 1539 | setipl(oldi);
|
---|
| 1540 |
|
---|
| 1541 | /* ++++++++++++++++++++++++++++ Interrupts restored +++++++++++++++++++++++++ */
|
---|
| 1542 |
|
---|
| 1543 | }
|
---|
| 1544 |
|
---|
| 1545 | return(TRUE);
|
---|
| 1546 | }
|
---|
| 1547 |
|
---|
| 1548 | /* |
---|
| 1549 |
|
---|
| 1550 | */
|
---|
| 1551 |
|
---|
| 1552 | /*
|
---|
| 1553 | =============================================================================
|
---|
| 1554 | setsv() -- unconditionally send out new source value
|
---|
| 1555 | =============================================================================
|
---|
[7258c6a] | 1556 | */
|
---|
[f40a309] | 1557 |
|
---|
[7258c6a] | 1558 | void setsv(int16_t grp, int16_t src, int16_t ival)
|
---|
| 1559 | {
|
---|
| 1560 | register struct sment *smf, *smp;
|
---|
| 1561 | register uint16_t *fpu;
|
---|
[f40a309] | 1562 | register int32_t ltmp;
|
---|
[7258c6a] | 1563 | register int16_t val;
|
---|
[f40a309] | 1564 | register int16_t gs;
|
---|
| 1565 | register int16_t oldi;
|
---|
| 1566 |
|
---|
| 1567 | gs = (grp << 4) | src; /* calculate grp/src index */
|
---|
| 1568 | fpu = io_fpu + FPU_OFNC; /* point to FPU */
|
---|
| 1569 |
|
---|
| 1570 | valents[gs].val = ival; /* update value in table */
|
---|
| 1571 |
|
---|
| 1572 | smf = (struct sment *)&valents[gs]; /* point at value table */
|
---|
| 1573 | smp = smf;
|
---|
| 1574 |
|
---|
| 1575 | /* |
---|
| 1576 |
|
---|
| 1577 | */
|
---|
| 1578 | while (smf NE (smp = smp->nxt)) { /* update functions */
|
---|
| 1579 |
|
---|
| 1580 | switch (smp->vp & 0x000F) {
|
---|
| 1581 |
|
---|
| 1582 | case 1: /* frq 1 */
|
---|
| 1583 | case 3: /* frq 2 */
|
---|
| 1584 | case 5: /* frq 3 */
|
---|
| 1585 | case 7: /* frq 4 */
|
---|
| 1586 |
|
---|
| 1587 | val = ival >> 3;
|
---|
| 1588 | break;
|
---|
| 1589 |
|
---|
| 1590 | case 10: /* filtr */
|
---|
| 1591 |
|
---|
| 1592 | ltmp = ((int32_t)ival >> 1) + ((int32_t)ival >> 2);
|
---|
[7258c6a] | 1593 |
|
---|
[f40a309] | 1594 | if (ltmp > (int32_t)VALMAX)
|
---|
| 1595 | ltmp = (int32_t)VALMAX;
|
---|
| 1596 | else if (ltmp < (int32_t)VALMIN)
|
---|
| 1597 | ltmp = (int32_t)VALMIN;
|
---|
| 1598 |
|
---|
| 1599 | val = (int16_t)ltmp;
|
---|
| 1600 | break;
|
---|
| 1601 |
|
---|
| 1602 | default:
|
---|
| 1603 |
|
---|
| 1604 | val = ival;
|
---|
[6dd74a9] | 1605 | }
|
---|
[f40a309] | 1606 |
|
---|
| 1607 | oldi = setipl(FPU_DI);
|
---|
| 1608 |
|
---|
| 1609 | /* ++++++++++++++++++++++++++++ FPU interrupts disabled +++++++++++++++++++++ */
|
---|
| 1610 |
|
---|
| 1611 | *(fpu + (smp->vp << 4) + FPU_TCV1) = val;
|
---|
[6dd74a9] | 1612 |
|
---|
[f40a309] | 1613 | setipl(oldi);
|
---|
| 1614 |
|
---|
| 1615 | /* ++++++++++++++++++++++++++++ Interrupts restored +++++++++++++++++++++++++ */
|
---|
| 1616 |
|
---|
| 1617 | }
|
---|
| 1618 | }
|
---|
| 1619 |
|
---|
| 1620 | /* |
---|
| 1621 |
|
---|
| 1622 | */
|
---|
| 1623 |
|
---|
| 1624 | /*
|
---|
| 1625 | =============================================================================
|
---|
| 1626 | l_prmtr() -- set parameter articulation status
|
---|
| 1627 | =============================================================================
|
---|
| 1628 | */
|
---|
[7258c6a] | 1629 |
|
---|
[f40a309] | 1630 | void l_prmtr(int16_t stat, int16_t sig)
|
---|
[7258c6a] | 1631 | {
|
---|
| 1632 | if (NOT stat)
|
---|
[f40a309] | 1633 | return;
|
---|
[7258c6a] | 1634 |
|
---|
[f40a309] | 1635 | switch (sliders) {
|
---|
| 1636 |
|
---|
| 1637 | case LS_PRMTR:
|
---|
| 1638 | case LS_OTHER:
|
---|
| 1639 | case LS_EQ:
|
---|
| 1640 |
|
---|
| 1641 | sliders = LS_VOICE;
|
---|
| 1642 | swpt = &t_voice;
|
---|
| 1643 | break;
|
---|
| 1644 |
|
---|
| 1645 | case LS_VOICE:
|
---|
| 1646 | default:
|
---|
| 1647 |
|
---|
| 1648 | sliders = LS_PRMTR;
|
---|
| 1649 | swpt = &t_prmtr;
|
---|
| 1650 | break;
|
---|
| 1651 | }
|
---|
| 1652 |
|
---|
| 1653 | lcdlbls();
|
---|
| 1654 | setleds();
|
---|
| 1655 | }
|
---|
| 1656 |
|
---|
| 1657 | /* |
---|
| 1658 |
|
---|
| 1659 | */
|
---|
| 1660 |
|
---|
| 1661 | /*
|
---|
| 1662 | =============================================================================
|
---|
| 1663 | l_voice() -- set voice selection status
|
---|
| 1664 | =============================================================================
|
---|
| 1665 | */
|
---|
| 1666 |
|
---|
| 1667 | void l_voice(int16_t stat, int16_t vce)
|
---|
| 1668 | {
|
---|
| 1669 | register int16_t ap, j, par;
|
---|
| 1670 | register uint16_t *fpu;
|
---|
| 1671 |
|
---|
| 1672 | int8_t buf[8];
|
---|
| 1673 |
|
---|
[7258c6a] | 1674 | if (NOT stat)
|
---|
[f40a309] | 1675 | return;
|
---|
[7258c6a] | 1676 |
|
---|
[f40a309] | 1677 | articen[vce] = NOT articen[vce]; /* toggle voice enable */
|
---|
| 1678 |
|
---|
| 1679 | sprintf(buf, "%c%2d %c", (articen[vce] ? '\176' : ' '), vce + 1,
|
---|
| 1680 | (articen[vce] ? '\177' : ' '));
|
---|
| 1681 |
|
---|
| 1682 | GLCcurs(G_ON);
|
---|
| 1683 | GLCtext(0, (1 + (6 * vce)), buf);
|
---|
| 1684 | GLCcurs(G_OFF);
|
---|
| 1685 |
|
---|
| 1686 | if (articen[vce]) { /* turn articulation on if voice is enabled */
|
---|
| 1687 |
|
---|
| 1688 | for (ap = 0; ap < 14; ap++) {
|
---|
| 1689 |
|
---|
| 1690 | par = arpar[ap];
|
---|
| 1691 | sendart(vce, par, lastart[par]);
|
---|
| 1692 | }
|
---|
| 1693 |
|
---|
| 1694 | } else { /* ... or turn it off if voice is disabled */
|
---|
| 1695 |
|
---|
| 1696 | fpu = io_fpu + FPU_OFNC + (vce << 8);
|
---|
[7258c6a] | 1697 |
|
---|
[f40a309] | 1698 | for (j = 1; j < 16; j++)
|
---|
| 1699 | *(fpu + (j << 4) + FPU_TSF2) = 0;
|
---|
| 1700 | }
|
---|
| 1701 | }
|
---|
| 1702 |
|
---|
[6dd74a9] | 1703 | /* |
---|
[f40a309] | 1704 |
|
---|
| 1705 | */
|
---|
| 1706 |
|
---|
| 1707 | /*
|
---|
| 1708 | =============================================================================
|
---|
| 1709 | l_group() -- set group selection status
|
---|
| 1710 | =============================================================================
|
---|
| 1711 | */
|
---|
| 1712 |
|
---|
| 1713 | void l_group(int16_t stat, int16_t grp)
|
---|
| 1714 | {
|
---|
| 1715 | int8_t buf[8];
|
---|
| 1716 |
|
---|
[7258c6a] | 1717 | if (NOT stat)
|
---|
[f40a309] | 1718 | return;
|
---|
| 1719 |
|
---|
| 1720 | grpsel[grp] = NOT grpsel[grp]; /* toggle voice enable */
|
---|
| 1721 |
|
---|
| 1722 | sprintf(buf, "%c%2d %c", (grpsel[grp] ? '\176' : ' '), grp + 1,
|
---|
| 1723 | (grpsel[grp] ? '\177' : ' '));
|
---|
| 1724 |
|
---|
[6dd74a9] | 1725 | GLCcurs(G_ON);
|
---|
[f40a309] | 1726 | GLCtext(0, (1 + (6 * grp)), buf);
|
---|
| 1727 | GLCcurs(G_OFF);
|
---|
| 1728 | }
|
---|
| 1729 |
|
---|
[6dd74a9] | 1730 | /*
|
---|
[f40a309] | 1731 | =============================================================================
|
---|
| 1732 | l_other -- set aux function status
|
---|
| 1733 | =============================================================================
|
---|
| 1734 | */
|
---|
| 1735 |
|
---|
| 1736 | void l_other(int16_t stat, int16_t sig)
|
---|
| 1737 | {
|
---|
| 1738 | if (NOT stat)
|
---|
| 1739 | return;
|
---|
| 1740 |
|
---|
| 1741 | sliders = LS_OTHER;
|
---|
[0580615] | 1742 | swpt = &t_other;
|
---|
[f40a309] | 1743 |
|
---|
[7258c6a] | 1744 | lcdlbls();
|
---|
[f40a309] | 1745 | }
|
---|
| 1746 |
|
---|
| 1747 | /* |
---|
| 1748 |
|
---|
| 1749 | */
|
---|
| 1750 |
|
---|
| 1751 | /*
|
---|
| 1752 | =============================================================================
|
---|
| 1753 | l_eq -- set eq mode
|
---|
| 1754 | =============================================================================
|
---|
| 1755 | */
|
---|
| 1756 |
|
---|
| 1757 | void l_eq(int16_t stat, int16_t sig)
|
---|
| 1758 | {
|
---|
[7258c6a] | 1759 | if (NOT stat)
|
---|
[f40a309] | 1760 | return;
|
---|
[7258c6a] | 1761 |
|
---|
| 1762 | if (sliders EQ LS_EQ) {
|
---|
| 1763 |
|
---|
[f40a309] | 1764 | sliders = LS_PRMTR;
|
---|
| 1765 | swpt = &t_prmtr;
|
---|
| 1766 |
|
---|
| 1767 | } else {
|
---|
| 1768 |
|
---|
| 1769 | sliders = LS_EQ;
|
---|
| 1770 | swpt = &t_eq;
|
---|
| 1771 | }
|
---|
| 1772 |
|
---|
| 1773 | lcdlbls();
|
---|
| 1774 | }
|
---|
| 1775 |
|
---|
| 1776 | /*
|
---|
| 1777 | =============================================================================
|
---|
| 1778 | artclr() -- clear the articulation pot values
|
---|
| 1779 | =============================================================================
|
---|
| 1780 | */
|
---|
| 1781 |
|
---|
| 1782 | void artclr(void)
|
---|
| 1783 | {
|
---|
| 1784 | register int16_t i;
|
---|
| 1785 |
|
---|
| 1786 | for (i = 0; i < 14; i++)
|
---|
| 1787 | lastart[arpar[i]] = artitab[i];
|
---|
| 1788 | }
|
---|
| 1789 |
|
---|
| 1790 | /* |
---|
| 1791 |
|
---|
| 1792 | */
|
---|
| 1793 |
|
---|
| 1794 | /*
|
---|
| 1795 | =============================================================================
|
---|
| 1796 | l_init() -- initialize articulation values (reset the sliders)
|
---|
| 1797 | =============================================================================
|
---|
| 1798 | */
|
---|
| 1799 |
|
---|
| 1800 | void l_init(int16_t stat, int16_t sig)
|
---|
| 1801 | {
|
---|
| 1802 | register uint16_t *fpu;
|
---|
| 1803 | register int16_t barval, i, j;
|
---|
| 1804 | int8_t buf[16];
|
---|
| 1805 |
|
---|
| 1806 | if (NOT stat)
|
---|
| 1807 | return;
|
---|
| 1808 |
|
---|
| 1809 | fpu = io_fpu + FPU_OFNC;
|
---|
| 1810 |
|
---|
| 1811 | switch (sliders) {
|
---|
| 1812 |
|
---|
| 1813 | case LS_PRMTR:
|
---|
| 1814 | case LS_VOICE:
|
---|
| 1815 | case LS_INST:
|
---|
| 1816 | case LS_LIBR:
|
---|
| 1817 | case LS_NGRP:
|
---|
| 1818 | case LS_LOAD:
|
---|
| 1819 |
|
---|
| 1820 | /* clear all but spares in voices 1..12 */
|
---|
| 1821 |
|
---|
| 1822 | for (i = 0; i < 12; i++)
|
---|
| 1823 | for (j = 1; j < 16; j++)
|
---|
| 1824 | *(fpu + (i << 8) + (j << 4) + FPU_TSF2) = 0;
|
---|
| 1825 |
|
---|
| 1826 | artclr();
|
---|
| 1827 |
|
---|
| 1828 | for (i = 0; i < 14; i++) {
|
---|
| 1829 |
|
---|
| 1830 | BGprmtr[i] = artitab[i];
|
---|
| 1831 |
|
---|
| 1832 | if (BarType[i]) {
|
---|
| 1833 |
|
---|
| 1834 | barval = (((artitab[i] >> 5) - 500) << 6) / 252;
|
---|
| 1835 | BarCset(i, barval);
|
---|
| 1836 |
|
---|
| 1837 | } else {
|
---|
[7258c6a] | 1838 |
|
---|
[f40a309] | 1839 | barval = artitab[i] / 252;
|
---|
[7258c6a] | 1840 | BarBset(i, barval);
|
---|
| 1841 | }
|
---|
| 1842 | }
|
---|
[f40a309] | 1843 |
|
---|
| 1844 | break;
|
---|
| 1845 |
|
---|
| 1846 | case LS_OTHER:
|
---|
| 1847 |
|
---|
| 1848 | /* clear spares in voices 2..12 */
|
---|
| 1849 |
|
---|
| 1850 | for (i = 1; i < 12; i++)
|
---|
| 1851 | *(fpu + (i << 8) + FPU_TSF2) = 0;
|
---|
| 1852 |
|
---|
| 1853 | for (i = 0; i < 14; i++)
|
---|
| 1854 | BarBset(i, BGother[i] = 0);
|
---|
| 1855 |
|
---|
| 1856 | break;
|
---|
| 1857 |
|
---|
| 1858 | case LS_EQ:
|
---|
| 1859 |
|
---|
| 1860 | for (i = 0; i < 14; i++) {
|
---|
| 1861 |
|
---|
| 1862 | sendeq(i, gain2eq(0));
|
---|
| 1863 | BarCset(i, BGeq[i] = 0);
|
---|
| 1864 | }
|
---|
| 1865 |
|
---|
| 1866 | break;
|
---|
| 1867 | }
|
---|
| 1868 | }
|
---|
| 1869 |
|
---|
| 1870 | /* |
---|
| 1871 |
|
---|
| 1872 | */
|
---|
| 1873 |
|
---|
| 1874 | /*
|
---|
| 1875 | =============================================================================
|
---|
| 1876 | sendart() -- send out an articulation value
|
---|
| 1877 | =============================================================================
|
---|
| 1878 | */
|
---|
| 1879 |
|
---|
| 1880 | void sendart(int16_t vce, int16_t par, int16_t ival)
|
---|
| 1881 | {
|
---|
| 1882 | register uint16_t *fpu;
|
---|
| 1883 | register int16_t val, oldi, mult;
|
---|
| 1884 | int16_t nop;
|
---|
| 1885 |
|
---|
| 1886 | lastart[par] = ival;
|
---|
| 1887 |
|
---|
| 1888 | fpu = io_fpu + FPU_OFNC + (vce << 8) + (par << 4);
|
---|
| 1889 | mult = 0x7FFF;
|
---|
| 1890 |
|
---|
| 1891 | switch (par) {
|
---|
| 1892 |
|
---|
| 1893 | case 1: /* freq 1 */
|
---|
| 1894 | case 3: /* freq 2 */
|
---|
| 1895 | case 5: /* freq 3 */
|
---|
| 1896 | case 7: /* freq 4 */
|
---|
| 1897 |
|
---|
| 1898 | val = addpch(ival, 0);
|
---|
| 1899 | break;
|
---|
| 1900 |
|
---|
| 1901 | case 10: /* filter */
|
---|
| 1902 |
|
---|
| 1903 | val = ((ival >> 5) - 500) << 5;
|
---|
| 1904 | break;
|
---|
| 1905 |
|
---|
| 1906 | /* |
---|
[0580615] | 1907 |
|
---|
[f40a309] | 1908 | */
|
---|
[7258c6a] | 1909 |
|
---|
[f40a309] | 1910 | case 2: /* level */
|
---|
| 1911 |
|
---|
| 1912 | val = ival;
|
---|
| 1913 | mult = 0xFFFF;
|
---|
| 1914 | break;
|
---|
| 1915 |
|
---|
| 1916 | case 4: /* location */
|
---|
| 1917 |
|
---|
| 1918 | val = ((ival >> 5) - 500) << 5;
|
---|
| 1919 | mult = 0xFFFF;
|
---|
| 1920 | break;
|
---|
| 1921 |
|
---|
| 1922 | default:
|
---|
| 1923 |
|
---|
| 1924 | val = ival;
|
---|
| 1925 | }
|
---|
| 1926 |
|
---|
| 1927 | oldi = setipl(FPU_DI);
|
---|
| 1928 |
|
---|
| 1929 | /* ++++++++++++++++++++++++++++ FPU interrupts disabled +++++++++++++++++++++ */
|
---|
| 1930 |
|
---|
| 1931 | *(fpu + FPU_TCV2) = val;
|
---|
| 1932 | ++nop; ++nop; ++nop;
|
---|
| 1933 | *(fpu + FPU_TSF2) = mult;
|
---|
| 1934 |
|
---|
| 1935 | setipl(oldi);
|
---|
| 1936 |
|
---|
| 1937 | /* ++++++++++++++++++++++++++++ Interrupts restored +++++++++++++++++++++++++ */
|
---|
| 1938 |
|
---|
| 1939 | }
|
---|
| 1940 |
|
---|
| 1941 | /* |
---|
| 1942 |
|
---|
| 1943 | */
|
---|
| 1944 |
|
---|
| 1945 | /*
|
---|
| 1946 | =============================================================================
|
---|
| 1947 | doslide() -- update a changed slider value
|
---|
| 1948 | =============================================================================
|
---|
| 1949 | */
|
---|
| 1950 |
|
---|
| 1951 | void doslide(void)
|
---|
| 1952 | {
|
---|
| 1953 | register int16_t arp, bar, barval, i, slval;
|
---|
| 1954 |
|
---|
| 1955 | slval = ART_VAL(aval); /* scaled articulation value */
|
---|
| 1956 | bar = asig - 25; /* bar number */
|
---|
| 1957 |
|
---|
| 1958 | switch (sliders) {
|
---|
| 1959 |
|
---|
| 1960 | case LS_PRMTR: /* parameter articulation */
|
---|
| 1961 | case LS_VOICE:
|
---|
| 1962 | case LS_INST:
|
---|
| 1963 | case LS_LIBR:
|
---|
| 1964 | case LS_NGRP:
|
---|
| 1965 | case LS_LOAD:
|
---|
| 1966 |
|
---|
| 1967 | BGprmtr[bar] = slval;
|
---|
| 1968 | arp = arpar[bar];
|
---|
| 1969 |
|
---|
| 1970 | for (i = 0; i < 12; i++)
|
---|
| 1971 | if (articen[i])
|
---|
| 1972 | sendart(i, arp, slval);
|
---|
| 1973 |
|
---|
| 1974 | if (BarType[bar]) { /* center-zero bar */
|
---|
| 1975 |
|
---|
| 1976 | barval = (((slval >> 5) - 500) << 6) / 252;
|
---|
| 1977 | BarCadj(bar, barval);
|
---|
| 1978 |
|
---|
| 1979 | } else { /* bottom-zero bar */
|
---|
| 1980 |
|
---|
| 1981 | barval = slval / 252;
|
---|
| 1982 | BarBadj(bar, barval);
|
---|
| 1983 | }
|
---|
| 1984 |
|
---|
| 1985 | return;
|
---|
| 1986 | /* |
---|
| 1987 |
|
---|
| 1988 | */
|
---|
| 1989 | case LS_OTHER: /* aux, dome, cv control */
|
---|
| 1990 |
|
---|
| 1991 | switch (asig) {
|
---|
| 1992 |
|
---|
| 1993 | case 26: /* aux mod */
|
---|
| 1994 | sendart(9, 0, slval);
|
---|
| 1995 | break;
|
---|
| 1996 |
|
---|
| 1997 | case 27: /* depth */
|
---|
| 1998 | sendart(3, 0, slval);
|
---|
| 1999 | break;
|
---|
| 2000 |
|
---|
| 2001 | case 28: /* rate */
|
---|
| 2002 | sendart(2, 0, slval);
|
---|
| 2003 | break;
|
---|
| 2004 |
|
---|
| 2005 | case 29: /* intensity */
|
---|
| 2006 | sendart(1, 0, slval);
|
---|
| 2007 | break;
|
---|
| 2008 |
|
---|
| 2009 | case 30: /* cv1 */
|
---|
| 2010 | sendart(11, 0, slval);
|
---|
| 2011 | break;
|
---|
| 2012 |
|
---|
| 2013 | case 31: /* cv2 */
|
---|
| 2014 | sendart(10, 0, slval);
|
---|
| 2015 | break;
|
---|
[7258c6a] | 2016 |
|
---|
[f40a309] | 2017 | case 32: /* cv3 */
|
---|
[7258c6a] | 2018 | sendart(6, 0, slval);
|
---|
[f40a309] | 2019 | break;
|
---|
| 2020 |
|
---|
| 2021 | case 33: /* cv4 */
|
---|
[7258c6a] | 2022 | sendart(8, 0, slval);
|
---|
[f40a309] | 2023 | break;
|
---|
| 2024 |
|
---|
| 2025 | default:
|
---|
| 2026 | slval = 0; /* force unused pots to stay zero */
|
---|
| 2027 | break;
|
---|
| 2028 | }
|
---|
| 2029 |
|
---|
| 2030 | BGother[bar] = slval;
|
---|
| 2031 | barval = slval / 252;
|
---|
| 2032 | BarBadj(bar, barval);
|
---|
| 2033 |
|
---|
| 2034 | return;
|
---|
| 2035 |
|
---|
[0580615] | 2036 | /* |
---|
[f40a309] | 2037 |
|
---|
[7258c6a] | 2038 | */
|
---|
| 2039 | case LS_EQ: /* eq control */
|
---|
| 2040 |
|
---|
| 2041 | barval = (((slval >> 5) - 500) << 6) / 252;
|
---|
[f40a309] | 2042 | BGeq[bar] = barval;
|
---|
| 2043 | sendeq(bar, gain2eq(SL2GAIN(slval)));
|
---|
| 2044 | BarCadj(bar, barval);
|
---|
| 2045 |
|
---|
| 2046 | return;
|
---|
| 2047 |
|
---|
| 2048 | default:
|
---|
| 2049 | return;
|
---|
| 2050 | }
|
---|
| 2051 | }
|
---|
| 2052 |
|
---|
[7258c6a] | 2053 | /* |
---|
[f40a309] | 2054 |
|
---|
| 2055 | */
|
---|
| 2056 |
|
---|
| 2057 | /*
|
---|
| 2058 | =============================================================================
|
---|
| 2059 | settmpo() -- set the tempo
|
---|
[7258c6a] | 2060 | =============================================================================
|
---|
[f40a309] | 2061 | */
|
---|
| 2062 |
|
---|
| 2063 | void settmpo(int16_t val)
|
---|
| 2064 | {
|
---|
[7258c6a] | 2065 | register int16_t timeval;
|
---|
[f40a309] | 2066 |
|
---|
| 2067 | tmpoval = val;
|
---|
| 2068 | timeval = ( ( (tmpomlt + 50) * tmpoval) / 100);
|
---|
| 2069 | timeval = (int16_t)( (192000L / timeval) - 1);
|
---|
| 2070 | TIME_T2H = timeval >> 8;
|
---|
| 2071 | TIME_T2L = timeval & 0x00FF;
|
---|
| 2072 | }
|
---|
| 2073 |
|
---|
| 2074 | /* |
---|
| 2075 |
|
---|
| 2076 | */
|
---|
| 2077 |
|
---|
| 2078 | /*
|
---|
| 2079 | =============================================================================
|
---|
| 2080 | settune() -- send the fine tuning from tuneval to the FPU
|
---|
| 2081 | =============================================================================
|
---|
| 2082 | */
|
---|
| 2083 |
|
---|
| 2084 | void settune(void)
|
---|
| 2085 | {
|
---|
| 2086 | register int16_t oldi, i, grp;
|
---|
| 2087 | register uint16_t *fpu;
|
---|
| 2088 | register int32_t trval, trmax;
|
---|
| 2089 | int16_t nop;
|
---|
| 2090 |
|
---|
| 2091 | trmax = PCHMAX;
|
---|
| 2092 |
|
---|
| 2093 | oldi = setsr(0x2200);
|
---|
| 2094 |
|
---|
| 2095 | /* +++++++++++++++++++++++ FPU interrupts disabled ++++++++++++++++++++++++++ */
|
---|
| 2096 |
|
---|
| 2097 | for (i = 0; i < 12; i++) {
|
---|
| 2098 |
|
---|
| 2099 | if (-1 NE (grp = vce2grp[i])) {
|
---|
| 2100 |
|
---|
| 2101 | trval = (int32_t)tuneval + ((int32_t)s_trns[grp - 1] << 1);
|
---|
| 2102 |
|
---|
| 2103 | if (trval > trmax)
|
---|
| 2104 | trval = trmax;
|
---|
| 2105 |
|
---|
| 2106 | } else {
|
---|
| 2107 |
|
---|
| 2108 | trval = (int32_t)tuneval;
|
---|
| 2109 | }
|
---|
| 2110 |
|
---|
| 2111 | fpu = io_fpu + FPU_OFNC + (i << 8) + 0x0010; /* freq 1 */
|
---|
| 2112 |
|
---|
| 2113 | *(fpu + FPU_TCV3) = (uint16_t)(0x0000FFFFL & trval);
|
---|
| 2114 | ++nop; ++nop; ++nop;
|
---|
| 2115 | *(fpu + FPU_TSF3) = 0x7FFF;
|
---|
| 2116 | }
|
---|
| 2117 |
|
---|
| 2118 | setsr(oldi);
|
---|
| 2119 |
|
---|
| 2120 | /* ++++++++++++++++++++++++++++ Interrupts restored +++++++++++++++++++++++++ */
|
---|
| 2121 |
|
---|
| 2122 | }
|
---|