All pastes #797148 Raw Edit

Miscellany

public text v1 · immutable
#797148 ·published 2007-11-25 20:08 UTC
rendered paste body
#include <cstdio>
#include <cstdlib>
#include <map>
#include <string>
#include <iostream>
#include <vector>
#include <boost/assign.hpp>

using namespace std;
using namespace boost::assign;

int main()
{
map <string, int> notes;
map <string, vector<int> > chordLib;
vector<int> tmp;
map <string, vector<long long> > tmpvec;
vector<map <string, vector<long long> > > samples;

notes["a"] = 0; notes["a#"] = 1; notes["b"] = 2; notes["c"] = 3; notes["c#"] = 4;
notes["d"] = 5; notes["d#"] = 6; notes["e"] = 7; notes["f"] = 8; notes["f#"] = 9;
notes["g"] = 10; notes["g#"] = 11;


tmp += 0, 4, 7; chordLib["M"] = tmp; tmp.clear();
tmp += 0, 3, 7; chordLib["m"] = tmp; tmp.clear();
tmp += 0, 4, 8; chordLib["aug"] = tmp; tmp.clear();
tmp += 0, 3, 6; chordLib["dim"] = tmp; tmp.clear();
tmp += 0, 10, 4, 7; chordLib["7"] = tmp; tmp.clear();

tmp += 0, 1000000000LL; 		tmpvec["x"] = tmp; tmp.clear(); 
tmp += 1420000000LL, 4860000000LL;	tmpvec["7"] = tmp; tmp.clear();
tmp += 5060000000LL, 7570000000LL;	tmpvec["8"] = tmp; tmp.clear();
tmp += 8050000000LL, 10300000000LL;	tmpvec["9"] = tmp; tmp.clear();
tmp += 10840000000LL, 12950000000LL;	tmpvec["10"] = tmp; tmp.clear();
tmp += 13489000000LL, 16060000000LL;	tmpvec["11"] = tmp; tmp.clear();
samples += tmpvec;

/*samples.append({"x":[0, 1000000000], 7:[1420000000, 4860000000], 8:[5060000000, 7570000000], 9:[8050000000, 10300000000], 10:[10840000000, 12950000000], 11:[13489000000, 16060000000]})
samples.append({"x":[0, 1000000000], 0:[2475000000, 4700000000], 1:[5240000000, 6850000000], 2:[7550000000, 9700000000], 3:[10170000000, 12130000000], 4:[12805000000, 15300000000]})
samples.append({"x":[0, 1000000000], 5:[2690000000, 4835000000], 6:[5705000000, 7560000000], 7:[8405000000, 10810000000], 8:[11115000000, 12880000000], 9:[13720000000, 16270000000]})
samples.append({"x":[0, 1000000000], 10:[2690000000, 4065000000], 11:[4950000000, 6774000000], 0:[7410000000, 9300000000], 1:[9880000000, 11820000000], 2:[12443000000, 13845000000]})
samples.append({"x":[0, 1000000000], 2:[2250000000, 4115000000], 3:[4615000000, 6320000000], 4:[6880000000, 8805000000], 5:[9275000000, 11050000000], 6:[11700000000, 13270000000]})
samples.append({"x":[0, 1000000000], 7:[2225000000, 4070000000], 8:[4500000000, 6410000000], 9:[6800000000, 8480000000], 10:[9060000000, 10770000000], 11:[11410000000, 14020000000]})
*/

//chordLib = {"M":[0,4,7], "m":[0,3,7], "aug":[0,4,8], "dim":[0,3,6], "7":[0,10,4,7]}
//cout << chordLib["M"][2];
//cout << notes["a"];
cout << tmp.size();
}



/*
litb> geordi: { map<vector<int>, string> m; vector<int> a, b; a+= 1, 2; b+= 42, 666; m[a] = "first vec"; m[b] = "something other"; cout << m; }
<geordi> [([1, 2], first vec), ([42, 666], something other)]
*/