// ----------------------------------- PLAY --------------------------------------------------------- private void pbPlayButton_Click(object sender, EventArgs e) { composition.setTempo(formTempo); composition.play(outputDevice); picGraph.Invalidate(); //Invalidate(); }
private void btnN6_Click(object sender, EventArgs e) { MyComposition comp1 = new MyComposition(formTempo); comp1.addNote(generatedNotes.ElementAt(5)); comp1.play(outputDevice); }
private void button16_Click(object sender, EventArgs e) { List <MyNote> posledni = composition.getLastSix(); MyComposition singleNote = new MyComposition(formTempo); singleNote.addNote(posledni.ElementAt(5)); singleNote.play(outputDevice); }
private void PlayLastSix_Click(object sender, EventArgs e) { int compositionLength = composition.getLength(); if (compositionLength > 6) { List <MyNote> lastSix = composition.getLastSix(); MyComposition.play(lastSix, formTempo, outputDevice); } else { composition.setTempo(formTempo); composition.play(outputDevice); } }
//----------------------------------- PANEL ------------------------------------------------------------------- private void fillPanel() { panel1.Controls.Clear(); int radioY = 53; int buttonY = 10; int counter = 0; int currentButton = 10; int currentRadio = 37; int increment = 80; foreach (MyNote n in composition.getListNotes()) { panel1.HorizontalScroll.Value = 0; Button button = new Button(); RadioButton radioButton = new RadioButton(); button.Height = 40; button.Width = 70; radioButton.Width = 35; //button.Tag = counter; radioButton.Tag = counter; button.Location = new Point(currentButton, buttonY); radioButton.Location = new Point(currentRadio, radioY); compositionHistory.Add(new Components(button, radioButton)); currentRadio += increment; currentButton += increment; button.Text = n.ToString(); button.Click += (s, e) => { MyComposition comp = new MyComposition(formTempo); comp.addNote(n); comp.play(outputDevice); }; panel1.Controls.Add(button); panel1.Controls.Add(radioButton); panel1.ScrollControlIntoView(button); counter++; } }
private void PlaySample_Click(object sender, EventArgs e) { MyComposition comp = new MyComposition(formTempo); comp.addNote(new MyNote(64, 1)); comp.addNote(new MyNote(64, 1)); comp.addNote(new MyNote(65, 1)); comp.addNote(new MyNote(67, 1)); comp.addNote(new MyNote(67, 1)); comp.addNote(new MyNote(65, 1)); comp.addNote(new MyNote(64, 1)); comp.addNote(new MyNote(62, 1)); comp.addNote(new MyNote(60, 1)); comp.addNote(new MyNote(60, 1)); comp.addNote(new MyNote(62, 1)); comp.addNote(new MyNote(64, 1)); comp.addNote(new MyNote(64, 2)); comp.addNote(new MyNote(62, 1)); comp.addNote(new MyNote(62, 1)); comp.play(outputDevice); }