1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <string>
using namespace std;
struct note_t
{
char letter;
int position;
string modeName;
};
int main ()
{
srand(static_cast<unsigned int>(time(0)));
short int key;
short int mode;
short int assess;
note_t notes[7] = { {'C',0,"Ionian"},
{'D',2,"Dorian"},
{'E',4,"Phrygian"},
{'F',5,"Lydian"},
{'G',7,"Mixolydian"},
{'A',9,"Aeolian"},
{'B',11,"Locrian"}};
key=rand()%7;
cout << "Letter: " << notes[key].letter << endl;
cout << "Position: " << notes[key].position << endl;
cout << "-------------------------" << endl;
mode=rand()%7;
cout << "Mode name: " << notes[mode].modeName << endl;
cout << "Position: " << notes[mode].position << endl << endl;
system ("pause");
return 0;
}
|