Esempio n. 1
0
 public void GenerateGroove()
 {
     ;
     for (var i = 0; i < 20; i++)
     {
         var timeSignature = new TimeSignature(Randomizer.ProbabilityOfTrue(0.7) ? 4 : 3, 4);
         var feel          = Randomizer.ProbabilityOfTrue(0.75) ? 4 : 3;
         var groove        = GrooveGenerator.GenerateGroove(new SongInfo(timeSignature, feel));
         var drumStyle     = new DrumStyle(SectionType.Verse);
         drumStyle.Generate(groove);
         Console.WriteLine("{0}, {1} feel", timeSignature, feel);
         Console.WriteLine(TabWriter.AsTab(groove.Feel, drumStyle.Notes, timeSignature.BeatCount));
     }
 }
Esempio n. 2
0
        public void RiffResolutionTest()
        {
            const int feel          = 4;
            var       timeSignature = new TimeSignature(8, 4);
            var       songInfo      = new SongInfo(timeSignature, feel);
            var       groove        = GrooveGenerator.GenerateGroove(songInfo);

            WriteRhythm("Original groove", groove.Beats, timeSignature.BeatCount, feel);

            for (var i = 1; i <= 10; i++)
            {
                var res       = 4.0 / i;
                var riffBeats = RiffGenerator.Rhythm(timeSignature, groove.Beats.ToList(), res, feel);
                WriteRhythm(string.Format("{0:0}% resolution", res * 100), riffBeats, timeSignature.BeatCount, feel);
            }
        }
Esempio n. 3
0
        public void GrooveWithFill()
        {
            var       time        = TimeSignature.CommonTime;
            var       feel        = Randomizer.ProbabilityOfTrue(0.6) ? 4 : 3;
            const int measures    = 4;
            var       totalLength = measures * time.BeatCount;
            var       drumStyle   = new DrumStyle(SectionType.None);

            drumStyle.Generate(GrooveGenerator.GenerateGroove(new SongInfo(time, feel)));
            var grooveNotes = Enumerable.Range(0, measures).SelectMany(i => drumStyle.Notes.Select(n => new PercussionNote(n.Start + i * time.BeatCount, n.Percussion, n.Velocity)));
            var fillLength  = Randomizer.ProbabilityOfTrue(0.5) ? 2 : 4;
            var fill        = FillGenerator.GetFill(totalLength - fillLength, fillLength, feel);

            grooveNotes = grooveNotes.Where(n => n.Start < totalLength - fillLength).Union(fill);
            Console.WriteLine(TabWriter.AsTab(feel, grooveNotes.ToList(), measures * time.BeatCount));
        }
Esempio n. 4
0
 private Groove GetGroove()
 {
     return(GrooveGenerator.GenerateGroove(_songInfo));
 }