Musical Concepts

Author : Clément Soulard

Last Modification Date : May 31, 2004

Time

The Simultaneity

The simultaneity has two rules :

This is illustrated by the picture below, we see there two staves, they play simultaneously :

Example 1

You can see that the reference X we are talking about is the most left point of the music symbol and not the X of the stem.

Example 2

In this example the first rule is not sufficient to determine all the position of the notes, we use the second rule.

Discussion about readability

There is an usual conception of music that make this rule always true, even if you are in the time of writing, the application of those two rules are not so easy to apply at first if you write music with your hand.

Informatic allow to make this rules true by the time of writing easily without making the work harder for the writer, that is why alternate take, can never disable this rule : There is no gain.

 

 

Attributes

Attibutes gives information about the way to represent the music graphical, an attribut is not instisic data, but it's information for representing the data.

The information about the representation of the data can change in the time. This is often used in music to let the scrore be more concise or easier to read. So in the general case an attribute can be

An attribute is said to be timed if it accurs at a specific time in the measure. We dont need to specify its duration this duration can be computed from the next attributes to come. We amphasis that the time given is in the measure. For example the number of divisions/beats/beat-type in a measure is not a timed attribute. Thought it can change in différent measure.

Time Signature

Warning : This chaper is not dealing with simultaneity concepts (Synchrnisation of X axis whith the time axis) This will be treated in the simultanety chapter

The time signature

The measure has a time signature :

Local Time and Universal Time

As presented above there is two ways of representing the music :

The part-wise notation

In the part-wise notation, several parts can have different time signatures. In the case of partwise representation we can have different time signature in the various parts. This lead us to invent the concept of '"Universal Timeline" (Maybe the word I use is a bit innapropriate). This is like another part that has a scale of time compatible with all the parts.

and the time-wise notation

In the time wise notation, different parts share the same time. So there is no problem.

The Universal time has for division (number of ticks) the greater common numerator of all the parts. And to compute the time of a MC in the measure we multiply the time of an event by the universal time factor.

Time Attributes / Writing coherence

The time signature gives us the number of thick in the measure. The total sum of each duration (in ticks) of events in a measure should be Beats/Division*Resolution

Contrary to the simultaneity tis rules may sometimes hardenned the task of writing. Sometime you want to modifiy an already written phrase but you want to add the note first and delete the note after. By doing this you have to switch for a while in an intermediate mode that is not coherent with the grammar of writing but this provide you whith some facility.

Alternate Take choose that this would be possible not to be coherent with the attributes, but it's is only in some upper level of rendering that you have to be coherent like printing or saving.

Example 1

Fitfths

The fifth let us know the aleration we must place in implicit mode. It is represented by :

A fifth is positive or negative if it is negative then it is represented by flat

If it is positive it is represented by sharps. In the above example it is a -4 fiffth.

Clefs

The clef let us know what is the height of a note with the pitch data.

There are several types of clefs

The clef give an information for the association of an graphical height to a pitched note.

There can be some changes of the clef in the measure.

Alterations

An alteration is tied to a note. It modifies its pitch by one or two halftones upper or lower. The alteration, is in most case relative to a tune.

In the graphical representation we use two type of alterations.

Directions

A direction give no information about the pitch, nor the duration of notes, but it gives informations about the way it is played.

This group a king of fuzzy class. Some are concerning mouvments like Allegro, Piano.

Some other are clearly inserted with a time notion. Like piano, staccato, fortissimo etc.

The direction is caracterizedby its start time, but it has no end time. This is more a human concern to know when the mouvement ends.

Example of a dynamics direction

Stems

General

The computation of the group of stem is probably one of the most instinctive aspect of musical notation. And finally it may be above a strict mathematics algorithm. Nevertheless, we have to find an algorithm to decide 90% correctly, wether or not grouping stem. First we look at some examples to find some rationnal behavior that fits most of the cases.

Type of stems
Examples

Example 1

In this example we see that there is eight at the left hand, those notes are group stemable. Thought, we cannot group all the consecutive group stemable notes in one because the second E neutral is the start of a strong time.

In the general case, the stems are not all grouped in one measure, but you can see it sometime, for example in exercises book, when there is a strong similarity and, a need of geometric reminder of the rithmic coherence.

Example 2

In this example also we have twoconsecutive group stemable notes, we see clearly that grouping those note would give us the impression that the eight are in the second time division.

Example 3

This example show the invert effect, thoug the second note starts a stronger weight division we choose to continue the stem group. This gives us playing instruction and you see that the second example would be also true. It is not so hard to read, but conventions use more often the 1 form I cannot think of a rule that makes a better decision.

The freedom of using the second form should remain for the expert.

Stems Symbols
Stem Support

I created the notion of stem support this concept is usefull to build stem support. A stem support is based on a point, it is linked to the note.

That stem support has a direction which is either 1 or -1 -1 is for the ascending stems and 1 for the descending. 0 is for a no stem note, but in the program. We build a stem support after having specified so you shall not build 0 direction stem support for a Whole. But in some case like quarter you represent a note without its stem (Like in a tempo mesures...)

Then I tried to compute the stem bar (on the top) for doing this I use a modified linear regression algorithm. This is a home made but it seems to work quite good. - I should add the type to the stem support. The type caracterize if there is one bar or two or three.

Building the voice

To build stems we have to browse the note by voice. That is to say that we must build a vector of voices. Then we will be able to browse the measure section by voice to compute the grouped stems. First we build the voice. A note can have some unspecified voice or you can specify the voice int the XML file.


