counterpointFunc.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2010 by Luigi Negretti Lanner   *
00003  *   luigi.negrettilanner@gmail.com   *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 /*INIZIALIZZAZIONE DEGLI ARRAY PER I PARAMETRI PITCH DUR DB INSTR */
00021 int contrappunto::init_params()
00022 {
00023      tcrom[0] = 5.0;
00024      tcrom[1] = 5.01;
00025      tcrom[2] = 5.02;
00026      tcrom[3] = 5.03;
00027      tcrom[4] = 5.04;
00028      tcrom[5] = 5.05;
00029      tcrom[6] = 5.06;
00030      tcrom[7] = 5.07;
00031      tcrom[8] = 5.08;
00032      tcrom[9] = 5.09;
00033      tcrom[10] = 5.10;
00034      tcrom[11] = 5.11;
00035 
00036      tcrom[12] = 6.0;
00037      tcrom[13] = 6.01;
00038      tcrom[14] = 6.02;
00039      tcrom[15] = 6.03;
00040      tcrom[16] = 6.04;
00041      tcrom[17] = 6.05;
00042      tcrom[18] = 6.06;
00043      tcrom[19] = 6.07;
00044      tcrom[20] = 6.08;
00045      tcrom[21] = 6.09;
00046      tcrom[22] = 6.10;
00047      tcrom[23] = 6.11;
00048 
00049      tcrom[24] = 7.0;
00050      tcrom[25] = 7.01;
00051      tcrom[26] = 7.02;
00052      tcrom[27] = 7.03;
00053      tcrom[28] = 7.04;
00054      tcrom[29] = 7.05;
00055      tcrom[30] = 7.06;
00056      tcrom[31] = 7.07;
00057      tcrom[32] = 7.08;
00058      tcrom[33] = 7.09;
00059      tcrom[34] = 7.10;
00060      tcrom[35] = 7.11;
00061 
00062      tcrom[36] = 8.0;
00063      tcrom[37] = 8.01;
00064      tcrom[38] = 8.02;
00065      tcrom[39] = 8.03;
00066      tcrom[40] = 8.04;
00067      tcrom[41] = 8.05;
00068      tcrom[42] = 8.06;
00069      tcrom[43] = 8.07;
00070      tcrom[44] = 8.08;
00071      tcrom[45] = 8.09;
00072      tcrom[46] = 8.10;
00073      tcrom[47] = 8.11;
00074 
00075      tcrom[48] = 9.0;
00076      tcrom[49] = 9.01;
00077      tcrom[50] = 9.02;
00078      tcrom[51] = 9.03;
00079      tcrom[52] = 9.04;
00080      tcrom[53] = 9.05;
00081      tcrom[54] = 9.06;
00082      tcrom[55] = 9.07;
00083      tcrom[56] = 9.08;
00084      tcrom[57] = 9.09;
00085      tcrom[58] = 9.10;
00086      tcrom[59] = 9.11;
00087 
00088      tcrom[60] = 10.0;
00089      tcrom[61] = 10.01;
00090      tcrom[62] = 10.02;
00091      tcrom[63] = 10.03;
00092      tcrom[64] = 10.04;
00093      tcrom[65] = 10.05;
00094      tcrom[66] = 10.06;
00095      tcrom[67] = 10.07;
00096      tcrom[68] = 10.08;
00097      tcrom[69] = 10.09;
00098      tcrom[70] = 10.10;
00099      tcrom[71] = 10.11;
00100 
00101      tcrom[72] = 11.0;
00102      tcrom[73] = 11.01;
00103      tcrom[74] = 11.02;
00104      tcrom[75] = 11.03;
00105      tcrom[76] = 11.04;
00106      tcrom[77] = 11.05;
00107      tcrom[78] = 11.06;
00108      tcrom[79] = 11.07;
00109      tcrom[80] = 11.08;
00110      tcrom[81] = 11.09;
00111      tcrom[82] = 11.10;
00112      tcrom[83] = 11.11;
00113 
00114 ////array intensita'
00115     tdb[0] = 40;
00116     tdb[1] = 41;
00117     tdb[2] = 42;
00118     tdb[3] = 43;
00119     tdb[4] = 44;
00120     tdb[5] = 45;
00121     tdb[6] = 46;
00122     tdb[7] = 47;
00123     tdb[8] = 48;
00124     tdb[9] = 49;
00125 
00126     tdb[10] = 50;
00127     tdb[11] = 51;
00128     tdb[12] = 52;
00129     tdb[13] = 53;
00130     tdb[14] = 54;
00131     tdb[15] = 55;
00132     tdb[16] = 56;
00133     tdb[17] = 57;
00134     tdb[18] = 58;
00135     tdb[19] = 59;
00136 
00137     tdb[20] = 60;
00138     tdb[21] = 61;
00139     tdb[22] = 62;
00140     tdb[23] = 63;
00141     tdb[24] = 64;
00142     tdb[25] = 65;
00143     tdb[26] = 66;
00144     tdb[27] = 67;
00145     tdb[28] = 68;
00146     tdb[29] = 69;
00147 
00148     tdb[30] = 70;
00149     tdb[31] = 71;
00150     tdb[32] = 72;
00151     tdb[33] = 73;
00152     tdb[34] = 74;
00153     tdb[35] = 75;
00154     tdb[36] = 76;
00155     tdb[37] = 77;
00156     tdb[38] = 78;
00157     tdb[39] = 79;
00158 
00159     tdb[40] = 80;
00160     tdb[41] = 81;
00161     tdb[42] = 82;
00162     tdb[43] = 83;
00163     tdb[44] = 84;
00164     tdb[45] = 85;
00165     tdb[46] = 86;
00166     tdb[47] = 87;
00167     tdb[48] = 88;
00168     tdb[49] = 89;
00169 
00170     tdb[50] = 90;
00171     tdb[51] = 91;
00172     tdb[52] = 92;
00173     tdb[53] = 93;
00174     tdb[54] = 94;
00175     tdb[55] = 95;
00176     tdb[56] = 96;
00177     tdb[57] = 97;
00178     tdb[58] = 98;
00179     tdb[59] = 99;
00180 
00181     tdb[60] = 100;
00182     tdb[61] = 101;
00183     tdb[62] = 102;
00184     tdb[63] = 103;
00185     tdb[64] = 104;
00186     tdb[65] = 105;
00187     tdb[66] = 106;
00188     tdb[67] = 107;
00189     tdb[68] = 108;
00190     tdb[69] = 109;
00191 
00192     tdb[70] = 110;
00193     tdb[71] = 111;
00194     tdb[72] = 112;
00195     tdb[73] = 113;
00196     tdb[74] = 114;
00197     tdb[75] = 115;
00198     tdb[76] = 116;
00199     tdb[77] = 117;
00200     tdb[78] = 118;
00201     tdb[79] = 119;
00202 
00203 
00204 tdur[0] = 0.125;
00205 tdur[1] = 0.25;
00206 tdur[2] = 0.375;
00207 tdur[3] = 0.5;
00208 tdur[4] = 0.625;
00209 tdur[5] = 0.75;
00210 tdur[6] = 0.875;
00211 tdur[7] = 1;
00212 tdur[8] = 1.125;
00213 tdur[9] = 1.25;
00214 tdur[10] = 1.375;
00215 tdur[11] = 1.5;
00216 tdur[12] = 1.625;
00217 tdur[13] = 1.75;
00218 tdur[14] = 1.875;
00219 tdur[15] = 2;
00220 tdur[16] = 2.125;
00221 tdur[17] = 2.25;
00222 tdur[18] = 2.375;
00223 tdur[19] = 2.5;
00224 tdur[20] = 2.625;
00225 tdur[21] = 2.75;
00226 tdur[22] = 2.875;
00227 tdur[23] = 3;
00228 tdur[24] = 3.125;
00229 tdur[25] = 3.25;
00230 tdur[26] = 3.375;
00231 tdur[27] = 3.5;
00232 tdur[28] = 3.625;
00233 tdur[29] = 3.75;
00234 tdur[30] = 3.875;
00235 tdur[31] = 4;
00236 tdur[32] = 4.125;
00237 tdur[33] = 4.25;
00238 tdur[34] = 4.375;
00239 tdur[35] = 4.5;
00240 tdur[36] = 4.625;
00241 tdur[37] = 4.75;
00242 tdur[38] = 4.875;
00243 tdur[39] = 5;
00244 tdur[40] = 5.125;
00245 tdur[41] = 5.25;
00246 tdur[42] = 5.375;
00247 tdur[43] = 5.5;
00248 tdur[44] = 5.625;
00249 tdur[45] = 5.75;
00250 tdur[46] = 5.875;
00251 tdur[47] = 6;
00252 tdur[48] = 6.125;
00253 tdur[49] = 6.25;
00254 tdur[50] = 6.375;
00255 tdur[51] = 6.5;
00256 tdur[52] = 6.625;
00257 tdur[53] = 6.75;
00258 tdur[54] = 6.875;
00259 tdur[55] = 7;
00260 tdur[56] = 7.125;
00261 tdur[57] = 7.25;
00262 tdur[58] = 7.375;
00263 tdur[59] = 7.5;
00264 tdur[60] = 7.625;
00265 tdur[61] = 7.75;
00266 tdur[62] = 7.875;
00267 tdur[63] = 8;
00268 tdur[64] = 8.125;
00269 tdur[65] = 8.25;
00270 tdur[66] = 8.375;
00271 tdur[67] = 8.5;
00272 tdur[68] = 8.625;
00273 tdur[69] = 8.75;
00274 tdur[70] = 8.875;
00275 tdur[71] = 9;
00276 tdur[72] = 9.125;
00277 tdur[73] = 9.25;
00278 tdur[74] = 9.375;
00279 tdur[75] = 9.5;
00280 tdur[76] = 9.625;
00281 tdur[77] = 9.75;
00282 tdur[78] = 9.875;
00283 tdur[79] = 10;
00284 tdur[80] = 10.125;
00285 tdur[81] = 10.25;
00286 tdur[82] = 10.375;
00287 tdur[83] = 10.5;
00288 tdur[84] = 10.625;
00289 tdur[85] = 10.75;
00290 tdur[86] = 10.875;
00291 tdur[87] = 11;
00292 tdur[88] = 11.125;
00293 tdur[89] = 11.25;
00294 tdur[90] = 11.375;
00295 tdur[91] = 11.5;
00296 tdur[92] = 11.625;
00297 tdur[93] = 11.75;
00298 tdur[94] = 11.875;
00299 tdur[95] = 12;
00300 tdur[96] = 12.125;
00301 tdur[97] = 12.25;
00302 tdur[98] = 12.375;
00303 tdur[99] = 12.5;
00304 tdur[100] = 12.625;
00305 tdur[101] = 12.75;
00306 tdur[102] = 12.875;
00307 
00308 
00309 
00310             
00311 ////array instr
00312     tInstr[0] = 1;
00313     tInstr[1] = 2;
00314     tInstr[2] = 3;
00315     tInstr[3] = 4;
00316     tInstr[4] = 5;
00317     tInstr[5] = 6;
00318     tInstr[6] = 7;
00319     tInstr[7] = 8;
00320     tInstr[8] = 9;
00321     tInstr[9] = 10;
00322     tInstr[10] = 11;
00323     tInstr[11] = 12;
00324     tInstr[12] = 13;
00325     tInstr[13] = 14;
00326     tInstr[14] = 15;
00327     tInstr[15] = 16;
00328     tInstr[16] = 17;
00329     tInstr[17] = 18;
00330     tInstr[18] = 19;
00331     tInstr[19] = 20;
00332     tInstr[20] = 21;
00333     tInstr[21] = 22;
00334     tInstr[22] = 23;
00335     tInstr[23] = 24;
00336     
00337     //initializing act
00338     int i = (int)max_act->value();
00339     for ( i = 0; i < 1800; i++ )
00340     {
00341     tact[i] = i;
00342     }
00343 }
00344 
00345 void select_val()
00346 {
00347     formula f1, f2;
00348     f1.trp_seq();
00349     
00350         if (f1.l > f1.k)
00351             {
00352             f2.solveFormula();
00353             o = u;
00354             }
00355         else if (f1.l < f1.k)
00356             {
00357             f2.solveFormula();
00358             o = v;
00359             }
00360 }

Generated on Sun Jul 1 20:29:36 2012 for Csmusgen by  doxygen 1.4.7