public void AddNote(InstrumentNoteInstance note) { lock (CurrentNotes) { CurrentNotes.Add(note); } }
private void button1_Click(object sender, EventArgs e) { if (ini == null) { ini = new InstrumentNoteInstance(); ini.Instrument = (int)InstrumentChooser.Value; ini.time = 0; ini.freq = InstrumentSynth.PitchToFrequency(trackBar1.Value); View.Audio.MusicSynthGen.AddNote(ini); button1.Text = "Stop"; } else { View.Audio.MusicSynthGen.RemoveNote(ini); ini = null; button1.Text = "Test"; } }
public void RemoveNote(InstrumentNoteInstance note) { lock (CurrentNotes) { CurrentNotes.Remove(note); } }