Metronom v1
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 | //by Niko #include <iostream> #include <windows.h> //_beep i Sleep using namespace std; int main() { int a,b,i,t,c; a=440; b=880; cout<<"podaj tempo (bpm)"<<endl; cin>>t; c=60000/t/10; //dlugosc ticku i=1; // do petli int stoper; stoper=0; // licznik while (i==1) { _beep(stoper%4==0? b : a ,c); //akcent na raz Sleep(60000/t-c); stoper++; cout<<stoper%4+1<<' '; if (stoper%4==3) cout << '|'; } system("pause"); return 0; } |
Show Comments