An Object-Oriented Toolkit for Music Notation
Total Page:16
File Type:pdf, Size:1020Kb
An Object-Oriented Toolkit for Music Notation THESIS Submitted in Fulfilment of the requirements for the Degree of MASTER OF SCIENCE (APPLIED COMPUTER SCIENCE) by Andrew Arnold Eales November 1998 Supervisor : Dr. R.J. Foss Abstract This thesis investigates the design and implementation of an object-oriented toolkit for music notation. It considers whether object-oriented technology provides features that are desirable for representing music notation. The ability to sympathetically represent the conventions of music notation provides software tools that are flexible to use, and easily extended to represent less common features of music notation. The design and implementation of an object-oriented class hierarchy that captures the structural and semantic relationships of music notation symbols is described. Functions that search for symbols, and update symbol positions are also implemented. Traditional context-sensitive and spatial relationships between music symbols may be maintained, or extended to provide notational features found in modern music. MIDI functionality includes the ability to play music notation and to allow step-recording of MIDI events. The toolkit has been designed to simplify the creation of applications that make use of music notation; example applications are created to demonstrate its capabilities. Keywords : object-oriented, music notation, computer music. i Table of Contents 1. Introduction 1.1 Computers and Music Notation ..................................................... 1 1.2 Object-Oriented Software Design .................................................. 1 1.3 Designing Music Notation Software .............................................. 2 1.4 Music Notation and MIDI ............................................................. 2 1.5 Project Objectives ......................................................................... 3 2. An Overview of Music Notation 2.1 Traditional Music Notation ........................................................... 5 2.2 The Notational Hierarchy .............................................................. 6 2.2.1 Score and Pages ........................................................... 7 2.2.2 Systems and Staves ...................................................... 7 2.2.3 Clefs and Key-Signatures ............................................. 10 2.2.4 Time-Signatures ........................................................... 11 2.2.5 Bars and Barlines ......................................................... 12 2.2.6 Voices .......................................................................... 14 2.2.7 Notes, Rests, and Chords .............................................. 15 2.2.7.1 Notes ............................................................. 15 2.2.7.2 Rests .............................................................. 16 2.2.7.3 Chords ........................................................... 17 2.2.8 Beams .......................................................................... 18 2.2.9 Articulation Symbols and Ornaments ............................ 19 2.2.10 Dynamics, and Auxiliary Symbols ............................... 20 2.2.11 Parts ........................................................................... 21 2.3 Classifying Notation Symbols ....................................................... 22 2.3.1 Context-Sensitive Relationships ..................................... 22 2.3.2 Semantic Constituents ................................................... 22 2.3.3 Semantic Modifiers ....................................................... 23 2.3.4 Notational Conveniences ................................................ 23 2.3.5 Spatially Dependent Symbols ......................................... 24 ii 3. Music Notation Software and Software Tools 3.1 Overview ......................................................................................25 3.2 Music Notation Software ............................................................... 25 3.2.1 Finale ............................................................................ 25 3.2.2 Encore ...........................................................................27 3.2.3 MUSICA ........................................................................ 29 3.2.4 Copyist ......................................................................... 29 3.2.5 Other Notation Programs ............................................... 30 3.3 Sequencers and Educational Software ........................................... 31 3.4 Software Tools for Music Notation ............................................... 32 3.4.1 Notation Interchange File Format ................................... 33 3.4.2 The Notation Engine ..................................................... 34 3.4.3 Music Fonts .................................................................. 34 3.5 Object-Oriented Music Representation .......................................... 36 4. Designing an Object-Oriented Toolkit for Music Notation 4.1 Object-Oriented Development Methods .......................................... 37 4.1.1 Selecting a Method ......................................................... 38 4.2 Object-Oriented analysis and Design ............................................. 39 4.2.1 The Coad Method ........................................................... 39 4.3 Identifying objects and their relationships ...................................... 41 4.3.1 Scores, Pages and Score Templates ............................... 42 4.3.2 Systems and Staves ....................................................... 45 4.3.3 Bars and Barlines ......................................................... 48 4.3.3.1 Bar Representation ....................................... 51 4.3.3.2 Barline Relationships .................................... 53 4.3.3.3 Secondary Bars ............................................. 55 4.3.4 Clefs, Key-Signatures and Time-Signatures .................. 56 4.4 Voices ......................................................................................... 58 iiii 4.5 Note, Rest and Chord Relationships ............................................... 59 4.5.1 Note Structure ............................................................... 59 4.5.2 Rests ............................................................................ 61 4.5.3 Chords and MusicEvent Objects .................................... 62 4.6 Beams and Beamed Groups .......................................................... 64 4.7 Irregular Groups ........................................................................... 67 4.8 MIDI Message Objects .................................................................. 68 4.9 Part Obje cts ................................................................................. 69 4.10 Defining Object Relationships ..................................................... 70 4.11 Comparing MUSICA and the OOTMN .......................................... 77 4.11.1 Abstract Classes in MUSICA ........................................ 78 4.11.2 The MUSICA Class Hierarchy ...................................... 78 5. Implementing the Toolkit for Music Notation in C++ 5.1 Selecting a Development Environment ............................................ 81 5.2 Real-World Models and Machine Models ....................................... 82 5.3 An Object-Oriented Implementation of the Model ........................... 83 5.3.1 Creating objects ............................................................. 84 5.3.2 Storing Objects .............................................................. 85 5.3.3 Searching for Objects ..................................................... 86 5.3.4 Moving Objects ............................................................. 89 5.4 Implementing Objects .................................................................... 93 5.4.1 Encoding Music Symbols ............................................... 93 5.4.2 Representing Notes ........................................................ 93 5.4.2.1 Name Class .................................................... 93 5.4.2.2 Pitch Class ..................................................... 94 5.4.2.3 Octave Representation .................................... 95 5.4.3 Line Symbols ................................................................. 96 5.4.4 Special Symbols ............................................................ 97 5.4.4.1 Slurs, Ties, and Phrase Markings ................... 97 5.4.4.2 Beams ........................................................... 98 iv 5.5 MIDI Playback ............................................................................. 99 5.5.1 MIDI Synchronisation ................................................... 100 5.6 Algorithms used by the OOTMN ................................................... 103 5.6.1 Creating Beamed Groups .............................................. 103 5.6.2 Calculating Grouplet Durations ..................................... 105 5.6.3 Implementing MIDI Playback ......................................... 106 6. Examples of Toolkit-Created Applications 6.1 Designing Applications using the OOTMN ..................................... 108 6.2 Notation and Composition software ............................................... 109 6.2.1 User-interface Design ..................................................... 109 6.2.2 Using the Notation and Composition Program ................ 111 6.2.3 Secondary Bars, Secondary Stems and Split-Stem Chords ........................................................