Created
April 12, 2018 05:14
-
-
Save aksh1618/978ada8fa61e0d78b6e9529d19ee3491 to your computer and use it in GitHub Desktop.
C++ Windows API Für Elise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adapted from https://gist.github.com/spara/1832855 | |
#include<bits/stdc++.h> | |
#include<windows.h> | |
#include<stdlib.h> | |
using namespace std; | |
int main() | |
{ | |
int duration = 350; | |
int sleep_reduction = 350; | |
// while (true) { | |
// Beep(3110 * 10, 100); | |
// } | |
// play e4 | |
Sleep(600 - sleep_reduction); | |
Beep(329.63 * 10, duration); | |
Sleep(350 - sleep_reduction); | |
// play d4# | |
Beep(311.13 * 10, duration); | |
Sleep(350 - sleep_reduction); | |
// play e4 | |
Beep(329.63 * 10, duration); | |
Sleep(350 - sleep_reduction); | |
// play d4# | |
Beep(11.13 * 10, duration); | |
Sleep(350 - sleep_reduction); | |
// play e4 | |
Beep(329.63 * 10, duration); | |
Sleep(350 - sleep_reduction); | |
// play b3 | |
Beep(246.94 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play d4 | |
Beep(293.66 * 10,duration); | |
Sleep(400 - sleep_reduction); | |
// play c4 | |
Beep(261.63 * 10,duration); | |
Sleep(400 - sleep_reduction); | |
// play a3 | |
Beep(220 * 10, 900); | |
Sleep(1000 - sleep_reduction); | |
// play d3 | |
Beep(46.83 * 10, duration); | |
Sleep(350 - sleep_reduction); | |
//play f3 | |
Beep(174.61 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
//play a3 | |
Beep(220 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play b3 | |
Beep(246.94 * 10, 900); | |
Sleep(1000 - sleep_reduction); | |
// play f3 | |
Beep(174.61 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play a3# | |
Beep(233.08 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play b3 | |
Beep(246.94 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play c4 | |
Beep(261.63 * 10, 900); | |
Sleep(1000 - sleep_reduction); | |
Sleep(duration - sleep_reduction); | |
// play e4 | |
Beep(329.63 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play d4# | |
printf("here"); | |
Beep(311.13 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play e4 | |
Beep(329.63 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play d4# | |
Beep(311.13 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play e4 | |
Beep(329.63 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play b3 | |
Beep(246.94 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play d4 | |
Beep(293.66 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play c4 | |
Beep(261.63 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play a3 | |
Beep(220 * 10, 900); | |
Sleep(1000 - sleep_reduction); | |
// play d3 | |
Beep(146.83 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play f3 | |
Beep(174.61 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play a3 | |
Beep(220 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play b3 | |
Beep(246.94 * 10, 900); | |
Sleep(1000 - sleep_reduction); | |
// play f3 | |
Beep(174.61 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play c4 | |
Beep(261.63 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play b3 | |
Beep(246.94 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play a3 | |
Beep(220 * 10, 900); | |
Sleep(1000 - sleep_reduction); | |
// play b3 | |
Beep(46.94 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play c4 | |
Beep(261.63 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play d4 | |
Beep(293.66 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play e4 | |
Beep(329.63 * 10, 900); | |
Sleep(1000 - sleep_reduction); | |
// play g3 | |
Beep(196 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play f4 | |
Beep(349.23 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
//play e4 | |
Beep(329.23 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play d4 | |
Beep(293.63 * 10, 900); | |
Sleep(1000 - sleep_reduction); | |
// play e3 | |
Beep(64.81 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play e4 | |
Beep(329.63 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play d4 | |
Beep(293.63 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play c4 | |
Beep(261.63 * 10, 900); | |
Sleep(1000 - sleep_reduction); | |
// play d3 | |
Beep(146.83 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play d4 | |
Beep(293.63 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play c4 | |
Beep(261.63 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play b3 | |
Beep(246.94 * 10, 900); | |
Sleep(1000 - sleep_reduction); | |
Sleep(400 - sleep_reduction); | |
// play e4 | |
Beep(329.63 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play d4# | |
Beep(311.13 * 10, duration); | |
Sleep(350 - sleep_reduction); | |
// play e4 | |
Beep(329.63 * 10, duration); | |
Sleep(350 - sleep_reduction); | |
// play d4# | |
Beep(11.13 * 10, duration); | |
Sleep(350 - sleep_reduction); | |
// play e4 | |
Beep(329.63 * 10, duration); | |
Sleep(350 - sleep_reduction); | |
// play b3 | |
Beep(246.94 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play d4 | |
Beep(293.66 * 10,duration); | |
Sleep(400 - sleep_reduction); | |
// play c4 | |
Beep(261.63 * 10,duration); | |
Sleep(400 - sleep_reduction); | |
// play a3 | |
Beep(220 * 10, 900); | |
Sleep(1000 - sleep_reduction); | |
// play d3 | |
Beep(46.83 * 10, duration); | |
Sleep(350 - sleep_reduction); | |
//play f3 | |
Beep(174.61 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
//play a3 | |
Beep(220 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play b3 | |
Beep(246.94 * 10, 900); | |
Sleep(1000 - sleep_reduction); | |
// play f3 | |
Beep(174.61 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play a3 | |
Beep(233.08 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play b3 | |
Beep(246.94 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play c4 | |
Beep(261.63 * 10, 900); | |
Sleep(1000 - sleep_reduction); | |
Sleep(duration - sleep_reduction); | |
// play e4 | |
Beep(329.63 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play d4# | |
Beep(311.13 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play e4 | |
Beep(329.63 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play d4# | |
Beep(311.13 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play e4 | |
Beep(329.63 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play b3 | |
Beep(246.94 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play d4 | |
Beep(293.66 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play c4 | |
Beep(261.63 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play a3 | |
Beep(220 * 10, 900); | |
Sleep(1000 - sleep_reduction); | |
// play d3 | |
Beep(146.83 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play f3 | |
Beep(174.61 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play a3 | |
Beep(220 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play b3 | |
Beep(246.94 * 10, 900); | |
Sleep(1000 - sleep_reduction); | |
// play f3 | |
Beep(174.61 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play c4 | |
Beep(261.63 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play b3 | |
Beep(246.94 * 10, duration); | |
Sleep(400 - sleep_reduction); | |
// play a3 | |
Beep(220 * 10, 900); | |
Sleep(1000 - sleep_reduction); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment