public void Chord_Interval() { var defaultNoteLength = (MusicalLength)MusicalFraction.Quarter; var defaultVelocity = (SevenBitNumber)90; var pattern = new PatternBuilder() .SetNoteLength(defaultNoteLength) .SetVelocity(defaultVelocity) .SetRootNote(NoteDefinition.Get(NoteName.CSharp, 5)) .Chord(new[] { IntervalDefinition.Two, IntervalDefinition.Five }, OctaveDefinition.Get(2).A) .Chord(new[] { IntervalDefinition.Two, -IntervalDefinition.Ten }, OctaveDefinition.Get(2).B) .Build(); TestNotes(pattern, new[] { new NoteInfo(NoteName.A, 2, null, defaultNoteLength, defaultVelocity), new NoteInfo(NoteName.B, 2, null, defaultNoteLength, defaultVelocity), new NoteInfo(NoteName.D, 3, null, defaultNoteLength, defaultVelocity), new NoteInfo(NoteName.B, 2, new MathTime(new MusicalTime(), defaultNoteLength), defaultNoteLength, defaultVelocity), new NoteInfo(NoteName.CSharp, 3, new MathTime(new MusicalTime(), defaultNoteLength), defaultNoteLength, defaultVelocity), new NoteInfo(NoteName.CSharp, 2, new MathTime(new MusicalTime(), defaultNoteLength), defaultNoteLength, defaultVelocity), }); }
public void Transpose_Down_OutOfRange() { Assert.ThrowsException <ArgumentOutOfRangeException>(() => { NoteDefinition.Get(SevenBitNumber.MinValue) .Transpose(IntervalDefinition.GetDown(SevenBitNumber.MaxValue)); }); }
public void Transpose_Down_Max() { var expectedNoteDefinition = NoteDefinition.Get(SevenBitNumber.MinValue); var actualNoteDefinition = NoteDefinition.Get(SevenBitNumber.MaxValue) .Transpose(IntervalDefinition.GetDown(SevenBitNumber.MaxValue)); Assert.AreEqual(expectedNoteDefinition, actualNoteDefinition); }
public void Transpose_Down() { var expectedNoteDefinition = NoteDefinition.Get((SevenBitNumber)25); var actualNoteDefinition = NoteDefinition.Get((SevenBitNumber)35) .Transpose(IntervalDefinition.FromHalfSteps(-10)); Assert.AreEqual(expectedNoteDefinition, actualNoteDefinition); }
public void Note_Multiple_Interval() { var defaultNoteLength = (MusicalLength)MusicalFraction.Quarter; var defaultVelocity = (SevenBitNumber)90; var pattern = new PatternBuilder() .SetNoteLength(defaultNoteLength) .SetVelocity(defaultVelocity) .SetRootNote(NoteDefinition.Get(NoteName.CSharp, 5)) .Note(IntervalDefinition.Two) .Note(-IntervalDefinition.Four) .Build(); TestNotes(pattern, new[] { new NoteInfo(NoteName.DSharp, 5, null, defaultNoteLength, defaultVelocity), new NoteInfo(NoteName.A, 4, new MathTime(new MusicalTime(), defaultNoteLength), defaultNoteLength, defaultVelocity) }); }
public AddNoteAction(NoteDefinition noteDefinition, SevenBitNumber velocity, ITimeSpan length) { NoteDefinition = noteDefinition; Velocity = velocity; Length = length; }
public void CheckReferences() { Assert.IsTrue(ReferenceEquals(NoteDefinition.Get((SevenBitNumber)34), NoteDefinition.Get((SevenBitNumber)34))); }