public void RhythmTimingTest() { rhythm.AddLayer("O..oO...O..oOO.."); rhythm.AddLayer("..S...S...S...S."); rhythm.AddLayer("````````````````"); rhythm.AddLayer("...............+"); Pattern pattern = rhythm.GetPattern().Repeat(4); player.Play(pattern); }
public void Test_put_rhythm_in_track() { Rhythm rhythm = new Rhythm(); rhythm.AddLayer("So").AddLayer("xx"); rhythm.Length = 10; rhythm.AddRecurringAltLayer(0, 0, 7, 2, ".."); rhythm.AddRangedAltLayer(1, 1, 5, "XX"); rhythm.AddOneTimeAltLayer(1, 4, "**"); var rhythms = rhythm.GetRhythm().ToList(); rhythms[0].Should().Be("..So..So..So..SoSoSo"); rhythms[1].Should().Be("xxXXXXXX**XXxxxxxxxx"); TrackTable t = new TrackTable(10, 1.0d); t.Add(rhythm); t[9, 3].ToString().Should().Be("V9 L0 [ACOUSTIC_SNARE]i Rs [BASS_DRUM]s L1 [HAND_CLAP]i [HAND_CLAP]i"); t[9, 9].ToString().Should().Be("V9 L0 [ACOUSTIC_SNARE]i Rs [BASS_DRUM]s L1 Rs [HAND_CLAP]s Rs [HAND_CLAP]s"); }
public void Test_replacing_with_default_rhythm_kit() { rhythm.AddLayer(".OoSs^`*+x"); rhythm.GetPattern().ToString() .Should().Be("V9 L0 Ri [BASS_DRUM]i Rs [BASS_DRUM]s [ACOUSTIC_SNARE]i Rs [ACOUSTIC_SNARE]s [PEDAL_HI_HAT]i [PEDAL_HI_HAT]s Rs [CRASH_CYMBAL_1]i [CRASH_CYMBAL_1]s Rs Rs [HAND_CLAP]s"); }