Exemple #1
0
        public static ProcessResultArray <Clip> Apply(SetLengthOptions options, params Clip[] clips)
        {
            var resultClips = ClipUtilities.CreateEmptyPlaceholderClips(clips);

            for (var index = 0; index < clips.Length; index++)
            {
                var clip          = clips[index];
                var resultClip    = resultClips[index];
                var lengthCounter = 0;
                foreach (var note in clip.Notes)
                {
                    ClipUtilities.AddNoteCutting(resultClip, new NoteEvent(note)
                    {
                        Duration = options.Lengths[lengthCounter++ % options.Lengths.Length]
                    });
                }
            }
            return(new ProcessResultArray <Clip>(resultClips));
        }
Exemple #2
0
        public static ProcessResultArray <Clip> Apply(SetLengthOptions options, params Clip[] clips)
        {
            var resultClips = new Clip[clips.Length];

            var i = 0;

            foreach (var clip in clips)
            {
                var resultClip    = new Clip(clips[i].Length, clips[i].IsLooping);
                var lengthCounter = 0;
                foreach (var note in clip.Notes)
                {
                    resultClip.Add(new NoteEvent(note.Pitch, note.Start, options.Lengths[lengthCounter++ % options.Lengths.Length], note.Velocity));
                }

                resultClips[i] = resultClip;
                i++;
            }
            return(new ProcessResultArray <Clip>(resultClips));
        }