ToString() public method

public ToString ( ) : string
return string
Exemplo n.º 1
0
 public void TestNotesOverlap()
 {
     SheetMusic.SetNoteSize(false);
     KeySignature key = new KeySignature(0, 0);
     int quarter = 400;
     TimeSignature time = new TimeSignature(4, 4, quarter, 60000);
     int num1 = WhiteNote.BottomTreble.Number();
     int num2 = num1 + 1;
     MidiNote note1 = new MidiNote(0, 0, num1, quarter);
     MidiNote note2 = new MidiNote(0, 0, num2, quarter);
     List<MidiNote> notes = new List<MidiNote>(2);
     notes.Add(note1);
     notes.Add(note2);
     ChordSymbol chord = new ChordSymbol(notes, key, time, Clef.Treble, null);
     Assert.AreEqual(chord.ToString(),
                     "ChordSymbol clef=Treble start=0 end=400 width=25 hastwostems=False AccidSymbol accid=Sharp whitenote=F4 clef=Treble width=9 Note whitenote=F4 duration=Quarter leftside=True Note whitenote=F4 duration=Quarter leftside=True Stem duration=Quarter direction=1 top=F4 bottom=F4 end=E5 overlap=False side=2 width_to_pair=0 receiver_in_pair=False ");
 }
Exemplo n.º 2
0
 public void TestStemUpBass()
 {
     SheetMusic.SetNoteSize(false);
     KeySignature key = new KeySignature(0, 0);
     int quarter = 400;
     TimeSignature time = new TimeSignature(4, 4, quarter, 60000);
     int num1 = WhiteNote.BottomBass.Number();
     int num2 = num1 + 2;
     MidiNote note1 = new MidiNote(0, 0, num1, quarter);
     MidiNote note2 = new MidiNote(0, 0, num2, quarter);
     List<MidiNote> notes = new List<MidiNote>(2);
     notes.Add(note1);
     notes.Add(note2);
     ChordSymbol chord = new ChordSymbol(notes, key, time, Clef.Bass, null);
     Assert.AreEqual(chord.ToString(),
                     "ChordSymbol clef=Bass start=0 end=400 width=16 hastwostems=False Note whitenote=A3 duration=Quarter leftside=True Note whitenote=B3 duration=Quarter leftside=False Stem duration=Quarter direction=1 top=B3 bottom=A3 end=A4 overlap=True side=2 width_to_pair=0 receiver_in_pair=False ");
 }
Exemplo n.º 3
0
 public void TestWholeDuration()
 {
     SheetMusic.SetNoteSize(false);
     KeySignature key = new KeySignature(0, 0);
     int quarter = 400;
     TimeSignature time = new TimeSignature(4, 4, quarter, 60000);
     int num1 = WhiteNote.BottomTreble.Number();
     MidiNote note1 = new MidiNote(0, 0, num1, quarter*4);
     List<MidiNote> notes = new List<MidiNote>(2);
     notes.Add(note1);
     ChordSymbol chord = new ChordSymbol(notes, key, time, Clef.Treble, null);
     Assert.AreEqual(chord.ToString(),
                     "ChordSymbol clef=Treble start=0 end=1600 width=16 hastwostems=False Note whitenote=F4 duration=Whole leftside=True ");
 }
Exemplo n.º 4
0
 public void TestSixteenthDuration()
 {
     SheetMusic.SetNoteSize(false);
     KeySignature key = new KeySignature(0, 0);
     int quarter = 400;
     TimeSignature time = new TimeSignature(4, 4, quarter, 60000);
     int num1 = WhiteNote.BottomTreble.Number();
     MidiNote note1 = new MidiNote(0, 0, num1, quarter/4);
     List<MidiNote> notes = new List<MidiNote>(2);
     notes.Add(note1);
     ChordSymbol chord = new ChordSymbol(notes, key, time, Clef.Treble, null);
     Assert.AreEqual(chord.ToString(),
                     "ChordSymbol clef=Treble start=0 end=100 width=16 hastwostems=False Note whitenote=F4 duration=Sixteenth leftside=True Stem duration=Sixteenth direction=1 top=F4 bottom=F4 end=G5 overlap=False side=2 width_to_pair=0 receiver_in_pair=False ");
     Assert.AreEqual(chord.AboveStaff, SheetMusic.NoteHeight);
 }