コード例 #1
0
        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.");
            }
        }
コード例 #2
0
        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);
                }
            }
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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;
            }
        }