To let us know what is the next note in the voice we implement the function 
getNextVoiceNote(NoteMusic * pnote) in the sorted notes object.
getNextVoiceNote(NoteMusic * pnote) returns the note that has a 
start time equal to pnote->getStart()+pnote->getDuration().
If several note correspond to this constraint we choose the one 
that has the same voice first. If the voice is unspecified in the 
file then we shall prefer the note that has the same  staff and we 
set the remainingVoice note to the one that we do not return not to 
forget any note in the measure.

To build the voices we implement the function build voices in sortedNotes
Here is the algorithm

Each time we build the voice we clear the vector of voice to make a new one.
voices.clear();
//We make a copie of all the note in sorted notes to
//have a temp vector of the remainning notes.

QPtrList duplicatedNotes=duplicateNotes();


//The vector is supposed to be sorted at this time.
//While there is some note in our temp copy we try to build
//the voice that is coming from the first note in this set

while(duplicatedNotes.first()){
	NoteMusic * note=duplicatedNotes.first();
	duplicatedNotes.remove(duplicatedNotes.first());
//We create th voice
	VoiceMC * voice=new VoiceMC();
	voice->append(note);
	while(getNextVoiceNote(voice->last())){
		note=getNextVoiceNote(voice->last());
		voice->append(note);
		duplicatedNotes.remove(note);
	}
voices.append(voice);
}

To let us know what is the next note in the voice we implement the function getNextVoiceNote(NoteMusic * pnote) in the sorted notes object. It return the note that has a start time equal to pnote->getStart()+pnote->getDuration(). If several note correspond to this constraint we choose the one that has the same staff and we set the remainingVoice note to the one that we do not return If the voice is unspecified (-1) then every note that has the same virtual voice became eligible

Once it is build the voice have an id the id. This id is the voice id of a note in this voice or the order it has been build. Because of mixed unspecified voice and specified voice we must be carefull that those different ways of generating an id does not conflicts.

Algorithm : Determining how to build Grouped Stems from notes in a voice

A stem can be tied if it belong to the weight duration. So looking for this I have to get the time signature from the measure. And see the possible weght duration. For every note I determine if it is concerned by the Grouped Stem.

Decision tree :

If it is a whole, a half or a quarter.
	A note shall not have a grouped stem
If it is a Eight, a Sixteen, a 32nd
	If its starttime and end time belong to the same weight or lower duration.
	It can be member of a grouped stem.

If there are two possible member of Grouped stem in a time then we create a grouped stem and add those notes to it.

The only moment where I can see a MS and a Note is at the note factory. And this is bad because the concept and the note are still tied.

So I must implement a structure that associate note and MS. We may imagine this by associating indexes an their respective vector.

After I can access note and Associate MS. I browse the note and collect the canditates to Group Stemming. Then I take the x and y informations that are missing in the array of symbol. And build stems.

buildStems in MeasureSection
	calls electableGroupedStems in measureSection and fills a vector with the ellectable note.
	calls buildSimpleStems for every note if it is not in electable
GroupedStem and if is candidate to stem (i.e can be a whole) we build a simple stemsMS.
	calls buildGroupedStems builds grouped Stems with the informations taken in electableGroupedStem

Implements the getTime for the measure, it return the time duration. We must distinguish two type of measure Composed and Simple

Implementation of the association Vector

We define the link function having two paramaters (left and Right) for the manipulation in the containers we will assume

the getright(int left) function get the the right for the parameter left

Build the grouped stems
for each note
	get the type
	get the corresponding MS and
		get X and Y
	build a note support
Implement the getTime for the measure, it return the time duration

The get time unction return the maximum lenght of o stem bar in a measure. We will use this information for determining the size of the group of stems that we can build. So we must distinguish simple time signature like 4/4 where time is the duration of a beat. From composed time time signature like 12/8. Where time is 3x the duration of a beat. Rules for grouping stems If you look at a score you will see that it is not so easy to find a rule for the stem gouping :

Implement Measure getPoids(NoteMusic *)

Implement the computeElectableGroupedStems in measure

Computations of the possible weight in the measure

The weights of a measure is the factoristaion of the duration on the important time in this measure. If a measure has 36 divisions since 36 is 3*3*2*2 we have 5 kind of weight that are :

In the real world not all the weight are important those should be determined by : the time duration in division (The division attribute)

Using the following algorithm we miss the 6 weight but restrictions with the time duration may prove that this divisions is useless in practic case.

Implement the build groupedStems

In the measure section we call getStemGroups we now have the stems MC.

In classical notation, you must care when there are several voices in the same measure that the stems of each voice do not recover themeselves.

By stem positionionning, we wish to compute what is the angle the linking bar will do with the staff.

Tuplets

The tuplets represent a group of note that is a non paired division of a time 1/3, 1/5, 1/7 ... The most widely seen king of tuplet is the 3plet.

Grace Notes

When constructing a grace note we are facing a problem : It has no duration in its concept but it has to be represented before the real note that has the same support.

We are performing this by using the division support. When a grace note is appended to the support we must it put some natural length contraint on its current division by doing this it is causes that it moves it self. So it should be represented to the left by a distance of its natural length

Chords

If a note is a chord then it is linked to another note.If a note is chord is is said to be chorded to another note. We translate this in the NoteMC by a link property to another note.

It has the same start thet the preceding note.

To perform this in the parser we do it on the build and it require to be a sequence of note. In the XML the first note of the chord is not marked as a chord, but the following note belonging to the chord are marked as chord.

So it is not possible to define a chord whith defining other note in between the notes belonging to the chord

Property of a chorded note :

At the construction time, we will look to see if some other note are chorded to the note. If some then we modify the stem support.

Application to stem :

If a note is chorded then it is not stemable Action on voice : A chorded note cannot belong to a voice : Only the main note belong to the voice

Symbols