Last active
December 19, 2015 19:58
-
-
Save Dr4g0/6009985 to your computer and use it in GitHub Desktop.
Music Popcorns
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace NotesPopcorn | |
{ | |
class Program | |
{ | |
static void Main() | |
{ | |
decimal noteA1 = 110.00m; | |
decimal noteC=130.81m; | |
decimal noteDb = 138.59m; | |
decimal noteD = 146.83m; | |
decimal noteEb = 155.56m; | |
decimal noteE = 164.81m; | |
decimal noteF = 174.61m; | |
decimal noteGb = 175.00m; | |
decimal noteG = 196.00m; | |
decimal noteAb = 207.65m; | |
decimal noteA = 220.00m; | |
decimal noteBb = 233.08m; | |
decimal noteB = 246.94m; | |
string[] popcornsNotes = { "A", "G", "A", "E", "C", "E", "A1", "P","A", "G", "A", "E", "C", "E", "A1" }; | |
//ABC2BCCADADDGAAGAAGAECEAAGAECEAABCBCCADADDGAAGABCEDECACGEDECACGEGbGGbEE"; | |
for (int i = 0; i < popcornsNotes.Length; i++) | |
{ | |
switch (popcornsNotes[i]) | |
{ | |
case "A": Console.Beep((int)noteA, 350); break; | |
case "B": Console.Beep((int)noteB, 350); break; | |
case "C": Console.Beep((int)noteC, 350); break; | |
case "D": Console.Beep((int)noteD, 350); break; | |
case "E": Console.Beep((int)noteE, 350); break; | |
case "F": Console.Beep((int)noteF, 300); break; | |
case "G": Console.Beep((int)noteG, 350); break; | |
case "A1": Console.Beep((int)noteA1, 300); break; | |
case "P": Thread.Sleep(350); break; | |
default: | |
break; | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment