home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / FSGFX.ZIP / BUTTONS.C next >
C/C++ Source or Header  |  1990-03-07  |  13KB  |  571 lines

  1. /* buttons.c */
  2. /* buttons and fileio from mks7.c */
  3.  
  4. #include <stdio.h>
  5. #include "mygraph.h"
  6. #include "mymouse.h"
  7. #include "mymididl.h"
  8. #include "mks7.h"
  9.  
  10.  
  11. int channel = 0;
  12. int patch = 98;
  13.  
  14. char disk[3][15] = { "Exit",
  15.             "Load",
  16.             "Save" };
  17. int instrument = 1;
  18. unsigned char switchbyte[3] = {0x60,0x3C,0x17};
  19. char description[] = "default patch";
  20. struct parm pm[] =
  21.     { { "Rate", 127 },/*LFO*/
  22.     { "Delay", 54 },/*LFO*/
  23.     { "Modulation",  0 },/*DCO LFO*/
  24.     { "Pulse Width",  0 },/*DCO PWM*/
  25.     { "Cutoff frequency", 64 },/*VCF*/
  26.     { "Resonance", 64 },/*VCF*/
  27.     { "Envelope", 33 },/*VCF ENV*/
  28.     { "Modulation", 64 },/*VCF */
  29.     { "Keyboard Follow ", 64 },/*VCF*/
  30.     { "VCA Level", 64 },/*VCA LEVEL*/
  31.     { "Attack", 64 },/*ENV*/
  32.     { "Decay", 64 },/*ENV*/
  33.     { "Sustain", 64 },/*ENV*/
  34.     { "Release", 64 },/*ENV*/
  35.     { "SUB Oscillator", 64 } };/*ENV*/
  36.  
  37. struct switches sw[] =
  38.     { { "Velocity",  1, 0x40, "on "    },/*VCA*/
  39.     { "Velocity",  1, 0x20, "on "    },/*VCF*/
  40.     { "Chorus",    0, 0x00, "on "    },/**/
  41.     { "Sawtooth",  0, 0x00, "off"    },/**/
  42.     { "Pulse",    0, 0x00, "off"    },/**/
  43.     { "Range",    8, 0x02, "8' "    },/**/
  44.     { "Noise",    0, 0x00, "off"    },/**/
  45.     { "High Pass", 1, 0x10, "off"    },/**/
  46.     { "Source",    0, 0x00, "ENV "  },/*VCA*/
  47.     { "Inversion", 0, 0x00, "PLUS " },/*ENV*/
  48.     { "Source",    0, 0x00, "LFO"    },/*PWM*/
  49.     { "Whole",    0, 0x00, "off"    },/**/
  50.     { "Hold",    0, 0x00, "off"    },/**/
  51.     { "Chord",    3, 0x00, "3 "    },/**/
  52.     { "Melody",    1, 0x00, "1 "    },/**/
  53.     { "Bass",    2, 0x00, "2 "    } };/**/
  54.  
  55.  
  56.  
  57. draw_knob(ptspot, fspace, knumber, kpos)
  58. struct point ptspot;
  59. int fspace;
  60. int knumber;
  61. int kpos;
  62. {
  63.     struct point kspot;
  64.     int kwidth = 20;
  65.     int kheight = 6;
  66.  
  67.     kspot.x = ptspot.x + 10 - 8 + pm[knumber].value;
  68.     kspot.y = ptspot.y + 2 + (fspace * kpos);
  69.  
  70.     g_mode(XOR);
  71.     g_line(kspot.x,kspot.y,kspot.x+kwidth,kspot.y);        /* draw knob */
  72.     g_line(kspot.x+kwidth,kspot.y,kspot.x+kwidth,kspot.y+kheight);
  73.     g_line(kspot.x+kwidth,kspot.y+kheight,kspot.x,kspot.y+kheight);
  74.     g_line(kspot.x,kspot.y+kheight,kspot.x,kspot.y);
  75.     g_mode(OR);
  76. }
  77.  
  78. erase_knob(ptspot, fspace, knumber, kpos)
  79. struct point ptspot;
  80. int fspace;
  81. int knumber;
  82. int kpos;
  83. {
  84.     int kx;
  85.     int ky;
  86.     int kwidth = 20;
  87.     int kheight = 6;
  88.  
  89.     kx = ptspot.x + 10 - 8 + pm[knumber].value;
  90.     ky = ptspot.y + 2 + (fspace * kpos);
  91.  
  92.     g_mode(XOR);    /* XOR the old one */
  93.     g_line(kx,ky,kx+kwidth,ky);        /* erase know */
  94.     g_line(kx+kwidth,ky,kx+kwidth,ky+kheight);
  95.     g_line(kx+kwidth,ky+kheight,kx,ky+kheight);
  96.     g_line(kx,ky+kheight,kx,ky);
  97.     g_mode(OR);
  98. }
  99.  
  100. struct point d0pt = { DXSPOT+(0*DSPACE), DYSPOT };
  101. struct point d1pt = { DXSPOT+(1*DSPACE), DYSPOT };
  102. struct point d2pt = { DXSPOT+(2*DSPACE), DYSPOT };
  103. struct rect d0rect;
  104. struct rect d1rect;
  105. struct rect d2rect;
  106.  
  107. struct point i0pt = { IXSPOT+(0*ISPACE), IYSPOT };
  108. struct point i1pt = { IXSPOT+(1*ISPACE), IYSPOT };
  109. struct point i2pt = { IXSPOT+(2*ISPACE), IYSPOT };
  110. struct rect i0rect;
  111. struct rect i1rect;
  112. struct rect i2rect;
  113.  
  114. struct point omix0pt = { OMIXFXSPOT,OMIXFYSPOT+1*OMIXFSPACE };
  115. struct point omix1pt = { OMIXFXSPOT,OMIXFYSPOT+2*OMIXFSPACE };
  116. struct point omix2pt = { OMIXFXSPOT,OMIXFYSPOT+3*OMIXFSPACE };
  117. struct point omix3pt = { OMIXFXSPOT,OMIXFYSPOT+4*OMIXFSPACE };
  118. struct rect omix0rect;
  119. struct rect omix1rect;
  120. struct rect omix2rect;
  121. struct rect omix3rect;
  122.  
  123. struct point smix0pt =  { SMIXFXSPOT,SMIXFYSPOT+1*SMIXFSPACE };
  124. struct point smix1pt =  { SMIXFXSPOT,SMIXFYSPOT+2*SMIXFSPACE };
  125. struct point smix2pt =  { SMIXFXSPOT,SMIXFYSPOT+3*SMIXFSPACE };
  126. struct point dcof0pt =  { DCOFXSPOT, DCOFYSPOT+DCOFSPACE*2 };
  127. struct point dcof1pt =  { DCOFXSPOT+BWIDTH10,DCOFYSPOT+DCOFSPACE*2 };
  128. struct point vcffpt =  { VCFFXSPOT, VCFFYSPOT+5*VCFFSPACE };
  129. struct point envfpt =  { ENVFXSPOT, ENVFYSPOT+4*ENVFSPACE };
  130. struct rect smix0rect;
  131. struct rect smix1rect;
  132. struct rect smix2rect;
  133. struct rect dcof0rect;
  134. struct rect dcof1rect;
  135. struct rect vcffrect;
  136. struct rect envfrect;
  137.  
  138.  
  139. menu()
  140. {
  141.     int a;
  142.     char temp[80];
  143.     g_clrscn();
  144.     g_puts(0,0,"MKS-7 Editor Librarian, WITH GRAPHIC ENVELOPE!");
  145.  
  146.     d0rect = g_drwbtn(DXSPOT+(0*DSPACE),DYSPOT,disk[0],"");
  147.     d1rect = g_drwbtn(DXSPOT+(1*DSPACE),DYSPOT,disk[1],"");
  148.     d2rect = g_drwbtn(DXSPOT+(2*DSPACE),DYSPOT,disk[2],"");
  149.         i0rect = g_drwbtn(IXSPOT+(0*ISPACE),IYSPOT,
  150.     sw[13+instrument].name, sw[13+instrument].status);
  151.     i1rect = g_drwbtn(IXSPOT+(1*ISPACE),IYSPOT,
  152.         sw[11].name, sw[11].status);
  153.     i2rect = g_drwbtn(IXSPOT+(2*ISPACE),IYSPOT,
  154.         sw[12].name, sw[12].status);
  155.  
  156.     for(a = 0; a < 2; a++)
  157.     {
  158.     g_puts(LFOFXSPOT, LFOFYSPOT - 8 + (a * LFOFSPACE), pm[a].name);
  159.     g_hfader(LFOFXSPOT, LFOFYSPOT+(a*LFOFSPACE) , pm[a].value);
  160.     g_msgbox(LFOFXSPOT-16, LFOFYSPOT-12, 23*8, 2*LFOFSPACE+8,
  161.     "Low Frequency Oscillator", "");
  162.     }
  163. /* draw mix faders */
  164.  
  165.     g_puts(OMIXFXSPOT, OMIXFYSPOT - 8, pm[9].name);
  166.     g_hfader(OMIXFXSPOT, OMIXFYSPOT, pm[9].value);
  167.     g_msgbox(OMIXFXSPOT-16, OMIXFYSPOT-12, 23*8, 5*OMIXFSPACE+8,
  168.     "Output Mix","");
  169.     omix0rect = g_drwbtn(OMIXFXSPOT,OMIXFYSPOT+1*OMIXFSPACE,
  170.         sw[0].name, sw[0].status);
  171.     omix1rect = g_drwbtn(OMIXFXSPOT,OMIXFYSPOT+2*OMIXFSPACE,
  172.         sw[8].name, sw[8].status);
  173.     omix2rect = g_drwbtn(OMIXFXSPOT,OMIXFYSPOT+3*OMIXFSPACE,
  174.         sw[7].name, sw[7].status);
  175.     omix3rect = g_drwbtn(OMIXFXSPOT,OMIXFYSPOT+4*OMIXFSPACE,
  176.         sw[2].name, sw[2].status);
  177.  
  178.     g_puts(SMIXFXSPOT, SMIXFYSPOT - 8, pm[14].name);
  179.     g_hfader(SMIXFXSPOT, SMIXFYSPOT, pm[14].value);
  180.     g_msgbox(SMIXFXSPOT-16, SMIXFYSPOT-12, 23*8, 4*SMIXFSPACE+8,
  181.     "Source Mix","");
  182.     smix0rect = g_drwbtn(SMIXFXSPOT,SMIXFYSPOT+1*SMIXFSPACE,
  183.         sw[4].name, sw[4].status);
  184.     smix1rect = g_drwbtn(SMIXFXSPOT,SMIXFYSPOT+2*SMIXFSPACE,
  185.         sw[3].name, sw[3].status);
  186.     smix2rect = g_drwbtn(SMIXFXSPOT,SMIXFYSPOT+3*SMIXFSPACE,
  187.         sw[6].name, sw[6].status);
  188.  
  189.     for(a = 0; a < 2; a++)
  190.     {
  191.     g_puts(DCOFXSPOT, DCOFYSPOT -8 + (a * DCOFSPACE),
  192.     pm[a+2].name);
  193.     g_hfader(DCOFXSPOT, DCOFYSPOT+(a*DCOFSPACE) , pm[a+2].value);
  194.     }
  195.     g_msgbox(DCOFXSPOT-16, DCOFYSPOT-12, 23*8, 3*DCOFSPACE+8,
  196.     "Digital Controlled Oscillator", "");
  197.  
  198.     dcof0rect = g_drwbtn(DCOFXSPOT, DCOFYSPOT+DCOFSPACE*2,sw[10].status,"");
  199.  
  200.     dcof1rect = g_drwbtn(DCOFXSPOT+BWIDTH10,DCOFYSPOT+DCOFSPACE*2,
  201.         sw[5].name, sw[5].status);
  202.  
  203.     for(a = 0; a < 5; a++)
  204.     {
  205.     g_puts(VCFFXSPOT, VCFFYSPOT -8 + (a * VCFFSPACE),
  206.     pm[a+4].name);
  207.     g_hfader(VCFFXSPOT, VCFFYSPOT+(a*VCFFSPACE) , pm[a+4].value);
  208.     }
  209.     g_msgbox(VCFFXSPOT-16, VCFFYSPOT-12, 23*8, 6*VCFFSPACE+8,
  210.     "Voltage Controlled Filter", "");
  211.     vcffrect = g_drwbtn(VCFFXSPOT, VCFFYSPOT+5*VCFFSPACE,
  212.         sw[1].name,sw[1].status);
  213.  
  214.     for(a = 0; a < 4; a++)
  215.     {
  216.     g_puts(ENVFXSPOT, ENVFYSPOT -8 + (a * ENVFSPACE),
  217.     pm[a+10].name);
  218.     g_hfader(ENVFXSPOT, ENVFYSPOT+(a*ENVFSPACE) , pm[a+10].value);
  219.     }
  220.     g_msgbox(ENVFXSPOT-16, ENVFYSPOT-12, 23*8, 5*ENVFSPACE+8,
  221.     "ADSR Envelope", "");
  222.     envfrect = g_drwbtn(ENVFXSPOT, ENVFYSPOT+4*ENVFSPACE,
  223.         sw[9].name,sw[9].status);
  224.  
  225.     }
  226.  
  227. loadpatch()
  228. {
  229.     FILE *fptr;
  230.     char filename[80];
  231.     int a;
  232.     char temp[10];
  233.     g_fselect("*.pat",filename);
  234.     if( (fptr=fopen(filename, "r")) == NULL)
  235.     {
  236.     g_puts(0, 42*8,"Can't open file            ");
  237.     mshidecur();
  238.     g_clrscn();
  239.     menu();
  240.     msshowcur();
  241.     parameter();
  242.     }
  243.     for(a = 0; a<4; a++)
  244.     {
  245.     pm[a].value = atoi(fgets(temp,10,fptr));
  246. /*    printf("%d\n", pm[a].value);*/
  247.     }
  248.  
  249.     switchbyte[0] = atoi(fgets(temp,80,fptr));
  250. /*    printf("%d\n", switchbyte[0]);    */
  251.     for(a = 4; a<15; a++)
  252.     {
  253.     pm[a].value = atoi(fgets(temp,80,fptr));
  254.     /*  printf("%d\n", pm[a].value);    */
  255.     }
  256.  
  257.     switchbyte[1] = atoi(fgets(temp,80,fptr));
  258. /*    printf("%x\n", switchbyte[1]);*/
  259.     switchbyte[2] = atoi(fgets(temp,80,fptr));
  260. /*    printf("%x\n", switchbyte[2]);    */
  261.     fgets(description, 80, fptr);
  262. /*    printf("%s\n", description);*/
  263. /*    getche();*/
  264.     fclose(fptr);
  265.     /* now to reassimilate the switch data */
  266.  
  267. if((switchbyte[0] & 0x40) == 0x40)  /* VCF */
  268.     {
  269.     sw[0].value = 1;
  270.     sw[0].mask  = 0x40;
  271.     strcpy(sw[0].status, "on ");
  272.     }
  273. else
  274.     {
  275.     sw[0].value = 0;
  276.     sw[0].mask  = 0x00;
  277.     strcpy(sw[0].status, "off");
  278.     }
  279.  
  280. if((switchbyte[0] & 0x20) == 0x20)  /* VCA */
  281.     {
  282.     sw[1].value = 1;
  283.     sw[1].mask  = 0x20;
  284.     strcpy(sw[1].status, "on ");
  285.     }
  286. else
  287.     {
  288.     sw[1].value = 0;
  289.     sw[1].mask  = 0x00;
  290.     strcpy(sw[1].status, "off");
  291.     }
  292.  
  293. if((switchbyte[1] & 0x20) == 0x20)  /* Chorus */
  294.     {
  295.     sw[2].value = 1;
  296.     sw[2].mask  = 0x20;
  297.     strcpy(sw[2].status, "off");
  298.     }
  299. else
  300.     {
  301.     sw[2].value = 0;
  302.     sw[2].mask  = 0x00;
  303.     strcpy(sw[2].status, "on ");
  304.     }
  305.  
  306. if((switchbyte[1] & 0x10) == 0x10)  /* Sawtooth */
  307.     {
  308.     sw[3].value = 1;
  309.     sw[3].mask  = 0x10;
  310.     strcpy(sw[3].status, "on ");
  311.     }
  312. else
  313.     {
  314.     sw[3].value = 0;
  315.     sw[3].mask  = 0x00;
  316.     strcpy(sw[3].status, "off");
  317.     }
  318.  
  319. if((switchbyte[1] & 0x08) == 0x08)  /* Pulse    */
  320.     {
  321.     sw[4].value = 1;
  322.     sw[4].mask  = 0x08;
  323.     strcpy(sw[4].status, "on ");
  324.     }
  325. else
  326.     {
  327.     sw[4].value = 0;
  328.     sw[4].mask  = 0x00;
  329.     strcpy(sw[4].status, "off");
  330.     }
  331. /*printf(" %x, %x, %x", switchbyte[1], 0x04, switchbyte[1] & 0x04);*/
  332. if((switchbyte[1] & 0x04) == 0x04)  /* Range 4 */
  333.     {
  334. /* printf("hello", getche());*/
  335.     sw[5].value = 4;
  336.     sw[5].mask  = 0x04;
  337.     strcpy(sw[5].status, "4' ");
  338.     }
  339. else if((switchbyte[1] & 0x02) == 0x02)  /* Range 8 */
  340.     {
  341.     sw[5].value = 8;
  342.     sw[5].mask  = 0x02;
  343.     strcpy(sw[5].status, "8' ");
  344.     }
  345. else if((switchbyte[1] & 0x01) == 0x01)  /* Range 16 */
  346.     {
  347.     sw[5].value = 16;
  348.     sw[5].mask  = 0x01;
  349.     strcpy(sw[5].status, "16'");
  350.     }
  351. /*printf("%d, %x, %s \n",sw[5].value, sw[5].mask, sw[5].status);
  352. getche();*/
  353.  
  354. if((switchbyte[2] & 0x20) == 0x20)  /* Noise    */
  355.     {
  356.     sw[6].value = 1;
  357.     sw[6].mask  = 0x20;
  358.     strcpy(sw[6].status, "on ");
  359.     }
  360. else
  361.     {
  362.     sw[6].value = 0;
  363.     sw[6].mask  = 0x00;
  364.     strcpy(sw[6].status, "off");
  365.     }
  366.  
  367. if((switchbyte[2] & 0x10) == 0x10)  /* HP filter*/
  368.     {
  369.     sw[7].value = 1;
  370.     sw[7].mask  = 0x10;
  371.     strcpy(sw[7].status, "off");
  372.     }
  373. else
  374.     {
  375.     sw[7].value = 0;
  376.     sw[7].mask  = 0x00;
  377.     strcpy(sw[7].status, "on ");
  378.     }
  379.  
  380. if((switchbyte[2] & 0x04) == 0x04)  /* VCA source */
  381.     {
  382.     sw[8].value = 1;
  383.     sw[8].mask  = 0x04;
  384.     strcpy(sw[8].status, "GATE");
  385.     }
  386. else
  387.     {
  388.     sw[8].value = 0;
  389.     sw[8].mask  = 0x00;
  390.     strcpy(sw[8].status, "ENV ");
  391.     }
  392.  
  393. if((switchbyte[2] & 0x02) == 0x02)  /* ENV dir */
  394.     {
  395.     sw[9].value = 1;
  396.     sw[9].mask  = 0x02;
  397.     strcpy(sw[9].status, "MINUS");
  398.     }
  399. else
  400.     {
  401.     sw[9].value = 0;
  402.     sw[9].mask  = 0x00;
  403.     strcpy(sw[9].status, "PLUS ");
  404.     }
  405.  
  406. if((switchbyte[2] & 0x01) == 0x01)  /* PWM source */
  407.     {
  408.     sw[10].value = 1;
  409.     sw[10].mask  = 0x01;
  410.     strcpy(sw[10].status, "MAN");
  411.     }
  412. else
  413.     {
  414.     sw[10].value = 0;
  415.     sw[10].mask  = 0x00;
  416.     strcpy(sw[10].status, "LFO");
  417.     }
  418. }
  419.  
  420. sendpatch()
  421. {
  422.     int a;
  423.     for(a = 0; a<3; a++)
  424.     switchbyte[a] = 0;
  425.  
  426.     switchbyte[0] = (sw[0].mask | sw[1].mask);
  427.  
  428.     for(a = 2; a<6; a++)
  429.     switchbyte[1] = (switchbyte[1] | sw[a].mask);
  430.  
  431.     for(a = 6; a<11; a++)
  432.     switchbyte[2] = (switchbyte[2] | sw[a].mask);
  433.  
  434. /* for(a = 0; a<3; a++)
  435.     printf("%d ", switchbyte[a]);
  436.     getche();*/
  437.  
  438.     MIDIINIT
  439.     txmidi( 0xF0);
  440.     txmidi( 0x41);
  441.     txmidi( 0x30);
  442.     txmidi( channel);
  443.     txmidi( patch);
  444.  
  445.     for(a = 0; a<4; a++)
  446.     txmidi( pm[a].value);
  447.  
  448.     txmidi( switchbyte[0]);
  449.  
  450.     for(a = 4; a<15; a++)
  451.     txmidi(pm[a].value);
  452.  
  453.     txmidi(switchbyte[1]);
  454.     txmidi(switchbyte[2]);
  455.     txmidi(0xF7);
  456.     MIDIRESET
  457. }
  458. savepatch()
  459. {
  460.     FILE *fptr;
  461.     char filename[80];
  462.     int a;
  463.  
  464.     g_puts(0,42*8, "Enter name of patch to save > ");
  465.     g_gets(-1,-1,filename);
  466.     if( (fptr=fopen(filename, "w")) == NULL)
  467.     {
  468.     g_puts(0, 42*8,"Can't open file            ");
  469.     msshowcur();
  470.     parameter();
  471.     }
  472.     g_puts(0,42*8,"Enter a description of the patch >");
  473.     g_gets(-1,-1,description);
  474.     g_puts(0,42*8,description);
  475.  
  476.     for(a = 0; a<4; a++)
  477.     fprintf(fptr, "%d\n", pm[a].value);
  478.  
  479.     fprintf(fptr, "%d\n", switchbyte[0]);
  480.  
  481.     for(a = 4; a<15; a++)
  482.     fprintf(fptr, "%d\n", pm[a].value);
  483.  
  484.     fprintf(fptr, "%d\n", switchbyte[1]);
  485.     fprintf(fptr, "%d\n", switchbyte[2]);
  486.     fprintf(fptr, "%s\n", description);
  487.  
  488.     fclose(fptr);
  489. }
  490. select_instr()
  491. {
  492.     if(instrument == 0) /*cycle through values*/
  493.     {
  494.     patch = 98;
  495.     instrument = 1;
  496.     }
  497.     else if (instrument == 1)
  498.     {
  499.     patch = 17;
  500.     instrument = 2;
  501.     }
  502.     else if (instrument == 2)
  503.     {
  504.     patch = 99;
  505.     instrument = 0;
  506.     }
  507.     channel = sw[13+instrument].value - 1;
  508. }
  509. whole_mode()
  510. {
  511.     MIDIINIT
  512.     if(sw[11].value == 1)
  513.     {
  514.     sw[11].value = 0;
  515.     strcpy(sw[11].status, "off");
  516.     txmidi(176 + channel);
  517.     txmidi(121);
  518.     txmidi(0);
  519.     }
  520.     else if(sw[11].value == 0)
  521.     {
  522.     sw[11].value = 1;
  523.     strcpy(sw[11].status, "on ");
  524.     txmidi(176 + channel);
  525.     txmidi(121);
  526.     txmidi(127);
  527.     }
  528.     MIDIRESET
  529. }
  530. hold()
  531. {
  532.     MIDIINIT
  533.     if(sw[12].value == 1)
  534.     {
  535.     sw[12].value = 0;
  536.     strcpy(sw[12].status, "off");
  537.     txmidi(176 + channel);
  538.     txmidi(64);
  539.     txmidi(0);
  540.     }
  541.     else if(sw[12].value == 0)
  542.     {
  543.     sw[12].value = 1;
  544.     strcpy(sw[12].status, "on ");
  545.     txmidi(176 + channel);
  546.     txmidi(64);
  547.     txmidi(127);
  548.     }
  549.     MIDIRESET
  550. }
  551. set_channel()
  552. {
  553. char temp[80];
  554. sw[13+instrument].value++;
  555. if(sw[13+instrument].value > 16)
  556.     sw[13+instrument].value = 1;
  557.  
  558. if (sw[13+instrument].value <10)
  559.     {
  560.     strcpy(sw[13+instrument].status, " ");
  561.     itoa(sw[13+instrument].value, temp, 10);
  562.     strcat(sw[13+instrument].status,temp);
  563.     }
  564.     else
  565.     itoa(sw[13+instrument].value, sw[13+instrument].status, 10);
  566.  
  567. }
  568.  
  569.  
  570.  
  571.