static void Main(string[] args) { var dynamics = System.Console.ReadLine(); Piano _piano = new Piano(); //ピアノを演奏します。 _piano.Play(dynamics); System.Console.ReadLine(); }
public void PlayOneNoteTest() { //There isn't really a feasible way to test whether or not the sampling returned will add up to the same thing for two different piano's //so I just made copied over Piano testPiano = new Piano("q2we4r5ty7u8i9op-[=zxdcfvgbnjmk,.;/' ", 44100); testPiano.StrikeKey('q'); PianoWire testWire = (PianoWire)testPiano.returnKeyAtIndex('q'); double[] testArray = testWire.buffer.getValues(); Assert.AreEqual(testArray[0], testPiano.Play()); }
public void PlayMultipleNotesTest() { Piano testPiano = new Piano("q2we4r5ty7u8i9op-[=zxdcfvgbnjmk,.;/' ", 44100); testPiano.StrikeKey('q'); testPiano.StrikeKey('2'); testPiano.StrikeKey('w'); PianoWire testWire1 = (PianoWire)testPiano.returnKeyAtIndex('q'); PianoWire testWire2 = (PianoWire)testPiano.returnKeyAtIndex('2'); PianoWire testWire3 = (PianoWire)testPiano.returnKeyAtIndex('w'); double[] testArray1 = testWire1.buffer.getValues(); double[] testArray2 = testWire2.buffer.getValues(); double[] testArray3 = testWire3.buffer.getValues(); double result = testArray1[0] + testArray2[0] + testArray3[0]; Assert.AreEqual(result, testPiano.Play()); }
static void Main(string[] args) { List <StringInstrument> stringInstruments = new List <StringInstrument>(); Guitar guitar = new Guitar("Guitarra Acustica", "Dreadnought", 6); Piano piano = new Piano("Piano", "Piano de Cola", 230); stringInstruments.Add(guitar); stringInstruments.Add(piano); Console.WriteLine(guitar.Play()); Console.WriteLine(guitar.Play()); Console.WriteLine(piano.Play()); Console.WriteLine(guitar.showTuning()); Console.WriteLine(piano.showTuning()); foreach (StringInstrument instrument in stringInstruments) { guitar.FineTune(); piano.FineTune(); } Console.WriteLine(guitar.showTuning()); Console.WriteLine(piano.showTuning()); }
public void PlayNoNotesTest() { Piano testPiano = new Piano("q2we4r5ty7u8i9op-[=zxdcfvgbnjmk,.;/' ", 44100); Assert.AreEqual(0, testPiano.Play()); }