Skip to content
Chanan edited this page Aug 19, 2020 · 2 revisions

Bar Class

Namespace: CW.Soloist.CompositionService.MusicTheory
Assembly: CW.Soloist.CompositionService.dll


Summary

Represents a single musical bar in a musical piece.

Each bar contains the following properties:

  • time signature which represents the number of beats in the bar and the duration of each beat.
  • List of chords which represent the harmony in the current bar.
  • List of notes which represent the melody notes in the current bar.

Implements IBar.

Defintion

internal class Bar : IBar
{
    // IBar interface properties 
    IDuration TimeSignature { get; }
    IList<IChord> Chords { get; }
    IList<INote> Notes { get; set; }

    // IBar interface methods 
    IList<IChord> GetOverlappingChordsForNote(int noteIndex) { ... }
    IList<INote> GetOverlappingNotesForChord(IChord chord, out IList<int> chordNotesIndices) { ... }
    IList<INote> GetOverlappingNotesForChord(int chordIndex, out IList<int> chordNotesIndices) { ... }

    // Constructors 
    public Bar() { ... } 
    public Bar(IBar bar) { ... } 
    public Bar(IDuration timeSignature) { ... } 
    public Bar(IDuration timeSignature, IList<IChord> chords, IList<INote> notes) { ... } 
    
    // ToString method  
    public override string ToString() { ... } 
}

Properties

Property Name Type Description
TimeSignature IDuration Contains the bar's duration, for example: 4/4 for standard western music and 3/4 for a valse.
Chords IList<IChord> The chords which represent the harmony in the bar.
Notes IList<INote> The notes which represent the melody in the bar.

Methods

Method Name Return Type Description
GetOverlappingChordsForNote IList<IChord> Returns the chords that are played in parallel to given note.
GetOverlappingNotesForChord IList<INote> Returns the notes that are played in parallel to given chord.
ToString string Returns a string representation the given bar.
  • Home
  • Getting Started
  • Design
    • Business Logical Layer (CW.Soloist.CompositionService)
    • Data Access Layer
    • Presentation Layer
Clone this wiki locally