public void ModifyNote(ISampleMaker voice, int step, int newDuration) { StepEvent stepEvent = null; if (this.stepEvents.ContainsKey(step)) { stepEvent = this.stepEvents[step]; stepEvent.VoiceNotes[voice].Duration = newDuration; } else { throw new SequencerException("Step not found at position '" + step.ToString() + "' to modify."); } }
public void ModifyNote(ISampleMaker voice, ISampleMaker newVoice, int step) { StepEvent stepEvent = null; if (this.stepEvents.ContainsKey(step)) { stepEvent = this.stepEvents[step]; if (stepEvent.VoiceNotes.ContainsKey(voice)) { int duration = stepEvent.VoiceNotes[voice].Duration; stepEvent.VoiceNotes.Remove(voice); this.AddNote(newVoice, step, duration); } } }
public void AddNote(ISampleMaker voice, int step, int duration) { StepEvent stepEvent = null; if (this.stepEvents.ContainsKey(step)) { stepEvent = this.stepEvents[step]; } else { stepEvent = new StepEvent(); this.stepEvents.Add(step, stepEvent); } stepEvent.Step = step; VoiceNote note = new VoiceNote(); note.Duration = duration; note.Voice = voice; stepEvent.VoiceNotes.Add(voice, note); }
public void DeleteNote(ISampleMaker voice, int step) { StepEvent stepEvent = null; if (this.stepEvents.ContainsKey(step)) { stepEvent = this.stepEvents[step]; } else { return; } if (stepEvent.VoiceNotes.ContainsKey(voice)) { bool f = stepEvent.VoiceNotes.Remove(voice); this.stepEvents.Remove(step); ////Debug.WriteLine(f); this.stepChanged = true; } }