-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlesson4.cpp
44 lines (35 loc) · 869 Bytes
/
lesson4.cpp
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
// tutorial 2.cpp
#include "MuMaterial.h"
int main(void)
{
MuMaterial mat1, mat2, matFinal;
MuNote nota;
srand(static_cast<unsigned int>(time(0)));
nota.SetInstr(1);
nota.SetStart(0.0);
nota.SetDur(0.17);
int turns = 10;
while(turns--)
{
mat1.Clear();
mat2.Clear();
for(int i = 0; i < 7; i++)
{
if(i == 0)
nota.SetAmp(0.75);
else
nota.SetAmp(0.4);
nota.SetPitch(Between(48,60));
mat1 += nota;
}
mat2 = mat1;
// 8va abaixo / 8va acima
int transp = 12;
if (rand()%2) transp *= -1;
mat2.Transpose(transp);
mat1 += mat2;
matFinal += mat1;
}
matFinal.PlaybackWithCsound("/Users/cem/Desktop/melodia");
return 0;
}