&dA &d@ &dA &d@ &dE ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» &dA &d@ &dE º AUTOSET and AUTOSCR º &dA &d@ &dE ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ &dA &dA &d@ Version 4.02 &dA &d@ (Must correspond with VERSION variable) &dA &dA &d@ (rev 02/06/04) &dA &d@ (rev 03/18/06) &dA &dA &d@ As of &dE03/18/06&d@, these two very similar programs have been &dA &d@ unified into one source. The differences are controlled by the &dA &d@ AUTOSCR variable at the top of the #define list. &dA &dA &dA &d@ Preamble to the &dEAUTOSCR&d@ program &dA &d@ ======================================= &dA &dA &d@ This program is the first of a set of three programs designed &dA &d@ to convert &dEMUSEDATA Stage 2&d@ full-score files into &dESCORE pmx&d@ &dA &d@ files. The program was first derived from the 3.03 version &dA &d@ (rev 04/08/97) of autoset. As with autoset, the input to the &dA &d@ program are stage2 files; the output are non page specific I-files. &dA &d@ &dA &d@ The task of converting to SCORE is slightly different from that &dA &d@ of typesetting, since it is not concerned with versatility of &dA &d@ output or presentation; it is simply data conversion. The &dA &d@ autoscr program also has additional tasks to perform and will &dA &d@ pass on information to the i-files which is not transferred by &dA &d@ autoset. The i-files, themselves, will have modifications that &dA &d@ the music typesetting programs are not set up to read. This &dA &d@ means essentially that for purposes of data conversion, we are &dA &d@ modifying the i-file format to accommodate extra data which is &dA &d@ specifically related to the SCORE pmx format. &dA &dA &d@ Since versatility of size is not a consideration in data conversion, &dA &d@ the autoscr program is designed to operate at one size only, namely, &dA &d@ size-14. Since we are simply concerned with transferring all data &dA &d@ in the most compact manner, we will be constructing only full-score &dA &d@ SCORE files. SCORE itself has a very advanced tool-set for resizing &dA &d@ scores and for extraction of parts. &dA &dA &d@ .................................................................... &dA &dA &dA &d@ Preamble to the &dEAUTOSET&d@ program &dA &d@ ======================================= &dA &dA &d@ Program takes input file from source library file and creates &dA &d@ an intermediate file &dA &dA &d@ Note: With a program as complex as this one, there are necessarily &dA &d@ going to be corner cases that are too difficult or too obscure to &dA &d@ handle properly. To prevent the details of these cases from being &dA &d@ "lost" in the program, there will appear from time to time &dA &d@ paragraphs labled "CORNER", which decribe the situation and any &dA &d@ potential limitations imposed on the program. &dA &dA &d@ .................................................................... &dA &dA &dA &d@ Version control &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &d@ 09-21-93 Added 8th element to tiearr (.,TIE_FOUND) to &dA &d@ prevent program from looking twice for tie &dA &d@ 09-21-93 Added code to allow multiple rests when there &dA &d@ are two or more instruments all resting. &dA &d@ (one staff only) &dA &dA &d@ 09-22-93 In the old version, only one wedge, one dashes &dA &d@ and one of each type of transpos could be &dA &d@ active at once. By expanding the smusdir &dA &d@ array, we can expand this to five of each &dA &d@ type of super-object &dA &dA &d@ 09-22-93 Attempting to fix several things. &dA &d@ (1) whole rest should be counted as a "pass" in &dA &d@ computing MULTI_TRACK &dA &d@ (2) accidentals should not be repeated on a &dA &d@ unison sounding note (mcat >= 2) &dA &dA &d@ 09-23-93 Temporary ASCII data was being stored in tdata &dA &d@ which for the multiple measure case was being &dA &d@ overwritten. Storage is now in tsdata. &dA &dA &d@ 09-30-93 The sorting process for the ts(.) array has been &dA &d@ changed. Hopefully it is now more rigorous. &dA &d@ The old algorithm is presered in comment. &dA &dA &d@ 10-09-93 Autoset now works on a group of files within a &dA &d@ stage2 directory. There is an default option &dA &d@ for the output directory, based on the group &dA &d@ being worked on. &dA &dA &d@ 10-09-93 Adding the "Print suggestion" feature to the stage2 &dA &d@ format. All four slur letter pairs now are &dA &d@ interchangable. Forcing a slur above or below &dA &d@ a note is done using a print suggestion. Also, &dA &d@ print suggestions are now the preferred way to &dA &d@ indicate a font in a musical direction. &dA &dA &d@ 10-09-93 Added 9th element to tiearr (.,TIE_FORCE) to &dA &d@ force a tie to be overhanded or underhanded &dA &dA &d@ 11-11-93 Added Attribute type sub-objects. Immediate application &dA &d@ was to add duration attribute. Duration is expresed &dA &d@ as a ratio. 1/4 = quarter note, etc. &dA &dA &d@ 01-08-94 A side effect of the bubble sort of the mf(.) array &dA &d@ (c. line 3450) was that chord tones (type 2) were &dA &d@ being separated from their principal tones (type 1). &dA &d@ The bubble sort has been replaced with a sort that &dA &d@ does not do this. &dA &dA &d@ 03-19-94 Minimum distance between notes can be set with a print &dA &d@ record. Also note value having this minimum distance &dA &d@ can be set with print record &dA &dA &d@ 03-20-94 Option added to let a note with a dot be "over-printed" &dA &d@ (combined with) a note without a dot, and vice versa, &dA &d@ provided the notes are the came type (color). &dA &d@ See DOT_DIFFERENCE below. &dA &d@ (Changed &dA12/24/05&d@. This feature is now &dA &d@ controlled by the dot_difference_flag.) &dA &dA &d@ 03-20-94 Typesetting of unisons refined. (1) Typeset unisons are &dA &d@ allowed only when all notes of first chord are either &dA &d@ equal/above all notes of second chord, or equal/below &dA &d@ all notes of second chord. (2) Fixed a bug where typeset &dA &d@ unisons were sometimes shifted to the right. &dA &dA &d@ 03-20-94 Global tuplet print options added (tuplet_print_flag). &dA &d@ Grand staff distance option added (granddist now set &dA &d@ by print suggestion). &dA &dA &d@ 03-21-94 Vertical position of musical diretions can now be &dA &d@ modified. &dA &dA &d@ 03-23-94 Fixed problem of spurious accidentals being added as &dA &d@ a result of ties from the previous measure. &dA &dA &d@ 03-26-94 Completely overhauled the horizonal spacing mechanism. &dA &d@ The problem was that the logic which added extra space &dA &d@ was located too late in the program, after detailed &dA &d@ information about the vertical right and left profiles &dA &d@ was lost. &dA &dA &d@ 03-29-94 Improved placement of ornaments, accidentals attached &dA &d@ to ornaments, fingerings &dA &dA &d@ 03-30-94 Added new component of data storage to the ts array &dA &d@ system. Basically, we would like to be able to &dA &d@ alter the x-y position of various elements using &dA &d@ print suggestions. To store this information, we &dA &d@ have added a string array: tsr.48(MAX_OBJECTS) &dA &dA &d@ 04-07-94 Added capability to blank out notes or rests; to &dA &d@ leave space for an irest; to shift notes or rests &dA &d@ (the entire object) left or right, up or down; &dA &d@ to shift a set of figures left or right, up or &dA &d@ down. Increased length of tsr strings to 51. &dA &dA &d@ 04-26-94 Changing the way the program makes space for text. &dA &d@ In the final analysis, the placement of text and &dA &d@ the arrangement of notes over text must be done &dA &d@ by mskpage. What is important here is that we &dA &d@ allow enough space to accommodate text, while at &dA &d@ at the same time adding as little as possible to &dA &d@ the spacing parameters. Also implementing multiple &dA &d@ text lines at this time. &dA &dA &d@ 05-27-94 Trying to correct a problem of slur placement. There &dA &d@ seems to be some confusion over when to modify the &dA &d@ position above an object, vs. below an object. &dA &d@ For some reason I can't figure out, this information &dA &d@ was not consistant with slur tips. Upon reflection, &dA &d@ it seems that slurs tips should determine this &dA &d@ correctly all of the time. I'm probably missing &dA &d@ a subtle point here, so I'd better watch things &dA &d@ for a while. &dA &dA &d@ 05-29-94 Under certain conditions, the NOTEDUR parameter &dA &d@ can give the wrong "time-space" increment. We &dA &d@ cannot allow this parameter to be less than the &dA &d@ time distance (number of divisions) to the next &dA &d@ time node. This fix may not yet be complete, &dA &d@ since we still may have wrong values for &dA &d@ Leland's score duration parameter. Time will &dA &d@ tell. &dA &dA &d@ 06-08-94 Attempting to add code to deal with repeaters. &dA &dA &d@ 06-18-94 Adding feature that lets musical directions include &dA &d@ an optional offset (measured in divisions) from &dA &d@ the point where they occur in a measure. This &dA &d@ allows things like &dAcresc.&d@ to appear in the middle &dA &d@ of longer notes. &dA &dA &d@ There is a slight problem in adding this feature. &dA &d@ Normally a musical direction will generate a SIGN &dA &d@ or a WORDS type object. This translates in the &dA &d@ intermediate code to a "D" type object. "D" type &dA &d@ objects belong to the group called "passing &dA &d@ objects," which means that the mskpage program &dA &d@ passes over them when looking for controlling &dA &d@ nodes. The problem is that if one of this objects &dA &d@ &dLoccupies a division by itself&d@, it should not be &dA &d@ passed over. The solution that seems to work the &dA &d@ best is to assign "D" objects with this special &dA &d@ feature (unique division number) to a new object &dA &d@ type called "I" (isolated direction) which shares &dA &d@ all of the properties of the "F" (figure) group of &dA &d@ objects. This does not seem to effect their &dA &d@ printing in any way, but it does seem to assure &dA &d@ that they will receive proper treatment by &dA &d@ mskpage. &dA &dA &d@ In order to make this work in this program, we &dA &d@ need to set a special flag for SIGNS, WORDS and &dA &d@ MARKS that stand on their own division (or stand &dA &d@ with other members of this same group). If this &dA &d@ flag is set, these elements in the ts(.) array &dA &d@ must be treated like figures in the section of &dA &d@ the program that computes space and syncopation. &dA &dA &d@ 10-11-94 Added capability to specify absolute vertical position &dA &d@ of rests, etc. Increased length of tsr string to 68. &dA &dA &d@ 10-13-94 Added capability of specifying font changes for *-type &dA &d@ records with P-print suggestions using the C: &dA &d@ where the font change is to occure. This takes &dA &d@ the !## change font instructions out of the source data &dA &d@ and puts them in the P-print suggestions where they &dA &d@ belong. &dA &dA &d@ 11-21-94 Small problem: We were using oldsct as the end of the &dA &d@ valid data in tsdata. However, tsdata is loaded &dA &d@ according to the value of @n, which can exceed sct &dA &d@ in certain situations. In the case where action &dA &d@ processes multiple measures, this could result in &dA &d@ data in tsdata being overwritten. The solution &dA &d@ was to introduce a new variable old@n, which is &dA &d@ used to keep track of the end of valid data in &dA &d@ tsdata. Since old@n tracks @n and not sct, no &dA &d@ data will be overwritten. old@n is set to zero &dA &d@ at the same time sct is set to zero. &dA &dA &d@ 01-01-95 Fix autoset so that it can serve as the source for &dA &d@ both regular autoset.z and autoset6.z (notesize = 6) &dA &dA &d@ 01-02-95 The wedge spread parameter was not being properly &dA &d@ scaled. It should be multiplied by notesize / 10. &dA &dA &dA &d@ 02-23-95 In the case where text is sporatically present (lower &dA &d@ voices of chorals, for example), there is no provision &dA &d@ to mark the end of text, when the text ends with an &dA &d@ extender (_). Introduce new variable &dEtextconflag&d@ &dA &d@ which is turned on for notes having a simple extender &dA &d@ and off for any other text. The combination of &dA &d@ no text and textconflag = ON is then the situation &dA &d@ we need to mark. We will use textconflag as a bit &dA &d@ flag (i.e., bit 0 means extender in level one; bit 1 &dA &d@ means extender in level two; etc.) &dA &dA &d@ 04-17-95 Fix autoset so that it can serve as the source for &dA &d@ auto21.z (notesize = 21) &dA &dA &d@ 04-22-95 Allow situation where notesize is odd; i.e., &dA &d@ vpar(1) <> vpar(2) / 2. In this case, we assume &dA &d@ 2 * vpar(1) = notesize - 1 &dA &dA &d@ 05-29-95 Unified AUTOSET for all note sizes &dA &dA &d@ 05-31-95 Code added to prevent tuplets over "partial" beams &dA &d@ from being associated with those beams. &dA &dA &d@ 01-30-96 In non ISO case of two parts, where two notes are combined &dA &d@ as a chord, the "main" note was not given the right stem &dA &d@ flag. Added line to do this. &dA &d@ When combining rests in ISO case, you need to clear last &dA &d@ line of array ts(.,.), because you will use it later for &dA &d@ collecting info on slurs &dA &d@ New code to look for cases where groups of notes might &dA &d@ be combined under the same beam. At the moment, this &dA &d@ works only with two parts and with regular notes. &dA &dA &d@ 03-04-96 Added capability to handle repeaters with two alternating &dA &d@ notes. &dA &dA &d@ 09-27-96 Added capability to force rests to be printed on the middle &dA &d@ line. &dA &dA &d@ 10-12-96 New feature supported: ties that don't terminate on a note. &dA &d@ The primary use of this is when there is a first ending &dA &d@ or a da capo with a tie that refers back to an earlier &dA &d@ point in the music. This feature is implemented using &dA &d@ a new type of musical direction ("X"). &dA &dA &d@ 12-24-96 Added capability to handle triple and quadruple dots &dA &dA &d@ 02-02-97 Fix problem of overlapping trill extensions. Added &dA &d@ arrays pre_tsnum, pre_ctrarrf, and pre_try (pre = preliminary) &dA &dA &d@ 02-19-97 Allow alternate repeaters to work on even-tuples of 6 or greater. &dA &d@ Allow slurs with alternate repeaters, when slurs start at the &dA &d@ beginning of a beam and end at the end of a beam &dA &dA &d@ 02-23-97 Allow print suggestions for different kinds of printing. Use &dA &d@ columns 2-. Blank in column 2 = universal print suggestion. &dA &d@ Otherwise read columns 2-- until a blank is encountered. &dA &d@ Codes for selective suggestions: &dA &d@ &dA &d@ "p" = parts &dA &d@ "s" = score &dA &d@ "t" = short score (piano vocal) &dA &dA &d@ 02-23-97 Implement print suggestions for numbering measures. &dA &d@ &dA &d@ 02-24-97 Fixed AUTOSET so that the accumulation of inctype &dA &d@ (the time value increment from the previous node) &dA &d@ adds up to a full measure. This problem arrises &dA &d@ from durations that divide the quarter note by &dA &d@ factors other than 2 or 3. &dA &d@ &dA &d@ 02-24-97 Implement Y co-ordinate positioning of wavy line (~) &dA &d@ by means of print suggestion. &dA &d@ &dA &d@ 02-25-97 Attempting to deal with the problem of tied notes with &dA &d@ accidentals that span over to system boundaries. &dA &d@ Proposed solution is to invent a catagory of &dA &d@ "invisible" Sub-Object (type small-k), which will &dA &d@ appear in i-files, and will only be activated in &dA &d@ page files, when needed (i.e., when there is a &dA &d@ new system). &dA &d@ &dA &d@ 03-01-97 Fix multiple accidentals on ornaments. Allow trills &dA &d@ with wavy lines (~) to have accidentals. &dA &d@ &dA &d@ 03-21-97 Add print suggestions for tuplets. Square vs. round; &dA &d@ broken vs. continuous; number inside vs. outside. &dA &d@ &dA &d@ 03-24-97 Implemented print suggestions for articulations. &dA &d@ (I think) &dA &d@ &dA &d@ 04-08-97 Fix it so that all ornaments attached to notes of a &dA &d@ chord are printed (i.e., ornaments are not combined &dA &d@ the way articulations, accents, bowings, fermatas are). &dA &d@ &dA &d@ 04-20-03 Implemented print suggestions for ties (as a form of &dA &d@ articulation). This involves (1) increasing the &dA &d@ length of tsr string to 72, and (2) adding a 10th &dA &d@ element to tiearr (.,TIE_SUGG) to contain suggestions. &dA &dA &d@ 04-24-03 Allowing print suggestion for extra notes of chords &dA &d@ &dA &d@ 05-02-03 Implemented print suggestions for extension dots and &dA &d@ accidentals. Increasing the length of tsr string to 80. &dA &d@ &dA &d@ 05-02-03 Adding version control to print suggestions. Hereafter &dA &d@ every print suggestion with a version control number &dA &d@ will be checked against the version of autoset running. &dA &d@ If the one's digit and the tenth's digit do not correspond, &dA &d@ a warning message will be printed. The version also &dA &d@ contains a 100ths digit. This allows autoset to be &dA &d@ revised in ways wherein print suggestions are not &dA &d@ affected. &dA &d@ &dA &d@ 05-06-03 Implemented print suggestions for the shape, length and &dA &d@ position of slurs. Length of tsr string increased to 112. &dA &d@ &dA &d@ 05-14-03 Implementing a print suggestion for modification of the &dA &d@ first stem length of beam. Length of tsr string increased &dA &d@ to 116 &dA &d@ &dA &d@ 05-17-03 Implementing editorial square brackets for dynamics, ornaments &dA &d@ and accents (not trill super-objects, not articulations) &dA &d@ &dA &d@ 05-25-03 Implementing a print suggestion for preventing mskpage &dA &d@ from altering the spacings it computes in a particular &dA &d@ measure, when it is trying to justify a line. Obviously &dA &d@ this will be over-ridden when there is only one measure &dA &d@ in the line. &dA &d@ &dA &d@ 09-01-03 Fixing a program error. When there was a note with multiple &dA &d@ lines of text, and the first line had an extension character &dA &d@ ("_"), autoset was ignoring the rest of the text data (i.e., &dA &d@ the data for the remaining lines.) &dA &d@ &dA &d@ 09-14-03 In the case where an "I" type object is being set, it can &dA &d@ happen that the variable inctype is calculated incorrectly. &dA &d@ The procedure putobj has been modified to check "I" type &dA &d@ objects for illogical inctypes. If a correction is made, &dA &d@ a cautionary statement is issued. This fix is somewhat of &dA &d@ a cludge. &dA &dA &d@ 09-22-03 Some variables related to key and accidentals were not being &dA &d@ properly initialized at the top of the processing loop. &dA &dA &d@ 10-01-03 Allowing a print suggestion for directives (* records) to set &dA &d@ the font to zero: e.g., P C25:f0 This will cause the &dA &d@ directive to &dEnot&d@ be printed. This feature can be used to &dA &d@ blank directives in selected parts of a score, or allow &dA &d@ directives to appear in parts but not in the score. &dA &dA &d@ 10-19-03 Corner case error: For some reason, text records are not &dA &d@ supposed to have a "-" character in them; the solution &dA &d@ appears to be the use of "=" as a substitute for "-". &dA &d@ At c. line 14330, the substitution is made, but the code &dA &d@ neglected to take into account that "\0=" = "fi". This &dA &d@ is now fixed. &dA &dA &d@ 10-20-03 Introducing optional conversion to ligitures in text. &dA &d@ Set LIGIT = 1 to convert. &dA &dA &d@ 11-04-03 Adding code to allow for job-specific print suggestions to &dA &d@ be specified by column number. &dA &dA &d@ 11-16-03 Adding feature: It is now possible to put editorial &dA &d@ parentheses around figured harmonies. &dA &dA &d@ 12-09-03 Adding a new section of code which attempts to mitigate &dA &d@ somewhat the unevenness in note spacing introduced by &dA &d@ the addition of text. This modification also adds &dA &d@ an optional second sub-parameter to the second parameter &dA &d@ (sobx) of the text record. This second sub-parameter &dA &d@ contains the un-modified sobx for use in cases where &dA &d@ MSKPAGE or MSKPART stretches out the notes and leaves &dA &d@ enough room to keep the text at its original computed &dA &d@ location. &dA &dA &d@ 12-10-03 Adding code to shorten the down stem for music with text &dA &d@ for notes on middle line of staff or on the adjacent &dA &d@ space above (B4 and C5 in the treble clef). &dA &dA &d@ 12-16-03 Adding the ability for print suggestions to apply to &dA &d@ specific notesizes or to sets of note sizes. &dA &dA &d@ 12-16-03 Adding the option of running AUTOSET with a note compression &dA &d@ factor. Also trying to reduce the gradularity of note &dA &d@ distance calculations by multiplying them all by 100. &dA &d@ Introducing new variables cfactor and xmindist &dA &dA &d@ 01-03-04 Adding a new print suggestion that directs autoset to generate &dA &d@ type 7 whole rests. MSKPAGE will then be able to omit parts &dA &d@ on a system by system basis, for those parts containing only &dA &d@ type 7 whole rests. &dA &dA &d@ 01-06-04 Adding a new print suggestion to implement line control &dA &d@ features. &dA &dA &d@ 01-17-04 Fix a bug in program. In order to typeset slurs, it is &dA &d@ apparently necessary to know the terminating pitch. For &dA &d@ this reason (only), it is sometimes necessary to process &dA &d@ more than one measure at a time. If time changes were &dA &d@ encountered in these additional measures, they were being &dA &d@ typeset at the beginning of the group instead of in their &dA &d@ proper place. The fix is to make sure that time changes &dA &d@ encountered after the first measure are placed in the &dA &d@ ts(.) array and processed in their proper order. Also, &dA &d@ time changes that occur at the beginning of a measure &dA &d@ must have their spn number set to 6913. &dA &dA &d@ 01-17-04 Fix a bug in program. We need to keep font changes &dA &d@ for musical directives from interferring with the &dA &d@ text of these directives. Font changes are signalled &dA &d@ in-line by inserting "!<#>", where <#> is the new &dA &d@ font number. We will now add a terminator "|" to this &dA &d@ code, so that font changes are now signalled by &dA &d@ "!|". &dA &dA &d@ 01-19-04 The problem with inctypes that was partially fixed in &dA &d@ 09-14-03 still has the problem that the inctype total &dA &d@ has be modified. This can cause MSKPAGE to crash. &dA &d@ The current change is an attempt to fix this problem. &dA &d@ The fix is still a cludge. &dA &dA &d@ 02-04-04 Adding the option of using Times Roman font for editorial &dA &d@ dynamics and the trill. &dA &dA &d@ 02-06-04 Using grace note dot to typeset editorial staccato &dA &dA &d@ 03-19-04 We are in the process of converting over to a new &dA &d@ system of font organization (and some new text fonts &dA &d@ as well). For the moment, we will maintain both &dA &d@ versions of AUTOSET. The new code will appear under &dA &d@ under the #define parameter NEWFONTS. &dA &dA &d@ 04-22-04 As part of NEWFONTS, a new kerning feature has been &dA &d@ introduced -- data to be stored in new variable &dA &d@ kernmap(52,26) &dA &dA &d@ 05-12-04 Adding general print suggestion to turn off the printing &dA &d@ of rests -- to be used where a blank line is supplied &dA &d@ for a continuo part &dA &dA &d@ 12-18-04 Add notesize = 18 to autoset.z &dA &dA &d@ 01-30-05 Adding v-type print suggestion to adjust height of text &dA &dA &d@ 01-30-05 Adding treatment of "&" flag in measure records &dA &dA &d@ 03-04-05 Getting rid of all code alternate to NEWFONTS &dA &dA &d@ 04-10-05 In the rare case where there is text and (for reasons of &dA &d@ singers range) an alternative pitch is suggested, there &dA &d@ was a problem with the 12/09/03 code. It was incorrectly &dA &d@ using the alternate pitch to adjust space. The code &dA &d@ referenced here fixes this problem, but may alter the &dA &d@ original algorighm in unexpected ways, i.e., the "fix" &dA &d@ is untested. &dA &d@ &dA &d@ 04-26-05 Adding print suggestion that allows suppression of printing &dA &d@ of a slur. This is used when a slur lines up with a tuple &dA &d@ and the preference is to use a curved tuple bracket to &dA &d@ represent the slur (thus hopefully avoiding the clash &dA &d@ between the slur and the tuple number. The implementation &dA &d@ of this suggestion involves the addition of a new bit &dA &d@ to the Slur super-object situation flag, sitf. &dA &d@ &dA &d@ 05-14-05 Shifting position of staccato and spiccato marks when they &dA &d@ occur at the stem end of a note (chord) &dA &d@ &dA &d@ 05-26-05 Expanding general print suggestions to include arbitrarily &dA &d@ fixing the position of articulations. &dA &d@ &dA &d@ 05-28-05 New "C1:]" measure suggestion to implement &dEmid-movement&d@ right &dA &d@ justification. This is useful for page turns and for locating &dA &d@ repeats on system boundaries. &dA &d@ &dA &d@ 05-29-05 Fixing a minor bug; but the change could produce unexpected &dA &d@ results. See NOTE at change. Also fixing a bug that in certain &dA &d@ situations reversed the order of Key-change, Time-change. &dA &d@ This change should also be watched. &dA &d@ &dA &d@ 09-22-05 Trying to fix some minor bugs in the positioning of articulations &dA &d@ &dA &d@ 11-02-05 Allow for special case of a grace note tied to a regular note &dA &d@ on the same division. This permits one posible representation &dA &d@ of an arpeggiation. &dA &dA &d@ 11-05-05 Fixing a minor bug; Accidentals now can attach to trills that &dA &d@ include the ~~~~~~~ super-object. &dA &d@ Also adding feature that allows accidental to follow the tr. &dA &d@ when used with the ~~~~~~~ super_object. (the U option) &dA &d@ &dA &d@ 11-05-05 Fixing a minor bug; In the case of a key change on the grand &dA &d@ staff, cancellation naturals on the second staff where &dA &d@ being omitted. Fix --> reset oldkey in loop &dA &d@ &dA &d@ 11-05-05 Fixing a minor bug; Cautionary accidentals were not being &dA &d@ printed for tied-over note. Need to over-ride the small "k" &dA &d@ &dA &d@ 11-05-05 Adding feature: Tuplet (brackets and numbers) can be moved &dA &d@ up or down, left or right, with a print suggestion on &dA &d@ the tuplet terminator "!" &dA &d@ &dA &d@ 12-04-05 Fixing an obscure bug: In certain syncopated situations &dA &d@ when processing 3 or more passes (usually on the grand &dA &d@ staff). The DINC variable is not set correctly. The &dA &d@ "fix" may create new problems, but only in other &dA &d@ obscure situations. Keep a lookout! &dA &d@ &dA &d@ 12-18-05 New feature: a single line staff may be specified by a &dA &d@ a clef code = 0 (i.e., "$ C:0") &dA &d@ &dA &d@ 12-20-05 New feature: implementing general print suggestion j: &dA &d@ (P C0:j#) for changing stem directions. Default (j:0) &dA &d@ indicates "no change." &dA &d@ &dA &d@ 12-21-05 New feature: putting "//" in the part name (line 9 of &dA &d@ the source file) will cause that part of the name that &dA &d@ follows to be put on a second line in the output. &dA &d@ Essentially, this works by inserting blanks up to &dA &d@ length 17 in place of the "//". &dA &d@ &dA &d@ 12-20-05 New feature: implementing general print suggestion k: &dA &d@ (P C0:k#) for setting certain operational flag (defaults are 0) &dA &d@ bit 0: (for two or more tracks) &dA &d@ 0 = allow overstrike when there a dot-difference &dA &d@ 1 = do not overstrike &dA &dA &d@ 01-01-06 New feature: changing the general print suggestion r<#> to &dA &d@ be "bit" oriented, and adding a feature that allows irests &dA &d@ to globally be passed through as non-printed rest objects. &dA &d@ For the suggestion (P C0:r<#>) the bits now indicate as &dA &d@ follows: (defaults are 0) &dA &d@ bit 0: placement of rests &dA &d@ 0 = use default placement &dA &d@ 1 = always place on middle line &dA &d@ bit 1: treatment of irests. &dA &d@ 0 = use irest as a simple "backup" command &dA &d@ 1 = treat irest as an "un-printed" rest object &dA &dA &d@ 01-01-06 New feature: It is now possible to use the print suggestion &dA &d@ &dEPx..&d@ to ask &dEautoset&d@ to 1) report on measure progress, and &dA &d@ 2) to enter debug mode. Specifically: &dA &d@ &dA &d@ If column 3 of the command contains the letter "m", &dA &d@ then autoset will report the measures it has completed, &dA &d@ i.e., operate as if MREPORT = 1 &dA &dA &d@ If column 4 of the command contains the letter "d", &dA &d@ then autoset will operate in debug mode, i.e., as if &dA &d@ &process D were operative. &dA &dA &d@ 01-01-06 CHANGING VERSION NUMBER TO 4.01 &dA &d@ Reason: We have made significant changes (improvements) &dA &d@ to the way autoset processes multi-tracks under the I:2 &dA &d@ designation. In particular, Version 4.00 accepted &dA &d@ stem-up and stem-down iso-data and rationalized these &dA &d@ into a single stem direction. While this allowed for &dA &d@ easier creation of merged I:2 data files, it limited &dA &d@ autoset in its ability to represent precisely what &dA &d@ the encoder intended. In Version 4.01, iso-data is &dA &d@ combined (collapsed) only when stem directions are &dA &d@ the same. Note: files built for the older version of &dA &d@ autoset can still be processed as intended by including &dA &d@ the print suggestion "P C0:j3". &dA &dA &d@ 01-04-06 There is an on-going problem when repeaters are combined &dA &d@ with super-objects. I have crafted a "fix" for the case &dA &d@ of simple repeaters + tuples, but there is still much &dA &d@ work to be done here. &dA &dA &d@ 01-06-06 I have allowed notes with repeaters to have articulations &dA &d@ on the first note (I think). &dA &dA &d@ 01-06-06 Extending the general print suggestion d<#> to include &dA &d@ Ending super-objects. &dA &dA &d@ 01-06-06 Extending the general print suggestion a<#> for articulations. &dA &dA &d@ 01-07-06 Adding the tremulo ornament to the group which includes &dA &d@ trills, turns, mordents, etc. Allowing print suggestions. &dA &dA &d@ 01-07-06 There is a bug in the way print suggestions interact with &dA &d@ transpositions. The "fix" works, but may expose other &dA &d@ problems. &dA &dA &d@ 01-07-06 Adding some warnings re: bad format of musical directions &dA &d@ (* type records). &dA &dA &d@ 01-13-06 Implementing arpeggios &dA &dA &d@ 01-15-06 Allowing slurs to end on a repeater (first note in group) &dA &dA &d@ 01-15-06 Attempting to allow repeaters on groups of alternating notes &dA &d@ of size 6, 12, and 24; i.e., notes pairs represented with &dA &d@ extension dots. Additions done "on the fly" and not &dA &d@ fully reasoned or fully checked out. &dEKeep an eye on it&d@. &dA &dA &d@ 02-19-06 We need to add a feature that allows for different types of &dA &d@ note heads to be printed. The immediate need is for an "x" &dA &d@ for "cymbal crash," but there are many other percussion and &dA &d@ non-standard shapes. Philosophically, this could be &dA &d@ approached in two ways: either this information could be &dA &d@ "hard coded" as is the note size (i.e., in column 17), or &dA &d@ it could be done with a print suggestion. I am planning to &dA &d@ take the second route, and here is why. Size, it could be &dA &d@ argued should be hard coded, because it is often used to &dA &d@ indicate editorial vs. original information, and we have &dA &d@ chosen to hard code this distinction. Note shape, on the &dA &d@ other hand, does not change pitch or duration, but rather &dA &d@ indicates (at most) something about the means by which a &dA &d@ note is played and about the sound. It would be nice to &dA &d@ hardcode this information, but I don't see an easy way to &dA &d@ do this. Columns 17 to 22 are designated for note &dA &d@ description, and they are fully taken up. The only way &dA &d@ would be to add more codes in column 17, and since printed &dA &d@ duration is already contained here (comprising a dimension &dA &d@ with 11 elements, we would rapidly run out of codes, if we &dA &d@ tried to overlay another dimension of shape. The alternative &dA &d@ is to use a print suggestion, and here we have a viable &dA &d@ solution. There is already a print suggestion for modifying &dA &d@ the printing of note, rest and figure objects. It's &dA &d@ designation is "C1:". The code "p" in this catagory &dA &d@ accounts for one of the 4 bytes available, and of the 8 bits &dA &d@ in this byte, only 4 are currently in use. This means that &dA &d@ we could &dEintroduce a new catagory "s"&d@, which would have &dA &d@ 4 bits available to it. This could accommodate 15 exotic &dA &d@ note &dEshapes&d@, which should be enough. &dA &dA &d@ 03-04-06 Revising AUTOSET so that in default mode multiple rests will &dA &d@ be generated only when typesetting parts. Global print &dA &d@ suggestion m<#> can be used to over-ride default. &dA &d@ C0:m0 = no multi rests; C0:m1 = generate multi-rests &dA &dA &d@ 03-07-06 Adding the ability to set multiple rests up to mdouble, mdotted &dA &d@ mheavy2, and mheavy3. Note: this feature is normally for &dA &d@ parts only. &dA &dA &d@ 03-13-06 Removing type 6 and type 7 Symbol Objects (whole rests as &dA &d@ symbols) and replacing them with type 9 Rest Objects with &dA &d@ inc = 10000 or inc = 10001. The new MSKPAGE requires this. &dA &d@ Also, don't even process for "multi rests" unless the &dA &d@ multirest_flag = 1 (Normally Parts only). &dA &dA &d@ 03-18-06 Combining the source codes for AUTOSCR and AUTOSET. &dA &d@ Also, adding certain features of each of these programs &dA &d@ to the other. In the case of AUTOSET, we are adding &dA &d@ the capability to communicate pitch and track information &dA &d@ to the output via attribute records (A records) &dA &dA &d@ 03-25-06 Adding various "@" records for tranmitting source and &dA &d@ analysis information. &dA &dA &d@ 08-23-06 Adding editorial accidentals to key signature &dA &dA &d@ 09-13-06 In the soprano clef, the placement algorithm was placing &dA &d@ flats too low on the staff. The current "fix" covers only &dA &d@ the placement of flat, not flat cancellations. &dA &dA &d@ 11-20-06 Adding feature that allows a slur over a set of repeated &dA &d@ notes with repeater, provided that the slur covers all &dA &d@ the notes in the group and that there are no chords &dA &d@ in the repeated pattern. &dA &dA &d@ 11-26-06 Fixing a minor bug in the placement of slurs. &dA &dA &d@ 11-26-06 Adding feature to global print suggestion C0:k that &dA &d@ asks that new key signatures be printed out even &dA &d@ when they are no different from the existing one. &dA &dA &d@ 11-26-06 Adding feature to allow chords (double stops) with &dA &d@ two colors of notes &dA &dA &d@ 11-26-06 Fixing a minor bug in the placement of extension &dA &d@ dots when combining parts on a single staff &dA &dA &d@ 10-14-07 Adding code to allow autoscr to combine notes on &dA &d@ a single beam when there are irests present. This &dA &d@ situation comes up when there is a change from &dA &d@ single parts to a combined part within a measure. &dA &dA &d@ 10-15-07 Adding code to put out "silent" key change nodes. &dA &d@ No difference in display output. This addition &dA &d@ just clears up a corner case bug in the mskpage &dA &d@ process (the easiest fix in this case). &dA &dA &d@ 10-15-07 Adding code to deal with rests with capital letter &dA &d@ note types. With rests, capital letter note types &dA &d@ are used to indicate rests which might be taken &dA &d@ out if the take out variable wrest = 1 and an &dA &d@ entire line in a score has nothing but rests. &dA &d@ To signal a capital letter rest, autoset/autoscr &dA &d@ puts out a jtype = r instead of the usual &dA &d@ jtype = R. The mskpage/spaging program knows &dA &d@ how to deal with this and always outputs a &dA &d@ capital "R" to the page specific files. &dA &dA &d@ 10-24-07 Adding grobal print suggestion for setting musical &dA &d@ font in $ records. Default defined by DEFAULT_DTIVFONT. &dA &d@ The mdirfont variable is now used only for text in &dA &d@ musical directives. Its default is DEFAULT_MDIRFONT. &dA &dA &d@ 10-25-07 Fixing a bug in the autoscr process. Accidental shift &dA &d@ units are scaled differently in SCORE than in Dmuse. &dA &d@ The conversion is 25 SCORE units = vpar(2) Dmuse units. &dA &dA &d@ 10-28-07 There is a minor bug in autoset that we fix here. In the &dA &d@ case where notes are combined into chords, the print &dA &d@ suggestions for the separate notes were being or-ed &dA &d@ together, producing unpredictable results. Actually, &dA &d@ this is bad encoding on the part of the encoder, and &dA &d@ should probably be flagged with a WARNING. But in &dA &d@ any case, the print suggestions should be combined in &dA &d@ a more intelligent way. &dA &dA &d@ 11-02-07 Adding a new global flag, suppress_key, which suppresses &dA &d@ the printing of the key signature. This to be used &dA &d@ in timpani parts where the timplani are tuned to &dA &d@ pitches with accidentals (e.g., B-flat and F). The &dA &d@ flag is set by bit-4 of the "k" global suggestion. &dA &dA &d@ 11-10-07 I uncovered a major problem in the implementation of print &dA &d@ suggestions for articulations. First of all, byte 1 of &dA &d@ the tcode string was not being set properly. This was &dA &d@ causing getpxpy to return null values for the various &dA &d@ suggestions. In addition, the interference section for &dA &d@ the code was uniformly preempting the placement &dA &d@ articulations irrespective of print suggestions. I have &dA &d@ fixed (I think) the problem for the case of spiccatos, &dA &d@ but have not checked the results for other articulations. &dA &dA &d@ 11-15-07 There is an obscure spacing difference between autoset and &dA &d@ autoscr having to do with the typsetting of irest. I think &dA &d@ it comes up when the irest has a dot. The fix here is an &dA &d@ untested cludge, but it seems to work. &dA &dA &d@ 11-19-07 Adding a new global suggestion to allow the minimum space &dA &d@ between notes to be altered. P C0:h<#> where # is a &dA &d@ percentage of the default (= 9 for notesize 14). &dA &dA &d@ 11-24-07 Fixing a small detail having to do with how autoscr &dA &d@ computes P3 and P10 &dA &dA &d@ 12-08-07 There is a problem with the continuation of the ~~~ wavy &dA &d@ line when there is more than one pass. The solution is &dA &d@ to make ctrflag a one-dimention array indexed by passnum. &dA &d@ This change may facilitate the printing multiple wavy &dA &d@ lines in a measure on a staff, but it also may introduce &dA &d@ some other problems. Keep an eye on this. &dA &dA &d@ 12-14-07 Fixing a logical problem that goes way back. The problem is with &dA &d@ the array claveax(.), which is used to reset the measax(.,.) &dA &d@ array, which in turn is used to determine which accidentals &dA &d@ are used in front of notes. When there is a key change in &dA &d@ the music, claveax(.) is adjusted AT THE TIME IT IS TYPESET. &dA &d@ But the spelling of the notes is determined while the &dA &d@ ts(.,.) array is being constructed. If there is a slur over &dA &d@ a key change, the ts(.,.) array continues to be built with &dA &d@ the old claveax(.) array. What we need is a new array &dA &d@ tclaveax(.), which is set to claveax(.) whenever a there is &dA &d@ a new build of the ts(.,.) array, but which can be changed &dA &d@ if there is a key change. Then measax(.,.) can be reset &dA &d@ from tclaveax(.) and the note spellings will reflect the &dA &d@ new key. I have made these changes, and the program seems &dA &d@ to work. Keep an eye on this, though. &dA &dA &d@ 01-01-08 Adding a minor new feature: The "c" option for print &dA &d@ suggestion C26: The "c" option is a varient of the &dA &d@ "a" option. It converts a single set of repeated &dA &d@ notes to a repeater &dEand adds a dot&d@ after the combined &dA &d@ note value. Strictly speaking, the resulting duration &dA &d@ is 50% too long, but the notation provides a convenient &dA &d@ way of representing repeated triplets (or some multiple &dA &d@ of triplets) without having to put the tuple number &dA &d@ above the repeater. The actual duration of the note &dA &d@ for spacing purposes is not altered. &dA &dA &d@ 01-26-08 Fixing a small bug in connection with editorial accents &dA &dA &d@ 02-03-08 Attempting to add a new feature (autoset only), which is &dA &d@ the 'R' type musical designation; a rehearsal number of &dA &d@ letter with a box drawn around it. The trick will be &dA &d@ getting the box size and placement right &dA &dA &d@ 04-19-08 There is an error in the way single track processing handles &dA &d@ the minimum spacing for dotted rests. This occurs at &dA &d@ approximately lines 12300 ++. The computed minimum space &dA &d@ is too large, because the right-hand margin gr(.,.) is made &dA &d@ too large due to some double counting. I don't want to change &dA &d@ this code, however, because it will alter the horizontal &dA &d@ spacing, which can (and sometime does) change the way mskpage &dA &d@ does the system breaks (an example of being locked in by &dA &d@ an error). The problem is not severe, because the minimum &dA &d@ space is often exceed anyway by the real space. Fine. &dA &d@ But this creates another problem, namely when autoscr computes &dA &d@ the space for rests in a multi-track measure, it always &dA &d@ uses the multi-track code (irests are ignored by autoset &dA &d@ in this situation). This means that the i-file spacings &dA &d@ generated by autoset and autoscr may be slightly different; &dA &d@ and this can lead to different system breaks. I have &dA &d@ added some code at approximately lines 14350 ++ to simulate &dA &d@ the single track error. The code is quite cludgey and may &dA &d@ not work all of the time. &dA &dA &d@ 04-19-08 The single track error describe above also causes the dot following &dA &d@ sixteenth and smaller rests to be placed too far to the right. &dA &d@ I added a small bit of code to partially fix this problem, The &dA &d@ code does not change the horizontal spacing formula. &dA &dA &d@ 04-22-08 Adding a new feature: the back tie. Since the position of this &dA &d@ character depends only on the note object, it is implemented as &dA &d@ a subobject. J = overhand back tie; K = underhand back tie. &dA &d@ For purposes of print suggestions, the back tie is handled like &dA &d@ a standard ornament. This means back ties may be applied to &dA &d@ multiple notes on a chord, but it also means that a note with &dA &d@ a back tie may have at most one ornament attached to it. Since &dA &d@ back ties are rare (second endings, etc.), this should not be &dA &d@ a problem. &dENote&d@: for the moment, back ties are not converted &dA &d@ to SCORE files. &dA &dA &d@ 05-01-08 Fixing an obscure problem with slurs. In the case where an &dA &d@ "inside" slur is desired (e.g., underhanded in an upper part &dA &d@ on a stave), the automatic slur adjustment algorithm tries &dA &d@ to make this slur go below everything on the staff, which &dA &d@ usually works, but not always. This code change implements &dA &d@ a new global print suggest C0:g<#> which can be used to &dA &d@ defeat (turn off) the automatic slur adjustment feature. &dA &d@ In this case other slur print suggestions should be used &dA &d@ to position the slur. &dA &dA &d@ 06-04-08 Fixing an obscure problem with the placement of accidentals &dA &d@ on notes with repeaters. I changed the limits on the gl(.,.) &dA &d@ array so that the accidental does "see" the repeaters. &dA &d@ Note: this fix might introduce some overlap in some situations. &dA &dA &d@ 06-04-08 Expanding from three to four the number of notes allowed in a &dA &d@ chord when multiple passes are used. (I think this works) &dA &dA &d@ 09-21-08 Expanding the repeater feature to include sub-groups (secondary beam) &dA &d@ of 3 and 6. This comes up in the case of repeated triplets. At &dA &d@ the moment, I don't have a way of making this work with the tuple &dA &d@ numbers. I just hope the new code does't throw off the common &dA &d@ cases. Keep an eye on this. &dA &dA &d@ 10-08-08 The first version of autoset permitted up to 15 different dynamic &dA &d@ combinations. At the time (c. 1988), this seemed like plenty, &dA &d@ so four bits were allocated in the ts(.) array for this purpose. &dA &d@ Now, it seems, we have exceeded this limit (Beethoven writes ffp &dA &d@ in the 7th symphony). In this code update, I have garnered another &dA &d@ three bits, allowing for another 8 dynamic combinations. Only &dA &d@ one of which is used at this point (ffp). We have space for 7 &dA &d@ more in the current setup. The ts(.) element SUBFLAG_1 actually &dA &d@ has two more bits available (before it goes negative), so we &dA &d@ could in theory add another 24 dynamic combinations. Lets &dA &d@ wait and see what's needed. &dA &d@ &dA &d@ 10-24-08 Adding a new print suggestion for breaking up a multi-measure rest &dA &d@ "P C1:f" The suggest must follow directly after the "measure" &dA &d@ record where the break is to occur. It applies only to the &dA &d@ typesetting of parts. If this measure (barline) is also to serve &dA &d@ as a system break (P C1:]), then the system break suggestion &dA &d@ should follow &dCafter&d@ the multi-measure break. &dA &dA &d@ 10-29-08 There was a problem in the way single whole-measure rests were being &dA &d@ compiled for parts. For multiple rests, field 8 (the distance &dA &d@ increment flag) of the following barline object is irrelevant; &dA &d@ but for single whole-measure rests, the &dCmskpage&d@ program tries to &dA &d@ use that flag in the normal way. When more than one part is being &dA &d@ typeset, this can result in an accumulation error. Since typesetting &dA &d@ multiple parts in a system is a highly useful feature (e.g., for &dA &d@ for comparison purposes), I coded a fix for this problem -- which &dA &d@ seems to work, but beware. It may impact the spacing of single &dA &d@ whole-measure rests. &dA &dA &d@ 11-18-08 The dynamic combination "ff" has been spaced a bit too widely. Adding &dA &d@ a new horizontal parameter hpar(140) to deal with this. &dA &dA &d@ 11-18-08 Also at this time, I am raising slightly the number over a multiple &dA &d@ rest bar for notesize = 21. &dA &dA &d@ 12-31-08 Working on the implementation of notesize = 16. &dA &dA &d@ 01-02-09 Adding a provision for larger note heads in the size 16 font &dA &d@ This effects the following parameters. Altimately, these &dA &d@ parameters are fixed in the proofpar library; but for the &dA &d@ time being, I want to keep this feature in this program &dA &dA &d@ hpar(51) = width of quarter note (approximately) &dA &d@ hpar(82) = width of black note (for typesetting) &dA &d@ hpar(83) = width of whole note (for typesetting) &dA &d@ hpar(84) = width of breve note (for typesetting) &dA &dA &d@ 01-12-09 New general print suggestion, a subset of k. If k & 0x10 > 0, &dA &d@ the slur pairs "{ }" and "z x" will be interpreted as editorial. &dA &d@ &dA &d@ 01-12-09 Fixing a minor bug in the implementation of horizontal print &dA &d@ suggestions. When the node is isolated, the modification must &dA &d@ be in the position of the word sub-object, not the object. &dA &dA &d@ 01-12-09 Encountering a new dynamic sign in Mozart of all places, mfp. &dA &d@ We will use some of the new space created 10-08-08. &dA &dA &d@ 02-02-09 Adding a new element to general print suggestion C0:k &dA &d@ Bit 5: set = typeset all new clef signs in full size &dA &d@ (for use in multi-singer recitatives). &dA &dA &d@ 02-02-09 We can now use the sequence "\+" to indicate an inline &dA &d@ "space" character. This is useful in music text &dA &d@ underlay. &dA &dA &d@ 03-10-09 It turns out that conductors have varying preferences &dA &d@ when it comes to the format and appearance of conducting &dA &d@ scores. For example, when two instruments appear on a &dA &d@ single staff, some conductors want to see both musical &dA &d@ lines represented all of the time, vs. showing only the &dA &d@ active musical lines. An acceptable variation on this &dA &d@ is to show a single line when the instruments are playing &dA &d@ in unison. Others would rather see the score kept as clean &dA &d@ as possible, with the use of 1. and 2. and a single line &dA &d@ of music when only one of the two instruments is playing. &dA &d@ For this reason, it is necessary to implement a second &dA &d@ score-type group, called skore, whose use we will, by &dA &d@ convention, assign to the more complete (and busy) &dA &d@ representation. &dA &dA &d@ 03-15-09 There needs to be a way to disable the feature where &dA &d@ rests are collapsed in the two instrument isorhythmic &dA &d@ case. We will use bit 2 of the global print suggestion &dA &d@ P C0:r for this. The situation comes up when typesetting &dA &d@ scores with complicated two instrument parts. &dA &dA &d@ 03-16-09 Encountering a new dynamic sign in Beethoven, sff. &dA &d@ We will use some of the new space created 10-08-08. &dA &dA &d@ 11-23-09 Fixing a small bug that developed when I tried to improve &dA &d@ obx spacing with repeaters. &dA &dA &d@ 11-27-09 Adding the "@ SCORECON pitch transposition" option for &dA &d@ applying a post pitch modification to the P6 parameter. &dA &dA &dA &d@ Program options &dA #define XPOS_FIXED 1 /* with Beethoven, try 1 first, then 0; with Haydn, use 1 #define DISP_DISK "j" #define VERSION "4.02" /* Version 4.00 defined &dA05/02/03&d@ /* Version 4.01 defined &dA01/01/06&d@ /* Version 4.02 (current version) defined &dA02/03/08&d@ (new data file in musprint) #define AUTOSCR 0 #define PGROUP "scrcon" #define SFZ 0 /* SFZ = 1: print sfortzando as sfz &dK#&d@define DOT_DIFFERENCE 1 (&dA12/24/05&d@ now controlled by dot_difference_flag) &dK &d@ /* DOT_DIFFERENCE = 1: don't allow overstrike #define SUB_EDIT 1 /* SUB_EDIT = 0: do not distinguish between /* original and editorial data #define NO_EDIT 0 /* NO_EDIT = 1: do not process editorial data #define ROMAN_EDIT 0 /* ROMAN_EDIT = 1: use Times Roman font for /* editorial marks: tr, dynamics #define OLD_REPEATERS 1 /* OLD_REPEATERS = 1: use half notes instead of quarters #define CUSTOM_PAR 1 /* allows use of custom parameters, for whatever reason /* see code at CUSTOM_PAR #define LIGIT 1 /* LIGIT = 1: convert ffl, ffi, ff, fl, fi in /* text subobjects to ligitures /* see code at CUSTOM_PAR #define DEFAULT_DTIVFONT 37 #define DEFAULT_MDIRFONT 31 /* default font for musical directions #define BIG16 0 /* &dA01/02/09&d@ Wide version of size 16 note heads #define REPORT4 0 #define MREPORT 0 /* &dA01/01/06&d@ This feature can also be activated by /* using the print suggestion "Pxm." #define OBJ_REPORT 0 #define TRUE 0 #define FALSE 1 &dA &d@ Actual Characters #define DOT_CHAR 44 &dA &d@ Descriptive Definitions #define TIE_SNUM 1 #define TIE_NTYPE 2 #define TIE_VLOC 3 #define TIE_FHDIS 4 #define TIE_FSTEM 5 #define TIE_NDX 6 #define TIE_STAFF 7 #define TIE_FOUND 8 #define TIE_FORCE 9 #define TIE_SUGG 10 #define TIE_ARR_SZ 10 /* &dA04/20/03&d@ new 10th element for tiearr #define FIG_SNUM 1 #define FIG_HOFF1 2 #define FIG_HOFF2 3 #define FIG_READY 4 #define REG 1 #define GRACE 2 #define CUE 3 #define CUEGRACE 4 #define BM_SNUM 1 #define BM_CNT 2 #define BM_READY 3 #define BM_STEM 4 #define BM_TUPLE 5 #define BM_SIZE 6 #define BM_SUGG 7 #define BM_SZ 7 #define SL_SNUM 1 #define SL_YSHIFT 2 #define SL_XSHIFT 3 #define SL_NEXTSNUM 4 #define SL_BEAMF 5 #define SL_SUGG 6 #define SL_SIZE 6 #define TU_SNUM 1 #define TU_Y1 2 #define TU_Y2 3 #define TU_FSTEM 4 #define TYPE 1 #define DIV 2 #define CLAVE 3 #define AX 4 #define TEMP4 4 #define NTYPE 5 #define DOT 6 #define TUPLE 7 #define STAFFLOC 8 #define SPACING 9 #define STEM_FLAGS 10 #define BEAM_FLAG 11 #define BEAM_CODE 12 #define LOCAL_XOFF 13 #define SUPER_FLAG 14 #define SLUR_FLAG 15 #define SUBFLAG_1 16 #define SUBFLAG_2 17 #define VIRT_NOTE 18 #define SORTPAR1 18 #define SORTPAR2 19 #define TEMP2 19 #define GLOBAL_XOFF 19 #define TEXT_INDEX 20 #define PASSNUM 21 #define BACKTIE 22 #define NOTE_DUR 23 #define DINC_FLAG 24 #define VIRT_STEM 25 #define ED_SUBFLAG_1 26 #define ED_SUBFLAG_2 27 #define STAFF_NUM 28 #define NUM_STAVES 28 #define MULTI_TRACK 29 #define TEMP1 30 #define SPN_NUM 30 #define OBY 31 #define SLUR_X 32 #define NODE_SHIFT 33 #define TRACK_NUM 34 #define BASE_40 35 #define NOTE_DISP 36 #define AX_DISP 37 #define AUG_DOTS 38 #define TSR_POINT 39 #define TS_SIZE 42 &dA &dA &d@ ts(.) Array positions for arpeggio variables (note doublings with other flags) &dA #define ARPEG_FLAG 16 #define ARPEG_TOP 26 #define ARPEG_BOTTOM 27 #define TSR_LENG 116 #define NUMBER_OF_FIG 3 #define FIG_SPACE 4 #define FIG_DATA 5 #define MIN_FIG_SPAC 20 #define FIG_DUR 23 #define SIGN_POS 3 #define SIGN_TYPE 4 #define SUPER_TYPE 5 #define FONT_NUM 6 #define WEDGE_OFFSET 7 #define S_TRACK_NUM 8 #define WEDGE_SPREAD 10 #define POSI_SHIFT1 11 #define ISOLATED 12 #define POSI_SHIFT2 13 #define TIME_NUM 3 #define DOLLAR_SPN 5 /* (New &dA01/17/04&d@) #define DIVSPQ 3 #define CLEF_NUM 3 #define CLEF_FONT 4 #define TRANS_FLAG 5 #define CLEF_STAFF_POS 6 #define BAR_NUMBER 3 #define BAR_TYPE 4 #define REPEAT 5 #define BACK_ENDING 6 #define FORW_ENDING 7 #define BAR_FLAGS 8 #define M_NUMBER 10 #define REGULAR 1 #define HEAVY 2 #define DOTTED 3 #define DOUBLE_REG 5 #define REG_HEAVY 6 #define HEAVY_REG 9 #define DOUBLE_HEAVY 10 #define DOUBLE_DOTTED 15 #define WEDGES 1 #define DASHES 2 #define OCT_UP 3 #define OCT_DOWN 4 #define DBL_OCT_UP 5 #define DBL_OCT_DOWN 6 #define NORMAL_TRANS 13 #define NOTE 1 #define XNOTE 2 #define REST 3 #define CUE_NOTE 4 #define XCUE_NOTE 5 #define CUE_REST 6 #define GR_NOTE 7 #define XGR_NOTE 8 #define NOTE_OR_REST 8 #define FIGURES 9 #define BAR_LINE 10 #define SIGN 11 #define WORDS 12 #define MARK 13 #define CLEF_CHG 14 #define DESIGNATION 15 #define METER_CHG 16 #define DIV_CHG 17 #define AX_CHG 18 #define P_SUGGESTION 19 #define MUSICAL_DIR 11 #define IREST 12 #define BACKSPACE 13 #define SEGNO 1 #define PED 2 #define END_PED 3 #define LETTER_DYNAM 4 #define RIGHT_JUST_STR 5 #define CENTER_STR 6 #define LEFT_JUST_STR 7 #define TIE_TERM 8 /* TIE_TERM added &dA10-12-96&d@ #define REH_MARK 9 /* REH_MARK added &dA10-12-96&d@ #define BELOW 1 #define ABOVE 2 #define HEAD 0 #define TAIL 1 #define FULLSIZE 0 #define CUESIZE 1 #define THIRTY_SECOND 4 #define SIXTEENTH 5 #define EIGHTH 6 #define QUARTER 7 #define HALF 8 #define WHOLE 9 #define BREVE 10 #define SLASH8 0 #define ARPEGGIO 33 /* ARPEGGIO added &dA01/13/06&d@ #define UP 0 #define DOWN 1 #define SINGLE_NOTE 0 #define CHORD 1 #define NO_BEAM 0 #define END_BEAM 1 #define START_BEAM 2 #define CONT_BEAM 3 #define OFF 0 #define ON 1 * Parametric Definitions #define MAX_STAFF 2 #define MAX_TIES 16 #define MAX_FIG 4 #define MAX_PASS 10 #define MAX_OBJECTS 1000 #define MAX_M 400 * Other Definitions #define DUMMY_VALUE 10000 #define INT1000000 1000000 #define INT10000 10000 #define INT100 100 #define INT9000 9000 #define BHPAR1 30 #define MAX_MEAS 2000 * Process parameters *process D /* &dA01/01/06&d@ This feature can also be activated by /* using the print suggestion "Px.d" * str infiles.12(100),pgroup.12 str file.100,out.280,line.180,temp.180,lib.30,temp2.160,temp3.160,temp4.160,temp5.20 str line2.180,slurstr.160,slurlet.1,slurover.80,slurunder.80 str inlib.100,outlib.100,outfile.100 str claves.7,numbers.10,accs.3 str note.4,jtype.1,codes.12 str ttext.180,msg.60,xbyte.2 /* ttext lengthened to 180 &dA04/22/04 str tcode.4(MAX_M),tdata.80(MAX_M,2) str sobl.120(30),tsdata.100(MAX_OBJECTS) str mname.60,tname.60,wname.80,sourcename.80,partname.80 str tsr.TSR_LENG(MAX_OBJECTS) /* &dA05/14/03&d@ expanded length to 116 str version.4 /* &dA05/02/03&d@ str mrest_line.200 /* New &dA03/07/06&d@ int tv1(MAX_M),tv2(MAX_M),tv3(MAX_M),tv4(MAX_M) int tv5(MAX_M) /* New &dA01/17/04&d@ int tvar1,tvar2,tiecnt int supcnt,supnums(12) int mf(256),beampar(4,MAX_PASS,BM_SZ),mf2(120) /* &dA05/14/03&d@ expanded BM_SZ to 7 int multichk(3,MAX_PASS,MAX_STAFF) int tiearr(MAX_TIES,TIE_ARR_SZ),slurar(8,SL_SIZE),tuar(4,MAX_PASS,4) int figarr(MAX_FIG,4) int sitf,super_flag,slur_flag,subflag_1,subflag_2 int spc(255),nsp(33),claveax(50),measax(4,50) /* &dA06/04/08&d@ expanding measax to (4,50) int tclaveax(50) /* New &dA12/14/07&d@ int zak(2,7),wak(9),hpar(200),vpar(200),bvpar(35),vpar20 int a,d,e,g,h,i,j,k,m,s,y,z int @a,@b,@c,@d,@e,@n,old@n int f1,f2,f3,f4,pmode int notesize,mtfont,twfont,beamfont,curfont,mdirfont,dtivfont int olddivspq,divspq int cline(MAX_STAFF),clef(MAX_STAFF),clave,key int a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16 int save_a4 int c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17 int t1,t2,t3,t4 int x1,x2,y1,y2,z1 int olda1,unison_flag,sugg_flg,sugg_flg2 int beamdata(4,MAX_PASS,31),beamcode(31) int passpar(MAX_PASS) int firstsp,tfirstsp,emptyspace(MAX_STAFF,45) int ts(MAX_OBJECTS,TS_SIZE) int sct,oldsct,maxsct,divpoint,mrest,measnum,totdiv,cuediv,mdiv,qflag int figdiv,esnum,smusdir(30,4) int tsnum(MAX_PASS),ctrarrf(MAX_PASS),try(MAX_PASS) int pre_tsnum(MAX_PASS),pre_ctrarrf(MAX_PASS),pre_try(MAX_PASS) int ntype,f8,inctype,jcode,pcode,nodtype,passtype,passsize,stem int firstoff,sigflag int oby,sobx,soby,sobcnt,snum int sobx2 /* added &dA12/09/03&d@ int obx1,obx2,oby1,oby2 int c8flag(MAX_STAFF),transflag(MAX_STAFF),tuflag,passnum,chorddur,spn int ctrflag(MAX_PASS) /* made into an array &dA12/08/07 int mindist int tnum,tden,abflg,nstaves int ssize,scnt,debug_point int vflag,mcat,sflag,granddist,outpnt,tword_height int note_dur int minshort int global_tpflag int tpflag,xposi_shift,yposi_shift int save_xposi_shift /* added &dA01/12/09 int pcontrol,px,py,pyy,pxx int putobjpar int repeater_flag,repeater_flag2,repeater_case int repeater_dot_flag /* added &dA01/01/08 int repeater_dot_flag2 /* added &dA09/21/08 int chord_spread,mdir_offset int font_changes(10,2),changecnt int textconflag int min_space /* added &dA11/19/07 int slur_adjust /* added &dA05/01/08 bstr outslurs.8 label E(20),T(6),SS(21),PSUG(20),TPF(5),TPFF(5),ADJS(5) /* expanding PSUG &dA05/01/08 label R1(14) table X(10000),Y(30000) &dA &dA &d@ Variables added 6-19-93 for processing slurs &dA int profile(100,2) int sgroup(13,3),nsgroups int curvedata(8,4,8) int curve &dA &dA &d@ Variables added 5-27-93 for pseudo typesetting of simultaneous notes &dA int npasses,thispass,passcnt(MAX_PASS,3) int pitchcnt(10) int ndata(20,11) int pcnt int clashes(10,10) int tgroup(10),ntgroups int printpos(10) int ps_passcount(2) int gl(2,45),gr(2,45),oldgr(2,45) int pseudo_gr(2,45) int pseudo_gl(2,45) real r1,r2,r3,r4 &dA &dA &d@ Variables added 4-27-94 for determining text position &dA int ttextcnt str ttextarr.80(6) str xbytearr.2(6) &dA &dA &d@ Variables added 6-08-94 for working or repeaters &dA str chord_tones.4(10) int chordsize,last_chordsize,chordsize2 int checkoff(10) * int p,x,obx,dv1,dv2,dv3,dv4 &dA &dA &d@ Variables added 9-27-96 for controlling position of rests &dA int restplace,restplace2 &dA &dA &d@ Variables added 02-23-97 for determining range of print suggestions &dA &d@ and numbering measures; and the inctype accumulation problem &dA str job_type.1 int m_number int inctype_rem &dA &dA &d@ Variables added &dA12/09/03&d@ for trying to even out notes with text underlay &dA int nspace(MAX_M,8),org_c4 &dA &dA &d@ Variables added &dA12/16/03&d@ for running AUTOSET with a compression factor &dA int cfactor,xmindist &dA &dA &d@ Variable added &dA01/03/04&d@ for generating option type 7 whole rests &dA int wrest &dA &dA &d@ Variable added &dA10/15/07&d@ for generating optional smaller rests &dA int opt_rest_flag &dA &dA &d@ Variable added &dA01/19/04&d@ to fix the accumulation of inctypes &dA int fix_next_inctype &dA &dA &d@ Variables added &dA03/19/04&d@ to implement NEWFONTS organization &dA str XFontstr.76(12) str kernfiles.360 int XFonts(12,19) int Fspacex(90) int revsizes(24) int nsizes(12) int sizenum int kernmap(52,26) &dA &dA &d@ Variables added &dA05/12/04&d@ to implement print suggestion to turn &dA &d@ off the printing of rests (for empty continuo lines). &dA int restoff &dA &dA &d@ Variables added &dA01/30/05&d@ to implement print suggestion to adjust &dA &d@ height of text under staff &dA int text_flag int text_loc &dA &dA &d@ Variable added &dA05/26/05&d@ to implement arbitrary fixed placement &dA &d@ of articulations &dA int art_flag &dA &dA &d@ Variable added &dA12/18/05&d@ to implement single line staff &dA str LL.1 int single_line &dA &dA &d@ Variable added &dA12/20/05&d@ to implement stem change flag &dA int stem_change_flag bstr tbit1.2000,tbit2.2000 &dA &dA &d@ Variable added &dA12/24/05&d@ to implement various operational flags &dA int dot_difference_flag &dA &dA &d@ Variable added &dA01/01/06&d@ to set various new flags &dA int irest_flag int mreport_flag int debug_flag int ligit_flag int xdata_flag int scr_flag int rest_flag(MAX_PASS) int tracknum_flag &dA &dA &d@ Variable added &dA01/06/06&d@ to allow the d<#> print suggestion to include Endings &dA int ending_height &dA &dA &d@ Variables added &dA01/13/06&d@ to implement arpeggios &dA int arpeg_flag int arpeg_top int arpeg_bottom &dA &dA &d@ Variables added &dA03/04/06&d@ to for controlling the setting of multi-rests &dA int multirest_flag &dA &dA &d@ Variables added &dA11/26/06&d@ to allow reprinting of existing key signature &dA &d@ and chords with two colors &dA &d@ Also fixing a minor bug in printing extension &dA &d@ dots &dA int key_reprint_flag int mixed_color_flag int old_c2 &dA &dA &d@ Variables added &dA10/14/07&d@ to allow autoscr to combine notes under one beam &dA &d@ when there are irests present. &dA int beam_fixup_cnt int beam_fixup_arr(100,2) &dA &dA &d@ Variable added &dA11/02/07&d@ to allow suppression of the key signature &dA int suppress_key &dA &dA &d@ Variables added &dA02/03/08&d@ to allow typesetting of boxes around rehearsal numbers &dA int box_flag int font_base,font_height,zero_height &dA &dA &d@ Variable added &dA01/12/09&d@ to allow "{ }" and "z x" to represent editorial slurs &dA int in_line_edslur &dA &dA &d@ Variable added &dA02/02/09&d@ to control the "large clef" option &dA int large_clef_flag &dA &dA &d@ Variable added &dA03/15/09&d@ to permit the disabling of rest collapse &dA int rest_collapse &dA &dA &d@ Variables added &dA03/20/03&d@ for additional code required by autoscr &dA int measuremap(MAX_MEAS,5) /* 1 = number of tracks /* 2 = number of gaps 3 = pointer to data /* 4 = number of divspm 5 = number of divspq int trackstave(MAX_MEAS,9,3) /* trackstave data int timegaps(15000,3) int barnum,tgpnt,staves,track,staff,durflag,barnum2,opbarnum int trackdivpnt(9) int scr_qwidth int how_much_mrest(2) int composer_num int track_flag int track_assign(9) int instrument_number int transposition str jscrdat.80,kscrdat.100 str header1.180 str header2.180 str header3.180 str composer.80 str comp_names.80(20) &dA &dA &d@ Variable added &dA11/27/03&d@ for additional code required by autoscr &dA int pitch_mod &dAÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿&d@ &dA³ Description of arrays not described elsewhere ³&d@ &dAÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ&d@ &dA &dA &d@ Description of tiearr(MAX_TIES,TIE_ARR_SZ) &dA &dA &d@ This is an array for collecting information on ties. The &dA &d@ program allows up to MAX_TIES such simultaneous ties (first &dA &d@ dimension of the array). The second dimension contains the &dA &d@ following attributes: &dA &dA &d@ tiearr(TIE_SNUM) = super-object number for this tie &dA &d@ tiearr(TIE_NTYPE) = note type: 1 = note, 2 = xnote, 4 = cue, 5 = xcue, etc. &dA &d@ tiearr(TIE_VLOC) = location on staff of tied notes &dA &d@ tiearr(TIE_FHDIS) = horizontal displacement of first note &dA &d@ head from its object (chords only) &dA &d@ tiearr(TIE_FSTEM) = stem flag for first note &dA &d@ tiearr(TIE_NDX) = ts() index for first note in tie &dA &d@ tiearr(TIE_STAFF) = staff number (0 or 1) for first note in tie &dA &d@ tiearr(TIE_FOUND) = tie found flag &dA &d@ tiearr(TIE_FORCE) = tie force flag &dA &d@ tiearr(TIE_SUGG) = print suggestions for altering tie position (added &dA04/20/03&d@) &dA &dA &d@ Note: It can happen that a note is tied in both directions &dA &d@ out of the measure (e.g. pedal points). In this situation, we &dA &d@ will need to use the information in the old tiearr before &dA &d@ constructing a new one. Since we cannot deposit the tie &dA &d@ super-object until we have deposited the terminating note &dA &d@ object, and since we cannot deposit this note object without &dA &d@ knowing the new super-object number for the forward tie, we must &dA &d@ increment snum and store this number somewhere before writing &dA &d@ out the note object. We will use tv4(.) to store this number. &dA &d@ This also has a baring on how ties are handled within the &dA &d@ measure. When a tie flag is encountered, snum is incremented &dA &d@ and stored in tv4(.). tv4(.) is filled with ties from the top &dA &d@ note down. After any backward ties are dealt with, a free slice &dA &d@ of tiearr is identified and filled. The pointer to this slice &dA &d@ of tiearr may be put in ts(22) (after old ties are taken care &dA &d@ of). If the other end of this tie is encountered within the &dA &d@ measure (as determined by ts(22)), then the information in &dA &d@ tiearr is used with current information to construct the &dA &d@ super-object. &dA &dA &dA &d@ Description of figarr(MAX_FIG,4) &dA &dA &d@ This is an array for collecting information on continuation &dA &d@ lines for figures. The program allows up to MAX_FIG figures, and &dA &d@ each of these levels may have a continuation line. The first &dA &d@ dimension is therefore MAX_FIG; the highest level is 1 and the &dA &d@ lowest level is MAX_FIG. (In this version 3.0, MAX_FIG is 4) &dA &d@ The second dimension contines the following attributes: &dA &dA &d@ figarr(FIG_SNUM) = super-object number for this continuation &dA &d@ figarr(FIG_HOFF1) = horizontal off-set from first object &dA &d@ figarr(FIG_HOFF2) = horizontal off-set from second object &dA &d@ figarr(FIG_READY) = completion flag: set = array completed &dA &dA &dA &d@ Description of beamdata(4,MAX_PASS,31) &dA &dA &d@ Note: At the moment, there is a structural reason why the third &dA &d@ dimension of beamdata cannot exceed 31. This is because &dA &d@ beampar(.,.,BM_STEM) stores stem directions as bits. &dA &dA &d@ This is an array for collecting information on the beams that &dA &d@ connect notes together. The first dimension tells whether this &dA &d@ information is for (1) regular notes, (2) grace notes to regular &dA &d@ notes, (3) cue notes, or (4) grace notes to cue notes. The &dA &d@ second dimension tells the pass number for this beam. The &dA &d@ third dimension contains the beamcodes for the various notes &dA &d@ under the beam. &dA &dA &d@ The beamcode is a number between 1 and 666661. It describes the &dA &d@ structure of the beam for this note/chord. This version (3.0) of &dA &d@ the program supports beams up to 256th notes. The ones column of &dA &d@ the beamcode is for eighth notes, the tens column for sixteenth &dA &d@ notes, etc. The digits have the following meaning: &dA &dA &d@ 1 = continued beam &dA &d@ 2 = begin beam &dA &d@ 3 = end beam &dA &d@ 4 = forward hook &dA &d@ 5 = backward hook &dA &d@ 6 = repeater character &dA &d@ 7 = begin repeated beam &dA &d@ 8 = end repeated beam &dA &dA &dA &d@ Description of beampar(4,MAX_PASS,BM_SZ) &dA05/14/03&d@ expanded BM_SZ to 7 &dA &dA &d@ In addition to beamdata, there are seven other parameters &dA &d@ related to beams. These parameters are represented in the &dA &d@ array beampar as follows: &dA &dA &d@ beampar(BM_SNUM) = super-object number for the beam &dA &d@ beampar(BM_CNT) = note counter for beam &dA &d@ beampar(BM_READY) = flag that signals that a beam is complete &dA &d@ and should be put out. &dA &d@ beampar(BM_STEM) = stem flags for notes under beam &dA &d@ beampar(BM_TUPLE) = tuplet flag, which relates to the beam &dA &d@ in the following ways: &dA &d@ a. BM_TUPLE is set to (1 + stem) when the first note of &dA &d@ a beam is a tuplet &dA &d@ b. BM_TUPLE must be cleared after a beam is processed &dA &d@ c. if processing a beam, if BM_TUPLE is > 0 and if &dA &d@ end of tuplet bit is set, then process tuplet &dA &d@ with this beam (i.e. use no bracket and put &dA &d@ tuplet number over the beam in the middle. &dA &dA &d@ beampar(BM_SIZE) = size of beam (full size vs. cue size) &dA &d@ beampar(BM_SUGG) = suggestion for modifying length of first stem of beam New &dA05/14/03 &dA &dA &d@ Description of slurar(8,SL_SIZE) &dA &dA &d@ This is an array for collecting information on slurs between &dA &d@ two notes. This program allows up to four simultaneous slurs, &dA &d@ and four dotted slurs (hence the first dimension = 8). The &dA &d@ second dimension contains the following elements: &dA &dA &d@ slurar(SL_SNUM) = super-object number for this slur &dA &d@ slurar(SL_YSHIFT) = shift in y co-ordinate of the first &dA &d@ note of the slur &dA &d@ slurar(SL_XSHIFT) = shift in x co-ordinate of the first &dA &d@ note of the slur &dA &d@ slurar(SL_NEXTSNUM) = super-object number for next slur &dA &d@ (or zero) &dA &d@ slurar(SL_BEAMF) = beam flag: 0 = slur does not start on a beam &dA &d@ 1 = slur starts on a stem-up beam &dA &d@ 2 = slur starts on a stem-down beam &dA &d@ slurar(SL_SUGG) = print suggestion for beginning of slur (&dA05/06/03&d@) &dA &dA &d@ Note: There are some similarities between the handling of &dA &d@ ties and the handling of slurs. It can happen that a note will &dA &d@ have one or more slurs ending and/or starting on it. In this &dA &d@ case, as in the case of ties, the terminating super-objects &dA &d@ cannot be written until the object is written, and the object &dA &d@ cannot be written until the super-object numbers for the new &dA &d@ slurs are known. This means that we must establish these &dA &d@ numbers and save them before destroying the contents of the &dA &d@ slurar for the old slurs. This is the purpose for the NEXTSNUM &dA &d@ element in slurar. It is the super-object number for a forward &dA &d@ slur. After the backward slur is written, and at the time the &dA &d@ new elements of slurar are to be written, this number is moved &dA &d@ from slurar(SL_NEXTSNUM) to slurar(SL_SNUM). &dA &dA &dA &d@ Description of tuar(4,MAX_PASS,4) &dA &dA &d@ This is an array for collecting information on tuplet groups. &dA &d@ The first dimension tells whether this information is for &dA &d@ (1) regular notes, (2) grace notes to regular notes, (3) cue &dA &d@ notes, or (4) grace notes to cue notes. The second dimension &dA &d@ tells the pass number for this tuplet group. The elements of &dA &d@ the third dimension are as follows: &dA &dA &d@ tuar(TU_SNUM) = super-object number &dA &d@ tuar(TU_Y1) = y co-ordinate of the first object &dA &d@ tuar(TU_Y2) = y co-ordinate of the terminating note &dA &d@ head of the first object &dA &d@ tuar(TU_FSTEM) = bits 0-7: stem flag of the first note &dA &d@ bits 8-15: bracket flags (0 = no bracket) &dA &dA &d@ Note: Since it is not possible for a note to belong to two &dA &d@ tuplet groups at once, we do not have the problem present in &dA &d@ ties and slurs. There is a short-cut to processing that has been &dA &d@ mentioned in connection with beams, and which should be mentioned &dA &d@ here also. At processing time (when tuplet process bit is set), &dA &d@ we should check to see if beampar(.,.,BM_TUPLE) for this pass &dA &d@ is set. If it is, then we should do nothing; the tuplet will &dA &d@ be processed along with the beam and without a bracket. If &dA &d@ beampar(.,.,BM_TUPLE) is clear, then we must process the tuplet &dA &d@ using a bracket. &dA &dA &d@ Handling of the long trill &dA &dA &d@ The long trill is a simple super-object. However, there may &dA &d@ be several long trills in a measure-group. Therefore we need to &dA &d@ store this information for each pass. &dA &dA &d@ Let us assume up to MAX_PASS passes. Then each of the parameters &dA &d@ associated with long trills (tsnum, ctrflag, and try) will be a one &dA &d@ dimentional array type variable. &dA &dA &d@ The parameters associated with long trills are as follows: &dA &dA &d@ ctrflag(.) = wavy line continuation flag (made into an array &dA12/08/07&d@) &dA &dA &d@ tsnum(.) = super-object number of long trill (0 = no &dA &d@ long trill present) &dA &d@ &dA &d@ ctrarrf(.) = situation flag 1 = no "tr" before long ~~~ &dA &d@ 2 = "tr" start, no accidental &dA &d@ 3 = "tr" start, with sharp &dA &d@ 4 = "tr" start, with natural &dA &d@ 5 = "tr" start, with flat &dA &dA &d@ try(.) = vertical displacement from associated object &dA &dA &d@ To deal with the case of overlapping trills (one long trill ends &dA &d@ where the next begins), we have introduced the arrays: &dA &dA &d@ pre_tsnum(.) = prelimary storage for tsnum(.) &dA &d@ pre_ctrarrf(.) = prelimary storage for ctrarrf(.) &dA &d@ pre_try(.) = prelimary storage for try(.) &dA &dA &d@ for storing temporarily the associated values of tsnum, ctrarrf &dA &d@ and try. &dA &dA &dA &d@ Description of smusdir(30,4) &dA &dA &d@ There are actually 6 musical direction super-objects: wedges, &dA &d@ dashes, octave-up transposition, octave-down transposition, 15-up &dA &d@ transposition, and 15-down transposition. We may encounter these &dA &d@ in any one of up to 5 passes. Therefore the first dimension is &dA &d@ (super-object type - 1) * 5 + pass-number. If there is no pass &dA &d@ number, then the first available row starting at 1 will be used &dA &d@ (i.e., assume pass 1 first, then pass 2, etc.). If the row for &dA &d@ a particular pass is in use, then use the next higher one, etc. &dA &d@ If no rows are available, this should halt the program. &dA &dA &d@ Desciption of the second element: &dA &dA &d@ smusdir(.,1) = snum (0 = inactive, > 0 = active) &dA &d@ smusdir(.,2) = spread (Wedges) &dA &d@ = word space (Dashes) &dA &d@ = 0 (Oct-up) &dA &d@ = 1 (Oct-down) &dA &d@ = 2 (15-up) &dA &d@ = 3 (15-down) &dA &d@ smusdir(.,3) = offset (Wedges) &dA &d@ = font number (Dashes) &dA &d@ = x-offset (Transpositions) &dA &d@ smusdir(.,4) = vertical offset from top of staff &dA &dA &d@ Vertical Parameters vpar(.) &dA &d@ ------------------- &dA &dA &d@ vpar(1) = one vertical note space &dA &d@ vpar(2) = two " " spaces &dA &d@ vpar(3) = three " " " &dA &d@ vpar(4) = four " " " &dA &d@ vpar(5) = five " " " &dA &d@ vpar(6) = six " " " &dA &d@ vpar(7) = seven " " " &dA &d@ vpar(8) = eight " " " &dA &d@ vpar(9) = nine " " " &dA &d@ vpar(10) = ten " " " &dA &d@ vpar(11) = vertical shift for printing multiple rest ends &dA &d@ vpar(12) = vertical correction of dot position, if on staff line &dA &d@ vpar(13) = height parameter for beams &dA &d@ vpar(14) = shift in height for multiple beams &dA &d@ vpar(15) = cutoff of severe up-down pattern under beam &dA &d@ vpar(16) = vertical space between beams &dA &d@ vpar(17) = fudge factor for two/more slanted beams on staff lines &dA &d@ vpar(18) = fudge factor for one slanted beam on staff lines &dA &d@ vpar(19) = maximum rise allowed for beam on one staff line &dA &d@ vpar(20) = minimum rise allowed for beam crossing two staff lines &dA &d@ vpar(21) = minimum rise allowed for beam crossing 3 staff lines &dA &d@ vpar(22) = vertical shift for printing hooks and beams &dA &d@ vpar(23) = shift down for printing italic 8 under treble clef &dA &d@ vpar(24) = minimum stem length that triggers adding to 16th stem &dA &dA &d@ vpar(31) = vertical shift for printing add-flags &dA &d@ vpar(32) = (un-used) &dA &d@ vpar(33) = first level of time words &dA &d@ vpar(34) = (un-used) &dA &d@ vpar(35) = (un-used) &dA &d@ vpar(36) = vertical shift for printing grace size add-flags &dA &d@ vpar(37) = adjustment f/raising 16th beams because of short stems &dA &d@ vpar(38) = minimum for sum of two stems under 2-note beam &dA &d@ vpar(39) = amount to extend stems under 2-note beam (s. vpar(38)) &dA &d@ vpar(40) = height of horizontal ending lines &dA &dA &d@ vertical parameters (continued) vpar(.) &dA &dA &d@ vpar(41) = length of vertical hooks on ending lines &dA &d@ vpar(43) = height of signet sign above staff lines &dA &d@ vpar(44) = height above staff for words, wedges &dA &d@ vpar(45) = height below staff for words, wedges &dA &d@ vpar(46) = height above staff for 8ve &dA &d@ vpar(47) = height below staff for 8ve &dA &d@ vpar(48) = height of figures &dA &d@ vpar(49) = position of first figure &dA &d@ vpar(50) = height of spiccato character &dA &d@ vpar(51) = height of horizontal ~~~~ &dA &d@ vpar(52) = height of turn &dA &d@ vpar(53) = height of tr. trill character &dA &d@ vpar(54) = height of shake &dA &d@ vpar(55) = height of mordent &dA &d@ vpar(56) = height of accidental over ornament &dA &d@ vpar(57) = height of horizontal accent &dA &d@ vpar(58) = height of vertical accent &dA &d@ vpar(59) = height of harmonic character &dA &d@ vpar(60) = height of thumb position character &dA &d@ vpar(61) = height of down bow &dA &d@ vpar(62) = height of up bow &dA &d@ vpar(63) = height of fermata &dA &d@ vpar(64) = height of tuplet number &dA &d@ vpar(65) = vertical shift for adding sixteenth grace rest flag &dA &d@ vpar(66) = default distance between staves of grand staff &dA &d@ vpar(67) = amount to lengthen flag stem with repeater if note is on a space (stem up) &dA &d@ vpar(68) = amount to lengthen flag stem with repeater if note is on a line (stem up) &dA &d@ vpar(69) = location for first repeater on flag stem if note is on a space (stem up) &dA &d@ vpar(70) = location for first repeater on flag stem if note is on a line (stem up) &dA &d@ vpar(71) = amount to lengthen flag stem with 2 repeaters if note is on a space (stem down) &dA &d@ vpar(72) = amount to lengthen flag stem with >2 repeaters if note is on a space (stem down) &dA &d@ vpar(73) = amount to lengthen flag stem with 2 repeaters if note is on a line (stem down) &dA &d@ vpar(74) = amount to lengthen flag stem with >2 repeaters if note is on a line (stem down) &dA &d@ vpar(75) = location for first repeater on flag stem if note is on a space (stem down) &dA &d@ vpar(76) = location for first repeater on flag stem if note is on a line (stem down) &dA &d@ vpar(77) = maximum absolute stopping point for quarter stem with repeater (stem up) &dA &d@ vpar(78) = mimimum absolute stopping point for quarter stem with repeater (stem down) &dA &d@ vpar(79) = slight lengthening of quarter stem with repeater &dA &d@ vpar(80) = more extra lengthening of quarter stem with one repeater &dA &d@ vpar(81) = location of first repeater on quarter stem &dA &d@ vpar(82) = location of tuple number above note or quarter stem with repeaters &dA &d@ vpar(83) = location of tuple number above eight stem with repeaters &dA &dA &d@ New vertical parameters &dA05/17/03&d@ &dA &dA &d@ vpar(84) = vertical shift up for printing square brackets for editorial dynamics &dA &d@ vpar(85) = vertical shift up for printing square brackets for editorial trill &dA &d@ vpar(86) = vertical shift up for printing square brackets for editorial accidentals &dA &d@ vpar(87) = vertical shift up for printing square brackets for turn ornament &dA &d@ vpar(88) = vertical shift up for printing square brackets for shake ornament &dA &d@ vpar(89) = vertical shift up for printing square brackets for mordant ornament &dA &d@ vpar(90) = vertical shift up for printing square brackets for horizontal accent &dA &d@ vpar(91) = vertical shift up for printing square brackets for vertical accent &dA &dA &d@ New vertical parameter &dA11/16/03&d@ &dA &dA &d@ vpar(92) = vertical shift up for printing small parentheses around figures &dA &d@ vpar(93) = vertical shift up for printing large parentheses around figures &dA &dA &dA &dA &d@ vpar(101) = vertical displacement to first line of text &dA &dA &dA &d@ Horizontal Parameters hpar(.) &dA &d@ --------------------- &dA &dA &d@ hpar(1) = shift following accidental natural &dA &d@ hpar(2) = shift following accidental sharp &dA &d@ hpar(3) = shift following accidental flat &dA &d@ hpar(4) = minimum distance between notes &dA &d@ dotted note to note ratio = 12 / 10 &dA &d@ triplet note to note ratio = 9 / 10 &dA &d@ double note to note ratio = 13 / 10 &dA &d@ (cf. determine spacing) &dA &d@ hpar(5) = distance from beginning of staff lines to 1st character &dA &d@ hpar(6) = shift following accidental natural-sharp &dA &d@ hpar(7) = shift following accidental natural-flat &dA &d@ hpar(8) = shift after big clef sign &dA &d@ hpar(9) = shift following sharp or natural in key signature &dA &d@ hpar(10) = shift following accidental double sharp &dA &d@ hpar(11) = shift following flat in key signature &dA &d@ hpar(12) = shift after key signature &dA &d@ hpar(13) = shift if no key signature or key change &dA &d@ hpar(14) = shift following common or cut time signature &dA &d@ hpar(15) = shift following accidental double flat &dA &d@ hpar(16) = shift to middle of double digit time signature &dA &d@ hpar(17) = shift to middle of single digit time signature &dA &d@ hpar(18) = shift after time signature &dA &d@ hpar(19) = shift for printing staccato and spiccato at stem end (New &dA05/14/05&d@) &dA &d@ hpar(20) = shift for large number &dA &d@ hpar(21) = half shift for large number &dA &d@ hpar(22) = shift before printing multiple rest &dA &d@ hpar(23) = shift after printing multiple rest &dA &d@ hpar(24) = shift before printing whole measure rest &dA &d@ hpar(25) = shift for complete whole measure rest &dA &d@ hpar(26) = space taken up by up flag &dA &d@ hpar(27) = extra shift for dot under flag &dA &d@ hpar(28) = extra shift after note with stem-up flag &dA &d@ hpar(29) = minimum separation between previous object and accidental &dA &d@ hpar(30) = shift for dot after half or whole rest &dA &d@ hpar(31) = shift for dot after quarter or smaller rest &dA &d@ hpar(32) = shift for dot after whole note or larger &dA &d@ hpar(33) = shift for dot after half note or smaller note &dA &d@ hpar(34) = horizontal correction of dot position, if on staff line &dA &d@ hpar(35) = minimum space following projecting flag &dA &d@ hpar(36) = space before bar line &dA &d@ hpar(37) = space after bar line &dA &d@ hpar(38) = length of beam hook character &dA &d@ hpar(39) = placement of movement word &dA &d@ hpar(40) = shift for the first natural/flat of a double accidental &dA &d@ hpar(41) = gap between ending line and measure line &dA &d@ hpar(42) = gap between end of long trill and next object &dA &d@ hpar(43) = distance between repeat sign and bar line &dA &d@ hpar(44) = space between light bar and light bar &dA &d@ hpar(45) = space between heavy bar and light bar, or light bar and heavy bar, or two heavy bars &dA &d@ hpar(46) = space between end of wedge and dynamic &dA &d@ hpar(47) = space between end of 8ve and next object &dA &d@ hpar(48) = space between end of continuation and bar line &dA &d@ hpar(49) = space add to left side of note heads to further separate them &dA &d@ from previous objects (implemented, because the separation &dA &d@ of hpar(29) alone is not enough between note heads) &dA &dA &d@ hpar(51) = width of quarter note (approximately) &dA &d@ hpar(52) = shift of small italic 8 for octave treble clef &dA &d@ hpar(53) = approximate width of grace note &dA &d@ hpar(54) = right shift for adding sixteenth rest flag &dA &d@ hpar(55) = not used &dA &d@ hpar(56) = length of standard beam character &dA &d@ hpar(57) = back shift before concatination character &dA &d@ hpar(58) = space between words &dA &d@ hpar(59) = back shift before last "__" of continuous underline &dA &d@ hpar(60) = width of dynamic letter p &dA &d@ hpar(61) = width of dynamic letter m &dA &d@ hpar(62) = width of dynamic letter f &dA &d@ hpar(63) = width of dynamic letter s &dA &d@ hpar(64) = width of dynamic letter z &dA &d@ hpar(65) = width of dynamic letter r &dA &d@ hpar(66) = width of number figure &dA &d@ hpar(67) = width of small plus figure &dA &d@ hpar(68) = width of small x figure &dA &d@ hpar(69) = width of two-plus figure &dA &d@ hpar(70) = width of figured sharp &dA &d@ hpar(71) = width of four-plus figure &dA &d@ hpar(72) = width of five-plus figure &dA &d@ hpar(73) = width of six-slash figure &dA &d@ hpar(74) = width of seven-slash figure &dA &d@ hpar(75) = width of figured natural &dA &d@ hpar(76) = width of figured flat &dA &d@ hpar(77) = overlap if figure continuation line &dA &d@ hpar(78) = right shift if slur interferes with stem &dA &d@ hpar(79) = actual thickness of light bar line &dA &d@ hpar(80) = thickness of dot &dA &d@ hpar(81) = actual thickness of heavy bar line &dA &d@ hpar(82) = width of black note (for typesetting) &dA &d@ hpar(83) = width of whole note (for typesetting) &dA &d@ hpar(84) = width of breve note (for typesetting) &dA &d@ hpar(85) = space between stems (for typesetting) &dA &d@ hpar(86) = width of big clef sign (approximate) &dA &d@ hpar(87) = width of whole rest and half rest &dA &d@ hpar(88) = width of quarter rest and eight rest &dA &d@ hpar(89) = right shift for adding sixteenth grace rest flag &dA &d@ hpar(90) = width of stem &dA &d@ hpar(91) = shift to second dot of double dot &dA &d@ hpar(92) = width of common and cut time glyph &dA &d@ hpar(93) = width of bar line &dA &d@ hpar(94) = minimum extra shift, when accidental occurs on note of minimum space &dA &d@ hpar(95) = "chip" off of note shape &dA &d@ hpar(96) = width of heavy bar line &dA &d@ hpar(97) = standard spacing between grace notes &dA &d@ hpar(98) = amount by which repeater protrudes from stem &dA &d@ hpar(99) = offset of repeater for eighth notes (stem up) &dA &d@ hpar(100) = offset of repeater for eighth notes (stem down) &dA &d@ hpar(101) = offset of repeater for quarter notes (stem down) &dA &d@ hpar(102) = offset for printing tuple number above stem with repeater &dA &d@ hpar(103) = offset for printing tuple number above note with repeater &dA &d@ hpar(104) = back shift for printing two tuple numbers &dA &d@ hpar(105) = forward shift for printing second of two tuple numbers &dA &d@ hpar(106) = forward shift for printing second of two leger lines (for note on line) &dA &d@ hpar(107) = forward shift for printing second of two leger lines (for note on space) &dA &dA &d@ New horizontal parameters &dA05/17/03&d@ &dA &dA &d@ hpar(108) = width of editorial dynamic letter p &dA &d@ hpar(109) = width of editorial dynamic letter m &dA &d@ hpar(110) = width of editorial dynamic letter f &dA &d@ hpar(111) = width of editorial dynamic letter s &dA &d@ hpar(112) = width of editorial dynamic letter z &dA &d@ hpar(113) = width of editorial dynamic letter r &dA &d@ hpar(114) = backup to print square bracket for editorial p [p... &dA &d@ hpar(115) = backup to print square bracket for editorial m [m... &dA &d@ hpar(116) = backup to print square bracket for editorial f [f... &dA &d@ hpar(117) = backup to print square bracket for editorial s [sf &dA &d@ hpar(118) = backup to print square bracket for editorial r [rf &dA &d@ hpar(119) = shift to print square bracket following editorial f f] &dA &d@ hpar(120) = shift to print square bracket following editorial p p] &dA &d@ hpar(121) = shift to print square bracket following editorial z z] &dA &d@ hpar(122) = backup to print square bracket for editorial tr [tr] &dA &d@ hpar(123) = shift to print square bracket following editorial tr [tr] &dA &d@ hpar(124) = backup to print square bracket for editorial accidental &dA &d@ hpar(125) = shift to print square bracket following editorial accidental &dA &d@ hpar(126) = backup to print square bracket for turn ornament &dA &d@ hpar(127) = shift to print square bracket following turn ornament &dA &d@ hpar(128) = backup to print square bracket for shake ornament &dA &d@ hpar(129) = shift to print square bracket following shake ornament &dA &d@ hpar(130) = backup to print square bracket for mordant ornament &dA &d@ hpar(131) = shift to print square bracket following mordant ornament &dA &d@ hpar(132) = backup to print square bracket for horizontal accent &dA &d@ hpar(133) = shift to print square bracket following horizontal accent &dA &d@ hpar(134) = backup to print square bracket for vertical accent &dA &d@ hpar(135) = shift to print square bracket following vertical accent &dA &dA &d@ New horizontal parameters &dA11/16/03&d@ &dA &dA &d@ hpar(136) = backup to print small left parenthesis in front of figure &dA &d@ hpar(137) = shift to print small right parenthesis after figure &dA &d@ hpar(138) = backup to print large left parenthesis in front of figures &dA &d@ hpar(139) = shift to print large right parenthesis after figures &dA &dA &d@ New horizontal parameters &dA11/18/08&d@ etc. &dA &dA &d@ hpar(140) = width of dynamic letter f in ff combinations &dA &dA &d@ Vertical parameters &dA &d@ ------------------- &dA &dA &d@ loop for i = 1 to 10 &dA &d@ vpar(i) = i * 8 &dA &d@ repeat &dA &d@ vpar(11) = 4 &dA &d@ vpar(12) = 7 &dA &d@ vpar(13) = 42 &dA &d@ vpar(14) = 7 &dA &d@ vpar(15) = 30 &dA &d@ vpar(16) = 13 &dA &d@ vpar(17) = 6 &dA &d@ vpar(18) = 9 &dA &d@ vpar(19) = 7 &dA &d@ vpar(20) = 22 &dA &d@ vpar(21) = 27 &dA &d@ vpar(22) = 4 &dA &d@ vpar(23) = 64 &dA &d@ vpar(24) = 40 &dA &dA &d@ loop for i = 1 to 24 &dA &d@ vpar(i) = vpar(i) * notesize / 16 &dA &d@ repeat &dA &dA &d@ vpar(31) = 14 * notesize + 8 / 16 &dA &d@ vpar(32) = 0 /* was 8 &dA &d@ vpar(33) = 5 * notesize / 3 &dA &d@ vpar(34) = 0 /* was 121 &dA &d@ vpar(35) = 0 /* was 15 &dA &d@ vpar(36) = 12 * notesize + 6 / 16 &dA &d@ vpar(37) = 3 * notesize - 8 / 16 &dA &d@ vpar(38) = 84 * notesize / 16 &dA &d@ vpar(39) = 15 * notesize / 16 &dA &d@ vpar(40) = 3 * notesize &dA &d@ vpar(41) = 3 * notesize / 2 &dA &d@ vpar(43) = 5 * notesize / 2 &dA &d@ vpar(44) = 5 * notesize / 2 &dA &d@ vpar(45) = 8 * notesize &dA &d@ vpar(46) = 4 * notesize &dA &d@ vpar(47) = 10 * notesize &dA &d@ vpar(48) = 3 * notesize / 2 &dA &d@ vpar(49) = 7 * notesize &dA &d@ vpar(50) = notesize &dA &d@ vpar(51) = notesize &dA &d@ vpar(52) = 3 * notesize / 2 &dA &d@ vpar(53) = 2 * notesize &dA &d@ vpar(54) = 3 * notesize / 2 &dA &d@ vpar(55) = 3 * notesize / 2 &dA &d@ vpar(56) = 4 * notesize / 3 &dA &d@ vpar(57) = 3 * notesize / 2 &dA &d@ vpar(58) = 3 * notesize / 2 &dA &d@ vpar(59) = 3 * notesize / 2 &dA &d@ vpar(60) = 3 * notesize / 2 &dA &d@ vpar(61) = 3 * notesize / 2 &dA &d@ vpar(62) = 9 * notesize / 4 &dA &d@ vpar(63) = 2 * notesize &dA &d@ vpar(64) = 3 * notesize / 2 &dA &d@ vpar(65) = 11 (for notesize 14) 4 (for notesize 6) &dA &d@ vpar(66) = 10 * notesize &dA &d@ vpar(67) = 8 (for notesize 14) &dA &d@ vpar(68) = 5 (for notesize 14) &dA &d@ vpar(69) = 21 (for notesize 14) &dA &d@ vpar(70) = 18 (for notesize 14) &dA &d@ vpar(71) = 2 (for notesize 14) &dA &d@ vpar(72) = 1 (for notesize 14) &dA &d@ vpar(73) = 6 (for notesize 14) &dA &d@ vpar(74) = 5 (for notesize 14) &dA &d@ vpar(75) = 21 (for notesize 14) &dA &d@ vpar(76) = 17 (for notesize 14) &dA &d@ vpar(77) = 19 (for notesize 14) &dA &d@ vpar(78) = 24 (for notesize 14) &dA &d@ vpar(79) = 2 (for notesize 14) &dA &d@ vpar(80) = 1 (for notesize 14) &dA &d@ vpar(81) = 19 (for notesize 14) &dA &d@ vpar(82) = 17 (for notesize 14) &dA &d@ vpar(83) = 33 (for notesize 14) &dA &dA &d@ New vertical parameters &dA05/17/03&d@ &dA &dA &d@ vpar(84) = 5 (for notesize 14) &dA &d@ vpar(85) = 8 (for notesize 14) &dA &d@ vpar(86) = 8 (for notesize 14) &dA &d@ vpar(87) = 6 (for notesize 14) &dA &d@ vpar(88) = 5 (for notesize 14) &dA &d@ vpar(89) = 10 (for notesize 14) &dA &d@ vpar(90) = 7 (for notesize 14) &dA &d@ vpar(91) = 6 (for notesize 14) &dA &d@ vpar(92) = 7 (for notesize 14) &dA &d@ vpar(93) = 3 (for notesize 14) &dA &dA &d@ vpar(101) = 101 &dA &dA &d@ Horizontal parameters &dA &d@ --------------------- &dA &dA &d@ hpar(1) = 17 &dA &d@ hpar(2) = 21 &dA &d@ hpar(3) = 18 &dA &d@ hpar(4) = 34 &dA &d@ hpar(5) = 6 &dA &d@ hpar(6) = 38 &dA &d@ hpar(7) = 35 &dA &d@ hpar(8) = 60 &dA &d@ hpar(9) = 18 &dA &d@ hpar(10) = 24 &dA &d@ hpar(11) = 15 &dA &d@ hpar(12) = 19 &dA &d@ hpar(13) = 4 &dA &d@ hpar(14) = 55 &dA &d@ hpar(15) = 35 &dA &d@ hpar(16) = 25 &dA &d@ hpar(17) = 11 &dA &d@ hpar(18) = 33 &dA &d@ hpar(19) = 8 /* New &dA05/14/05&d@ &dA &d@ hpar(20) = 24 &dA &d@ hpar(21) = 12 &dA &d@ hpar(22) = 10 &dA &d@ hpar(23) = 30 &dA &d@ hpar(24) = 30 &dA &d@ hpar(25) = 110 &dA &d@ hpar(26) = 15 &dA &d@ hpar(27) = 12 &dA &d@ hpar(28) = 5 &dA &d@ hpar(29) = 9 &dA &d@ hpar(30) = 36 &dA &d@ hpar(31) = 24 &dA &d@ hpar(32) = 37 &dA &d@ hpar(33) = 29 &dA &d@ hpar(34) = 2 &dA &d@ hpar(35) = 44 &dA &d@ hpar(36) = 5 &dA &d@ hpar(37) = 25 &dA &d@ hpar(38) = 18 &dA &d@ hpar(39) = 80 &dA &d@ hpar(40) = 17 &dA &d@ hpar(41) = 10 &dA &d@ hpar(42) = 32 &dA &d@ hpar(43) = 15 &dA &d@ hpar(46) = 20 &dA &d@ hpar(47) = 14 &dA &d@ hpar(48) = 30 &dA &d@ hpar(49) = 3 &dA &dA &d@ loop for i = 1 to 50 &dA &d@ hpar(i) = hpar(i) * notesize / 16 &dA &d@ repeat &dA &dA &d@ hpar(44) = 6 (for notesize = 14) &dA &d@ hpar(45) = 5 (for notesize = 14) &dA &dA &d@ hpar(51) = 18 * notesize + 8 / 16 &dA &d@ hpar(52) = 7 * notesize + 2 / 7 &dA &d@ hpar(53) = 13 * notesize + 2 / 16 &dA &d@ hpar(54) = 4 &dA &d@ hpar(55) = 0 /* not used, formerly 80 &dA &d@ hpar(56) = 30 &dA &d@ hpar(57) = 3 &dA &d@ hpar(58) = 16 (for notesize 14) &dA &d@ hpar(59) = 0 (not used) &dA &d@ hpar(60) = 23 (for notesize 14) &dA &d@ hpar(61) = 25 (for notesize 14) &dA &d@ hpar(62) = 19 (for notesize 14) &dA &d@ hpar(63) = 12 (for notesize 14) &dA &d@ hpar(64) = 18 (for notesize 14) &dA &d@ hpar(65) = 15 (for notesize 14) &dA &d@ hpar(66) = 15 (for notesize 14) &dA &d@ hpar(67) = 13 (for notesize 14) &dA &d@ hpar(68) = 13 (for notesize 14) &dA &d@ hpar(69) = 22 (for notesize 14) &dA &d@ hpar(70) = 11 (for notesize 14) &dA &d@ hpar(71) = 22 (for notesize 14) &dA &d@ hpar(72) = 22 (for notesize 14) &dA &d@ hpar(73) = 20 (for notesize 14) &dA &d@ hpar(74) = 14 (for notesize 14) &dA &d@ hpar(75) = 9 (for notesize 14) &dA &d@ hpar(76) = 11 (for notesize 14) &dA &d@ hpar(77) = 3 * notesize / 2 &dA &d@ hpar(78) = 4 * notesize / 3 &dA &d@ hpar(79) = 2 (for notesize 14) &dA &d@ hpar(80) = 6 (for notesize 14) &dA &d@ hpar(81) = 7 (for notesize 14) &dA &d@ hpar(82) = 19 (for notesize 14) &dA &d@ hpar(83) = 24 (for notesize 14) &dA &d@ hpar(84) = 28 (for notesize 14) &dA &d@ hpar(85) = 6 (for notesize 14) &dA &d@ hpar(86) = 38 (for notesize 14) &dA &d@ hpar(87) = 27 (for notesize 14) &dA &d@ hpar(88) = 15 (for notesize 14) &dA &d@ hpar(89) = 3 (for notesize 14) &dA &d@ hpar(90) = 2 (for notesize 14) &dA &d@ hpar(91) = 13 (for notesize 14) &dA &d@ hpar(92) = 25 (for notesize 14) &dA &d@ hpar(93) = 2 (for notesize 14) &dA &d@ hpar(94) = hpar(2) >> 2 (4 for notesize 14) &dA &d@ hpar(95) = hpar(85) + hpar(90) >> 1 (4 for notesize 14) &dA &d@ hpar(96) = 7 (for notesize 14) &dA &d@ hpar(97) = 21 (for notesize 14) &dA &d@ hpar(98) = 11 (for notesize 14) &dA &d@ hpar(99) = 1 (for notesize 14) &dA &d@ hpar(100) = hpar(82) - hpar(99) &dA &d@ hpar(101) = hpar(82) - hpar(90) &dA &d@ hpar(102) = 10 (for notesize 14) &dA &d@ hpar(103) = 2 (for notesize 14) &dA &d@ hpar(104) = 9 (for notesize 14) &dA &d@ hpar(105) = 17 (for notesize 14) &dA &d@ hpar(106) = 3 (for notesize 14) &dA &d@ hpar(107) = 1 (for notesize 14) &dA &dA &d@ New horizontal parameters &dA05/17/03&d@ &dA &dA &d@ hpar(108) = 18 (for notesize 14) &dA &d@ hpar(109) = 21 (for notesize 14) &dA &d@ hpar(110) = 15 (for notesize 14) &dA &d@ hpar(111) = 10 (for notesize 14) &dA &d@ hpar(112) = 12 (for notesize 14) &dA &d@ hpar(113) = 12 (for notesize 14) &dA &d@ hpar(114) = 8 (for notesize 14) &dA &d@ hpar(115) = 8 (for notesize 14) &dA &d@ hpar(116) = 11 (for notesize 14) &dA &d@ hpar(117) = 6 (for notesize 14) &dA &d@ hpar(118) = 6 (for notesize 14) &dA &d@ hpar(119) = 7 (for notesize 14) &dA &d@ hpar(120) = 0 (for notesize 14) &dA &d@ hpar(121) = 3 (for notesize 14) &dA &d@ hpar(122) = 11 (for notesize 14) &dA &d@ hpar(123) = 21 (for notesize 14) &dA &d@ hpar(124) = 8 (for notesize 14) &dA &d@ hpar(125) = 13 (for notesize 14) &dA &d@ hpar(126) = 7 (for notesize 14) &dA &d@ hpar(127) = 28 (for notesize 14) &dA &d@ hpar(128) = 8 (for notesize 14) &dA &d@ hpar(129) = 27 (for notesize 14) &dA &d@ hpar(130) = 10 (for notesize 14) &dA &d@ hpar(131) = 27 (for notesize 14) &dA &d@ hpar(132) = 9 (for notesize 14) &dA &d@ hpar(133) = 23 (for notesize 14) &dA &d@ hpar(134) = 9 (for notesize 14) &dA &d@ hpar(135) = 21 (for notesize 14) &dA &d@ hpar(136) = 7 (for notesize 14) &dA &d@ hpar(137) = 15 (for notesize 14) &dA &d@ hpar(138) = 10 (for notesize 14) &dA &d@ hpar(139) = 15 (for notesize 14) &dA &d@ hpar(140) = 17 (for notesize 14) &dA &dA &dA &d@ Description of tsr.TSR_LENG(MAX_OBJECTS) /* &dA05/14/03&d@: size changed to 116 &dA &dA &d@ The purpose of the tsr strings is to store print suggestion data &dA &d@ for the note object and for sub-objects in the note field 32-43. &dA &dA &d@ Note Object &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄ &dA &dA &d@ byte1: bit 0 = control &dA &dA &d@ 0 = no modification of data (default in &dA &d@ 99.9% of all cases) &dA &d@ 1 = possible modification somewhere &dA &d@ &dA &d@ bits 1-4 = print modification code &dA &dA &d@ 0 = no modification &dA &d@ 1 = turn off all sub-objects &dA &d@ 2 = turn off all sub-objects &dA &d@ but print an extension dot &dA &dA &d@ 3-7 = eliminate tie if there is one &dA &d@ 3 = print object, no extension dot &dA &d@ 4 = print object, include extension dot &dA &d@ 5 = double note length, no extension dot &dA &d@ 6 = double note length, include extension dot &dA &d@ 7 = quadruple note length, no extension dot &dA &d@ &dA &d@ byte2: x-y active flags &dA &dA &d@ 0x01: active flag (0 = inactive) &dA &d@ 0x02: 0 = x position is relative &dA &d@ 1 = x position is absolute &dA &d@ 0x04: 0 = y position is relative &dA &d@ 1 = y position is absolute &dA &dA &d@ byte3: modification of horizontal position (from default) &dA &dA &d@ if byte3 >= 128, move notation to the right &dA &d@ by the amount (byte3 - 128) &dA &d@ if byte3 < 128, move notation to the left &dA &d@ by the amount (128 - byte3) &dA &d@ if byte3 = 0, do nothing &dA &dA &d@ byte4: modification of vertical position (from default) &dA &dA &d@ if byte4 >= 128, move notation down by the &dA &d@ amount (byte4 - 128) &dA &d@ if byte4 < 128, move notation up by the &dA &d@ amount (128 - byte4) &dA &d@ if byte4 = 0, do nothing &dA &dA &dA &dA &d@ Sub-objects in the Note Field 32-43 &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &dA &d@ At the moment, there are 19 code catagories for which data &dA05/02/03&d@ &dA &d@ can be stored. Each of these catagories requires 4 bytes. &dA &d@ The data stored in each byte is as follows: &dA &dA &d@ byte1 -- Normal case: &dA &d@ &dA &d@ bit 0 = control &dA &dA &d@ 0 = no modification of data (default in &dA &d@ 99.9% of all cases) &dA &d@ 1 = possible modification somewhere in this byte &dA &d@ &dA &d@ bit 1 = major location change flag &dA &dA &d@ 0 = no change in position relative &dA &d@ to staff (default) &dA &d@ 1 = determine position relative to staff &dA &d@ from bit 2 &dA &dA &d@ bit 2 = position relative to staff &dA &dA &d@ 0 = place notation above staff &dA &d@ 1 = place notation below staff &dA &dA &d@ bit 3 = print flag for score &dA &dA &d@ 0 = print notation in score (default) &dA &d@ 1 = don't print notation in score &dA &dA &d@ bit 4 = print flag for non-score (parts) &dA &dA &d@ 0 = print notation in non-score (default) &dA &d@ 1 = don't print notation in non-score &dA &dA &d@ bit 5 = parentheses flag for score &dA &dA &d@ 0 = no action (default) &dA &d@ 1 = surround notation with parentheses &dA &d@ in score &dA &dA &d@ bit 6 = parentheses flag for non-score (parts) &dA &dA &d@ 0 = no action (default) &dA &d@ 1 = surround notation with parentheses &dA &d@ in non-score (parts) &dA &dA &d@ byte1 -- Ties: &dA &d@ &dA &d@ modification to length of tie (end position) &dA &dA &d@ if byte1 >= 128, make length longer by the &dA &d@ amount (byte1 - 128) &dA &d@ if byte1 < 128, move length shorter by the &dA &d@ amount (128 - byte1) &dA &d@ if byte1 = 0, do nothing to length &dA &dA &d@ byte2: x-y active flags &dA &dA &d@ 0x01: active flag (0 = inactive) &dA &d@ 0x02: 0 = x position is relative &dA &d@ 1 = x position is absolute &dA &d@ 0x04: 0 = y position is relative &dA &d@ 1 = y position is absolute &dA &dA &d@ byte3: modification of horizontal position (from default) &dA &dA &d@ if byte3 >= 128, move notation to the right &dA &d@ by the amount (byte3 - 128) &dA &d@ if byte3 < 128, move notation to the left &dA &d@ by the amount (128 - byte3) &dA &d@ if byte3 = 0, do nothing &dA &dA &d@ byte4: modification of vertical position (from default) &dA &dA &d@ if byte4 >= 128, move notation down by the &dA &d@ amount (byte4 - 128) &dA &d@ if byte4 < 128, move notation up by the &dA &d@ amount (128 - byte4) &dA &d@ if byte4 = 0, do nothing &dA &dA &dA &d@ The code catagories are as follows: &dA &d@ &dA &d@ 1 = legato(_), staccato(.), line with dot(=) &dA &d@ 2 = spiccato: (i) &dA &d@ 3 = accents: horizontal(>), vertical(V), inverted vertical(A) &dA &d@ &dA &d@ 4 = single ornaments: turn(r), trill(t), shake(w), wavy line (~) &dA &d@ mordent(M), delayed turn(k) &dA &d@ 5 = second single ornament &dA &dA &d@ 6 = bowing: up-bow(v), down-bow(n) &dA &d@ 7 = harmonic: string harmonic(o) &dA &d@ 8 = thumb-open: thumb(Q), open-string(0) &dA &d@ 9 = finger1: finger code level 1 &dA &d@ 10 = finger2: finger code level 2 &dA &d@ 11 = finger3: finger code level 3 &dA &d@ 12 = finger4: finger code level 4 &dA &d@ 13 = finger5: finger code level 5 &dA &dA &d@ 14 = dynamics: any dynamic string &dA &dA &d@ 15 = upright fermata: (F) &dA &d@ 16 = inverted fermata: (E) &dA &d@ 17 = tie: (-) &dA04/20/03&d@: added tie to list &dA &d@ 18 = dots: (column 18) &dA &d@ 19 = accidentals: (column 19) &dA &dA &dA &d@ Slurs in the Note Field 32-43 &dA05/06/03&d@ &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &dA &d@ At the moment, there are 8 code catagories for which data &dA &d@ can be stored. Each of these catagories requires 4 bytes. &dA &dA &d@ For codes 20-23 = starting slurs "([{z" the data stored &dA &d@ in each byte is as follows: &dA &dA &d@ byte1: modification of horizontal start of slur (from default) &dA &dA &d@ if byte1 >= 128, move start of slur to the right &dA &d@ by the amount (byte1 - 128) &dA &d@ if byte1 < 128, move start of slur to the left &dA &d@ by the amount (128 - byte1) &dA &d@ if byte1 = 0, do nothing &dA &dA &d@ byte2: modification of vertical start of slur (from default) &dA &dA &d@ if byte2 >= 128, move start of slur down by the &dA &d@ amount (byte2 - 128) &dA &d@ if byte2 < 128, move start of slur up by the &dA &d@ amount (128 - byte2) &dA &d@ if byte2 = 0, do nothing &dA &dA &d@ byte3: modification of horizontal position of slur (from default) &dA &dA &d@ if byte3 >= 128, move entire slur to the right &dA &d@ by the amount (byte3 - 128) &dA &d@ if byte3 < 128, move entire slur to the left &dA &d@ by the amount (128 - byte3) &dA &d@ if byte3 = 0, do nothing &dA &dA &d@ byte4: modification of vertical position of slur (from default) &dA &dA &d@ if byte4 >= 128, move entire slur down by the &dA &d@ amount (byte4 - 128) &dA &d@ if byte4 < 128, move entire slur up by the &dA &d@ amount (128 - byte4) &dA &d@ if byte4 = 0, do nothing &dA &dA &d@ For codes 24-27 = ending slurs ")]}x" the data stored &dA &d@ in each byte is as follows: &dA &dA &d@ byte1: modification of horizontal end of slur (from default) &dA &dA &d@ if byte1 >= 128, move end of slur to the right &dA &d@ by the amount (byte1 - 128) &dA &d@ if byte1 < 128, move end of slur to the left &dA &d@ by the amount (128 - byte1) &dA &d@ if byte1 = 0, do nothing &dA &dA &d@ byte2: modification of vertical end of slur (from default) &dA &dA &d@ if byte2 >= 128, move end of slur down by the &dA &d@ amount (byte2 - 128) &dA &d@ if byte2 < 128, move end of slur up by the &dA &d@ amount (128 - byte2) &dA &d@ if byte2 = 0, do nothing &dA &dA &d@ byte3: modification to curvature (normal range -1 to +5) &dA &d@ &dA &d@ if byte1 >= 128, increase stock slur number by &dA &d@ amount (byte1 - 128). Up to a &dA &d@ point, this will add to the curvature &dA &d@ if byte1 < 128, decrease stock slur number by &dA &d@ amount (128 - byte2). This may have &dA &d@ the effect of flattening the slur slightly &dA &d@ if byte1 = 0, do nothing to length &dA &dA &dA &d@ Beams in the Note Field 26 /* New &dA05/14/03&d@ &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &dA &d@ code = 28 &dA &dA &d@ byte2: modification of first stem length (from default, as calculated &dA &d@ by mskpage or mkpart) &dA &dA &d@ if byte2 >= 128, lengthen stem by the amount (byte2 - 128) &dA &d@ (tenths of interline distance) &dA &d@ if byte2 < 128, shorten stem by the amount (byte2 - 128) &dA &d@ (tenths of interline distance) &dA &d@ if byte2 = 0 do nothing &dA &dA &dA &dA &dA &dA &d@ Vertical Parameters for guessing beam positions &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &dA &d@ bvpar(16) = height parameter for beams &dA &d@ bvpar(17) = decrease in bvpar(16) when range of notes exceeds vpar(3) &dA &d@ bvpar(18) = cutoff of wevere up-down pattern under beam &dA &d@ bvpar(20) = amount to add to beam height to get stradle &dA &d@ bvpar(22) = fudge factor for two/more slanted beams on staff lines &dA &d@ bvpar(23) = fudge factor for one slanted beam on staff lines &dA &d@ bvpar(24) = maximum rise allowed for beam on one staff line &dA &d@ bvpar(25) = minimum rise allowed for beam crossing two staff lines &dA &d@ bvpar(26) = minimum rise allowed for beam crossing three staff lines &dA &d@ bvpar(29) = minimum stem length that triggers adding to 16th stem &dA &d@ bvpar(30) = adjustment for raising 16th beams because of short stems &dA &d@ bvpar(31) = beam thickness &dA &d@ bvpar(32) = offset between beams (if two or three) &dA &d@ bvpar(33) = offset between beams (if more than three in staff line) &dA &d@ bvpar(34) = amount by which a hanging beam exceeds line height &dA &d@ bvpar(35) = maximum beam slope for short beams &dA &dA &dA &dA &d@ Explanation of Variables for NEWFONTS &dA03/19/04&d@ &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &d@ nsizes(12) = The 12 available note sizes. Currently four sizes are available &dA &d@ 3 [06], 8 [14], 10 [18], and 11 [21] (as of &dA12/18/04&d@) &dA &d@ revsizes(24) = The reverse map to nsizes &dA &d@ XFonts(12,19) = The number of 10s and the 6 x 3 (sizes, styles) for each notesize &dA &d@ XFontstr.76(12) = XFont data in string form &dA &d@ Fspacex(90) = index from (TMS font number - 50) to record in fontspac(.) &dA &d@ kernmap(52,26) = kerning data for current font &dA &d@ kernfiles.360 = names of kern files &dA &dA &dA &dA &d@ Variables added 03-20-03 for additional code required by autoscr &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &dA &d@ Description of measuremap(MAX_MEAS,5) &dA &d@ &dA &d@ For each measure, we need to know how many tracks are active, &dA &d@ and in the case of the grand staff, which staff should be &dA &d@ considered the primary staff in that measure. &dA &d@ &dA &d@ Parameter 1 = number of tracks active in this measure &dA &d@ &dA &d@ For each measure, we also need to know of any "time gaps" &dA &d@ for any of the active tracks in the measure. &dA &d@ &dA &d@ Parameter 2 = number of time gaps in measure &dA &d@ Parameter 3 = zero, if no time gaps &dA &d@ = pointer to timegap data if present &dA &d@ &dA &d@ For each measure, we also need to know the number of divisions &dA &d@ in the measure, and the number of divisions per quarter. &dA &d@ &dA &d@ Parameter 4 = number of divisions in the measure &dA &d@ Parameter 5 = number of divisions per quarter &dA &d@ &dA &dA &d@ Description of trackstave(MAX_MEAS,9,3) &dA &d@ &dA &d@ Trackstave data consists of three numbers for each of 9 possible tracks &dA &d@ &dA &d@ Parameter 1 = relative time spent on staff 1 &dA &d@ Parameter 2 = relative time spent on staff 2 &dA &d@ Parameter 3 = primary staff for this track in this measure &dA &d@ &dA &d@ Description of timegaps(15000,3) &dA &d@ &dA &d@ Timegaps data consists of groups of three numbers. &dA &d@ &dA &d@ Parameter 1 = track number &dA &d@ Parameter 2 = start of time for this timegap &dA &d@ Parameter 3 = length of time gap &dA &d@ &dA &d@ Description of pointers &dA &d@ &dA &d@ barnum = pointer into measuremap(.,.) and trackstave(.,.,.) &dA &d@ barnum2 = second counter of measure bars &dA &d@ opbarnum = operative barnum at typesetting stage (changed when new bar is typeset) &dA &d@ tgpnt = pointer into timegaps(.,.) &dA &dA &d@ Description of other variables &dA &dA &d@ staves = number of staves for this file (1 or 2) &dA &d@ track = current track number &dA &d@ staff = current staff number &dA &d@ durflag = flag that a duration has occurred in a measure &dA &d@ trackdivpnt(9) = division pointer for up to nine simultaneous tracks &dA &dA &d@ jscrdat = line of SCORE data appended to end of object records &dA &d@ kscrdat = line of SCORE data appended to end of sub-object records &dA &d@ scr_qwidth = width of a SCORE quarter note is 9/10 MUSEDATA quarter &dA &dA &d@ how_much_mrest(2) = the divspq and divspm for a section of mrest. &dA &d@ this is needed to construct the P7 parameter &dA &d@ for multiple rests. &dA &dA &d@ str header1.80 = first header record &dA &d@ str header2.80 = second header record &dA &d@ str header3.80 = third header record &dA &d@ str composer = composer name &dA &d@ str comp_names(.)= list of supported composers &dA &dA &d@ (int) composer_num = composer number 1 = J.S.Bach &dA &d@ 2 = G.F.Handel &dA &d@ 3 = J. Haydn &dA &d@ 4 = L. Beethoven &dA &d@ track_flag = indicates presence of track assignments in stage2 file &dA &d@ track_assign(9) = automatic assignment of tracks to staves &dA &dA &dA &d@ initialization of these parameters &dA &d@ ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ &dA &dA &dA &dA &d@ New code &dA03/19/04&d@ &dA revsizes(1) = 1 revsizes(2) = 1 revsizes(3) = 1 revsizes(4) = 1 revsizes(5) = 2 revsizes(6) = 3 revsizes(7) = 4 revsizes(8) = 5 revsizes(9) = 6 revsizes(10) = 6 revsizes(11) = 7 revsizes(12) = 7 revsizes(13) = 8 revsizes(14) = 8 revsizes(15) = 9 revsizes(16) = 9 revsizes(17) = 10 revsizes(18) = 10 revsizes(19) = 10 revsizes(20) = 11 revsizes(21) = 11 revsizes(22) = 11 revsizes(23) = 12 revsizes(24) = 12 &dA &dA &d@ start with notesize, and a number 30 to 48 (19 possibilities) &dA &d@ want a font number, that's all &dA XFontstr(1) = " 51 51 81 111 51 81 111 52 82 112 53 83 113 54 84 114 56 86 116" XFontstr(2) = " 51 52 82 112 53 83 113 54 84 114 55 85 115 56 86 116 58 88 118" XFontstr(3) = " 51 54 84 114 55 85 115 56 86 116 57 87 117 58 88 118 60 90 120" XFontstr(4) = " 52 55 85 115 57 87 117 58 88 118 59 89 119 60 90 120 63 93 123" XFontstr(5) = " 53 57 87 117 58 88 118 59 89 119 61 91 121 62 92 122 64 94 124" XFontstr(6) = " 55 59 89 119 61 91 121 63 93 123 64 94 124 65 95 125 68 98 128" XFontstr(7) = " 57 62 92 122 64 94 124 65 95 125 67 97 127 69 99 129 72 102 132" XFontstr(8) = " 58 64 94 124 66 96 126 68 98 128 70 100 130 72 102 132 74 104 134" XFontstr(9) = " 60 67 97 127 69 99 129 71 101 131 73 103 133 74 104 134 76 106 136" XFontstr(10) = " 61 69 99 129 71 101 131 73 103 133 74 104 134 75 105 135 78 108 138" XFontstr(11) = " 64 72 102 132 74 104 134 75 105 135 77 107 137 78 108 138 79 109 139" XFontstr(12) = " 65 74 104 134 75 105 135 77 107 137 78 108 138 79 109 139 80 110 140" loop for i = 1 to 12 sub = 1 loop for j = 1 to 19 XFonts(i,j) = int(XFontstr(i){sub..}) repeat repeat loop for a1 = 1 to 30 Fspacex(a1) = (a1 - 1) * 10 + 1 Fspacex(a1+30) = Fspacex(a1) + 400 Fspacex(a1+60) = Fspacex(a1) + 800 repeat kernfiles = "S024S027S031S034S037S041S044S048S054S058S061S065S068S075S082" kernfiles = kernfiles // "S085S088S095S098S105S109S115S119S132S146S153S160S173S203S231" kernfiles = kernfiles // "B025B028B032B035B039B042B046B049B053B056B060B064B067B074B081" kernfiles = kernfiles // "B085B088B095B099B106B109B116B120B134B145B152B159B173B205B229" kernfiles = kernfiles // "I024I027I031I034I037I041I044I048I054I058I061I065I068I075I082" kernfiles = kernfiles // "I085I088I095I098I105I109I115I119I132I146I153I160I173I203I231" kernfiles = lcs(kernfiles) &dA &dA &d@ End of &dA03/19/04&d@ material &dA &d@ &dA version = VERSION #if AUTOSCR ligit_flag = 0 comp_names(1) = "J.S.Bach" comp_names(2) = "G.F.Handel" comp_names(3) = "J. Haydn" comp_names(4) = "L. Beethoven" loop for i = 1 to 9 track_assign(i) = 0 repeat putc putc &dEÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»&d@ putc &dEº MUSEDATA to SCORE conversion process º&d@ putc &dEº ==================================== º&d@ putc &dEÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ&d@ putc putc Part I: Building non page specific I-files from stage2 files putc putc The home directory for this window should be directory putc of the &dEmusical work&d@ you are converting. The directory putc should contain the sub-directories &dESTAGE2&d@ and &dEOUTPUTS&d@. putc putc ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ putc putc You are about to create a (set of) SCORECON I-file(s). This program putc is in development and may incur changes. For revision control purposes, putc please enter the current date (xx/xx/xx will work). You may also enter putc your name or initials, if you choose. putc Example: 04/01/03 by W Hewlett getc line putc header1 = "SCORECON I-FILE. created: " // line putc Composers currently supported by this program putc 1 = J.S.Bach putc 2 = G.F Handel putc 3 = J. Haydn putc 4 = L. Beethoven putc putc Please indicate the composer by entering the appropriate number. If the putc composer is not on the list, simply type Enter. getc composer_num if composer_num = 0 or composer_num > 4 putc &dANote:&d@ Header records for this conversion may not be constructed in a putc standardized manner. Please let Eleanor know that your are putc doing this conversion, so that we can add the name to our list. putc Enter the composer's name now. getc composer else composer = comp_names(composer_num) end #else ligit_flag = LIGIT putc Musical Database Typesetting Program putc #endif Q1: notesize = 14 mtfont = 31 tword_height = 6 twfont = 34 abflg = 2 cfactor = 100 sizenum = revsizes(notesize) #if AUTOSCR #else putc Enter note size ( = 14: x = non standard parameters) getc line line = trm(line) if line <> "" if line = "x" putc Notesize? getc notesize putc Text font? (usually 31) getc mtfont putc Time word font? (usually 34) getc twfont putc Number of beats in alle breve time? (usually 2) getc abflg if abflg <> 4 abflg = 2 end else notesize = int(line) if chr(notesize) not_in [6,14,16,18,21] /* Code modified &dA12/31/08 putc Note size of ~notesize is not supported at this time. putc Supported sizes are 6, 14, 16, 18, and 21 putc goto Q1 end end end sizenum = revsizes(notesize) /* New &dA03/19/04&d@ putc Compression factor ( = none) getc line line = trm(line) if line <> "" cfactor = int(line) if cfactor = 0 cfactor = 100 end end #endif bvpar(16) = 3 * notesize bvpar(17) = notesize / 2 bvpar(18) = 30 * notesize / 16 bvpar(20) = notesize / 2 + 1 / 2 bvpar(22) = 6 * notesize / 16 bvpar(23) = 9 * notesize / 16 bvpar(24) = 7 * notesize / 16 bvpar(25) = 22 * notesize / 16 bvpar(26) = 27 * notesize / 16 bvpar(29) = 38 * notesize / 16 bvpar(30) = 3 * notesize - 8 / 16 bvpar(31) = notesize / 2 + 1 bvpar(32) = notesize * 8 + 4 / 10 bvpar(33) = notesize * 12 + 10 / 14 bvpar(34) = notesize - 3 / 9 bvpar(35) = notesize / 3 curfont = 0 &dA &dA &d@ initialization &dA &d@ ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ &dA &dA &d@ Vertical and horizontal parameters &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ file = DISP_DISK // ":/release/progs/proofpar/" // chs(notesize) open [1,1] file loop for i = 1 to 200 getf [1] vpar(i) repeat loop for i = 1 to 200 getf [1] hpar(i) repeat vpar20 = 2 * vpar(10) scr_qwidth = hpar(82) * 9 / 10 #if BIG16 if notesize = 16 ++hpar(51) /* width of quarter note (approximately) ++hpar(82) /* width of black note (for typesetting) ++hpar(83) /* width of whole note (for typesetting) ++hpar(84) /* width of breve note (for typesetting) end #endif #if CUSTOM_PAR if notesize = 14 vpar(101) = 111 end if notesize = 16 vpar(101) = 126 end if notesize = 18 /* size-18 added &dA12/18/04&d@ vpar(101) = 141 end if notesize = 21 vpar(101) = 171 end #endif &dA &dA &d@ Other parameters and variables &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA loop for i = 1 to 9 getf [1] wak(i) repeat loop for i = 1 to 2 loop for j = 1 to 6 getf [1] zak(i,j) repeat repeat close [1] claves = "CDEFGAB" numbers = "0123456789" accs = " #f" slurstr = "FpmFjoiOlpmFooiOphpFokoiffnFggnHFfFFIgGJcceBdddQBaAPEdQQcbeedddM" slurstr = slurstr // "KaNKddNMBaAAECCDlpmFIGGOlpmFOGOOphpFoiGHffnFggNH" slurstr = slurstr // "FfFFIgGJcceBECQQcdeAECQQcbeeddLMKaNKMdNMAaAAECCD" slurunder = "FHHFIGOOFHHFIGOOFNFFINGGFFNFIGNHFFFFIGGJBBBBECCQ" slurunder = slurunder // "BBBBECCQKCKKQNLMKKNKMLNMBKAAECCD" slurover = "lpppjoiolpppjoiophppokoiffnrggngffsngggncceedddd" slurover = slurover // "cceeddddcbeeddddcanaddndcaendddn" &dA &dA &d@ Meaning of curvedata: Curvedata is meant to describe the &dA &d@ approximate shape of slurs for various situations. The slurs &dA &d@ begin described are (flat) tips down. The end points are &dA &d@ assumed to be 0 and are therefore not included. A slur between &dA &d@ two notes need not be described, so that the first relevant &dA &d@ description is a slur between three notes. &dA &dA &d@ The first dimension of curvedata contains the number of notes &dA &d@ under the slur (not counting the end points). The second &dA &d@ dimension contains a number representing the curvature of the &dA &d@ slur (from 1 to 4). The third dimension contains the specific &dA &d@ note number for the height data. This number will range from &dA &d@ 1 to the number of notes under the slur (not counting the end &dA &d@ points). &dA &dA &dA &d@ Curvedata for notesize = 14 &dA curvedata(1,1,1) = 10 curvedata(1,2,1) = 14 curvedata(1,3,1) = 18 curvedata(1,4,1) = 22 curvedata(2,1,1) = 8 curvedata(2,2,1) = 12 curvedata(2,3,1) = 16 curvedata(2,4,1) = 20 curvedata(3,1,1) = 10 /* 8 curvedata(3,1,2) = 12 /* 12 curvedata(3,2,1) = 12 /* 10 curvedata(3,2,2) = 16 /* 16 curvedata(3,3,1) = 14 /* 12 curvedata(3,3,2) = 20 /* 20 curvedata(3,4,1) = 17 /* 15 curvedata(3,4,2) = 24 /* 24 curvedata(4,1,1) = 9 /* 7 curvedata(4,1,2) = 12 /* 12 curvedata(4,2,1) = 11 /* 10 curvedata(4,2,2) = 16 /* 16 curvedata(4,3,1) = 13 /* 12 curvedata(4,3,2) = 20 /* 20 curvedata(4,4,1) = 16 /* 15 curvedata(4,4,2) = 24 /* 24 curvedata(5,1,1) = 8 /* 6 curvedata(5,1,2) = 13 /* 12 curvedata(5,1,3) = 14 /* 13 curvedata(5,2,1) = 11 /* 9 curvedata(5,2,2) = 16 /* 15 curvedata(5,2,3) = 18 /* 17 curvedata(5,3,1) = 13 /* 11 curvedata(5,3,2) = 19 /* 19 curvedata(5,3,3) = 21 /* 21 curvedata(5,4,1) = 16 /* 14 curvedata(5,4,2) = 24 /* 23 curvedata(5,4,3) = 25 /* 25 curvedata(6,1,1) = 8 /* 5 curvedata(6,1,2) = 12 /* 11 curvedata(6,1,3) = 14 /* 13 curvedata(6,2,1) = 11 /* 9 curvedata(6,2,2) = 16 /* 15 curvedata(6,2,3) = 18 /* 17 curvedata(6,3,1) = 13 /* 11 curvedata(6,3,2) = 20 /* 19 curvedata(6,3,3) = 22 /* 21 curvedata(6,4,1) = 16 /* 14 curvedata(6,4,2) = 24 /* 23 curvedata(6,4,3) = 25 /* 25 curvedata(7,1,1) = 7 /* 5 curvedata(7,1,2) = 11 /* 11 curvedata(7,1,3) = 14 /* 13 curvedata(7,1,4) = 15 /* 14 curvedata(7,2,1) = 11 /* 9 curvedata(7,2,2) = 16 /* 15 curvedata(7,2,3) = 18 /* 17 curvedata(7,2,4) = 19 /* 18 curvedata(7,3,1) = 14 /* 11 curvedata(7,3,2) = 20 /* 19 curvedata(7,3,3) = 22 /* 21 curvedata(7,3,4) = 23 /* 22 curvedata(7,4,1) = 16 /* 14 curvedata(7,4,2) = 24 /* 23 curvedata(7,4,3) = 26 /* 25 curvedata(7,4,4) = 27 /* 26 curvedata(8,1,1) = 7 /* 5 curvedata(8,1,2) = 11 /* 11 curvedata(8,1,3) = 14 /* 13 curvedata(8,1,4) = 15 /* 14 curvedata(8,2,1) = 11 /* 9 curvedata(8,2,2) = 16 /* 15 curvedata(8,2,3) = 18 /* 17 curvedata(8,2,4) = 19 /* 18 curvedata(8,3,1) = 14 /* 11 curvedata(8,3,2) = 20 /* 19 curvedata(8,3,3) = 22 /* 21 curvedata(8,3,4) = 23 /* 22 curvedata(8,4,1) = 16 /* 14 curvedata(8,4,2) = 24 /* 23 curvedata(8,4,3) = 26 /* 25 curvedata(8,4,4) = 27 /* 26 loop for c1 = 2 to 8 loop for c2 = 1 to 4 c4 = c1 + 1 / 2 + 1 c5 = 1 loop for c3 = c1 to c4 step -1 curvedata(c1,c2,c3) = curvedata(c1,c2,c5) ++c5 repeat repeat repeat &dA &dA &d@ Scale for notesize = 6 &dA if notesize = 6 loop for c1 = 1 to 8 loop for c2 = 1 to 4 loop for c3 = 1 to 8 curvedata(c1,c2,c3) = curvedata(c1,c2,c3) * 3 + 3 / 7 repeat repeat repeat end &dA &dA &d@ Scale for notesize = 21 &dA if notesize = 21 loop for c1 = 1 to 8 loop for c2 = 1 to 4 loop for c3 = 1 to 8 curvedata(c1,c2,c3) = curvedata(c1,c2,c3) * 21 + 7 / 14 repeat repeat repeat end &dA &dA &d@ Scale for notesize = 18 &dA12/18/04&d@ &dA if notesize = 18 loop for c1 = 1 to 8 loop for c2 = 1 to 4 loop for c3 = 1 to 8 curvedata(c1,c2,c3) = curvedata(c1,c2,c3) * 18 + 7 / 14 repeat repeat repeat end &dA &dA &d@ Scale for notesize = 16 &dA12/31/08&d@ &dA if notesize = 16 loop for c1 = 1 to 8 loop for c2 = 1 to 4 loop for c3 = 1 to 8 curvedata(c1,c2,c3) = curvedata(c1,c2,c3) * 16 + 7 / 14 repeat repeat repeat end &dA* End of Initialization of parameters * Determine operating mode debug_point = 10000 pmode = 0 &D putc Debug above measure number ? (return = no debug) &D getc line &D line = trm(line) &D if line <> "" &D pmode = 4 &D debug_point = int(line) &D end #if AUTOSCR putc putc Autoscr performs the first step of the MUSEDATA to SCORE conversion process. putc Autoscr takes stage2 source files as input and produces non-page putc specific intermediate files. In this conversion process, the only putc files needed are the files with scrcon membership. putc putc Source library? (e.b46 g.b46 , stage2/01) getc inlib inlib = trm(inlib) inlib = inlib // "/" getdir line inlib = line // "/" // inlib pgroup = PGROUP job_type = "s" putc putc Autoscr works on only one movement at a time. The output library putc (for i-files) must already be allocated. Autoscr will name the putc output files (i-files) according to the order of the input files putc in the group; i.b46 e. part 1 from the input group becomes the i-file "01". putc Autoset can work on a range of parts within a group. You will be asked putc to provide this range. Enter the output library and range now. putc putc Output library? (Enter a blank line to get default output library) getc outlib outlib = trm(outlib) if outlib = "" j = len(inlib) - 1 temp = "" loop for i = j to 1 step -1 if inlib{i} <> "/" temp = inlib{i} // temp else i = 0 end repeat outlib = "outputs" line = "scrcon" perform check_for_lib (outlib,line) outlib = outlib // "/scrcon" line = "i-files" perform check_for_lib (outlib,line) outlib = outlib // "/i-files" line = temp perform check_for_lib (outlib,line) outlib = outlib // "/" // temp end #else putc putc Autoset performs the first step of the music typesetting process. putc Autoset takes stage2 source files as input and produces non-page putc specific intermediate files. Since the stage2 directory contains putc source files for a variety of uses, you need to specify the group putc (i.b46 e. sound, score, skore, parts, short or data) that you want putc autoset to work on. Enter the source library and group name now. putc putc Source library? getc inlib inlib = trm(inlib) inlib = inlib // "/" getdir line inlib = line // "/" // inlib putc Group name? (default = data) getc line line = trm(line) line = lcs(line) line = mrt(line) if "sound^short^parts^score^skore^data" con line /* &dA03/10/09&d@ adding skore pgroup = line else putc This is an unconventional group name. Would you please putc verify it by typing it again (or enter a conventional name). getc temp2 temp2 = trm(temp2) temp2 = mrt(temp2) temp2 = lcs(temp2) if "sound^short^parts^score^skore^data^" con temp2 /* &dA03/10/09&d@ adding skore pgroup = temp2 else if temp2 = line pgroup = line else pgroup = "data" putc group name has been set to "data" end end end &dA &dA &d@ Set job_type for selective print suggestions &dA if "sound^short^parts^score^skore^data^" con pgroup i = mpt / 6 + 1 job_type = ".tpskd"{i} /* &dA03/10/09&d@ Expanding job_type to include end /* k = skore (conductor's score) if job_type = "p" /* setting multirest_flag &dA03/04/06&d@ multirest_flag = 1 else multirest_flag = 0 end putc putc Autoset works on only one movement at a time. The output library putc (for i-files) must already be allocated. Autoset will name the putc output files (i-files) according to the order of the input files putc in the group; i.b46 e. part 1 from the input group becomes the i-file "01". putc Autoset can work on a range of parts within a group. You will be asked putc to provide this range. Enter the output library and range now. putc putc Output library? (Enter a blank line to get default output library) getc outlib outlib = trm(outlib) if outlib = "" j = len(inlib) - 1 temp = "" loop for i = j to 1 step -1 if inlib{i} <> "/" temp = inlib{i} // temp else i = 0 end repeat outlib = "outputs/" // pgroup if notesize <> 14 if notesize < 10 outlib = outlib // "0" end outlib = outlib // chs(notesize) end line = "i-files" perform check_for_lib (outlib,line) outlib = outlib // "/i-files" if temp <> "stage2" outlib = outlib // "/" // temp end end #endif outlib = outlib // "/" getdir line outlib = line // "/" // outlib &dA &dA &d@ Check that outlib exists &dA line2 = rev(outlib) line2 = line2{2..} if line2 con "/" line = line2{mpt+1..} line = rev(line) temp = rev(line2{1,mpt-1}) perform check_for_lib (line,temp) goto ALLOCATED end putc This is bullshit stop ALLOCATED: f1 = 10000 &dA &dA &d@ Get names of input files &dA open [9,1] inlib loop getf [9] line line = line{33..} line = trm(line) &dK &d@ temp = inlib // "/" // line temp = inlib // line open [2,1] temp loop for i = 1 to 11 getf [2] line2 repeat line2 = line2 // " " temp4 = " " // pgroup // " " if line2 con temp4 loop for i = 1 to 8 getf [2] line2 k = len(pgroup) if line2{1,k} = pgroup if line2 con "part " j = int(line2{sub+5..}) if f1 = 10000 k = 0 if line2 con " of " k = int(line2{sub+3..}) end putc putc There appear to be ~k parts in this group. Enter the first and putc last numbers of the range you wish, or &dAsimply type &d@ to putc process all of them. f1 = 0 getc f1 f2 if f1 = 0 f1 = 1 f2 = k end f3 = f1 end if j >= f1 and j <= f2 infiles(j) = line end end i = 100 end repeat if i <> 100 putc file ~line has a bad group membership format putc Please fix this problem before proceeding further. putc stop end end close [2] repeat eof9: loop for i = f1 to f2 if infiles(i) = "" putc Unable to find an input file for track ~i . Please check putc to see that your tracks are within the range of the size of putc the group you are working with. putc stop end repeat BIG: m_number = 0 tuflag = 0 loop for i = 1 to MAX_STAFF c8flag(i) = 0 transflag(i) = 0 repeat &dK &d@ ctrflag = 0 loop for i = 1 to MAX_PASS /* ctrflag(.) is an array as of &dA12/08/07 ctrflag(i) = 0 repeat loop for i = 1 to 4 loop for j = 1 to MAX_PASS loop for k = 1 to BM_SZ /* New size parameter &dA05/14/03&d@ beampar(i,j,k) = 0 repeat repeat repeat outslurs = "00000000" /* clear all pending slur flags snum = 0 esnum = 0 loop for j = 1 to MAX_PASS tsnum(j) = 0 pre_tsnum(j) = 0 rest_flag(j) = 0 repeat figdiv = 0 cuediv = 0 measnum = 0 divpoint = 0 sct = 0 /* necessary so that ts(.,.) will be completely cleared maxsct = 0 oldsct = 0 supcnt = 0 inctype = 0 inctype_rem = 0 vflag = 1 mcat = 0 granddist = vpar(66) global_tpflag = 0 tpflag = 0 xposi_shift = 0 yposi_shift = 0 textconflag = OFF restplace = 0 fix_next_inctype = 0 mdirfont = DEFAULT_MDIRFONT dtivfont = DEFAULT_DTIVFONT &dA &dA &d@ Code added &dA09/22/03&d@ for more complete initialization of variables &dA key = 0 loop for i = 1 to 50 claveax(i) = 0 loop for j = 1 to 4 /* &dA06/04/08&d@ was 3 measax(j,i) = claveax(i) repeat repeat restoff = 0 /* added &dA05/12/04&d@ text_flag = 0 /* added &dA01/30/05&d@ text_loc = vpar(101) /* added &dA01/30/05&d@ art_flag = 0 /* added &dA05/26/05&d@ single_line = 0 /* added &dA12/18/05&d@ stem_change_flag = 0 /* added &dA12/20/05&d@ dot_difference_flag = 0 /* added &dA12/24/05&d@ irest_flag = 0 /* added &dA01/01/06&d@ mreport_flag = 0 /* added &dA01/01/06&d@ debug_flag = 0 /* added &dA01/01/06&d@ ending_height = vpar(40) /* added &dA01/06/06&d@ key_reprint_flag = 0 /* added &dA11/26/06&d@ mixed_color_flag = 0 /* added &dA11/26/06&d@ suppress_key = 0 /* added &dA11/02/07&d@ min_space = hpar(29) /* added &dA11/19/07&d@ slur_adjust = 0 /* added &dA05/01/08&d@ in_line_edslur = 0 /* added &dA01/12/09&d@ large_clef_flag = 0 /* added &dA02/02/09&d@ rest_collapse = TRUE /* added &dA03/15/09&d@ pitch_mod = 0 /* added &dA11/27/09&d@ #if AUTOSCR xdata_flag = 1 scr_flag = 1 #else xdata_flag = 0 #endif *********** Transfer file to Data Table *********** if f3 = 0 putc Suspected problem with the allocation of group memberships putc in this directory. Please check all relevent files before putc proceeding further. putc putc &dAProgram Halted&d@ putc stop end instrument_number = f3 transposition = 50 file = inlib // infiles(f3) if f3 < 10 outfile = outlib // "0" // chs(f3) else outfile = outlib // chs(f3) end putc putc Input file = ~file putc open [1,1] file loop for i = 1 to 10 getf [1] line tput [X,i] ~line repeat &dA &dA &d@ Skip group membership information &dA getf [1] line if line con ":" /* looking for group memberships j = mpt + 1 loop for k = 0 to 100 out = txt(line,[' '],j) repeat while out <> "" loop for j = 1 to k /* k = number of group memberships getf [1] line line = line // pad(1) loop while line{1} = "&" loop getf [1] line line = line // pad(1) repeat while line{1} <> "&" getf [1] line line = line // pad(1) repeat repeat end box_flag = 0 /* New &dA02/03/08&d@ track_flag = 0 tracknum_flag = 0 loop getf [1] line line = line // pad(6) loop while line{1} = "&" /* skipping comments bracketed by & records loop getf [1] line line = line // pad(1) repeat while line{1} <> "&" getf [1] line line = line // pad(4) repeat if "Std" not_con line{1} /* skipping Sound records, deleted records, and tags if line{1} = "@" if line con "SCORECON" /* keep only SCORECON type comments if scr_flag = 1 ++i tput [X,i] ~line if line con "track assignment:" track_flag = 1 end end end else if line{1} = "a" /* continuation records if len(line) > 15 temp = line{16..} tget [X,i] line line = line // temp tput [X,i] ~line end else if line{1,2} = "Pv" /* New code &dA05/02/03&d@ if version{1,3} <> line{3,3} putc putc &dECAUTIONARY NOTICE&d@ putc putc The version of autoset you are running, &dGversion ~version &d@, putc putc does not correspond with the print suggestions, &dGversion ~line{3,4} &d@, putc in this file. There are two possible cases: putc putc Case I: The version of autoset you are running is older (lower number) putc than the version number in the file. Your version of autoset putc is probably still good, but you should &dEupgrade your version of putc &dEautoset at your earliest convenience&d@. putc putc Case II: You are running a more recent version of autoset, and the file putc you are working on may be out of date. We advise that you check putc carefully the output where print suggestions are applied to make putc sure the outcome is the desired one. If everything checks out, putc you may avoid this notice in the future by simply updating the putc print suggestion version number (the Pv record) to correspond putc with the version of autoset you are running. If the printed putc results to not look right, you will need to change (or possibly putc delete) the print suggestions in question. If you cannot get putc your desired result by these changes, we suggest you consult the putc latest version of the &dEstage2 source file documentation&d@ file. putc putc Type any key to continue getk k else if version{4} <> line{6} putc &dENOTICE:&d@ Your version of &dEautoset&d@ = ~version ; data version = ~line{3,4} if version{4} < "1" putc The processing of I:2 multi-tracks has been changed. putc We suggest you check the output. putc end if version{4} < "2" putc The data may contain rehearsal numbers/letters in boxes putc which your version will not process. putc end end end &dA &d@ New &dA02/03/08&d@ &dA if line{1,4} >= "4.02" box_flag = 1 end &dA &dA else &dA &dA &d@ New code &dA01/01/06&d@ to implement certain run-time options for autoset &dA if line{1,2} = "Px" if line{3,3} con "m" mreport_flag = 1 end if line{3,3} con "s" xdata_flag = 1 end if line{3,3} con "d" debug_flag = 1 putc Debug above measure number ? (return = no debug) getc line line = trm(line) if line <> "" debug_point = int(line) end end &dA else ++i tput [X,i] ~line end end end end end if line{1} = "/" line = line // pad(5) if line{1,5} = "/FINE" loop getf [1] line line = line // pad(4) repeat while line{1,4} <> "/END" end if line{1,4} = "/END" ssize = i close [1] goto LOADED end goto eof1 end repeat eof1: putc Mis-use of "/" or File not properly terminated putc putc This error can also be caused by a missing comment putc terminator "&". putc stop &dAÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿&d@ &dA³ Start Processing Data ³&d@ &dAÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ&d@ LOADED: barnum = 0 tgpnt = 0 if xdata_flag = 1 perform survay_file end barnum2 = 1 opbarnum = 1 ttext = "" firstoff = 0 sigflag = 0 key = 0 loop for i = 1 to 50 claveax(i) = 0 repeat repeater_flag = 0 nstaves = 1 * tget [X,5] line line = trm(line) // " " if line con "MV#:" temp = trm(line{mpt+4..}) line = line{1,mpt-1} end if line con "WK#:" line = trm(line{mpt+4..}) end tget [X,6] sourcename tget [X,7] wname tget [X,8] mname tget [X,9] partname #if AUTOSCR header2 = "Composer: " // composer // " Source: " // sourcename if composer_num = 1 header3 = "Work: BWV " // line // ":" // temp // " " // wname // " / " // mname end if composer_num = 2 header3 = "Work: " // line // ":" // temp // " " // wname // " / " // mname end if composer_num = 3 header3 = "Work: " // wname // " Mvmt: " // mname end if composer_num = 4 header3 = "Work: " // wname // " Mvmt: " // mname end #endif putc Work #: ~line .t30 Work name: ~wname putc Movement: ~temp .t30 Movement name: ~mname putc Part name: ~partname tget [X,10] out out = trm(out) a = 0 loop for i = 1 to len(out) if "SATB" con out{i} a = text_loc /* New &dA01/30/05&d@ text_flag = 1 /* New &dA01/30/05&d@ &dK &d@ a = vpar(101) end repeat scnt = 11 p = 0 tput [Y,1] ~a tput [Y,2] J D 4 500 -120 1 6913 0 0 tput [Y,3] W 0 0 44 ~mname outpnt = 3 &dA &dA &dA &d@ Special case code added &dA01/06/04&d@. Look for print suggestion tags &dA &d@ placed at the beginning of the file. This &dEmust&d@ be done here for &dA &d@ the case of tag Y U 1. The others follow along, but are not critical. &dA &dA &d@ Please note: &dEThis is &dANOT&dE the top of the stage2 data processing loop.&d@ &dA a10 = scnt PRA: tget [X,a10] line ++a10 line = line // pad(80) if line{1} = "P" if line{2} = " " sub = 2 goto MORE_SUGG_A end if line con " " a4 = sub temp4 = line{2..sub} &dA &dA &d@ This notesize filter removes all P suggestions &dA &d@ that do not meet notesize restrictions &dA loop for i = 1 to len(temp4) if temp4{i} = "#" if temp4{i,2} = "#<" a1 = int(temp4{i+2..}) /* sets sub if notesize >= a1 goto PRA /* This suggestion does not apply end i = sub - 1 /* prepare i for next code else if temp4{i,2} = "#>" a1 = int(temp4{i+2..}) /* sets sub if notesize <= a1 goto PRA /* This suggestion does not apply end i = sub - 1 /* prepare i for next code else a1 = int(temp4{i+1..}) /* sets sub if notesize <> a1 goto PRA /* This suggestion does not apply end i = sub - 1 /* prepare i for next code end end end repeat if temp4 con job_type sub = a4 goto MORE_SUGG_A end if temp4 con "a" sub = a4 goto MORE_SUGG_A end end goto PRA MORE_SUGG_A: if line{sub..} con "C" ++sub d = int(line{sub..}) /* column number if line{sub} = ":" ++sub /* skip ":" g = sub else temp5 = "" loop while line{sub} <> ":" and sub < len(line) temp5 = temp5 // line{sub} ++sub repeat if line{sub} <> ":" putc Incomplete print suggestion putc line = ~line goto PRA end ++sub /* skip ":" g = sub temp5 = temp5 // " " &dA &dA &d@ This notesize filter removes all P suggestions &dA &d@ that do not meet notesize restrictions &dA loop for i = 1 to len(temp5) if temp5{i} = "#" if temp5{i,2} = "#<" a1 = int(temp5{i+2..}) /* sets sub if notesize >= a1 loop while line{g} <> " " and g < len(line) ++g repeat sub = g /* skipping this suggestion goto MORE_SUGG_A end i = sub - 1 /* prepare i for next code else if temp5{i,2} = "#>" a1 = int(temp5{i+2..}) /* sets sub if notesize <= a1 loop while line{g} <> " " and g < len(line) ++g repeat sub = g /* skipping this suggestion goto MORE_SUGG_A end i = sub - 1 /* prepare i for next code else a1 = int(temp5{i+1..}) /* sets sub if notesize <> a1 loop while line{g} <> " " and g < len(line) ++g repeat sub = g /* skipping this suggestion goto MORE_SUGG_A end i = sub - 1 /* prepare i for next code end end end repeat if temp5 con job_type or temp5 con "a" &dK &d@ sub = g /* actually unnecessary else loop while line{g} <> " " and g < len(line) ++g repeat sub = g goto MORE_SUGG_A end end &dK &d@ g = sub /* unnecessary &dA &dA &d@ Column 0: general suggestions &dA if d = 0 /* general suggestion temp = "" loop for a2 = g to len(line) temp = temp // line{g} ++g repeat while line{g} <> " " temp = temp // " " if temp con "y" a2 = mpt + 1 if temp{a2} in ['0'..'9'] a3 = int(temp{a2..}) ++outpnt tput [Y,outpnt] Y U ~a3 end end &dK &d@ if temp con "z" &dK &d@ a2 = mpt + 1 &dK &d@ a3 = int(temp{a2..}) &dK &d@ ++outpnt &dK &d@ if a3 = 0 &dK &d@ tput [Y,outpnt] Y P 0 &dK &d@ else &dK &d@ temp = temp{sub..} &dK &d@ tput [Y,outpnt] Y P ~a3 ~temp &dK &d@ end &dK &d@ end else loop for a2 = g to len(line) ++g repeat while line{g} <> " " end sub = g goto MORE_SUGG_A end goto PRA end if line{1} = "$" goto PRA end &dA &dA &d@ End of special case code &dA01/06/04&d@ &dA &d@ &dA &dA &dA &d@ Set movement word (if present) &dA out = mname partname = trm(partname) &dA &dA &d@ New code to implement // feature in partnames &dA12/21/05&d@ &dA if partname con "//" temp3 = partname{mpt+2..} partname = partname{1,mpt-1} // pad(17) partname = partname // temp3 end if partname <> "" out = out // ": " // partname end if out <> "" oby = 0 - vpar(33) - notesize obx = p + hpar(39) + hpar(5) ++outpnt tput [Y,outpnt] J D 1 ~obx ~oby 1 6913 0 0 spn = 6913 ++outpnt tput [Y,outpnt] W 0 -~vpar(8) 44 ~out end mrest = 0 wrest = 0 @n = 0 old@n = 0 xmindist = hpar(4) * cfactor /* New &dA12/16/03&d@ mindist = xmindist / 100 /* New &dA12/16/03&d@ &dK &d@ mindist = hpar(4) minshort = 0 goto PR &dA &dA &d@ &dA &dA &d@ &dAÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿&d@ &dA &dA &d@ &dA³ Process the data file ³&d@ &dA &dA &d@ &dAÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ&d@ &dA &dA &d@ &dA &dA PR: tget [X,scnt] line ++scnt line = line // pad(80) if line{1} = "@" #if AUTOSCR if line con "SCORECON" /* This section added &dA11/27/09 if line con "pitch transposition:" pitch_mod = int(line{mpt+20..}) end end #endif goto PR end d = int(line{6,3}) /* possible duration g = int(line{9,4}) /* possible measure number if line{1} = "$" if mrest > 0 /* this code &dAadded 1-27-93&d@ perform setmrest end perform process_section goto PR end #if NO_EDIT if " ABCDEFGgcri" con line{1} if line{32..43} con "&" temp = line{44..} line = line{1..sub-1} // pad(43) line = line // temp end end #endif &dA &dA &dA &d@ MAIN CODE FOR PRINT SUGGESTIONS (ends around line 4800) &dA &d@ =================================== &dA if line{1} = "P" &dA &dA &d@ Re-coding this section &dA12/16/03&d@ to add notesize select feature &dA &d@ and to fix the problem of consecutive suggestion records &dA &d@ sugg_flg = 0 /* &dA05/02/03&d@ sugg_flg2 = 0 /* &dA05/02/03&d@ a1 = 1 loop while a1 < 10 ++a1 tget [X,scnt-a1] temp3 repeat while temp3{1} = "P" /* This code added &dA02/23/97&d@ if line{2} = " " sub = 2 goto MORE_SUGG end if line con " " a4 = sub temp4 = line{2..sub} &dA &dA &d@ This notesize filter removes all P suggestions &dA &d@ that do not meet notesize restrictions &dA loop for i = 1 to len(temp4) if temp4{i} = "#" if temp4{i,2} = "#<" a1 = int(temp4{i+2..}) /* sets sub if notesize >= a1 goto PR /* This suggestion does not apply end i = sub - 1 /* prepare i for next code else if temp4{i,2} = "#>" a1 = int(temp4{i+2..}) /* sets sub if notesize <= a1 goto PR /* This suggestion does not apply end i = sub - 1 /* prepare i for next code else a1 = int(temp4{i+1..}) /* sets sub if notesize <> a1 goto PR /* This suggestion does not apply end i = sub - 1 /* prepare i for next code end end end repeat if temp4 con job_type sub = a4 goto MORE_SUGG end if temp4 con "a" sub = a4 goto MORE_SUGG end end goto PR /* end of &dA02/23/97&d@ addition &dA &dK &d@ sugg_flg = 0 /* &dA05/02/03&d@ &dK &d@ sugg_flg2 = 0 /* &dA05/02/03&d@ &dK &d@ line = line // " " /* This code added &dA02/23/97&d@ &dK &d@ sub = 2 &dK &d@ if line{2} = " " &dK &d@ tget [X,scnt-2] temp3 &dK &d@ goto MORE_SUGG &dK &d@ end &dK &d@ if line con " " &dK &d@ a4 = mpt &dK &d@ temp3 = line{2..sub} &dK &d@ if temp3 con job_type &dK &d@ tget [X,scnt-2] temp3 &dK &d@ goto MORE_SUGG &dK &d@ end &dK &d@ end &dK &d@ goto PR /* end of &dA02/23/97&d@ addition MORE_SUGG: if line{sub..} con "C" ++sub d = int(line{sub..}) /* column number &dA &dA &d@ Code added &dA11/04/03&d@ to allow for job-specific print suggestions to &dA &d@ be specified by column number. &dA if line{sub} = ":" ++sub /* skip ":" g = sub else temp5 = "" g = sub loop while line{sub} <> ":" and sub < len(line) and sub < g + 20 temp5 = temp5 // line{sub} ++sub repeat if line{sub} <> ":" putc putc Incomplete print suggestion. &dEThis fault should be fixed&d@. putc index = ~(scnt+5) line = ~line putc goto PR end ++sub /* skip ":" g = sub &dA &dA &d@ Re-coding this section &dA12/16/03&d@ to add notesize select feature &dA &d@ temp5 = temp5 // " " &dA &dA &d@ This notesize filter removes all P suggestions &dA &d@ that do not meet notesize restrictions &dA loop for i = 1 to len(temp5) if temp5{i} = "#" if temp5{i,2} = "#<" a1 = int(temp5{i+2..}) /* sets sub if notesize >= a1 loop while line{g} <> " " and g < len(line) ++g repeat sub = g /* skipping this suggestion goto MORE_SUGG end i = sub - 1 /* prepare i for next code else if temp5{i,2} = "#>" a1 = int(temp5{i+2..}) /* sets sub if notesize <= a1 loop while line{g} <> " " and g < len(line) ++g repeat sub = g /* skipping this suggestion goto MORE_SUGG end i = sub - 1 /* prepare i for next code else a1 = int(temp5{i+1..}) /* sets sub if notesize <> a1 loop while line{g} <> " " and g < len(line) ++g repeat sub = g /* skipping this suggestion goto MORE_SUGG end i = sub - 1 /* prepare i for next code end end end repeat if temp5 con job_type or temp5 con "a" &dK &d@ sub = g /* actually unnecessary else loop while line{g} <> " " and g < len(line) ++g repeat sub = g goto MORE_SUGG end &dA &dK &d@ if temp5 con job_type &dK &d@ sub = g &dK &d@ else &dK &d@ loop while line{g} <> " " and g < len(line) &dK &d@ ++g &dK &d@ repeat &dK &d@ sub = g &dK &d@ goto MORE_SUGG &dK &d@ end end &dK &d@ g = sub /* unnecessary &dA &dA &d@ Column 0: general suggestions &dA if d = 0 /* general suggestion PQST: if "acdFfghjkmnpqrstvxyz" con line{g} /* "a" added &dA05/26/05&d@, and PSUG nums advanced /* "x" added (and string re-ordered) &dA01/03/04 /* "y" and "z" added &dA01/06/04 /* "c" added &dA05/12/04&d@, and PSUG nums advanced /* "v" added &dA01/30/05&d@, and PSUG nums advanced /* "j" added &dA12/20/05&d@, and PSUG nums advanced /* "k" added &dA12/24/05&d@, and PSUG nums advanced /* "m" added &dA03/04/06&d@, and PSUG nums advanced /* "F" added &dA10/24/07&d@, and PSUG nums advanced /* "h" added &dA11/19/07&d@, and PSUG nums advanced /* "g" added &dA05/01/08&d@, and PSUG nums advanced goto PSUG(mpt) PSUG(1): /* line{g} = "a" (New &dA05/26/05&d@) art_flag = int(line{g+1..}) g = sub goto PQST PSUG(2): /* line{g} = "c" (New &dA05/12/04&d@) restoff = int(line{g+1..}) g = sub if restoff <> 0 restoff = 1 end goto PQST PSUG(3): /* line{g} = "d" (Modified &dA01/06/06&d@) a6 = int(line{g+1..}) tword_height = a6 ending_height = vpar(2) * a6 / 2 /* New &dA01/06/06&d@ g = sub goto PQST PSUG(4): /* line{g} = "F" dtivfont = int(line{g+1..}) g = sub goto PQST PSUG(5): /* line{g} = "f" mdirfont = int(line{g+1..}) g = sub goto PQST PSUG(6): /* line{g} = "g" (New &dA05/01/08&d@) slur_adjust = int(line{g+1..}) g = sub goto PQST PSUG(7): /* line{g} = "h" (New &dA11/19/07&d@) a6 = int(line{g+1..}) min_space = hpar(29) * a6 / 100 g = sub goto PQST PSUG(8): /* line{g} = "j" (New &dA12/20/05&d@) stem_change_flag = int(line{g+1..}) g = sub goto PQST PSUG(9): /* line{g} = "k" (New &dA12/24/05&d@) a6 = int(line{g+1..}) dot_difference_flag = a6 & 0x01 key_reprint_flag = a6 & 0x02 /* added &dA11/26/06&d@ mixed_color_flag = a6 & 0x04 /* added &dA11/26/06&d@ suppress_key = a6 & 0x08 /* added &dA11/02/07&d@ in_line_edslur = a6 & 0x10 /* added &dA01/12/09&d@ large_clef_flag = a6 & 0x20 /* added &dA02/02/09&d@ g = sub goto PQST PSUG(10): /* line{g} = "m" (New &dA03/04/06&d@) a6 = int(line{g+1..}) if a6 = 1 multirest_flag = 1 else multirest_flag = 0 end g = sub goto PQST PSUG(11): /* line{g} = "n" m_number = int(line{g+1..}) g = sub goto PQST PSUG(12): /* line{g} = "p" xmindist = int(line{g+1..}) * hpar(4) * cfactor / 100 /* New &dA12/16/03 mindist = xmindist / 100 /* New &dA12/16/03 &dK &d@ mindist = int(line{g+1..}) * hpar(4) / 100 g = sub perform newnsp goto PQST PSUG(13): /* line{g} = "q" minshort = int(line{g+1..}) g = sub perform newnsp goto PQST PSUG(14): /* line{g} = "r" (New treatment &dA03/15/09&d@) a6 = int(line{g+1..}) restplace = a6 & 0x01 irest_flag = (a6 & 0x02) >> 1 rest_collapse = (a6 & 0x04) >> 2 /* New &dA03/15/09&d@: 0 = TRUE; 1 = FALSE g = sub goto PQST PSUG(15): /* line{g} = "s" granddist = int(line{g+1..}) g = sub granddist = granddist * vpar(2) + 5 / 10 goto PQST PSUG(16): /* line{g} = "t" global_tpflag = int(line{g+1..}) g = sub if global_tpflag > 4 global_tpflag = 4 end if global_tpflag < 0 global_tpflag = 0 end tpflag = global_tpflag goto PQST &dA &dA &d@ This option added &dA01/30/05 &dA PSUG(17): /* line{g} = "v" a6 = int(line{g+1..}) g = sub text_loc = a6 * notesize / 20 tget [Y,1] temp4 a6 = int(temp4) temp4 = temp4 // " " temp4 = temp4{sub..} temp4 = mrt(temp4) tput [Y,1] ~text_loc ~temp4 goto PQST &dA &dA &d@ This option added &dA01/03/04&d@; modified &dA01/06/04&d@ &dA PSUG(18): /* line{g} = "x" a6 = int(line{g+1..}) if a6 = 1 and mrest > 0 perform setmrest end wrest = a6 if wrest <> 1 wrest = 0 end g = sub goto PQST &dA &dA &dA &d@ These options added &dA01/06/04&d@ &dA PSUG(19): /* line{g} = "y" a6 = int(line{g+1..}) ++outpnt tput [Y,outpnt] Y U ~a6 g = sub goto PQST PSUG(20): /* line{g} = "z" a6 = int(line{g+1..}) ++outpnt if a6 = 0 tput [Y,outpnt] Y P 0 g = sub else g = sub temp = "" loop while line{g} <> " " and g < 80 temp = temp // line{g} ++g repeat if line{g} <> " " dputc Program Error stop end tput [Y,outpnt] Y P ~a6 ~temp end goto PQST &dA end sub = g goto MORE_SUGG end &dA &dA &d@ Deal with record that contains: notes, grace notes, cue notes, rests, figures &dA if " ABCDEFGgcrif" con temp3{1} /* &dA04/24/03&d@ allowing print sugg for chords a3 = mpt &dA &dA &d@ Column 1: The Object itself. NOTES, GRACE NOTES, CUE NOTES, RESTS, FIGURES &dA if d = 1 if "spxXyY" con line{g} /* "X" added &dA05/02/03&d@ "s" added &dA02/19/06 ++@n tcode(@n) = zpd(4) tcode(@n){1} = chr(1) tv1(@n) = P_SUGGESTION tv2(@n) = 0x0300 end ABCL: if line{g} = "p" i = int(line{g+1..}) g = sub if i < 0 i = 0 end if i > 7 i = 7 end if i > 0 i = i << 1 + 1 end tcode(@n){1} = chr(i) goto ABCL end &dA &dA &d@ This code added &dA02/19/06&d@ to implement different shapes of note heads &dA if line{g} = "s" i = int(line{g+1..}) g = sub if i < 0 i = 0 end if i > 15 i = 15 end i <<= 4 /* use upper part of first byte a3 = ors(tcode(@n){1}) a3 |= i /* add to what is already there a3 |= 0x01 /* turn on "active" bit tcode(@n){1} = chr(a3) goto ABCL end &dA &dA &d@ End of &dA02/19/06&d@ addition if "xXyY" con line{g} /* &dA05/02/03&d@ code revised a3 = mpt if line{g+1} = "+" ++g end a2 = int(line{g+1..}) g = sub a2 += 128 if a2 <= 0 a2 = 1 end if a2 > 255 a2 = 255 end a4 = ors(tcode(@n){2}) /* &dA05/02/03&d@ code revised if a3 < 3 tcode(@n){3} = chr(a2) if a3 = 1 a4 |= 0x01 /* set position as "relative" else a4 |= 0x03 /* set position as "absolute" end else tcode(@n){4} = chr(a2) if a3 = 3 a4 |= 0x01 /* set position as "relative" else a4 |= 0x05 /* set position as "absolute" end end tcode(@n){2} = chr(a4) goto ABCL end sub = g goto MORE_SUGG end &dA &dA &d@ Columns 18 and 19: dots and accidentals on NOTES, GRACE NOTES, CUE NOTES, and RESTS &dA if (d = 18 or d = 19) and a3 < 12 /* &dA05/02/03&d@ i = d /* 18 = dots, 19 = accs if "xXyY" con line{g} a3 = mpt ++@n tcode(@n) = zpd(4) tv1(@n) = P_SUGGESTION tv2(@n) = 0x0200 + i /* i is index into position string NXYP2: if line{g+1} = "+" ++g end a2 = int(line{g+1..}) g = sub a2 += 128 if a2 <= 0 a2 = 1 end if a2 > 255 a2 = 255 end a4 = ors(tcode(@n){2}) if a3 < 3 tcode(@n){3} = chr(a2) if a3 = 1 a4 |= 0x01 /* set position as "relative" else a4 |= 0x03 /* set position as "absolute" end else tcode(@n){4} = chr(a2) if a3 = 3 a4 |= 0x01 /* set position as "relative" else a4 |= 0x05 /* set position as "absolute" end end tcode(@n){2} = chr(a4) if "xXyY" con line{g} a3 = mpt goto NXYP2 end end sub = g goto MORE_SUGG end &dA &dA &d@ Columns 26 to 30: beams &dA &d@ if (d = 26 or d = 27) and a3 < 11 &dK &d@ if "baA" con line{g} if "baAc" con line{g} /* "c" option added &dA01/01/08 repeater_flag = mpt - 1 if d = 27 and repeater_flag > 0 repeater_flag += 4 end sub = g goto MORE_SUGG end if d = 26 /* New code &dA05/14/03&d@ i = 28 /* 28 = beam stem length code if line{g} = "y" ++@n tcode(@n) = zpd(4) tv1(@n) = P_SUGGESTION tv2(@n) = 0x0200 + i /* i is index into position string ++g sub = g if line{sub} = "+" ++sub end a2 = int(line{sub..}) g = sub a2 += 128 if a2 < 1 a2 = 1 end if a2 > 255 a2 = 255 end tcode(@n){2} = chr(a2) end end sub = g goto MORE_SUGG end &dA &dA &d@ Columns 32 to 43: ties, articulations, ornaments, dynamics, &dA &d@ fermatas, technical suggestions (fingerings, etc.) &dA if d >= 32 and d <= 43 and a3 < 12 /* &dA04/24/03&d@ 11 changed to 12 &dA &dA &d@ Slur suggestions. Additions and modifications to code on &dA05/06/03&d@ &dA if "([{z" con temp3{d} /* start slur 1,2,3,4 a5 = mpt if "ou" con line{g} /* this is a forced slur suggestion i = a5 - 1 << 1 - 1 + mpt ++@n tv1(@n) = P_SUGGESTION tv2(@n) = i sub = g goto MORE_SUGG end i = a5 + 19 /* 20, 21, 22, 23 &dA &dA &d@ New code &dA04/26/05&d@ for print suggestion suppressing the printing of a slur &dA if line{g} = "*" ++@n tcode(@n) = ch4(-1) /* 0xffffffff = suppress slur tv1(@n) = P_SUGGESTION tv2(@n) = 0x0200 + i /* i is index into position string sub = g goto MORE_SUGG end &dA if "xyXY" con line{g} a3 = mpt ++@n tcode(@n) = zpd(4) tv1(@n) = P_SUGGESTION tv2(@n) = 0x0200 + i /* i is index into position string NXYH: ++g sub = g if line{sub} = "+" ++sub end a2 = int(line{sub..}) g = sub a2 += 128 if a2 < 1 a2 = 1 end if a2 > 255 a2 = 255 end tcode(@n){a3} = chr(a2) if "xyXY" con line{g} a3 = mpt goto NXYH end end sub = g goto MORE_SUGG end &dA &dA &d@ More slur suggestions &dA if ")]}x" con temp3{d} /* end slur 1,2,3,4 i = mpt + 23 /* 24, 25, 26, 27 if "xyh" con line{g} a3 = mpt ++@n tcode(@n) = zpd(4) tv1(@n) = P_SUGGESTION tv2(@n) = 0x0200 + i /* i is index into position string NXYH2: ++g sub = g if line{sub} = "+" ++sub end a2 = int(line{sub..}) g = sub a2 += 128 if a2 < 1 a2 = 1 end if a2 > 255 a2 = 255 end tcode(@n){a3} = chr(a2) if "xyh" con line{g} a3 = mpt goto NXYH2 end end sub = g goto MORE_SUGG end &dA &dA &d@ End of &dA05/06/03&d@ Addition &dA if temp3{d} = "-" if "ou" con line{g} /* this is a specified tie ++@n tv1(@n) = P_SUGGESTION tv2(@n) = mpt + 7 end end &dK &d@ if "_.=i>VArt~wMkvnoQ012345mpfZRFE-" con temp3{d} &dK &d@ if "_.=i>VArt~wMkTvnoQ012345mpfZRFE-" con temp3{d} /* Tremulo added &dA01/07/06 if "_.=i>VArt~wMkTJKvnoQ012345mpfZRFE-" con temp3{d} /* Back ties added &dA04/22/08 i = mpt - 1 << 1 + 1 &dA &dA &d@ Tremulo added to this map &dA01/07/06&d@ &dA &d@ &dA &d@ Back ties added to this map &dA04/22/08&d@ &dA &d@  &dK &d@ i = int("01010102030303040404040404 060607080809090909091414141414151617"{i,2}) &dA &d@   &dK &d@ i = int("0101010203030304040404040404 060607080809090909091414141414151617"{i,2}) i = int("01010102030303040404040404040404060607080809090909091414141414151617"{i,2}) &dA &dA &d@ Explanation: We need to have a code which indicates the type of element to which &dA &d@ the suggestions is applied. So for, we have the following codes: &dA &dA &d@ 1 = legato, staccato, or legato-staccate &dEarticulation&d@ &dA &d@ 2 = spiccato &dEarticulation&d@ &dA &d@ 3 = horizontal, vertical, or inverted vertical &dEaccent&d@ &dA &d@ 4 = turn, trill, wavy line, shake, mordant, or delayed turn &dEornament &dA &d@ tremulo added &dA01/07/06&d@ &dA &d@ back ties added &dA04/22/08&d@ &dA &d@ 5 = (same thing, I think) &dA &d@ 6 = up bow, or down bow &dEbowing&d@ &dA &d@ 7 = &dEharmonic&d@ &dA &d@ 8 = open string, or thumb position &dA &d@ 9-13 = &dEfingering&d@ (five suggestions possible) &dA &d@ 14 = &dEdynamics&d@ &dA &d@ 15 = upright &dEfermata&d@ &dA &d@ 16 = inverted &dEfermata&d@ &dA &d@ 17 = &dEtie&d@ &dA &d@ 18 = &dEdots&d@ &dA &d@ 19 = &dEaccidentals&d@ &dA &d@ (20-23 = start slur) &dA &d@ (24-27 = stop slur) &dA if i = 4 /* ornament if sugg_flg2 < 2 ++sugg_flg2 i = sugg_flg2 + 3 end end if i = 9 /* fingering if d > 32 and temp3{d-1} = ":" i = 1000 /* i = 1000 means "do nothing" else if sugg_flg < 5 ++sugg_flg i = sugg_flg + 8 end end end if line{g} = "L" and i <> 17 /* &dA05/02/03&d@ "L" applies only to ties i = 1000 end if i < 1000 and "xXyYabL" con line{g} /* modifications to code &dA05/02/03 a3 = mpt ++@n tcode(@n) = zpd(4) tv1(@n) = P_SUGGESTION tv2(@n) = 0x0200 + i /* i is index into position string NXYP: if a3 < 5 ++g sub = g if line{sub} = "+" ++sub end a2 = int(line{sub..}) g = sub a2 += 128 if a2 < 1 a2 = 1 end if a2 > 255 a2 = 255 end a4 = ors(tcode(@n){2}) if a3 < 3 tcode(@n){3} = chr(a2) if a3 = 1 a4 |= 0x01 /* set position as "relative" else a4 |= 0x03 /* set position as "absolute" end else tcode(@n){4} = chr(a2) if a3 = 3 a4 |= 0x01 /* set position as "relative" else a4 |= 0x05 /* set position as "absolute" end end tcode(@n){2} = chr(a4) if i <> 17 a2 = ors(tcode(@n){1}) | 0x01 /* added &dA11/10/07&d@ Major oversight, check results tcode(@n){1} = chr(a2) end end if a3 = 5 or a3 = 6 a4 = a3 - 5 * 4 + 3 /* 5 -> 3, 6 -> 7 a2 = ors(tcode(@n){1}) | a4 tcode(@n){1} = chr(a2) ++g end if a3 = 7 /* &dA05/02/03&d@ "L" changes length of tie ++g sub = g if line{sub} = "+" ++sub end a2 = int(line{sub..}) g = sub a2 += 128 if a2 < 1 a2 = 1 end if a2 > 255 a2 = 255 end tcode(@n){1} = chr(a2) end if "xXyYabL" con line{g} a3 = mpt if a3 < 7 or i = 17 /* &dA05/02/03&d@ "L" applies only to ties goto NXYP end end end sub = g goto MORE_SUGG end &dA &dA &d@ Suggestions for tuples &dA if temp3{d} = "*" /* &dA03-21-97&d@ if "[(:;i" con line{g} a3 = mpt ++@n tv1(@n) = P_SUGGESTION tv2(@n) = 0x10 /* tuplet suggestion MOTUP: if a3 = 2 or a3 = 4 tv2(@n) |= 0x01 /* round tuplet end if a3 = 1 or a3 = 2 or a3 = 5 tv2(@n) |= 0x02 /* continuous tuplet end if a3 = 3 tv2(@n) = 0x10 /* square, broken tuplet (default) end if a3 = 5 tv2(@n) |= 0x04 /* tuplet number inside bracket end if "[(:;i" con line{g+1} ++g a3 = mpt goto MOTUP end end end if temp3{d} = "!" /* &dA11/05/05&d@ &dA &dA &d@ New code &dA11/05/05&d@ implementing post adjustment to tuple position &dA MOTUP2: if line{g} = "x" a2 = int(line{g+1..}) a2 *= vpar(2) a2 /= 10 g = sub if abs(a2) < 128 ++@n tv1(@n) = P_SUGGESTION tv2(@n) = 0x500 /* x adjustment to tuplet a2 += 128 tv2(@n) += a2 end goto MOTUP2 end if line{g} = "y" a2 = int(line{g+1..}) a2 *= vpar(2) a2 /= 10 g = sub if abs(a2) < 128 ++@n tv1(@n) = P_SUGGESTION tv2(@n) = 0x600 /* x adjustment to tuplet a2 += 128 tv2(@n) += a2 end goto MOTUP2 end end &dA &d@ End of &dA11/05/05&d@ addition sub = g goto MORE_SUGG end end &dA &dA &d@ Print suggestions applied to musical directions (not modified as of &dA05/02/03&d@) &dA if temp3{1} = "*" if d >= 17 and d <= 18 if "fxypY" con line{g} ++@n tcode(@n) = zpd(4) tv1(@n) = P_SUGGESTION &dK &d@ if "ABCDGPQ" con temp3{d} if "ABCDGPQR" con temp3{d} /* New &dA02/03/08&d@ tv2(@n) = 0x0100 else tv2(@n) = 0x0101 end end NXFP: if line{g} = "f" i = int(line{g+1..}) g = sub &dK &d@ if "ABCDG" con temp3{d} /* this is a designated font number if "ABCDGR" con temp3{d} /* this is a designated font number New &dA02/03/08 tcode(@n){1} = chr(i) end goto NXFP end if "xyYp" con line{g} a3 = mpt + 1 if a3 = 5 a3 -= 2 end if line{g+1} = "+" ++g end i = int(line{g+1..}) i += 0x80 if i <= 0 i = 1 end if i > 255 i = 255 end g = sub &dK &d@ if "ABCDEFGHPQUV" con temp3{d} /* this is a position shift if "ABCDEFGHPQRUV" con temp3{d} /* this is a position shift New &dA02/03/08 tcode(@n){a3} = chr(i) end goto NXFP end sub = g goto MORE_SUGG end &dK &d@ if d >= 25 and line{g} = "f" and temp3{17,2} con ['B'..'D'] if d >= 25 and line{g} = "f" and temp3{17,2} con ['B'..'D','R'] /* New &dA02/03/08 i = int(line{g+1..}) g = sub temp3 = temp3 // pad(100) &dA &dA &d@ De-construct temp3 into ASCII and font changes &dA loop for a1 = 1 to 10 font_changes(a1,1) = 0 font_changes(a1,2) = 0 repeat changecnt = 0 sub = 25 NXFNUM: if temp3{sub..} con "!" and temp3{sub+1} in ['0'..'9'] a1 = sub a2 = int(temp3{a1+1..}) ++changecnt font_changes(changecnt,1) = a1 font_changes(changecnt,2) = a2 &dA &dA &d@ Code change &dA01/17/04&d@ to keep font changes from interferring with the text &dA if temp3{sub} = "|" ++sub end &dA temp3 = temp3{1,a1-1} // temp3{sub..} sub = a1 goto NXFNUM end &dA &dA &d@ Add new font change and re-order in ascending order of location &dA ++changecnt font_changes(changecnt,1) = d font_changes(changecnt,2) = i loop for a1 = changecnt to 2 step -1 a2 = a1 - 1 if font_changes(a1,1) < font_changes(a2,1) a3 = font_changes(a1,1) font_changes(a1,1) = font_changes(a2,1) font_changes(a2,1) = a3 a3 = font_changes(a1,2) font_changes(a1,2) = font_changes(a2,2) font_changes(a2,2) = a3 end repeat &dA &dA &d@ Merge ASCII and font changes into new temp3 &dA temp4 = temp3{1,24} a2 = 25 loop for a1 = 1 to changecnt a3 = font_changes(a1,1) if a3 > a2 temp4 = temp4 // temp3{a2..a3-1} end a2 = a3 &dA &dA &d@ Code change &dA01/17/04&d@ keep font changes from interferring with the text &dA temp4 = temp4 // "!" // chs(font_changes(a1,2)) // "|" &dK &d@ temp4 = temp4 // "!" // chs(font_changes(a1,2)) &dA repeat temp4 = temp4 // temp3{a2..} temp3 = temp4 loop for a1 = @n to 1 step -1 if tv1(a1) = MUSICAL_DIR tdata(a1,1) = temp3{17..96} a1 = 0 end repeat sub = g goto MORE_SUGG end end &dA &dA &d@ Print suggestions applied to measures and barlines: New code &dA05/25/03 &dA if temp3{1} = "m" if d = 1 &dA &dA &dA &d@ New suggestion &dA10/24/08&d@ to breakup a multi-rest measure (for parts) &dA if line{g} = "f" and mrest > 0 perform setmrest end &dA &dA if line{g} = "n" ++@n tcode(@n) = zpd(4) tv1(@n) = P_SUGGESTION tv2(@n) = 0x0400 end &dA &dA &d@ New suggestion &dA05/28/05&d@ to implement &dEmid-movement&d@ right justification &dA &dA &d@ NOTE: This code contains a giant cludge. If the print suggestion follows &dA &d@ directly after a measure record, and "]" is the only suggestion, then &dA &d@ this code reaches directly into the output and changes it. &dA &d@ if line{g} = "]" if @n = 0 loop for i = outpnt to (outpnt - 10) step -1 tget [Y,i] temp4 if len(temp4) > 5 and temp4{1,3} = "J B" sub = 5 a6 = int(temp4{sub..}) a7 = int(temp4{sub..}) a8 = int(temp4{sub..}) a8 += 10000000 a9 = sub temp4 = "J B " // chs(a6) // " " // chs(a7) // " " // chs(a8) // temp4{sub..} tput [Y,i] ~temp4 goto PR end repeat end ++@n tcode(@n) = zpd(4) tv1(@n) = P_SUGGESTION tv2(@n) = 0x0401 end sub = g goto MORE_SUGG end end sub = g goto MORE_SUGG end goto PR end &dA &dA &d@ END OF MAIN CODE FOR PRINT SUGGESTIONS &dA &d@ ========================================== &dA &dA if line{8} = " " d = 0 end if mrest > 0 out = trm(line) if len(out) > 15 /* this is a normal stage2 data line perform setmrest else &dA &dA &d@ &dA03/07/06&d@ allowing only mheavy4 of all measure codes &dA &d@ to slip through here. &dA if "mrib" not_con line{1} or line{1,7} = "mheavy4" &dK &d@ if line{1,4} <> "meas" and "rib" not_con line{1} perform setmrest end end end if "ABCDEFGri" con line{1} ++@n i = NOTE if line{1} = "r" i = REST end if line{1} = "i" i = IREST end tv1(@n) = i tv2(@n) = d if " 123" con line{24} /* staff number goes in tv3(.) & 0x0000000f if mpt = 1 tv3(@n) = 0 else tv3(@n) = mpt - 2 end else putc Illegal character in staff number column (col. 24). Please fix. putc Record = ~line goto EE end &dA &dA &d@ Code added &dA01/30/05&d@ for text under notes &dA temp4 = trm(line) if len(temp4) > 43 text_flag = 1 end &dA if " 123456789" con line{15} /* track number goes in tv3(.) & 0x000000f0 if mpt = 1 /* track number = 0 means no information else tracknum_flag = 1 --mpt a1 = mpt << 4 tv3(@n) += a1 end else putc Illegal character in track number column (col. 15). Please fix. putc Record = ~line goto EE end &dA &dA &d@ Code added &dA01/30/05&d@ for text under notes &dA temp4 = trm(line) if len(temp4) > 43 text_flag = 1 end &dA if line{1} = "i" tcode(@n) = "ires" /* redundant, but do it to be on the safe side else tcode(@n) = line{1,4} end tdata(@n,1) = line{17..80} &dA &dA &d@ Code added &dA01/03/04&d@ to deal with optional rests (whole and otherwise) &dA if "WHQESTXYZ " con line{17} a1 = mpt if line{1} = "r" and wrest = 1 &dK &d@ tdata(@n,1){1} = "W" &dA &dA &d@ /* New: This line replaced &dA10/15/07&d@ &dA if line{17} = " " tdata(@n,1){1} = "o" else tdata(@n,1){1} = line{17} end &dA else tdata(@n,1){1} = "whqestxyz "{a1} end end &dK &d@ if wrest = 1 and line{1} = "r" and line{17} = " " &dK &d@ tdata(@n){1} = "W" &dK &d@ end &dA if "ri" con line{1} /* restplace flag goes in tv3(.) & 0x0000ff00 if mpt = 1 tv3(@n) += restplace << 8 end else if repeater_flag > 0 /* repeater flag goes in tv3(.) & 0x0000ff00 tv3(@n) += repeater_flag << 8 if bit(0,repeater_flag) = 1 and line{26} = "]" repeater_flag = 0 end end end &dA &dA &d@ Code added &dA05/12/04&d@ to implement global suggestion to turn off &dA &d@ the printing of rests (used for blank continuo parts). Note that &dA &d@ no other print suggestions for rest can be inforce when this &dA &d@ feature is used. &dA &dA &d@ Adding condition &dA01/01/06&d@ to make irest_flag work &dA &dK &d@ if restoff = 1 if restoff = 1 or (irest_flag = 1 and tv1(@n) = IREST) ++@n tcode(@n) = zpd(4) tv1(@n) = P_SUGGESTION tv2(@n) = 0x0300 tcode(@n){1} = chr(3) end &dA &dA &dA &d@ Code added &dA01/10/06&d@ to expand the operation of art_flag &dA if art_flag >= 16 and "ri" not_con line{1} a2 = art_flag >> 4 if a2 = 1 or a2 = 3 or a2 = 4 or a2 = 8 ++@n tcode(@n) = zpd(4) tcode(@n){1} = chr(1) tv1(@n) = P_SUGGESTION if a2 < 4 tv2(@n) = 0x0201 else if a2 = 4 tv2(@n) = 0x0202 else if a2 = 8 tv2(@n) = 0x0203 end end end tcode(@n){1} = chr(3) end end &dA goto PR end if line{1} = "/" perform action ++outpnt tput [Y,outpnt] J M 0 ~obx 0 0 10000 0 0 putc END goto NEXT end if " cgf*b" con line{1} a2 = mpt e = int(line{8}) &dK &d@ if line{8} in ['A'..'E'] if line{8} in ['A'..'E','X'] /* Implementing arpeggios &dA01/13/06 e = ors(line{8}) - 55 /* A = 10, etc. X = 33 (ARPEGGIO) end &dA &dA &d@ New code 01/13/06 implementing arpeggios; delete extraneous data &dA if e = ARPEGGIO line = line{1,24} line = line // pad(80) end &dA ++@n tdata(@n,1) = line{17..80} if line{1} = "f" tv3(@n) = 0 else if " 123" con line{24} /* staff number goes in tv3(.) & 0x0000000f if mpt = 1 tv3(@n) = 0 else tv3(@n) = mpt - 2 end else putc Illegal character in staff number column (col. 24). Please fix. putc Record = ~line goto EE end if a2 < 4 /* chords, grace, and cue notes if " 123456789" con line{15} /* track number goes in tv3(.) & 0x000000f0 if mpt = 1 /* track number = 0 means no information else --mpt a1 = mpt << 4 tv3(@n) += a1 end else putc Illegal character in track number column (col. 15). Please fix. putc Record = ~line goto EE end end end goto T(a2) /* a2 = mpt from ~20 lines above T(1): tv1(@n) = XNOTE tv2(@n) = 0 tcode(@n) = line{2,4} goto PR T(2): i = CUE_NOTE if line{2} = " " i = XCUE_NOTE tcode(@n) = line{3,4} e = 0 else tcode(@n) = line{2,4} end if line{2} = "r" i = CUE_REST end tv1(@n) = i tv2(@n) = e if line{2} = "r" /* restplace flag goes in tv3(.) & 0x0000ff00 tv3(@n) += restplace << 8 else if repeater_flag > 0 /* repeater flag goes in tv3(.) & 0x0000ff00 tv3(@n) += repeater_flag << 8 if bit(0,repeater_flag) = 1 and line{26} = "]" repeater_flag = 0 end end end goto PR T(3): i = GR_NOTE if line{2} = " " i = XGR_NOTE tcode(@n) = line{3,4} e = 0 else tcode(@n) = line{2,4} end tv1(@n) = i tv2(@n) = e if repeater_flag > 0 /* repeater flag goes in tv3(.) & 0x0000ff00 tv3(@n) += repeater_flag << 8 if bit(0,repeater_flag) = 1 and line{26} = "]" repeater_flag = 0 end end goto PR T(4): tv1(@n) = FIGURES tv2(@n) = d tv3(@n) = 0 tcode(@n) = line{2,4} goto PR T(5): tv1(@n) = MUSICAL_DIR if "12345" con line{15} tv2(@n) = mpt else tv2(@n) = 1 end if d > 0 tv3(@n) += d << 8 end &dA &dA &d@ &dA &d@ These lines added &dA02/03/08&d@. Rehearsal feature is not &dA &d@ implemented in SCORE conversion (for the moment) #if AUTOSCR if line{17} = "R" line{17} = "D" end if line{18} = "R" line{18} = "D" end #endif &dA &dA tcode(@n) = line{17,4} &dA &dA &d@ Code added &dA01/07/06&d@ to give format warning &dA if line{17,2} = " " putc &dEWARNING&d@ Bad format in a musical direction record temp4 = trm(line) putc Rec #~(scnt+5) -> &dE~temp4 putc end &dA &d@ goto PR T(6): tv1(@n) = BACKSPACE tv2(@n) = d tv3(@n) = 0 tcode(@n) = line{1,4} goto PR end if line{1} = "m" ++barnum2 a1 = measuremap(barnum2,1) jscrdat = "| NTRACKS=" // chs(a1) if nstaves = 2 loop for a2 = 1 to 9 if trackstave(barnum2,a2,1) + trackstave(barnum2,a2,2) > 0 jscrdat = jscrdat // " (" // chs(a2) // "," // chs(trackstave(barnum2,a2,3)) // ")" end repeat end if f4 = 0 and line{2,6} <> "heavy4" &dA &dA &d@ &dA03/07/06&d@ Allowing other measure types (except "mheavy4") here, but &dA &d@ clearing mrest below for all cases other than "measure" &dA &dK &d@ if line{2,4} = "easu" and f4 = 0 out = trm(line) &dK &d@ if len(out) < 16 &dA &dA &d@ New &dA03/13/06&d@ Don't process for "multi-rests" unless multirest_flag = 1 &dA &d@ Normally, this will apply to Parts only. &dA if len(out) < 16 and multirest_flag = 1 if @n = 1 if "ir" con tcode(1){1} out = trm(tdata(1,1)) if out = "" ++mrest if mrest = 1 how_much_mrest(1) = divspq how_much_mrest(2) = tv2(1) else if divspq <> how_much_mrest(1) dputc Program error stop end if tv2(1) <> how_much_mrest(2) putc Stage 2 file format error at approx rec ~scnt putc Attempting to use indefinite rests (rest with no letter) putc of successively different lengths, without change putc of meter. putc putc &dAProgram Halted&d@ putc stop end end mrest_line = line measnum = g if wrest = 1 or multirest_flag = 0 /* New code &dA01/03/04&d@ and &dA03/04/06 perform setmrest /* " " " else if line{2,4} <> "easu" perform setmrest /* &dA03/07/06&d@ clear mrest for non-standard measures end end @n = 0 out = trm(line) if len(out) > 7 if len(out) > 12 out = line{1,8} // chs(g-1) // pad(12) out = out // line{13..} out = trm(out) else out = line{1,8} // chs(g-1) out = trm(out) end end #if MREPORT putc ~out #endif &dA &dA &d@ Added &dA01/01/06&d@ &dA if mreport_flag = 1 putc ~out end &dA goto PR end end else if @n = vflag * 2 - 1 and nstaves = 1 &dA &dA &d@ examine &dA loop for i = 1 to vflag * 2 step 2 out = trm(tdata(i,1)) if "ir" not_con tcode(i){1} or out <> "" i = 10000 else if i < @n out = trm(tdata(i+1,1)) if tcode(i+1) <> "back" or out <> "" i = 10000 end end end repeat if i < 10000 ++mrest if mrest = 1 how_much_mrest(1) = divspq how_much_mrest(2) = tv2(1) else if divspq <> how_much_mrest(1) dputc Program error stop end if tv2(1) <> how_much_mrest(2) putc Stage 2 file format error at approx rec ~scnt putc Attempting to use indefinite rests (rest with no letter) putc of successively different lengths, without change putc of meter. putc putc &dAProgram Halted&d@ putc stop end end mrest_line = line measnum = g if wrest = 1 or multirest_flag = 0 /* New code &dA01/03/04&d@ and &dA03/04/06 perform setmrest /* " " " else if line{2,4} <> "easu" perform setmrest /* &dA03/07/06&d@ clear mrest for non-standard measures end end @n = 0 out = trm(line) #if MREPORT putc ~out #endif goto PR &dA &dA &d@ Added &dA01/01/06&d@ &dA if mreport_flag = 1 putc ~out end &dA end end end end end f4 = 0 ++@n tv1(@n) = BAR_LINE tv2(@n) = g tv3(@n) = nstaves measnum = g tcode(@n) = line{4,4} tdata(@n,1) = line{17..80} tdata(@n,2) = chs(barnum2) // "+" // jscrdat jscrdat = "" if tdata(@n,1) not_con "*" and tdata(@n,1) not_con "&" /* 2nd condition added &dA01/30/05 &dK &d@ if tdata(@n,1) not_con "*" out = trm(line) if len(out) > 7 if len(out) > 12 out = line{1,8} // chs(g-1) // pad(12) out = out // line{13..} out = trm(out) else out = line{1,8} // chs(g-1) out = trm(out) end end #if MREPORT putc ~out #endif &dA &dA &d@ Added &dA01/01/06&d@ &dA if mreport_flag = 1 putc ~out end &dA perform action loop for i = 1 to 50 loop for j = 1 to 4 /* &dA06/04/08&d@ was 3 &dK &d@ measax(j,i) = claveax(i) measax(j,i) = tclaveax(i) /* New &dA12/14/07&d@ repeat repeat @n = 0 end goto PR end putc ~line trp = 7 goto trap * NEXT: &dA &dA &d@ Open output file &dA open [3,2] outfile #if AUTOSCR putf [3] ~header1 putf [3] ~header2 putf [3] ~header3 #else &dA &dA &d@ New &dA03/25/06&d@ &dA tget [X,2] temp2 if temp2 con "{" temp2 = temp2{mpt..} temp2 = trm(temp2) else temp2 = "not identified" end tget [X,3] temp3 if temp3 con "TIMESTAMP:" temp3 = temp3{11..} temp3 = mrt(temp3) temp3 = trm(temp3) else temp3 = "" end putf [3] @ SOURCE: ~temp2 ~temp3 &dA #endif tget [Y,1] a .t1 temp3 &dA &dA &d@ Adding this code &dA01/30/05&d@ to make sure text is set at the right height &dA &d@ if text_flag = 1 a = text_loc end if single_line = 0 LL = "L" else LL = "l" end #if AUTOSCR temp3 = temp3 // " " a2 = transposition a4 = instrument_number a1 = measuremap(1,1) if nstaves = 2 line = "" loop for a3 = 1 to 9 if trackstave(1,a3,1) + trackstave(1,a3,2) > 0 line = line // " (" // chs(a3) // "," // chs(trackstave(1,a3,3)) // ")" end repeat putf [3] L ~granddist ~a ~notesize !39~partname | NTRACKS=~a1 ~line | TRANS=~a2 INSTN=~a4 else putf [3] ~LL 0 ~a ~notesize !39~partname | NTRACKS=~a1 | TRANS=~a2 INSTN=~a4 end #else if nstaves = 2 putf [3] L ~granddist ~a ~notesize !39~partname else putf [3] ~LL 0 ~a ~notesize !39~partname end #endif loop for i = 2 to outpnt tget [Y,i] line putf [3] ~line repeat close [3] treset [X] treset [Y] * ++f3 if f3 > f2 stop end goto BIG * trap: goto E(trp) E(1): putc Chord format error goto EE E(2): putc Figured harmony error goto EE E(3): putc Tie error putc putc This is most often caused by a tie that has &dAno terminating note&d@ putc in any part. You should first check to see that all ties in putc region where this error occurred are properly terminated. The putc problem can also be caused by excessive durations in a measure putc that has a tie. This will cause the program to think the measure putc has ended (early) and it will look for a terminating note in the putc &dAnext measure&d@; i.b46 e., it will skip a properly placed terminating note. putc If you still can't find the error, you might try deleting ties one putc at a time to see which one is causing the problem. putc putc Another cause can be trying to tie notes which are on different putc staves of the grand staff. At the moment, autoset does not support putc this feature. goto EE E(4): putc Bar error goto EE E(5): putc Text error goto EE E(6): putc Time signature error goto EE E(7): putc No recognizable control character goto EE E(8): putc Figured harmony out of order putc putc Possibly you have entered a figured offset improperly. putc putc For example, the offset &dAto&d@ the &dAsecond figure&d@ actually appears putc in the record for the first figure. The interpretation of the putc offset number is how must to advance the division counter &dAafter&d@ putc a figure is printed. putc goto EE E(9): putc Pitch decoding error goto EE /* This error condition added &dA10-12-96&d@ E(10): putc No pitch found to match tie termination (X) direction (*). putc putc Check musical direction records (*) in this measure for tie putc terminations and verify that the pitch in column 25 appears putc earlier in the measure, on the same staff. putc goto EE EE: putc putc &dAProgram Halted&d@ putc stop &dA &dA &d@ &dAÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿&d@ &dA &d@ &dA³ End of processing music data ³&d@ &dA &d@ &dAÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ&d@ &dA &dA &dA &dA &d@ &dA &dA &d@ &dAÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿&d@ &dA &dA &d@ &dA³ P R O C E D U R E S ³&d@ &dA &dA &d@ &dAÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ&d@ &dA &dA &d@ &dA &dA &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 1a. decodenote ³ &dA &d@³ ³ &dA &d@³ Input: note (string) ³ &dA &d@³ ³ &dA &d@³ Output: @c = clave number ³ &dA &d@³ 100 = rest ³ &dA &d@³ 200 = unprinted rest ³ &dA &d@³ ³ &dA &d@³ @d = &dAunmodified&d@ accidental flag ³ &dA &d@³ 0000 = no accidental ³ &dA &d@³ 0010 = sharp ³ &dA &d@³ 0011 = flat ³ &dA &d@³ 1010 = sharp sharp ³ &dA &d@³ 1111 = flat flat ³ &dA &d@³ ³ &dA &d@³ for rests, mf(1) = 0 ????????????? ³ &dA &d@³ ³ &dA &d@³ Note: decodenote is called only AFTER all note events have³ &dA &d@³ been reordered by time within the measure. ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure decodenote int a,b if note = "rest" @c = 100 @d = 0 mf(1) = 0 return end if note = "ires" @c = 200 @d = 0 return end if claves con note{1} a = mpt end @d = 0 loop for b = 2 to 4 if numbers con note{b} @c = mpt - 2 * 7 + a return end @d <<= 2 if accs con note{b} @d = @d | mpt end repeat putc note = ~note This will cause a ... return 9 &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 1a. decodeax (t1,t2) ³ &dA &d@³ ³ &dA &d@³ Input: t1 = pointer into ts array ³ &dA &d@³ t2 = index into measax array ³ &dA &d@³ bit(18,ts(t1,SUBFLAG_1)) = cautionary accidental flag³ &dA &d@³ (has effect only when no accidental would ³ &dA &d@³ otherwise be printed) ³ &dA &d@³ ³ &dA &d@³ Output: correct accidental in ts(.,AX) ³ &dA &d@³ ³ &dA &d@³ 0000 = no accidental ³ &dA &d@³ 0001 = natural ³ &dA &d@³ 0010 = sharp ³ &dA &d@³ 0011 = flat ³ &dA &d@³ 0110 = natural sharp ³ &dA &d@³ 0111 = natural flat ³ &dA &d@³ 1010 = sharp sharp ³ &dA &d@³ 1111 = flat flat ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure decodeax (t1,t2) int t1,t2,t3,t4,ax getvalue t1,t2 t3 = ts(t1,CLAVE) if t3 > 99 ts(t1,AX) = 0 return end &dA &dA &d@ adjust accident to reflect key and measure &dA t4 = ts(t1,AX) ax = t4 if ax = measax(t2,t3) if bit(18,ts(t1,SUBFLAG_1)) = 0 t4 = 0 else if t4 = 0 t4 = 1 /* natural end end else if ax = 0 t4 = 1 else if measax(t2,t3) > 7 if ax < 4 t4 = t4 | 4 end end end measax(t2,t3) = ax end ts(t1,AX) = t4 return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 2. action ³ &dA &d@³ ³ &dA &d@³ Purpose: Action is basically a continuation of the music ³ &dA &d@³ processing program. It is called when the data ³ &dA &d@³ for a measure is complete. ³ &dA &d@³ ³ &dA &d@³ Inputs: @n = number of elements in data arrays ³ &dA &d@³ tv1(.) = element type ³ &dA &d@³ ³ &dA &d@³ type element ³ &dA &d@³ ---- ------- ³ &dA &d@³ 1 regular note ³ &dA &d@³ 2 extra regular note in chord ³ &dA &d@³ 3 regular rest ³ &dA &d@³ 4 cue note ³ &dA &d@³ 5 extra cue note in chord ³ &dA &d@³ 6 cue rest ³ &dA &d@³ 7 grace note or grace rest ³ &dA &d@³ 8 extra grace note in chord ³ &dA &d@³ 9 figured harmony ³ &dA &d@³ 10 bar line ³ &dA &d@³ 11 musical direction ³ &dA &d@³ 12 invisable rest ³ &dA &d@³ 13 backspace ³ &dA &d@³ 14 clef change ³ &dA &d@³ 15 time designation or other directive ³ &dA &d@³ 16 time change ³ &dA &d@³ 17 change in divspq ³ &dA &d@³ 18 key change ³ &dA &d@³ 19 print suggestion ³ &dA &d@³ ³ &dA &d@³ tv2(.) = duration for types 1--9, 12,13 ³ &dA &d@³ = measure number for type 10 ³ &dA &d@³ = track number for type 11 (1 = default) ³ &dA &d@³ = new clef number for type 14 ³ &dA &d@³ = 0 for type 15 ³ &dA &d@³ = new time flag for type 16 ³ &dA &d@³ = new divspq for type 17 ³ &dA &d@³ = new key for type 18 ³ &dA &d@³ = type of suggestion for type 19 ³ &dA &d@³ ³ &dA &d@³ if between 0 and 7 ³ &dA &d@³ 0 = force slur 1 over ³ &dA &d@³ 1 = force slur 1 under ³ &dA &d@³ 2 = force slur 2 over ³ &dA &d@³ 3 = force slur 2 under ³ &dA &d@³ 4 = force slur 3 over ³ &dA &d@³ 5 = force slur 3 under ³ &dA &d@³ 6 = force slur 4 over ³ &dA &d@³ 7 = force slur 4 under ³ &dA &d@³ ³ &dA &d@³ if between 8 and 9 ³ &dA &d@³ 8 = overhanded tie (tips down) ³ &dA &d@³ 9 = underhanded tie (tips up) ³ &dA &d@³ ³ &dA &d@³ if between 16 and 31 (&dA03-21-97&d@) ³ &dA &d@³ bit 0: clear = square tuplet ³ &dA &d@³ set = round tuplet ³ &dA &d@³ bit 1: clear = broken tuplet ³ &dA &d@³ set = continuous tuplet ³ &dA &d@³ bit 2: clear = number outside tuplet ³ &dA &d@³ set = number inside tuplet ³ &dA &d@³ ³ &dA &d@³ if between 128 and 255 ³ &dA &d@³ font = type - 128 ³ &dA &d@³ ³ &dA &d@³ if between 0x100 and 0x1ff ³ &dA &d@³ vert and/or horz adj to musical dir ³ &dA &d@³ ³ &dA &d@³ if between 0x200 and 0x2ff ³ &dA &d@³ vert and/or horz adj to sub-obj ³ &dA &d@³ ³ &dA &d@³ if between 0x300 and 0x3ff ³ &dA &d@³ vert and/or horz adj to note/rest/fig ³ &dA &d@³ objects. ³ &dA &d@³ ³ &dA &d@³ if between 0x400 and 0x4ff ³ &dA &d@³ suggestion for barline or measure ³ &dA &d@³ ³ &dA &d@³ if between 0x500 and 0x5ff New &dA11/05/05&d@ ³ &dA &d@³ x adjustment to tuple ³ &dA &d@³ (range -127 to +127) ³ &dA &d@³ ³ &dA &d@³ if between 0x600 and 0x6ff New &dA11/05/05&d@ ³ &dA &d@³ y adjustment to tuple ³ &dA &d@³ (range -127 to +127) ³ &dA &d@³ ³ &dA &d@³ tv3(.) & 0x000f = staff number (0 or 1) ³ &dA &d@³ ³ &dA &d@³ For notes, rests and irests ³ &dA &d@³ & 0x00f0 = track number (0 to 9) 0=unknown ³ &dA &d@³ ³ &dA &d@³ For notes, ³ &dA &d@³ & 0xff00 = value of repeater_flag ³ &dA &d@³ For rests, ³ &dA &d@³ & 0xff00 = value of restplace ³ &dA &d@³ For musical directions ³ &dA &d@³ & 0xff00 = value of optional forward ³ &dA &d@³ offset for division counter ³ &dA &d@³ ³ &dA &d@³ tv5(.) used for flagging $ data that occurs ³ (New &dA01/17/04&d@) &dA &d@³ at the beginning of a measure, but ³ &dA &d@³ is not typeset immediately ³ &dA &d@³ ³ &dA &d@³ tcode(.) = pitch (rest) for types 1--8 ³ &dA &d@³ = number of figure fields for type 9 ³ &dA &d@³ (figured harmony) ³ &dA &d@³ = bar type for type 10 ³ &dA &d@³ = musical direction code and position ³ &dA &d@³ for type 11 ³ &dA &d@³ = "ires" for type 12 ³ &dA &d@³ = "back" for type 13 ³ &dA &d@³ = "0" or "128" for type 14 (clef change) ³ &dA &d@³ = "" for types 15--18 ³ &dA &d@³ = for type 19 (print suggestions) ³ &dA &d@³ a 4 byte code ³ &dA &d@³ ³ &dA &d@³ byte 1: 0x01: active flag (0 = inactive) ³ &dA &d@³ 0xfe: various meanings ³ &dA &d@³ (for ties only) ³ &dA &d@³ length modification (+128) ³ &dA &d@³ (0 = no data) ³ &dA &d@³ (for start slurs &dE([{z&d@ only) ³ &dA &d@³ curvature modification (+128) ³ &dA &d@³ (0 = no data) ³ &dA &d@³ (-1 = suppress slur) &dA04/26/05&d@ ³ &dA &d@³ (for notes, etc.) ³ &dA &d@³ upper four bits used to designate ³ &dA &d@³ note head shape. ³ &dA &d@³ 0 = regular ³ &dA &d@³ 1 = x (cymbal crash) &dA02/19/06&d@ ³ &dA &d@³ (2 = diamond) ³ &dA &d@³ ³ &dA &d@³ ³ &dA &d@³ byte 2: x-y active flags ³ &dA &d@³ 0x01: active flag (0 = inactive) ³ &dA &d@³ 0x02: 0 = x position is relative ³ &dA &d@³ 1 = x position is absolute ³ &dA &d@³ 0x04: 0 = y position is relative ³ &dA &d@³ 1 = y position is absolute ³ &dA &d@³ byte 3: x position data (+128) (0=no data) ³ &dA &d@³ byte 4: y position data (+128) (0=no data) ³ &dA &d@³ ³ &dA &d@³ &dKOLD tdata(.,.) = additional data for types 1--9, 11, 19&d@ ³ &dA03/21/03&d@ adding &dA &d@³ tdata(.,.) = additional data for types 1--11, 19 ³ tdata(.,.) for type 10 &dA &d@³ ³ &dA &d@³ ³ &dA &d@³ Output: ts(.,.) ³ &dA &d@³ Description of ts ³ &dA &d@³ -------------------------- ³ &dA &d@³ ³ &dA &d@³ Case I: Notes, Rests, Grace Notes, Cue Notes, Cue Rests ³ &dA &d@³ Extra Regular, Grace, and Cue notes in Chords ³ &dA &d@³ (types 1--8) ³ &dA &d@³ ³ &dA &d@³ ts(1) = type: 1 = note ³ &dA &d@³ 2 = extra regular note in chord ³ &dA &d@³ 3 = rest ³ &dA &d@³ 4 = cue note ³ &dA &d@³ 5 = extra cue note in chord ³ &dA &d@³ 6 = cue rest ³ &dA &d@³ 7 = grace note or grace rest ³ &dA &d@³ 8 = extra grace note in chord ³ &dA &d@³ ³ &dA &d@³ ts(2) = division number (starting with 1) ³ &dA &d@³ ts(3) = clave <100 = clave number ³ &dA &d@³ 100 = rest ³ &dA &d@³ 101 = movable rest ³ &dA &d@³ 200 = irest <-- ³ &dA &d@³ ³ &dA &d@³ ts(4) (used initially to store pointer to tcode(.) ) ³ &dA &d@³ ³ &dA &d@³ ts(4) = accidental flag ³ &dA &d@³ ³ &dA &d@³ bits 0x0f: 0 = none 6 = natural-sharp ³ &dA &d@³ 1 = natural 7 = natural-flat ³ &dA &d@³ 2 = sharp 10 = double sharp ³ &dA &d@³ 3 = flat 15 = double flat ³ &dA &d@³ ³ &dA &d@³ bit 0x10: 0 = regular 1 = "silent" ³ &dA &d@³ ³ &dA &d@³ bits 0xff00: left shift (positioning) ³ &dA &d@³ ³ &dA &d@³ ³ &dA &d@³ ts(5) = note type ³ &dA &d@³ ³ &dA &d@³ 1 = 256th note 7 = quarter note ³ &dA &d@³ 2 = 128th note 8 = half note ³ &dA &d@³ 3 = 64th note 9 = whole note ³ &dA &d@³ 4 = 32nd note 10 = breve ³ &dA &d@³ 5 = 16th note 11 = longa ³ &dA &d@³ 6 = 8th note 12 = eighth with slash ³ &dA &d@³ ³ &dA &d@³ ts(6) = dot flag 0 = no dot, 1 = dot, 2 = double dot ³ &dA &d@³ ts(7) = tuplet flag 0 = no tuplet, # = tuplet ³ &dA &d@³ 0xff first number ³ &dA &d@³ 0xff00 second number ³ &dA &d@³ 0xff0000 x adjustment (128 centered) ³ &dA &d@³ 0xff000000 y adjustment (128 centered) ³ &dA &d@³ ³ &dA &d@³ ts(8) = location on staff ³ &dA &d@³ ts(9) = spacing number ³ &dA &d@³ ts(10) = stem/chord flag bit clear set ³ &dA &d@³ ----- ------- --------- ³ &dA &d@³ 0 no stem stem ³ &dA &d@³ 1 step up stem down ³ &dA &d@³ 2 single note chord ³ &dA &d@³ 3 first note extra note ³ &dA &d@³ 4-7 (note number in chord) ³ &dA &d@³ ³ &dA &d@³ ts(11) = beam flag 0 = no beam ³ &dA &d@³ 1 = end beam ³ &dA &d@³ 2 = start beam ³ &dA &d@³ 3 = continue beam ³ &dA &d@³ ³ &dA &d@³ ts(12) = beam code (up to six digits) ³ &dA &d@³ ³ &dA &d@³ This is an integer less than 1000000. The one's ³ &dA &d@³ digit is the code for the eighth beam; the ³ &dA &d@³ tens digit is the code for the sixteenth beam, ³ &dA &d@³ etc. ³ &dA &d@³ ³ &dA &d@³ digit char meaning ³ &dA &d@³ ------- ---- --------- ³ &dA &d@³ 0 blank no beam ³ &dA &d@³ 1 = continued beam ³ &dA &d@³ 2 [ begin beam ³ &dA &d@³ 3 ] end beam ³ &dA &d@³ 4 / forward hook ³ &dA &d@³ 5 \ backward hook ³ &dA &d@³ 6 simple repeater ³ &dA &d@³ 7 begin repeated beam ³ &dA &d@³ 8 end repeated beam ³ &dA &d@³ ³ &dA &d@³ ts(13) = local x-offset (for chords) ³ &dA &d@³ ³ &dA &d@³ ts(14) = superflag bit set ³ &dA &d@³ ----- -------- ³ &dA &d@³ 0 tie ³ &dA &d@³ 1 begin ~~~~~ without tr. ³ &dA &d@³ 2 begin ~~~~~ with tr. ³ &dA &d@³ 3 end ~~~~~ ³ &dA &d@³ 4 begin tuplet ³ &dA &d@³ 5 end tuplet ³ &dA &d@³ 6 tuple has a bracket ³ &dA &d@³ 7 bracket is continuous ³ &dA &d@³ (0 = broken) ³ &dA &d@³ 8 number is inside ³ &dA &d@³ (0 = outside) ³ &dA &d@³ 9 bracket is round ³ &dA &d@³ (0 = square) ³ &dA &d@³ ³ &dA &d@³ 16 tie is editorial (dotted) ³ &dA &d@³ 17 ~~~ is editorial ³ &dA &d@³ 18 tuple is editorial ³ &dA &d@³ ³ &dA &d@³ ³ &dA &d@³ ts(15) = slurflag bit set meaning ³ &dA &d@³ ------- ------- ³ &dA &d@³ 0 start slur1 (new slur) ³ &dA &d@³ 1 stop slur1 (from prev. note) ³ &dA &d@³ 2 start slur2 (etc.) ³ &dA &d@³ 3 stop slur2 ³ &dA &d@³ 4 start slur3 ³ &dA &d@³ 5 stop slur3 ³ &dA &d@³ 6 start slur4 ³ &dA &d@³ 7 stop slur4 ³ &dA &d@³ ³ &dA &d@³ for editorial slurs ³ &dA &d@³ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ³ &dA &d@³ 16 start slur1 (new slur) ³ &dA &d@³ 17 stop slur1 (from prev. note) ³ &dA &d@³ 18 start slur2 (etc.) ³ &dA &d@³ 19 stop slur2 ³ &dA &d@³ 20 start slur3 ³ &dA &d@³ 21 stop slur3 ³ &dA &d@³ 22 start slur4 ³ &dA &d@³ 23 stop slur4 ³ &dA &d@³ ³ &dA &d@³ for both kinds of slurs ³ &dA &d@³ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ³ &dA &d@³ 8 force slur1 ³ &dA &d@³ 9 0 = up, 1 = down ³ &dA &d@³ 10 force slur2 ³ &dA &d@³ 11 0 = up, 1 = down ³ &dA &d@³ 12 force slur3 ³ &dA &d@³ 13 0 = up, 1 = down ³ &dA &d@³ 14 force slur4 ³ &dA &d@³ 15 0 = up, 1 = down ³ &dA &d@³ ³ &dA &d@³ for ties ³ &dA &d@³ ÄÄÄÄÄÄÄÄ ³ &dA &d@³ 24 specify tie orientation ³ &dA &d@³ 25 0 = overhand; 1 = underhand ³ &dA &d@³ ³ &dA &d@³ ³ &dA &d@³ ts(16) = subflag 1 bit item ³ &dA &d@³ ----- ------- ³ &dA &d@³ 0-3 ornaments ³ &dA &d@³ --------- ³ &dA &d@³ 0 = none ³ &dA &d@³ 1 = turn ³ &dA &d@³ 2 = trill(tr.) ³ &dA &d@³ 3 = shake ³ &dA &d@³ 4 = mordent ³ &dA &d@³ 5 = delayed turn ³ &dA &d@³ 6 = tremulo New &dA01/07/06&d@ ³ &dA &d@³ 7-15 (available) ³ &dA &d@³ ³ &dA &d@³ 4-9 accidental combinations ³ &dA &d@³ with ornaments ³ &dA &d@³ ----------------------- ³ &dA &d@³ 4-6 accidental above ornament ³ &dA &d@³ 7-9 accidental below ornament ³ &dA &d@³ ³ &dA &d@³ Accidental code ³ &dA &d@³ --------------- ³ &dA &d@³ 0 = none ³ &dA &d@³ 1 = sharp-sharp ³ &dA &d@³ 2 = flat-flat ³ &dA &d@³ 3 = sharp ³ &dA &d@³ 4 = natural ³ &dA &d@³ 5 = flat ³ &dA &d@³ 6 = (not used) ³ &dA &d@³ 7 = (not used) ³ &dA &d@³ ³ &dA &d@³ 10--13 dynamics ³ &dA &d@³ -------- ³ &dA &d@³ 0 = none (see also bits 26 ³ &dA &d@³ 1 = p to 28) ³ &dA &d@³ 2 = pp ³ &dA &d@³ 3 = ppp ³ &dA &d@³ 4 = pppp ³ &dA &d@³ 5 = f ³ &dA &d@³ 6 = ff ³ &dA &d@³ 7 = fff ³ &dA &d@³ 8 = ffff ³ &dA &d@³ 9 = mp ³ &dA &d@³ 10 = mf ³ &dA &d@³ 11 = fp ³ &dA &d@³ 12 = sfp ³ &dA &d@³ 13 = sf ³ &dA &d@³ 14 = sfz ³ &dA &d@³ 15 = rfz ³ &dA &d@³ ³ &dA &d@³ 14 upright fermata ³ &dA &d@³ 15 inverted fermata ³ &dA &d@³ ³ &dA &d@³ 16 print note in cue size ³ &dA &d@³ 17 editorial accidental ³ &dA &d@³ 18 cautionary accidental ³ &dA &d@³ ³ &dA &d@³ 19 accidental follows trill ³ &dA &d@³ rather than above or below ³ &dA &d@³ (added &dA11/05/05&d@) ³ &dA &d@³ ³ &dA &d@³ 20--23 shape of note head ³ &dA &d@³ ------------------ ³ &dA &d@³ 0 = regular ³ &dA &d@³ 1 = x (cymbal crash) ³ &dA &d@³ 2 -> (un-assigned) ³ &dA &d@³ possibilities include ³ &dA &d@³ normal diamond ³ &dA &d@³ stem centered diamond ³ &dA &d@³ blank (stem only) ³ &dA &d@³ 18th century ³ &dA &d@³ (added &dA02/19/06&d@) ³ &dA &d@³ ³ &dA &d@³ 24 overhand back tie ³ &dA &d@³ 25 underhand back tie ³ &dA &d@³ (added &dA04/22/08&d@) ³ &dA &d@³ ³ &dA &d@³ 26--28 more dynamics (added &dA10/08/08&d@) ³ &dA &d@³ ------------- ³ &dA &d@³ 0 = really none ³ &dA &d@³ 1 = ffp ³ &dA &d@³ 2 = mfp (added &dA01/12/09&d@) ³ &dA &d@³ 3 = Zf (added &dA03/16/09&d@) ³ &dA &d@³ 4 = ³ &dA &d@³ 5 = ³ &dA &d@³ 6 = ³ &dA &d@³ 7 = ³ &dA &d@³ ³ &dA &d@³ ³ &dA &d@³ ts(17) = subflag 2 bit item ³ &dA &d@³ ----- ------- ³ &dA &d@³ n 0 down bow ³ &dA &d@³ v 1 up bow ³ &dA &d@³ i 2 spiccato ³ &dA &d@³ . 3 staccato ³ &dA &d@³ = 4 line over dot ³ &dA &d@³ _ 5 legato ³ &dA &d@³ > 6 horizontal accent ³ &dA &d@³ A 7 vertical sfortzando accent ³ &dA &d@³ V 8 vertical sfortzando accent ³ &dA &d@³ o 9 harmonic ³ &dA &d@³ Q 10 thumb (*) ³ &dA &d@³ 0 11 open string (0) ³ &dA &d@³ ³ &dA &d@³ 12-31 fingering (up to 5 numbers) ³ &dA &d@³ ---------- ³ &dA &d@³ 12-14 first number ³ &dA &d@³ 0 = no number ³ &dA &d@³ 1 = finger 1 ³ &dA &d@³ 2 = finger 2 ³ &dA &d@³ 3 = finger 3 ³ &dA &d@³ 4 = finger 4 ³ &dA &d@³ 5 = finger 5 ³ &dA &d@³ 15 substitution bit ³ &dA &d@³ 0 = no substitution ³ &dA &d@³ 1 = substitution ³ &dA &d@³ 16-19 (second number, see 12 to 15) ³ &dA &d@³ 20-23 (third number) ³ &dA &d@³ 24-27 (fourth number) ³ &dA &d@³ 28-31 (fifth number) ³ &dA &d@³ ³ &dA &d@³ ³ &dA &d@³ ts(18) = used for sorting, later used to indicate position ³ &dA &d@³ of virtual note head (for placing slurs and ³ &dA &d@³ other articulations and signs). bit 24 ³ &dA &d@³ set if modified ³ &dA &d@³ ts(19) = used for sorting, later used to indicate global ³ &dA &d@³ x-offset for chord groups ³ &dA &d@³ ts(20) = index to ASCII tsdata ³ &dA &d@³ ts(21) = pass number ³ &dA &d@³ ts(22) = backtie flag (for regular, chord and cue notes) ³ &dA &d@³ ³ &dA &d@³ 0 = this note is not backward tied ³ &dA &d@³ # = this note is backward tied ³ &dA &d@³ ³ &dA &d@³ Actually the BACKTIE flag has multiple uses. ³ &dA &d@³ ³ &dA &d@³ (1) When the ts array is first being constructed, ³ &dA &d@³ there may be a tie &dAinto&d@ this group of notes ³ &dA &d@³ from a previous measure. In this case, a tiearr ³ &dA &d@³ ROW element has already been constructed. The ³ &dA &d@³ tiearr rows need to be searched and the proper ³ &dA &d@³ one found. This index (+ INT10000) is then ³ &dA &d@³ stored as the backtie flag. ³ &dA &d@³ ³ &dA &d@³ (2) For all other row elements of the ts array, ³ &dA &d@³ it is sufficient to store a back pointer to the ³ &dA &d@³ ts row that originated the tie. ³ &dA &d@³ ³ &dA &d@³ (3) When it comes time to process the ts array, ³ &dA &d@³ three cases may be encountered. ³ &dA &d@³ ³ &dA &d@³ (a) There is a non-zero backtie flag, and this ³ &dA &d@³ flag is greater than INT10000. In this case, ³ &dA &d@³ the backtie flag (- INT10000) points to a tiearr ³ &dA &d@³ ROW element, and the tie may be processed. ³ &dA &d@³ ³ &dA &d@³ (b) There is a forward tie from this note. In ³ &dA &d@³ this case, the backtie flag has already been ³ &dA &d@³ used to set a tie and the element is now free ³ &dA &d@³ for other use. We can generate a new row element³ &dA &d@³ in tiearr, and place the pointer to this element ³ &dA &d@³ in the backtie flag (the term "backtie" is now ³ &dA &d@³ a misnomer). ³ &dA &d@³ ³ &dA &d@³ (c) Now when we encounter a non-zero backtie ³ &dA &d@³ flag in a new ts ROW, we know this points to a ³ &dA &d@³ previous ts row, from which we can get the ³ &dA &d@³ pointer to the relevant tiearr ROW in that ³ &dA &d@³ ts(,.BACKTIE). ³ &dA &d@³ ³ &dA &d@³ For this method to work properly, it is ³ &dA &d@³ necessary that backward ties be processed before ³ &dA &d@³ forward ties. When a backward tie is processed ³ &dA &d@³ it is important to set the backtie flag to zero. ³ &dA &d@³ ³ &dA &d@³ ts(23) = note duration (in divisions) ³ &dA &d@³ ts(24) = increment distance flag ³ &dA &d@³ ³ &dA &d@³ 0 -- fixed distance (not to be modified by print) ³ &dA &d@³ # -- variable distance; # = time elaps between ³ &dA &d@³ this node and next node. ³ &dA &d@³ (576 divisions = quarter note) ³ &dA &d@³ ³ &dA &d@³ ts(25) = virtual end of stem (bit 24 set if modified) ³ &dA &d@³ ts(26) = editorial version of ts(16), subflag 1 ³ &dA &d@³ ts(27) = editorial version of ts(17), subflag 2 ³ &dA &d@³ ts(28) = staff number ³ &dA &d@³ ts(29) = multi-track flag << 2 + mcat flag ³ &dA &d@³ ³ &dA &d@³ multi-track flag ³ &dA &d@³ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ³ &dA &d@³ 0 = this note lies on a staff that has notes from ³ &dA &d@³ only one pass (the simplest and most common ³ &dA &d@³ situation). ³ &dA &d@³ 1 = this note belongs to one of multiple passes ³ &dA &d@³ on this staff and all notes on this pass ³ &dA &d@³ have stems which point up ³ &dA &d@³ 2 = this note belongs to one of multiple passes ³ &dA &d@³ on this staff and all notes on this pass ³ &dA &d@³ have stems which point down ³ &dA &d@³ 3 = this note belongs to one of multiple passes ³ &dA &d@³ on this staff and the notes for at least one ³ &dA &d@³ of these passes have stem directions which ³ &dA &d@³ are both up and down ³ &dA &d@³ ³ &dA &d@³ mcat flag ³ &dA &d@³ ÄÄÄÄÄÄÄÄÄ ³ &dA &d@³ 0 = only one independent instrument represented ³ &dA &d@³ in this measure (vflag = 1) ³ &dA &d@³ 1 = more than one independent instrument (vflag > 1)³ &dA &d@³ but only one pass and without chords (either ³ &dA &d@³ unison part, or single part) ³ &dA &d@³ 2 = more than one independent instrument (vflag > 1)³ &dA &d@³ but only one pass but with chords (more than ³ &dA &d@³ one part, but parts are isorhythmic) ³ &dA &d@³ 3 = more than one independent instrument (vflag > 1)³ &dA &d@³ and more than one pass (two or more musically ³ &dA &d@³ independent parts) ³ &dA &d@³ ³ &dA &d@³ ts(30) = spacing parameter (1 <= spn <= 6913) ³ &dA &d@³ ts(31) = y position of object (saves time in proc. chords) ³ &dA &d@³ ts(32) = pointer to extra ts() row element for storing data ³ &dA &d@³ on slurs. Elements 1-6 of new element are for ³ &dA &d@³ storing global data on slurs entering and leaving ³ &dA &d@³ the note. Elements 7-42 are taken in groups of ³ &dA &d@³ three (expanded from two in &dA05/06/03&d@ code revi- ³ &dA &d@³ sion), making a total of 12 such groups. Each ³ &dA &d@³ group describes a slur entering or leaving this ³ &dA &d@³ note. The first element in the group contains ³ &dA &d@³ general information + the x-offset; the second ³ &dA &d@³ element in the group contains the y-offset. The ³ &dA &d@³ third element in the group contains the integer ³ &dA &d@³ equivalent of the 4-byte print suggestion for ³ &dA &d@³ the slur. See &dATS32&d@ for more information. ³ &dA &d@³ ³ &dA &d@³ ts(33) = node shift flag (positive and negative values) ³ &dA &d@³ ³ &dA &d@³ ts(34) = track number: 0 if not present ³ &dA &d@³ ts(35) = base-40 pitch ³ &dA &d@³ ts(36) = displacement of note head from the definitive ³ &dA &d@³ node position (related to GLOBAL_XOFF) ³ &dA &d@³ Value = -100 if the displacement is (approx.) ³ &dA &d@³ one notehead to the left <-- ³ &dA &d@³ Value = 100 if the displacement is (approx.) ³ &dA &d@³ one notehead to the right --> ³ &dA &d@³ Otherwise Value = a * INT10000 + b where ³ &dA &d@³ a = width of notehead in dots ³ &dA &d@³ b = displacement (right or left) meas. in dots ³ &dA &d@³ ³ &dA &d@³ ts(37) = SCORE P5 accidental information ³ &dA &d@³ bits 0-7: the two digit (fractional) part of P5 ³ &dA &d@³ bits 8-15: the one digit integer part of P5 ³ &dA &d@³ bits 16-31: if non-zero, the number of dots ³ &dA &d@³ to the left of the definitive node ³ &dA &d@³ position where a CODE-9 natural ³ &dA &d@³ must be placed. ³ &dA &d@³ ³ &dA &d@³ ts(38) = SCORE P9 augmentation dot information ³ &dA &d@³ if bits 24-31 (0xff000000) are off, ³ &dA &d@³ bits 0-7: the two digit (fractional) part of P9³ &dA &d@³ bits 8-15: the dot part of P9 (in 10's & 100's) ³ &dA &d@³ otherwise, ³ &dA &d@³ bits 24-31 (0xff000000) contain # of dots ³ &dA &d@³ bits 0-23 contain relative dot position(in dots)³ &dA &d@³ x position * INT10000 + y position ³ &dA &d@³ (must use CODE-9 to set this) ³ &dA &d@³ ³ &dA &d@³ ts(39) = tsr pointer ³ &dA &d@³ ³ &dA &d@³ ³ &dA &d@³ Case II: Figures ³ &dA &d@³ ³ &dA &d@³ ts(1) = 9 ³ &dA &d@³ ts(2) = division number (starting with 1) ³ &dA &d@³ ts(3) = number of figures in this chord ³ &dA &d@³ ts(4) = space parameter ³ &dA &d@³ ts(5) = first figure -- position one ³ &dA &d@³ ts(6) = first figure -- position two ³ &dA &d@³ ts(7) = first start/stop flag for continuation line ³ &dA &d@³ ts(8) = second figure -- position one ³ &dA &d@³ ts(9) = second figure -- position two ³ &dA &d@³ ts(10) = second start/stop flag for continuation line ³ &dA &d@³ ts(11) = third figure -- position one ³ &dA &d@³ ts(12) = third figure -- position two ³ &dA &d@³ ts(13) = third start/stop flag for continuation line ³ &dA &d@³ ts(14) = fourth figure -- position one ³ &dA &d@³ ts(15) = fourth figure -- position two ³ &dA &d@³ ts(16) = fourth start/stop flag for continuation line ³ &dA &d@³ ³ &dA &d@³ figure field: 0 = blank ³ &dA &d@³ 1-19 = figure ³ &dA &d@³ 20 = + ³ &dA &d@³ 21 = x ³ &dA &d@³ 22 = 2+ ³ &dA &d@³ 23 = sharp ³ &dA &d@³ 24 = 4+ ³ &dA &d@³ 25 = 5+ ³ &dA &d@³ 26 = 6\ ³ &dA &d@³ 27 = 7\ ³ &dA &d@³ 28 = natural ³ &dA &d@³ 29 = flat ³ &dA &d@³ 30 = short continuation line (-) ³ &dA &d@³ ³ &dA &d@³ Adding 1000 to figure field (position one) indicates ³ &dA &d@³ small parantheses around the field. ³ &dA &d@³ Adding 2000 to figure field (position one) indicates ³ &dA &d@³ large parantheses this figure and the one below it. ³ &dA &d@³ Adding 3000 to figure field (position one) indicates ³ &dA &d@³ large parantheses this figure and the two below it. ³ &dA &d@³ (Added &dA11/16/03&d@) ³ &dA &d@³ ³ &dA &d@³ start/stop continuation flag: 0 = none ³ &dA &d@³ 1 = stop ³ &dA &d@³ 2 = start ³ &dA &d@³ 3 = continue ³ &dA &d@³ ³ &dA &d@³ ts(20) = minimum space for figure group ³ &dA &d@³ ts(21) = pass number ³ &dA &d@³ ts(23) = figure duration in divisions (0 if not given) ³ &dA &d@³ ts(24) = increment distance flag (see notes) ³ &dA &d@³ ts(28) = staff number ³ &dA &d@³ ³ &dA &d@³ Case III: Bar Lines ³ &dA &d@³ ³ &dA &d@³ ts(1) = 10 ³ &dA &d@³ ts(2) = division number (starting with 1) ³ &dA &d@³ ts(3) = bar number (0 = none) ³ &dA &d@³ ts(4) = bar type ³ &dA &d@³ ³ &dA &d@³ 1 = regular 5 = double regular ³ &dA &d@³ 2 = heavy 6 = regular-heavy ³ &dA &d@³ 3 = dotted 9 = heavy-regular ³ &dA &d@³ 10 = heavy-heavy ³ &dA &d@³ ³ &dA &d@³ ts(5) = repeat flag ³ &dA &d@³ ³ &dA &d@³ 0 = no repeats 1 = forward repeat ³ &dA &d@³ 2 = back repeat 3 = both repeats ³ &dA &d@³ ³ &dA &d@³ ts(6) = backward ending flag ³ &dA &d@³ ³ &dA &d@³ 0 = no ending ³ &dA &d@³ # = ending number: positive = stop ending ³ &dA &d@³ negative = discontinue ³ &dA &d@³ ending ³ &dA &d@³ ³ &dA &d@³ ts(7) = forward ending flag ³ &dA &d@³ ³ &dA &d@³ 0 = no ending ³ &dA &d@³ # = ending number ³ &dA &d@³ ³ &dA &d@³ ts(8) = flags ³ &dA &d@³ ³ &dA &d@³ bit set clear ³ &dA &d@³ ----- ------------ ------- ³ &dA &d@³ 0 continue ~~~ stop ~~~ ³ &dA &d@³ 1 segno sign 0 ³ &dA &d@³ 2 fermata over bar 0 ³ &dA &d@³ 3 fermata under bar 0 ³ &dA &d@³ ³ &dA &d@³ ts(9) = space parameter (important for non-contr. bars) ³ &dA &d@³ ts(10) = number over previous measure: 0 = none ³ &dA &d@³ ³ &dA &d@³ ts(20) = index to ASCII tsdata &dKtaken out&d@, ³ &dA &d@³ &dAthen put back&d@ &dA03/21/03&d@ ³ &dA &d@³ The reason for putting this back is that ³ &dA &d@³ we need an ASCII string to communicate ³ &dA &d@³ the NTRACK data that goes with the barline ³ &dA &d@³ object. ³ &dA &d@³ ³ &dA &d@³ ts(21) = pass number ³ &dA &d@³ ts(28) = number of staves ³ &dA &d@³ ³ &dA &d@³ Case IV: Signs, Words, Marks ³ &dA &d@³ ³ &dA &d@³ ts(1) = type sign = 11, words = 12, mark = 13 ³ &dA &d@³ ts(2) = division number (starting with 1) ³ &dA &d@³ ts(3) = vertical position flag: 1 = below line ³ &dA &d@³ 2 = above line ³ &dA &d@³ ts(4) = sign number ³ &dA &d@³ ³ &dA &d@³ 0 = no sign ³ &dA &d@³ 1 = segno ³ &dA &d@³ 2 = ped ³ &dA &d@³ 3 = * ³ &dA &d@³ 4 = other letter dynamics ³ &dA &d@³ 5 = D.S or D.C. (right justified string) ³ &dA &d@³ 6 = fine (centered string) ³ &dA &d@³ 7 = words (left justified string) ³ &dA &d@³ 8 = tie terminator (added &dA10-12-96&d@) ³ &dA &d@³ 9 = rehearsal mark (left justified + box) ³ &dA &d@³ (added &dA02-03-08&d@) ³ &dA &d@³ ³ &dA &d@³ ts(5) = super flag ³ &dA &d@³ ³ &dA &d@³ 0 = no super-object ³ &dA &d@³ 1 = start wedge ³ &dA &d@³ 2 = stop wedge ³ &dA &d@³ 3 = start dashes (after words) ³ &dA &d@³ 4 = stop dashes ³ &dA &d@³ 5 = start 8ve up ³ &dA &d@³ 6 = stop 8ve up ³ &dA &d@³ 7 = start 8ve down ³ &dA &d@³ 8 = stop 8ve down ³ &dA &d@³ 9 = start 15 up ³ &dA &d@³ 10 = stop 15 up ³ &dA &d@³ 11 = start 15 down ³ &dA &d@³ 12 = stop 15 down ³ &dA &d@³ 13 = normal transposition (temporary flag) ³ &dA &d@³ ³ &dA &d@³ ts(6) = parameter for words: optional font designation ³ &dA &d@³ ³ &dA &d@³ ts(7) = wedge offset (for cases where a wedge begins after ³ &dA &d@³ or stops at a letter dynamic) ³ &dA &d@³ ³ &dA &d@³ ts(8) = track number (useful for multiple wedges, dashes ³ &dA &d@³ or transpositions of the same type) ³ &dA &d@³ ³ &dA &d@³ ts(9) = spacing (for case of isolated mark) ³ &dA &d@³ ³ &dA &d@³ ts(10) = parameter for wedges: wedge spread ³ &dA &d@³ ³ &dA &d@³ ts(11) = parameter for musical directions which are ³ &dA &d@³ objects: position shift ³ &dA &d@³ ³ &dA &d@³ ts(12) = special flag for case where this element is ³ &dA &d@³ isolated on a division (possibly with other ³ &dA &d@³ members of this same group). ³ &dA &d@³ ³ &dA &d@³ ts(13) = parameter for musical directions which are ³ &dA &d@³ super-objects: position shift ³ &dA &d@³ ³ &dA &d@³ ts(20) = index to ASCII tsdata ³ &dA &d@³ ³ &dA &d@³ ts(21) = pass number ³ &dA &d@³ ³ &dA &d@³ ts(22) = backtie flag (for tie terminators) (added &dA10-12-96&d@) ³ &dA &d@³ ³ &dA &d@³ ts(28) = staff number ³ &dA &d@³ ³ &dA &d@³ Case V: Clef change in middle of a measure ³ &dA &d@³ ³ &dA &d@³ ts(1) = type = 14 ³ &dA &d@³ ts(2) = division number (starting with 1) ³ &dA &d@³ ts(3) = clef number ³ &dA &d@³ ts(4) = clef font number ³ &dA &d@³ ts(5) = transpostion flag: ³ &dA &d@³ ³ &dA &d@³ 1 = notes written octave higher than sound ³ &dA &d@³ 0 = notes written at sound ³ &dA &d@³ -1 = notes written octave lower than sound ³ &dA &d@³ ³ &dA &d@³ ts(6) = position on staff ³ &dA &d@³ ts(9) = space parameter ³ &dA &d@³ ts(20) = index to ASCII tsdata ³ &dA &d@³ ts(21) = pass number ³ &dA &d@³ ts(28) = staff number ³ &dA &d@³ ³ &dA &d@³ Case VI: Time designation in middle of a measure ³ &dA &d@³ ³ &dA &d@³ ts(1) = type = 15 ³ &dA &d@³ ts(2) = division number (starting with 1) ³ &dA &d@³ ts(9) = space parameter ³ &dA &d@³ ts(20) = index to ASCII tsdata ³ &dA &d@³ ts(21) = pass number ³ &dA &d@³ ts(28) = staff number ³ &dA &d@³ ³ &dA &d@³ Case VII: Meter change in middle of a measure ³ &dA &d@³ ³ &dA &d@³ ts(1) = type = 16 ³ &dA &d@³ ts(2) = division number (starting with 1) ³ &dA &d@³ ts(3) = time number (100 time numerator + denominator) ³ &dA &d@³ ts(9) = space parameter ³ &dA &d@³ ts(20) = index to ASCII tsdata ³ &dA &d@³ ts(21) = pass number ³ &dA &d@³ ts(28) = number of currently active staves ³ &dA &d@³ ³ &dA &d@³ Case VIII: Change in number of divisions per quarter ³ &dA &d@³ ³ &dA &d@³ ts(1) = type = 17 ³ &dA &d@³ ts(2) = division number (starting with 1) ³ &dA &d@³ ts(3) = divisions per quarter ³ &dA &d@³ ts(9) = space parameter ³ &dA &d@³ ts(20) = index to ASCII tsdata ³ &dA &d@³ ts(21) = pass number ³ &dA &d@³ ³ &dA &d@³ Case IX: Change in key signature ³ &dA &d@³ ³ &dA &d@³ ts(1) = type = 18 ³ &dA &d@³ ts(2) = division number (starting with 1) ³ &dA &d@³ ts(3) = new key signature ³ &dA &d@³ ts(4) = old key signature ³ &dA &d@³ ts(9) = space parameter ³ &dA &d@³ ts(20) = index to ASCII tsdata ³ &dA &d@³ ts(21) = pass number ³ &dA &d@³ ts(28) = number of currently active staves ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure action int t1,t2,t3,t4,t5,t6 int t7,t8 /* (added &dA10-12-96&d@) if @n = 0 return end passnum = 1 &dA &dA &d@ If there are no pending slurs, then clear the ts array and set sct = 0 &dA if sct = 0 loop for a9 = 1 to MAX_OBJECTS loop for a10 = 1 to TS_SIZE ts(a9,a10) = 0 repeat &dA &d@ tsdata(a9) = "" tsr(a9) = zpd(TSR_LENG) /* &dA05/02/03&d@: was zpd(72) ts(a9,TSR_POINT) = a9 repeat outslurs = "00000000" else if outslurs = "00000000" if sct > maxsct maxsct = sct end loop for a9 = 1 to maxsct + 10 loop for a10 = 1 to TS_SIZE ts(a9,a10) = 0 repeat &dA &d@ tsdata(a9) = "" tsr(a9) = zpd(TSR_LENG) /* &dA05/02/03&d@: was zpd(72) ts(a9,TSR_POINT) = a9 repeat sct = 0 old@n = 0 else if sct > maxsct maxsct = sct end loop for a9 = sct+1 to maxsct+10 loop for a10 = 1 to TS_SIZE ts(a9,a10) = 0 repeat &dA &d@ tsdata(a9) = "" tsr(a9) = zpd(TSR_LENG) /* &dA05/02/03&d@: was zpd(72) ts(a9,TSR_POINT) = a9 repeat end end oldsct = sct &dA &dA &d@ If you are starting a new version of the ts(.) array then &dA &d@ copy claveax(.) to tclaveax(.) &dA12/14/07&d@ &dA if sct = 0 loop for a9 = 1 to 50 tclaveax(a9) = claveax(a9) repeat end &dA &dA &dA &d@ Store original data in set array &dA divpoint = 1 cuediv = 0 totdiv = 1 qflag = 0 divspq = olddivspq loop for a9 = 1 to @n tsdata(a9+old@n) = "" line = tdata(a9,1) tvar1 = tv1(a9) tvar2 = tv2(a9) if tv3(a9) > 0xff if tvar1 <= NOTE_OR_REST if tvar1 = REST or tvar1 = CUE_REST restplace2 = tv3(a9) >> 8 else &dK &d@ repeater_flag2 = tv3(a9) >> 10 + 1 repeater_flag2 = tv3(a9) >> 8 /* changed &dA01/01/08 end else mdir_offset = tv3(a9) >> 8 end tv3(a9) &= 0xff else repeater_flag2 = 0 restplace2 = 0 mdir_offset = 0 end &dA &dA &d@ Deal with situation where there is an irest followed by a &dA &d@ print suggestion that it should be allocated space &dA if tvar1 = IREST if a9 < @n and tv1(a9+1) = P_SUGGESTION if tv2(a9+1) & 0xff00 = 0x0300 pcontrol = ors(tcode(a9+1){1}) if pcontrol = 3 or pcontrol = 5 tvar1 = REST /* send it through the system tcode(a9) = "rest" /* as a "regular" rest end end else if scr_flag = 1 tvar1 = REST /* send it through the system tcode(a9) = "ires" /* as a "silent" rest &dA(but be careful) end end end &dA &d@ &dA &d@ Case I: notes, rests, cue notes, grace notes, &dA &d@ extra notes in chords, figures &dA if tvar1 <> FIGURES and tvar1 <> P_SUGGESTION figdiv = 0 end if tvar1 <= NOTE_OR_REST loop for a3 = 1 to 7 step 3 a4 = a3 + 1 if tvar1 = a4 /* extra chord tone if a9 = 1 return 1 end c5 = 1 loop while tv1(a9-c5) = P_SUGGESTION and a9 > c5 + 1 ++c5 repeat if tv1(a9-c5) <> a3 if tv1(a9-c5) <> a4 return 1 end else * tricky code to set chord bit on first note in chord ts(sct,STEM_FLAGS) += 4 /* sct -> previous array entry end end repeat ++sct /* &dIincrementing array pointer &dAsct ts(sct,TYPE) = tvar1 &dA &dA &d@ &dASet DIV&d@ (for cue notes) &dA if chr(tvar1) in [CUE_NOTE,XCUE_NOTE,CUE_REST] if tvar1 <> XCUE_NOTE ts(sct,DIV) = divpoint + cuediv else ts(sct,DIV) = divpoint + cuediv - chorddur end goto WC end &dA &dA &d@ &dASet DIV&d@ (for regular and grace notes) &dA if tvar1 = XNOTE ts(sct,DIV) = divpoint - chorddur else ts(sct,DIV) = divpoint end cuediv = 0 &dA &dA &d@ In special case of arpeggios &dA01/13/06&d@, get vertical veriables &dA if tvar1 = GR_NOTE and tvar2 = ARPEGGIO if line{1} = " " ts(sct,ARPEG_TOP) = int(line{2}) else ts(sct,ARPEG_TOP) = int(line{1,2}) end if line{3} = "x" ts(sct,ARPEG_FLAG) = granddist else ts(sct,ARPEG_FLAG) = 0 end if line{4} = " " ts(sct,ARPEG_BOTTOM) = int(line{5}) else ts(sct,ARPEG_BOTTOM) = int(line{4,2}) end line{1,7} = "e " end &dA &dA &dA &d@ Normally at this point, we would decode the note and get &dA &d@ its clave number and accidental. The reason we cannot safely &dA &d@ do this at this time is that the backspace command might &dA &d@ cause us to insert some accidentals at earlier points in &dA &d@ the measure. Because of the current order, these notes &dA &d@ would not be accidentalized, whereas a later one (from &dA &d@ an earlier pass) would be. Also, we would like to allow &dA &d@ the various passes to run through non-controlling bar &dA &d@ lines. In any event, we must put off decoding and other &dA &d@ calculations that depend on this data until the entries &dA &d@ can be ordered by time. In the meantime, we will store &dA &d@ the a pointer to the proper tcode element in ts(4) WC: ts(sct,TEMP4) = a9 a4 = tvar2 /* duration field, in this case if tvar1 > REST a5 = tvar2 /* this will become NTYPE if chr(tvar1) in [CUE_NOTE,CUE_REST] &dA &dA &d@ We must, in this case, try to assign a length to the &dA &d@ cue-type entity in terms of the current value of divspq. &dA &d@ The parameter, a4, indicates the note type: &dA &dA &d@ 1 = 256th note 7 = quarter note &dA &d@ 2 = 128th note 8 = half note &dA &d@ 3 = 64th note 9 = whole note &dA &d@ 4 = 32nd note 10 = breve &dA &d@ 5 = 16th note 11 = longa &dA &d@ 6 = 8th note &dA &dA &d@ Columns 4-6 of the variable line contain tuple modifications &dA &d@ to the note value &dA --a4 a3 = 1 << a4 &dA &dA &d@ a3 = 64 --> means quarter note, etc. &dA a3 *= divspq &dA &dA &d@ a3 --> length of notetype as measured in units (64*divspq) &dA if line{4} <> " " a4 = int(line{4}) if line{4} in ['A'..'Z'] a4 = ors(line{4}) - 55 /* A = 10, etc end a8 = a4 / 3 /* default values for "denominator" if rem = 0 a8 *= 2 else a8 = a4 - 1 end if line{6} <> " " a8 = int(line{6}) if line{6} in ['A'..'Z'] a8 = ors(line{6}) - 55 /* A = 10, etc end end a3 *= a8 a3 /= a4 if rem <> 0 putc Unable to represent cue note in terms of current putc value of divisions per quarter putc &dAPush to terminate&d@ examine stop end end &dA &dA &d@ a3 --> length of note measured in units (64*divspq) &dA &d@ as modified by tuple information &dA if ".:;!" con line{2} /* code modified &dA12-24-96 if mpt = 1 a3 = a3 / 2 * 3 else if mpt = 2 a3 = a3 / 4 * 7 else if mpt = 3 a3 = a3 / 8 * 15 else a3 = a3 / 16 * 31 end end end end &dA &dA &d@ a3 --> length of note measured in units (64*divspq) &dA &d@ as further modified by dot information &dA chorddur = a3 / 64 if rem <> 0 putc Unable to represent cue note in terms of current putc value of divisions per quarter putc &dAPush to terminate&d@ examine stop end &dA &dA &d@ chorddur --> length of measured in units (divspq) &dA cuediv += chorddur end else if tvar1 <> XNOTE chorddur = a4 divpoint += a4 if divpoint > totdiv totdiv = divpoint end end if "zyxtseqhwbL" con line{1} a5 = mpt /* this will become NTYPE else if "123456789AB" con line{1} a5 = mpt /* this will become NTYPE ts(sct,SUBFLAG_1) |= 0x010000 /* set small print flag else if tvar1 = REST &dA &dA &dA &d@ New &dA10/15/07&d@ &dA if len(line) > 0 if "ZYXTSEQHW" con line{1} a5 = mpt /* this will become NTYPE with flag a5 += 0x100 else &dA &d@ Old code &dA &dA &d@ Code modified &dA01/03/04&d@ to deal with optional whole rests &dA &dK &d@ if len(line) > 0 and line{1} = "W" if line{1} = "o" /* o = float New &dA10/15/07 ts(sct,CLAVE) = 2 /* temporary floating rest with optionality else ts(sct,CLAVE) = 1 /* temporary floating rest flag end &dK &d@ ts(sct,CLAVE) = 1 /* temporary floating rest flag &dA a5 = WHOLE /* this will become NTYPE end end else &dA &dA &d@ Note type is missing, try to construct it. &dA &d@ (the presence of tuplets will throw this off) &dA putc Missing note type (column 17). Type Enter to continue. getc putc Attempting to construct note type. a8 = chorddur << 5 / divspq a5 = 1 loop while a8 > 0 a8 >>= 1 ++a5 repeat end end end end &dA &dA &d@ &dASet NTYPE &dA ts(sct,NTYPE) = a5 &dA &dA &d@ &dASet STAFFLOC (for rests)&d@ &dA if tvar1 = REST or tvar1 = CUE_REST ts(sct,STAFFLOC) = restplace2 end &dA &dA &d@ &dASet NOTE_DUR&d@ &dA if chr(tvar1) in [GR_NOTE,XGR_NOTE] ts(sct,NOTE_DUR) = 0 else ts(sct,NOTE_DUR) = chorddur end a8 = int(line{4}) if line{4} in ['A'..'Z'] a8 = ors(line{4}) - 55 end if a8 > 0 &dA &dA &d@ Code added to account for complex tuples: 5-11-93 &dA a3 = int(line{6}) if line{6} in ['A'..'Z'] a3 = ors(line{6}) - 55 /* A = 10, etc end &dK &d@ a3 *= 1000 a3 *= 256 /* New &dA11/05/05&d@ &dA &dA &d@ &dASet TUPLE &dA ts(sct,TUPLE) = a8 + a3 end &dA &dA &d@ &dASet DOT&d@ &dA if ".^:^^^;^^^^^^^!" con line{2} /* code modified &dA12-24-96&d@ ts(sct,DOT) = mpt /* 1 = single dot; 3 = double dot; 7 = triple dot; 15 = end &dA &dA &d@ New code &dA11/15/07&d@: a cludge fix to an obscure spacing problem &dA if scr_flag = 1 and tcode(a9) = "ires" ts(sct,DOT) = 0 end &dA if tcode(a9) <> "rest" and tcode(a9) <> "ires" &dAÕÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͸&d@ &dA³&d@ This calculation must be delayed until after the decoding &dA³&d@ &dA³&d@ --------------------------------------------------------- &dA³&d@ &dA³&d@ a1 = 52 - ts(sct,3) - cline(.) + c8flag(.) &dA³&d@ &dA³&d@ ts(sct,8) = a1 * notesize / 2 &dA³&d@ &dAÔÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ;&d@ &dA &dA &d@ &dACompute Base-40 value of pitch&d@ &dA if xdata_flag = 1 a1 = 0 if "..C.....D.....E....F.....G.....A.....B" con tcode(a9){1} a1 = mpt if "f.#" con tcode(a9){2} a1 += (mpt - 2) end if "f.#" con tcode(a9){3} a1 += (mpt - 2) end if tcode(a9) con ['0'..'9'] a2 = int(tcode(a9){mpt}) a1 += (a2 * 40) end end ts(sct,BASE_40) = a1 end &dA &dA &d@ &dASet STEM_FLAGS&d@ (incomplete) &dA a1 = 0 &dK &d@ if "u@d" con line{7} /* stem direction "u" or "d" &dK &d@ a1 = mpt &dK &d@ end &dA &dA &d@ New code &dA12/20/05&d@ implementing general suggestion for setting stem directions &dA if stem_change_flag = 0 or stem_change_flag = 3 if "u@d" con line{7} /* stem direction "u" or "d" a1 = mpt end else if stem_change_flag = 1 a1 = 0 else a1 = 2 end end &dA if tvar1 = XNOTE a1 += 12 end ts(sct,STEM_FLAGS) = a1 &dA &dA &d@ &dASet BEAM_FLAG&d@ &dA if "][=" con line{10} ts(sct,BEAM_FLAG) = mpt else ts(sct,BEAM_FLAG) = NO_BEAM end &dA &dA &d@ &dASet BEAM_CODE&d@ &dA a4 = 0 if ts(sct,BEAM_FLAG) > NO_BEAM if "[]=" con line{10} a3 = 1 loop for a1 = 10 to 15 if " =[]/\" con line{a1} a4 = mpt - 1 * a3 + a4 end if mpt = 1 a1 = 15 else a3 *= 10 end repeat end end ts(sct,BEAM_CODE) = a4 &dA &dA &d@ &dAI think this is the place to alter the ts array, in the case where&d@ &dA &d@ &dAa repeater is requested &dA if repeater_flag2 > 0 and ts(sct,BEAM_FLAG) = END_BEAM &dA &dA &dA &d@ New code &dA01/01/08&d@. Set the repeater_dot_flag. &dA repeater_dot_flag = 0 a3 = repeater_flag2 & 0x03 if a3 = 3 repeater_dot_flag = 1 end &dA &dA &d@ End of &dA01/01/08&d@ code &dA &dA &d@ Decision Point No. 1: Decide if repeaters are possible &dA a3 = 1 REP2: if a4 / a3 > 9 a3 *= 10 goto REP2 end c6 = bit(1,ts(sct,STEM_FLAGS)) c7 = ts(sct,NTYPE) &dA &dA &d@ For purposes of the code that follows, we need to keep track of the &dA &d@ subscripts which point to real data (i.e. not print suggestions) &dA &d@ in the data(.), tcode(.), and tv(.) arrays. We will store these &dA &d@ "valid" subscripts in the mf(.) array. &dA c10 = a9 c2 = 0 /* counter for primary type c4 = 100 /* secondary beam break flag c14 = 100 /* secondary beam break flag for threesomes (&dA09/21/08&d@) repeater_dot_flag2 = 0 /* added &dA09/21/08&d@ loop for a1 = sct to 1 step -1 /* Two exits from this loop: /* To REP1 when ts(a1,BEAM_FLAG) = START_BEAM (below) /* to NO_REP whenever a test "fails" loop while tv1(c10) = P_SUGGESTION --c10 repeat mf(a1) = c10 --c10 if ts(a1,TYPE) < tvar1 or ts(a1,TYPE) > tvar1 + 1 goto NO_REP end if ts(a1,TYPE) = tvar1 if ts(a1,TUPLE) <> 0 c4 = 100000 + (ts(a1,TUPLE) & 0xffff) end a5 = ts(a1,BEAM_CODE) / a3 if a5 > 3 or a5 = 0 goto NO_REP end if a1 < sct and a5 = 3 and c4 < 100000 /* secondary beam ends and starts again if c4 = 100 c4 = 16 end if c14 = 100 /* New &dA09/21/08&d@ c14 = 6 end &dA &dA &dA &d@ &dA09/21/08&d@ Working on repeaters: In the case of secondary beam endings, the following (existing) &dA &d@ code allows endings only in multiples of 2. Since multiple passes are made &dA &d@ through this code, c4 becomes the smallest group size. Specifically, this &dA &d@ prevents group sizes of 3 and 6, which common enough to consider. &dA loop while c4 > 1 c5 = c2 / c4 if rem <> 0 c4 >>= 1 end repeat while rem <> 0 &dA &dA &d@ &dA09/21/08&d@ I think the solution is to run twosome and threesome tests in parallel. &dA &d@ A jump to NO_REP occurs when both tests fail. I will use c14 for this &dA &d@ test. (New code) &dA loop while c14 > 1 c5 = c2 / c14 if rem <> 0 c14 >>= 1 end repeat while rem <> 0 if c4 = 1 and c14 = 1 /* c14 test added &dA09/21/08&d@ goto NO_REP end &dA &dA end ++c2 mf2(c2) = a1 end if bit(1,ts(a1,STEM_FLAGS)) <> c6 or ts(a1,NTYPE) <> c7 or ts(a1,DOT) > 0 goto NO_REP end codes = tdata(mf(a1),1){16,12} if ts(a1,BEAM_FLAG) = START_BEAM &dK &d@ if codes con ['-','(',')','[',']','{','}','~','>','.','_','=',','] &dK &d@ if codes con ['-',')',']','}','~','>','.','_','=',','] /* &dA02/19/97&d@ change accomodates slurs starting on beginning of beam &dK &d@ if codes con [')',']','}','~',','] /* &dA01/06/06&d@ change accomodates articulations on beginning of beam if codes con ['~',','] /* &dA01/13/06&d@ change accomodates slurs ending on beginning of beam goto NO_REP end &dK &d@ if codes con ['b','c','h'..'k','n','o','r'..'z','A','E','F','M','Q','S','V'] if codes con ['b','c','h'..'k','n','o','r'..'z','A','M','Q','S','V'] goto NO_REP end goto REP1 end if ts(a1,BEAM_FLAG) = END_BEAM &dK &d@ if codes con ['-','(',')','[',']','{','}','~','>','.','_','=',','] if codes con ['-','(','[','{','~','>','.','_','=',','] /* &dA02/19/97&d@ change accomodates slurs ending on end of beam goto NO_REP end else if codes con ['-','(',')','[',']','{','}','~','>','.','_','=','0'..'5',',',':'] goto NO_REP end end if codes con ['b','c','f','h'..'z','A','E','F','M','Q'..'S','V','Z'] goto NO_REP end repeat &dA &dA &d@ Case 1: Check to see if all chords under the beam are the same &dA REP1: chordsize = 1 chord_tones(1) = tcode(mf(a1)) loop for a2 = a1 + 1 to sct if ts(a2,TYPE) = tvar1 a2 = sct else ++chordsize chord_tones(chordsize) = tcode(mf(a2)) end repeat &dA &dA &d@ In case of chord at end of beam, finish building mf(.) array &dA c10 = a9 + 1 last_chordsize = 1 loop for a2 = sct + 1 to 100000 loop while tv1(c10) = P_SUGGESTION ++c10 repeat if tv1(c10) = tvar1 + 1 mf(a2) = c10 if "zyxtseqhwbL" con tdata(c10,1){1} if mpt <> c7 /* NTYPE of last chord tones goto NO_REP end else if "123456789AB" con tdata(c10,1){1} if mpt <> c7 /* NTYPE of last chord tones goto NO_REP end end end ++c10 ++last_chordsize else a2 = 100000 end repeat if c4 < 100 /* secondary beams have breaks &dA &dA &d@ &dA09/21/08&d@ We need to put the correct value in c4 at this point &dA if c4 = 1 c4 = c14 &dK &d@ dputc Secondary size = ~c4 end &dA goto REP3 end loop for a2 = a1 + chordsize to sct if ts(a2,TYPE) <> tvar1 goto REP3 end c5 = 0 loop for c6 = 1 to chordsize checkoff(c6) = 1 repeat REP4: c14 = 0 loop for c3 = 1 to chordsize if checkoff(c3) = 1 and chord_tones(c3) = tcode(mf(a2)) checkoff(c3) = 0 c14 = 1 c3 = chordsize end repeat if c14 = 0 goto REP3 end ++c5 if c5 < chordsize ++a2 if a2 <= sct if ts(a2,TYPE) <> tvar1 + 1 goto REP3 end else &dK &d@ if "zyxtseqhwbL" con tdata(mf(a2),1){1} &dK &d@ &dKThis was done&d@ if mpt <> c7 /* NTYPE of last chord tones &dK &d@ &dKearlier &d@ goto NO_REP &dK &d@ &dK &d@ end &dK &d@ end if tv1(mf(a2)) <> tvar1 + 1 goto REP3 end end goto REP4 else if a2 > sct + chordsize - 1 goto NO_REP end end repeat &dA &d@ &dA &d@ At this point, we have determined that all chords under the &dA &d@ beam are the same. We must compact all of these notes &dA &d@ into one note (simplest case). &dA &d@ c3 = sct - a1 / chordsize + 1 /* number of notes c5 = ts(a1,NTYPE) c6 = 0 &dK &d@ c14 = ts(a1,TUPLE) c14 = ts(a1,TUPLE) & 0xffff /* added &dA11/05/05&d@ if c14 > 255 /* no complex tuples allowed goto NO_REP end if c14 > 0 if c14 = c3 c7 = 2 loop c5 += 1 c8 = c3 / c7 if c8 > 1 c7 <<= 1 end repeat while c8 > 1 goto REP5 else goto NO_REP /* if tuple, then # must = group size end else if chr(c3) not_in [2,3,4,6,7,8,12,14,15,16,24,28,30,31,32] /* modified &dA12-24-96 goto NO_REP /* must be representable with note value + dot(s) end c7 = 2 loop c5 += 1 c8 = c3 / c7 if c8 = 1 mpt = rem if mpt > 0 /* code modified &dA12-24-96&d@ if mpt = c7 >> 1 c6 = 1 else if mpt = c7 / 4 * 3 c6 = 3 else if mpt = c7 / 8 * 7 c6 = 7 else c6 = 15 end end end end else c7 <<= 1 end repeat while c8 > 1 end REP5: if chordsize > 1 a9 += chordsize - 1 /* advance a9 over rest of last chord end c7 = 6 loop for a2 = 1 to QUARTER - ts(a1,NTYPE) - 1 c7 *= 10 c7 += 6 repeat ts(a1,BEAM_CODE) = c7 /* 666... etc &dA &dA &d@ New code &dA01/01/08&d@. Deal with special case of the repeater dot. &dA if repeater_dot_flag = 1 and c6 = 0 c6 = 1 end &dA loop for a2 = a1 to a1 + chordsize - 1 ts(a2,NTYPE) = c5 ts(a2,DOT) = c6 ts(a2,NOTE_DUR) *= c3 ts(a2,BEAM_FLAG) = NO_BEAM if a2 > a1 ts(a2,BEAM_CODE) = 0 end repeat &dA &dA &d@ &dA11/20/06&d@ Adding code here that allows a slur over repeated notes with a &dA &d@ repeater, provided that the slur covers all notes in the group &dA &d@ and that chordsize = 1. &dA &dA &d@ Also, clear the rest of the ts array and reset sct &dA a3 = 0 if (ts(a1,SLUR_FLAG) & 0xff) <> 0 and chordsize = 1 a2 = ts(a1,SLUR_FLAG) & 0xff codes = line{16,12} if codes con ")" and a2 = 1 a3 = 2 end if codes con "]" and a2 = 3 a3 = 8 end if codes con "}" and a2 = 5 a3 = 32 end if codes con "x" and a2 = 7 a3 = 128 end end &dA &dA &d@ We have already eliminated those cases where slurs start or end &dA &d@ within a repeater group. (about 200 lines above) &dA if a3 > 0 c5 = ts(sct,DIV) c6 = ts(sct,AX) c7 = ts(sct,NOTE_DUR) ts(a1,NOTE_DUR) -= c7 loop for a2 = a1 + chordsize to sct loop for c8 = 1 to TS_SIZE if c8 <> TSR_POINT ts(a2,c8) = 0 end repeat repeat ++a1 ts(a1,TYPE) = NOTE ts(a1,DIV) = c5 ts(a1,AX) = c6 ts(a1,NOTE_DUR) = c7 ts(a1,TEXT_INDEX) = c6 ts(a1,PASSNUM) = passnum ts(a1,SLUR_FLAG) = a3 &dA &d@ End of &dA11/20/06&d@ addition else loop for a2 = a1 + chordsize to sct loop for a3 = 1 to TS_SIZE if a3 <> TSR_POINT ts(a2,a3) = 0 end repeat repeat end &dA &dA &d@ &dA01/04/06&d@: There is a problem when a tuple has been started on a repeater. &dA &d@ First, tuflag has be set to 1, and has not been reset. Second, &dA &d@ the SUPER_FLAG has been set to show a tuple starting, but never &dA &d@ ending. I can fix these problems here, but this may be symtomatic &dA &d@ of problems with other super-objects, such as slurs. I am not &dA &d@ going to check this out at this point, but be aware! &dA loop for a2 = a1 to a1 + chordsize - 1 if ts(a2,SUPER_FLAG) <> 0 if (ts(a2,SUPER_FLAG)) & 0x10 <> 0 tuflag = 0 ts(a2,SUPER_FLAG) &= 0xffef /* turn off start tuple else putc &dEWarning&d@, SUPER_FLAG is non-zero at a repeater putc at approximately measure number ~measnum end else ts(a2,TUPLE) = 0 end repeat &dA sct = a1 + chordsize - 1 goto EBL REP3: &dA &dA &d@ Case 2: Check to see if chords under the beam can be arranged &dA &d@ in groups of 2, 4, 8, or 16 &dA &dA &d@ c2 = number of chords &dA &d@ mf2(.) = ts subscripts for primary notes of each chord &dA &d@ c4 = either: maximum group size &dA &d@ or: 100 (no group size limitation) &dA &d@ or: >= 1000 (tuples are present; no groups allowed) &dA if c4 >= 100000 goto REP15 /* &dA02/19/97&d@ change accomodates tuples end if c4 = 100 c4 = 32 loop while c4 > c2 / 2 c4 >>= 1 repeat end loop while c4 > 1 c3 = c2 / c4 if rem <> 0 c4 >>= 1 end repeat while rem <> 0 c5 = ts(a1,NTYPE) c6 = 1 loop while c5 < EIGHTH c6 <<= 1 ++c5 repeat repeater_dot_flag2 = 0 /* New &dA09/21/08&d@ if c4 > c6 c11 = c4 / 3 if rem = 0 repeater_dot_flag2 = 1 /* New &dA09/21/08&d@ else c4 = c6 /* Default from old version end end &dK &d@ dputc c4 = ~c4 if c4 = 1 goto REP15 end &dA &dA &d@ c4 is now the largest possible group notes under beam &dA &d@ Next we investigate the question of whether c4 is a &dA &d@ "legal" group size. &dA REP11: &dA &dA &d@ Look for first (actually last) chord prototype &dA c1 = 1 /* index into mf2 c3 = mf2(c1) /* c3 should start as sct chordsize = 1 chord_tones(1) = tcode(mf(c3)) ++c3 loop while chordsize < last_chordsize /* ++chordsize chord_tones(chordsize) = tcode(mf(c3)) /* accumulate chord tones ++c3 repeat &dA &dA &d@ Look for additional chords to match prototype &dA REP9: c6 = 1 /* chord counter REP8: ++c1 c3 = mf2(c1) /* ts index to next primary note backward in list c5 = 0 loop for c11 = 1 to chordsize checkoff(c11) = 1 repeat REP6: c11 = 0 loop for c12 = 1 to chordsize if checkoff(c12) = 1 and chord_tones(c12) = tcode(mf(c3)) checkoff(c12) = 0 c11 = 1 c12 = chordsize end repeat if c11 = 0 goto REP7 /* this pitch (tcode) was not found in chord end ++c5 ++c3 if c5 < chordsize if c3 = mf2(c1-1) goto REP7 /* this chord is not big enough end goto REP6 else if c3 <> mf2(c1-1) goto REP7 /* this chord is too big end end ++c6 /* "valid" chord found if c6 < c4 goto REP8 end &dA &dA &d@ Set up to look for new chord prototype &dA if c1 < c2 ++c1 /* index into mf2 c3 = mf2(c1) /* c3 should start as sct chordsize = 1 chord_tones(1) = tcode(mf(c3)) ++c3 loop while c3 < mf2(c1-1) ++chordsize chord_tones(chordsize) = tcode(mf(c3)) /* accumulate chord tones ++c3 repeat goto REP9 end goto REP10 /* successful pattern match REP7: c4 >>= 1 if c4 > 1 goto REP11 else goto REP15 end &dA &dA &d@ Repeaters on groups of chords will work, if group size = c4 &dA REP10: c5 = ts(a1,NTYPE) c7 = c4 c15 = 0 loop ++c15 ++c5 c7 >>= 1 repeat while c7 > 1 c1 = c2 c6 = mf2(c2) /* position for revised data REP13: /* loop between groups c3 = mf2(c1) REP12: /* loop within chord ts(c3,NTYPE) = c5 ts(c3,NOTE_DUR) *= c4 ts(c3,DOT) = repeater_dot_flag2 /* New &dA09/21/08&d@ if c3 <> mf2(c1) c13 = NO_BEAM ts(c3,BEAM_CODE) = 0 else temp3 = chs(ts(c3,BEAM_CODE)) c14 = len(temp3) if c1 = c2 /* beginning of first group c13 = START_BEAM temp3 = "222222"{1,c14} else if c1 = c4 /* beginning of last group c13 = END_BEAM temp3 = "333333"{1,c14} else c13 = CONT_BEAM temp3 = "111111"{1,c14} end end temp3{1,c15} = "666666"{1,c15} ts(c3,BEAM_CODE) = int(temp3) end ts(c3,BEAM_FLAG) = c13 ++c3 /* next pitch in chord if c3 < mf2(c1-1) putc Chord goto REP12 end chordsize = c3 - mf2(c1) &dA &dA &d@ Move data to revised position &dA if c1 <> c2 c7 = mf2(c1) /* source location; c6 = destination loop for c8 = 1 to chordsize loop for c9 = 1 to TS_SIZE if c9 <> TSR_POINT ts(c6,c9) = ts(c7,c9) end repeat ++c6 ++c7 repeat else c6 += chordsize end if c1 > c4 c1 -= c4 goto REP13 end if last_chordsize > 1 a9 += last_chordsize - 1 /* advance a9 over rest of last chord end &dA &dA &d@ Clear the rest of the ts array and reset sct &dA loop for c8 = c6 to sct loop for c9 = 1 to TS_SIZE if c9 <> TSR_POINT ts(c8,c9) = 0 end repeat repeat sct = c6 - 1 goto EBL REP15: &dA &dA &d@ Alternating case is the only possibility left &dA &dA &d@ Case 3: Check to see if chords under the beam alternate &dA &d@ in groups of 4, 8, 16, or 32, or a tuple size which is even &dA &dA &d@ c2 = number of chords &dA &d@ mf2(.) = ts subscripts for primary notes of each chord &dA &dA &dA &d@ Also allow alternating groups of size 6, 12, and 24 (&dA01/15/06&d@) &dA &dK &d@ if chr(c2) not_in [4,8,16,32] if chr(c2) not_in [4,6,8,12,16,24,32] if c4 > 100000 /* &dA02/19/97&d@ change accomodates tuples c4 -= 100000 if c4 & 0x01 = 0 if c4 = c2 and c4 >= 6 goto REP15A end end end goto REP16 end &dA &dA &d@ Look for first (actually last) chord prototype &dA REP15A: c1 = 1 /* index into mf2 c3 = mf2(c1) /* c3 should start as sct chordsize = 1 chord_tones(1) = tcode(mf(c3)) ++c3 loop while chordsize < last_chordsize /* ++chordsize chord_tones(chordsize) = tcode(mf(c3)) /* accumulate chord tones ++c3 repeat &dA &dA &d@ Check all "odd" chords for a match &dA loop for c1 = 3 to c2 - 1 step 2 c3 = mf2(c1) /* ts index to next "odd" primary note backward in list c5 = 0 loop for c11 = 1 to chordsize checkoff(c11) = 1 repeat REP17: c11 = 0 loop for c12 = 1 to chordsize if checkoff(c12) = 1 and chord_tones(c12) = tcode(mf(c3)) checkoff(c12) = 0 c11 = 1 c12 = chordsize end repeat if c11 = 0 goto NO_REP /* this pitch (tcode) was not found in chord end ++c5 ++c3 if c5 < chordsize if c3 = mf2(c1-1) goto NO_REP /* this chord is not big enough end goto REP17 else if c3 <> mf2(c1-1) goto NO_REP /* this chord is too big end end repeat &dA &dA &d@ Look for second (actually penultimate) chord prototype &dA c1 = 2 /* index into mf2 c3 = mf2(c1) chordsize2 = 1 chord_tones(1) = tcode(mf(c3)) ++c3 loop while c3 <> mf2(c1-1) ++chordsize2 chord_tones(chordsize2) = tcode(mf(c3)) /* accumulate chord tones ++c3 repeat &dA &dA &d@ Check all "even" chords for a match &dA loop for c1 = 4 to c2 step 2 c3 = mf2(c1) /* ts index to next "even" primary note backward in list c5 = 0 loop for c11 = 1 to chordsize2 checkoff(c11) = 1 repeat REP18: c11 = 0 loop for c12 = 1 to chordsize2 if checkoff(c12) = 1 and chord_tones(c12) = tcode(mf(c3)) checkoff(c12) = 0 c11 = 1 c12 = chordsize2 end repeat if c11 = 0 goto NO_REP /* this pitch (tcode) was not found in chord end ++c5 ++c3 if c5 < chordsize2 if c3 = mf2(c1-1) goto NO_REP /* this chord is not big enough end goto REP18 else if c3 <> mf2(c1-1) goto NO_REP /* this chord is too big end end repeat &dA &dA &d@ At this point, we have determined that there are c2/2 matching &dA &d@ pairs of chords, and that c2 = 4,6,8,12,16,24 or 32, or an even tuple &dA &d@ of 6 or greater. In this situation we may reduce these c2 &dA &d@ entries to two entries. The duration of each entry is c2/2 &dA &d@ times the old duration. The old duration determines the number &dA &d@ of beams; the new duration determines the number of through &dA &d@ beams. We are going to have to change the the division number &dA &d@ for the second member of the group. It is the same as the &dA &d@ division number of the (c2/2+1)-th member of the group. &dA &dA &dA &d@ &dA01/15/06&d@ Code added to deal with alternating groups of size 6, 12, and 24 &dA &dK &d@ c4 = c2 / 2 c7 = c2 / 3 if rem = 0 ts(c3,DOT) = 1 c4 = c2 / 3 else c4 = c2 / 2 end &dA c5 = ts(a1,NTYPE) c7 = c4 loop ++c5 /* new duration c7 >>= 1 repeat while c7 > 1 if c5 > 6 and c2 < 8 /* don't do a four group of eighths, etc. goto NO_REP end c15 = 7 - ts(a1,NTYPE) /* total number of beams c14 = 7 - c5 /* number through beams if c14 < 0 c14 = 0 end #if OLD_REPEATERS if c5 = 7 c5 = 8 c14 = c15 end #endif c15 -= c14 /* number of shortened beams &dA &dA &d@ Code added &dA01/15/06&d@ to allow alternating group sizes of 6, 12, and 24 &dA &d@ with repeaters. This code gets the DIV variable right &dA &d@ &dK &d@ c12 = mf2(c4) if ts(c3,DOT) = 1 c12 = c4 * 3 / 2 /* because we are counting backward in mf2(.) c12 = mf2(c12) else c12 = mf2(c4) end &dA c12 = ts(c12,DIV) /* division number for second member c6 = mf2(c2) /* position for revised data c3 = mf2(c2) REP19: /* loop within first chord ts(c3,NTYPE) = c5 c13 = c2 / 3 /* &dA02/19/97&d@ added for 6-tuples, 12-tuples if rem = 0 ts(c3,DOT) = 1 end ts(c3,NOTE_DUR) *= c4 if c3 <> mf2(c2) c13 = NO_BEAM ts(c3,BEAM_CODE) = 0 else temp3 = "777777"{1,c15} // "222222"{1,c14} ts(c3,BEAM_CODE) = int(temp3) c13 = START_BEAM end ts(c3,BEAM_FLAG) = c13 ++c3 /* next pitch in chord if c3 < mf2(c2-1) goto REP19 end chordsize = c3 - mf2(c2) c6 += chordsize REP20: /* loop within second chord ts(c3,DIV) = c12 ts(c3,NTYPE) = c5 c13 = c2 / 3 /* &dA02/19/97&d@ added for 6-tuples, 12-tuples if rem = 0 ts(c3,DOT) = 1 end ts(c3,NOTE_DUR) *= c4 if c3 <> mf2(c2-1) c13 = NO_BEAM ts(c3,BEAM_CODE) = 0 else temp3 = "888888"{1,c15} // "333333"{1,c14} ts(c3,BEAM_CODE) = int(temp3) c13 = END_BEAM end ts(c3,BEAM_FLAG) = c13 ++c3 /* next pitch in chord if c3 < mf2(c2-2) goto REP20 end chordsize = c3 - mf2(c2-1) c6 += chordsize if last_chordsize > 1 a9 += last_chordsize - 1 /* advance a9 over rest of last chord end &dA &dA &d@ Clear the rest of the ts array and reset sct &dA loop for c8 = c6 to sct loop for c9 = 1 to TS_SIZE if c9 <> TSR_POINT ts(c8,c9) = 0 end repeat repeat sct = c6 - 1 &dA &d@ goto EBL process array for last member of group &dA &dA &d@ Note &dA02/19/97&d@: The goto EBL has been commented out so that &dA &d@ in the case where a tuple or a slur has been started, it will &dA &d@ be completed. This feature has not been fully tested, and &dA &d@ may cause other problems. Beware! &dA REP16: end NO_REP: end &dA &dA &d@ &dAConstruct SUPER_FLAG&d@ &dA a14 = 0 /* a14 will become ts(14) codes = line{16,12} &dA &dA &d@ look for starting tuplet &dA if ts(sct,TUPLE) > 0 if tuflag = 0 and codes con "*" tuflag = 1 a1 = mpt a14 |= 0x10 /* begin tuplet if codes con "&" and mpt < a1 a14 |= 0x40000 /* editorial tuplet flag &dA03-21-97 end end end &dA &dA &d@ look for end of ~~~~~ &dA &dK &d@ if ctrflag > 0 /* ctrflag = continue trill flag if ctrflag(passnum) > 0 /* ctrflag changed to array &dA12/08/07 if codes con "c" else a14 |= 0x08 /* end ~~~~~ &dK &d@ if ctrflag >= 0x100 if ctrflag(passnum) >= 0x100 a14 |= 0x20000 /* editorial ~~~ flag &dA03-21-97 end &dK &d@ ctrflag = 0 ctrflag(passnum) = 0 end end &dA &dA &d@ look for start of ~~~~~ &dA if codes con "~" &dK &d@ if ctrflag = 0 if ctrflag(passnum) = 0 /* New &dA12/08/07&d@ a7 = mpt if codes con "&" and mpt < a7 &dK &d@ ctrflag = 0x0200 /* editorial start ~~~~~ ctrflag(passnum) = 0x0200 /* editorial start ~~~~~ a14 |= 0x20000 /* editorial ~~~ flag &dA03-21-97 else &dK &d@ ctrflag = 0x02 /* start ~~~~~ ctrflag(passnum) = 0x02 /* start ~~~~~ end if codes con "t" &dK &d@ ctrflag <<= 1 ctrflag(passnum) <<= 1 a14 |= 0x04 /* begin ~~~ with trill else a14 |= 0x02 /* begin ~~~ without trill end end end &dA &dA &d@ look for forward tie &dA if codes con "-" a7 = mpt a14 |= 0x01 /* tie flag if codes con "&" and mpt < a7 a14 |= 0x10000 /* editorial tie (dotted) &dA03-21-97 end end &dA &dA &d@ look for end of tuplet &dA if codes con "!" and tuflag = 1 a7 = mpt a14 |= 0x20 /* end tuplet if codes con "&" and mpt < a7 a14 |= 0x40000 /* editorial tuplet flag &dA03-21-97 end tuflag = 0 end &dA &dA &d@ &dASet SUPER_FLAG&d@ &dA #if SUB_EDIT #else a14 &= 0xffff /* turn off editorial flags &dA03-21-97&d@ #endif ts(sct,SUPER_FLAG) = a14 a14 = 0 loop for a1 = 1 to 12 if codes{a1} = "&" /* and codes{a1+1} in ['0'..'9'] #if SUB_EDIT a14 = 1 #endif if codes{a1+1} in ['0'..'9','X'] /* New &dA05/17/03&d@ ++a1 end goto TLP1 /* skip &# end if "()[]{}zx" con codes{a1} --mpt a7 = 1 << mpt if a14 = 1 a7 <<= 16 end ts(sct,SLUR_FLAG) |= a7 goto TLP1 end &dA &dA &d@ look for turns, mordents, and their accidentals (trills taken out &dA11/05/05&d@) &dA &d@ (T) tremulos added &dA01/07/06&d@ &dA &dK &d@ if "r@wMk" con codes{a1} /* new code &dA03/01/97&d@ if "r@wMkT" con codes{a1} /* code amended &dA01/07/06&d@ a7 = mpt &dA &dA &d@ Special case of tremulo &dA01/07/06&d@; no editorial and no accidentals allowed &dA if a14 = 0 and a7 = 6 ts(sct,SUBFLAG_1) |= a7 goto TLP1 end &dA if a14 = 0 ts(sct,SUBFLAG_1) |= a7 else ts(sct,ED_SUBFLAG_1) |= a7 end temp3 = codes // pad(13) loop for a3 = a1 + 1 to 13 repeat while "shbu" con temp3{a3} if a3 = a1 + 1 goto TLP1 end a7 = 0 temp3 = codes{a1+1..a3-1} a1 = a3 - 1 if temp3 con "u" temp4 = temp3{mpt..} // "..." if mpt = 1 temp3 = "" else temp3 = temp3{1,mpt-1} end if "uss.ubb.us..uh..ub.." con temp4{1,4} a7 = mpt + 3 a7 = a7 << 1 end end temp4 = temp3 // "...." if "ss..bb..s...h...b..." con temp4{1,4} mpt += 3 mpt >>= 2 a7 |= mpt end a7 <<= 4 if a14 = 0 ts(sct,SUBFLAG_1) |= a7 else ts(sct,ED_SUBFLAG_1) |= a7 end goto TLP1 end &dA &dA &d@ New code &dA11/05/05&d@ for trills and their accidentals &dA if codes{a1} = "t" a4 = 0 /* this will be bit 19 a7 = 2 if a14 = 0 ts(sct,SUBFLAG_1) |= a7 else ts(sct,ED_SUBFLAG_1) |= a7 end temp3 = codes // pad(13) loop for a3 = a1 + 1 to 13 repeat while "shbuU" con temp3{a3} if a3 = a1 + 1 goto TLP1 end a7 = 0 temp3 = codes{a1+1..a3-1} a1 = a3 - 1 if temp3 con "u" or temp3 con "U" temp4 = temp3{mpt..} // "..." if mpt = 1 temp3 = "" else temp3 = temp3{1,mpt-1} end if "uss.ubb.us..uh..ub.." con temp4{1,4} a7 = mpt + 3 /* 4,8,12,16,20 a7 = a7 << 1 /* 8,16,24,32,40 = 8 x (1,2,3,4,5) end if "Uss.Ubb.Us..Uh..Ub.." con temp4{1,4} a7 = mpt + 3 /* 4,8,12,16,20 a7 = a7 >> 2 /* 1,2,3,4,5 a4 = 1 end end temp4 = temp3 // "...." if "ss..bb..s...h...b..." con temp4{1,4} mpt += 3 mpt >>= 2 a7 |= mpt end a7 <<= 4 a4 <<= 19 if a14 = 0 ts(sct,SUBFLAG_1) |= a7 ts(sct,SUBFLAG_1) |= a4 /* establish bit 19 else ts(sct,ED_SUBFLAG_1) |= a7 ts(sct,ED_SUBFLAG_1) |= a4 /* establish bit 19 end goto TLP1 end &dA &d@ End of &dA11/05/05&d@ New Code if "FE@^+" con codes{a1} &dK &d@ if "^+@@@@FE" con codes{a1} accidental flags moved &dA03/01/97 &dK &d@ mpt += 7 mpt += 13 a7 = 1 << mpt if a14 = 0 ts(sct,SUBFLAG_1) |= a7 else ts(sct,ED_SUBFLAG_1) |= a7 end goto TLP1 end &dA &dA &d@ look for dynamics (This section recoded &dA10/08/08&d@ to simplify and add extra dynamic combinations) &dA if "mpfZR" con codes{a1} &dK &d@ if mpt < 4 &dK &d@ if mpt = 1 &dK &d@ if "pf" con codes{a1+1} &dK &d@ a7 = mpt + 8 /* mp = 9; mf = 10 9 10 &dK &d@ ++a1 &dK &d@ else &dK &d@ a7 = 0 &dK &d@ end &dK &d@ else &dK &d@ a7 = mpt - 2 * 4 + 1 /* p = 1; f = 5 1 5 &dK &d@ if "pf" con codes{a1+1} &dK &d@ ++a1 &dK &d@ if codes{a1-1} <> codes{a1} &dK &d@ if codes{a1} = "p" &dK &d@ a7 = 11 /* fp = 11 11 &dK &d@ end &dK &d@ else &dK &d@ ++a7 /* pp = 2; ff = 6 2 6 &dK &d@ if codes{a1} = codes{a1+1} &dK &d@ ++a1 &dK &d@ ++a7 /* ppp = 3; fff = 7 3 7 &dK &d@ if codes{a1} = codes{a1+1} &dK &d@ ++a1 &dK &d@ ++a7 /* pppp = 4; ffff = 8 4 8 &dK &d@ end &dK &d@ end &dK &d@ end &dK &d@ else &dK &d@ if a7 = 5 and codes{a1+1} = "z" &dK &d@ a7 = 13 /* fz = 13 13 &dK &d@ ++a1 &dK &d@ end &dK &d@ end &dK &d@ end &dK &d@ else &dK &d@ if mpt = 4 and a1 < len(codes) and codes{a1+1} = "p" /* Zp = sfp &dK &d@ a7 = 12 12 &dK &d@ ++a1 &dK &d@ else &dK &d@ a7 = mpt + 10 /* Z = sfz = 14; R = rfz = 15 14 15 &dK &d@ end &dK &d@ end &dK &d@ a7 <<= 10 &dA &dA &dA &d@ New code &dA10/08/08&d@ &dA a7 = 0 temp4 = codes // pad(13) /* so we don't run off at the end temp3 = temp4{a1} loop while "pf" con temp4{a1+1} temp3 = temp3 // temp4{a1+1} ++a1 /* this will rightsize a1 repeat temp3 = temp3 // pad(4) temp3 = temp3{1,4} temp3 = temp3 // "." /* max data length = 4; full padded length = 5 if "p .pp .ppp .pppp.f .ff .fff .ffff.mp .mf .fp .Zp .fz .Z .R ." con temp3 a7 = mpt + 4 / 5 /* values 1 to 15 a7 <<= 10 /* range in bits 0x3c00 end if "ffp .mfp .Zf ." con temp3 a7 = mpt + 4 / 5 /* 1 or 2 or 3 New &dA03/16/09&d@ &dA &d@ a7 = 1 a7 <<= 26 /* range in bits 0x1c000000 end &dA &dA &d@ End of new code &dA10/08/08&d@ if a14 = 0 if ts(sct,SUBFLAG_1) & 0x1c003c00 = 0 /* changed &dA10/08/08&d@ from 0x3100 ts(sct,SUBFLAG_1) |= a7 end else if ts(sct,ED_SUBFLAG_1) & 0x1c003c00 = 0 /* changed &dA10/08/08&d@ from 0x3100 ts(sct,ED_SUBFLAG_1) |= a7 end end goto TLP1 end &dA &dA &d@ look for back ties New &dA04/22/08&d@ &dA if "JK" con codes{a1} a7 = 1 << (mpt + 23) ts(sct,SUBFLAG_1) |= a7 goto TLP1 end &dA &dA &d@ other directions connected with notes &dA if "nvi.=_>AVoQ0" con codes{a1} --mpt a7 = 1 << mpt if a14 = 0 ts(sct,SUBFLAG_2) |= a7 else ts(sct,ED_SUBFLAG_2) |= a7 end goto TLP1 end &dA &dA &d@ fingering connected with notes &dA if "12345" con codes{a1} a4 = mpt a7 = 0 a3 = 0 FINNN: if a1 < len(codes) and "12345:" con codes{a1+1} if mpt = 6 a4 += 8 else a4 <<= a3 a7 += a4 a4 = mpt a3 += 4 end ++a1 goto FINNN end a4 <<= a3 a7 += a4 a7 <<= 12 if a14 = 0 ts(sct,SUBFLAG_2) |= a7 else ts(sct,ED_SUBFLAG_2) |= a7 end goto TLP1 end TLP1: repeat tsdata(a9+old@n) = line{28..} ts(sct,TEXT_INDEX) = a9 + old@n ts(sct,PASSNUM) = passnum ts(sct,STAFF_NUM) = tv3(a9) & 0x000f ts(sct,TRACK_NUM) = tv3(a9) >> 4 & 0x000f goto EBL end &dA &dA &d@ Case II: figures &dA if tvar1 = FIGURES ++sct ts(sct,TYPE) = tvar1 if figdiv = 0 figdiv = divpoint end ts(sct,DIV) = figdiv ts(sct,FIG_DUR) = tvar2 figdiv += tvar2 a3 = sct - 1 a4 = 0 loop while a3 > oldsct if ts(a3,TYPE) = FIGURES a4 = a3 end --a3 repeat while a4 = 0 * a4 = pointer to previous figure data in measure (or 0) ts(sct,NUMBER_OF_FIG) = int(tcode(a9)) if ts(sct,NUMBER_OF_FIG) > 4 return 2 end a7 = FIG_DATA loop for a5 = 1 to ts(sct,NUMBER_OF_FIG) line = mrt(line) &dK &d@ out = rev(line) &dK &d@ out = trm(out) &dK &d@ line = rev(out) if line = "" return 2 end &dA &dA &d@ Adding new code &dA11/16/03&d@ to allow for parentheses around figure fields &dA a13 = 0 /* initialize parentheses flag to null line = line // " " if line{1} = "(" if line con ")" a6 = mpt - 1 if mpt = 2 return 2 end a13 = 1 temp = line{2..(mpt-1)} /* section of line inside () if temp{1} = " " return 2 end /* section starts with non-blank field WB1a: if temp con " " temp = temp{mpt..} /* skip over non-blank field temp = mrt(temp) /* and remove leading blanks to next field if temp = "" return 2 end ++a13 goto WB1a end if a13 > (ts(sct,NUMBER_OF_FIG) - a5 + 1) return 2 end a13 *= 1000 line = line{2..a6} /* now remove parentheses from line else return 2 end end &dA if line con " " temp = line{1,mpt-1} line = line{mpt..} end temp = temp // pad(3) if "_-" con temp{1} if mpt = 1 if a4 = 0 return 2 end if ts(a4,a7+2) = 0 ts(a4,a7+2) = 2 else ts(a4,a7+2) = 3 end ts(sct,a7+2) = 1 else ts(sct,a7) = 30 /* 30 end else if "x@#@@@@nf" con temp{1} /* 21,23,28,29 ts(sct,a7) = mpt + 20 a6 = 2 goto WB1 end if "2@45" con temp{1} and temp{2} = "+" /* 22,24,25 ts(sct,a7) = mpt + 21 a6 = 4 goto WB1 end if "/\" con temp{2} and "67" con temp{1} /* 26,27 ts(sct,a7) = mpt + 25 a6 = 4 goto WB1 end a6 = int(temp) /* 1..19 if a6 < 0 or a6 > 19 return 2 end ts(sct,a7) = a6 if ts(sct,a7) < 10 a6 = 2 else a6 = 3 end WB1: if a6 < 4 temp = temp{a6..} if "+x@#@@@@nf" con temp{1} ts(sct,a7+1) = mpt + 19 else ts(sct,a7+1) = int(temp) end end end ts(sct,a7) += a13 /* Adding parentheses flag &dA11/16/03 a7 += 3 repeat &dA ts(sct,TEXT_INDEX) = a9 &d@ Removing this line ts(sct,PASSNUM) = passnum ts(sct,STAFF_NUM) = nstaves - 1 goto EBL end &dA &dA &d@ Case III: bar lines &dA if tvar1 = BAR_LINE ++sct ts(sct,TYPE) = tvar1 ts(sct,DIV) = divpoint ts(sct,BAR_NUMBER) = tvar2 if tcode(a9) = "sure" ts(sct,BAR_TYPE) = REGULAR else if "@1d@e2@@34" con tcode(a9){4} ts(sct,BAR_TYPE) = mpt end end if line con ":|" ts(sct,REPEAT) |= 0x02 end if line con "|:" ts(sct,REPEAT) |= 0x01 end if line con "stop-end" ts(sct,BACK_ENDING) = int(line{mpt+8..}) end if line con "start-end" ts(sct,FORW_ENDING) = int(line{mpt+9..}) end if line con "disc-end" a3 = int(line{mpt+8..}) ts(sct,BACK_ENDING) = 0 - a3 end &dA &dA &d@ &dA12/08/07&d@ ctrflag made into an array &dA &dK &d@ if ctrflag > 0 and line con "~" if line con "~" loop for a7 = 1 to passnum if ctrflag(a7) > 0 ts(sct,BAR_FLAGS) |= 0x01 end repeat end &dA &d@ if line con "A" ts(sct,BAR_FLAGS) |= 0x02 end if line con "F" ts(sct,BAR_FLAGS) |= 0x04 end if line con "E" ts(sct,BAR_FLAGS) |= 0x08 end ts(sct,SPACING) = hpar(37) ts(sct,M_NUMBER) = m_number if m_number > 0 ++m_number end &dK ts(sct,TEXT_INDEX) = a9 &d@ Removing this line ts(sct,TEXT_INDEX) = a9 + old@n /* and putting it back &dA03/21/03 tsdata(a9+old@n) = tdata(a9,2) /* and adding this line &dA03/21/03 ts(sct,PASSNUM) = passnum ts(sct,NUM_STAVES) = tv3(a9) goto EBL end &dA &dA &d@ Case IV: signs, words, marks &dA if tvar1 = MUSICAL_DIR ++sct a4 = 0 temp = tcode(a9) loop for a3 = 1 to 2 if "APQG" con temp{a3} ts(sct,TYPE) = SIGN ts(sct,SIGN_TYPE) = mpt end if temp{a3} = "X" /* (added &dA10/12/96&d@) ts(sct,TYPE) = SIGN ts(sct,SIGN_TYPE) = TIE_TERM end if "BCD" con temp{a3} ts(sct,TYPE) = WORDS ts(sct,SIGN_TYPE) = mpt + 4 end if "R" con temp{a3} /* (added &dA02/03/08&d@) ts(sct,TYPE) = WORDS ts(sct,SIGN_TYPE) = REH_MARK end if "EFHJ" con temp{a3} ts(sct,SUPER_TYPE) = mpt if mpt < 3 a4 = int(line{5..7}) /* get numerical parameter for wedges ts(sct,WEDGE_SPREAD) = a4 * notesize / 10 end end if "UWV" con temp{a3} if mpt = 2 ts(sct,SUPER_TYPE) = NORMAL_TRANS else ts(sct,SUPER_TYPE) = mpt + 4 /* 5 or 7 */ if int(tdata(a9,1){5,3}) <> 0 ts(sct,SUPER_TYPE) += 4 end end end repeat if ts(sct,TYPE) = 0 ts(sct,TYPE) = MARK end ts(sct,DIV) = divpoint + cuediv ts(sct,DIV) += mdir_offset if temp{3} = "+" ts(sct,SIGN_POS) = ABOVE else ts(sct,SIGN_POS) = BELOW end if a4 = 0 a4 = int(line{5..7}) ts(sct,FONT_NUM) = a4 /* get numerical parameter for words, etc. end ts(sct,WEDGE_OFFSET) = vpar(1) if ts(sct,SUPER_TYPE) = WEDGES << 1 /* end of wedge if ts(sct,WEDGE_SPREAD) = 0 /* point of wedge ts(sct,WEDGE_OFFSET) = notesize end end if ts(sct,SIGN_TYPE) = LETTER_DYNAM if ts(sct,SUPER_TYPE) = 1 /* start wedge line = trm(line) line = line // pad(9) temp = line{9..} &dA &dA &d@ Adjust temp for "Zp", "Z", and "R". &dA temp = " " // temp // " " if temp con "Zp" temp = temp{1..mpt-1} // "sfp" // temp{mpt+2..} end if temp con "Z" #if SFZ temp = temp{1..mpt-1} // "sfz" // temp{mpt+1..} #else temp = temp{1..mpt-1} // "sf" // temp{mpt+1..} #endif end if temp con "R" #if SFZ temp = temp{1..mpt-1} // "rfz" // temp{mpt+1..} #else temp = temp{1..mpt-1} // "rf" // temp{mpt+1..} #endif end temp = temp{2..} temp = trm(temp) a5 = notesize / 2 loop for a4 = 1 to len(temp) if "pmfszr" con temp{a4} mpt += 59 a5 += hpar(mpt) end repeat ts(sct,WEDGE_OFFSET) = a5 end if ts(sct,SUPER_TYPE) = 2 /* stop wedge ts(sct,WEDGE_OFFSET) = 0 - hpar(46) end end if ts(sct,SIGN_TYPE) = CENTER_STR or ts(sct,SIGN_TYPE) = LEFT_JUST_STR if ts(sct,SUPER_TYPE) = 1 /* start wedge if len(line) > 8 ttext = line{9..} ttext = trm(ttext) &dA &dA &d@ Introducing optional conversion to ligitures in words before a wedge &dA04/22/04 &dA if ligit_flag = 1 if ttext = "ff" ttext = "f\@f" end LIGCON4: if ttext con "ffi" ttext{mpt,3} = "\0:" goto LIGCON4 end if ttext con "ffl" ttext{mpt,3} = "\0;" goto LIGCON4 end if ttext con "ff" ttext{mpt,2} = "\0<" goto LIGCON4 end if ttext con "fi" ttext{mpt,2} = "\0=" goto LIGCON4 end if ttext con "fl" ttext{mpt,2} = "\0>" goto LIGCON4 end end #if AUTOSCR #else perform kernttext /* New &dA04/22/04&d@ #endif c5 = mtfont perform wordspace &dA &d@³ Outputs: a5 = space taken up by word if ts(sct,SIGN_TYPE) = CENTER_STR /* centered word a5 >>= 1 end a5 += notesize / 2 ts(sct,WEDGE_OFFSET) = a5 end end if ts(sct,SUPER_TYPE) = 2 /* stop wedge ts(sct,WEDGE_OFFSET) = 0 - notesize end end tsdata(a9+old@n) = line{9..} ts(sct,TEXT_INDEX) = a9 + old@n ts(sct,PASSNUM) = passnum ts(sct,STAFF_NUM) = tv3(a9) ts(sct,S_TRACK_NUM) = tvar2 goto EBL end &dA &dA &d@ Case V, VI, VII and VIII: &dA &d@ clef change, time designation, meter change, divspq change &dA if chr(tvar1) in [CLEF_CHG,DESIGNATION,METER_CHG,DIV_CHG] ++sct ts(sct,TYPE) = tvar1 ts(sct,DIV) = divpoint ts(sct,3) = tvar2 /* first parameter if tvar1 = CLEF_CHG ts(sct,CLEF_FONT) = int(tcode(a9)) end tsdata(a9+old@n) = tdata(a9,1) ts(sct,TEXT_INDEX) = a9 + old@n ts(sct,PASSNUM) = passnum ts(sct,STAFF_NUM) = tv3(a9) ts(sct,DOLLAR_SPN) = tv5(a9) /* added &dA01/17/04&d@ &dA &d@ assure proper current value of divspq for this loop if tvar1 = DIV_CHG qflag = 1 divspq = tvar2 end goto EBL end &dA &dA &d@ Case IX: key change &dA if tvar1 = AX_CHG ++sct ts(sct,TYPE) = tvar1 ts(sct,DIV) = divpoint ts(sct,3) = tvar2 /* new key ts(sct,4) = key /* old key tsdata(a9+old@n) = tdata(a9,1) ts(sct,TEXT_INDEX) = a9 + old@n ts(sct,PASSNUM) = passnum ts(sct,NUM_STAVES) = tv3(a9) ts(sct,DOLLAR_SPN) = tv5(a9) /* added &dA01/17/04&d@ &dA &dA &dA &d@ New &dA12/14/07&d@: This code adjusts tclaveax(.) to reflect &dA &d@ the current situation &dA loop for a6 = 1 to 50 tclaveax(a6) = 0 repeat a6 = tvar2 if a6 > 0 a7 = 4 loop for a8 = 1 to a6 loop for c5 = a7 to 50 step 7 tclaveax(c5) = 2 repeat a7 += 4 if a7 > 7 a7 -= 7 end repeat end if a6 < 0 a6 = 0 - a6 a7 = 7 loop for a8 = 1 to a6 loop for c5 = a7 to 50 step 7 tclaveax(c5) = 3 repeat a7 -= 4 if a7 < 1 a7 += 7 end repeat end loop for a6 = 1 to 50 loop for a7 = 1 to 4 /* &dA06/04/08&d@ was 3 measax(a7,a6) = tclaveax(a6) repeat repeat &dA &dA &d@ End of &dA12/14/07&d@ addition &dA goto EBL end &dA &dA &d@ Case X: irst, backspace &dA if tvar1 = IREST divpoint += tvar2 if divpoint > totdiv totdiv = divpoint end cuediv = 0 goto EBL end if tvar1 = BACKSPACE ++passnum divpoint -= tvar2 cuediv = 0 goto EBL end &dA &dA &d@ Case XI: print suggestions &dA if tvar1 = P_SUGGESTION if tvar2 < 8 /* forced slur suggestion a3 = tvar2 & 0x06 a4 = tvar2 & 0x01 a4 <<= 1 ++a4 /* 1 = over; 3 = under a4 <<= a3 + 8 ts(sct,SLUR_FLAG) |= a4 /* turn on forced slur flag goto EBL end if tvar2 < 10 if tvar2 = 8 ts(sct,SLUR_FLAG) |= 0x1000000 /* overhanded tie else ts(sct,SLUR_FLAG) |= 0x3000000 /* underhanded tie end goto EBL end if tvar2 < 32 ts(sct,SUPER_FLAG) |= 0x40 /* tuplet has a bracket &dA03-21-97 if bit(0,tvar2) = 1 ts(sct,SUPER_FLAG) |= 0x200 /* bracket is round &dA03-21-97 end if bit(1,tvar2) = 1 ts(sct,SUPER_FLAG) |= 0x80 /* bracket is continuous &dA03-21-97 end if bit(2,tvar2) = 1 ts(sct,SUPER_FLAG) |= 0x100 /* tuplet number is inside &dA03-21-97 end goto EBL end if tvar2 >= 0x100 and tvar2 < 0x200 /* musical direction a3 = ors(tcode(a9){1}) if a3 > 0 ts(sct,FONT_NUM) = a3 end a3 = ors(tcode(a9){2}) << 8 + ors(tcode(a9){3}) if tvar2 & 0xff = 0 ts(sct,POSI_SHIFT1) = a3 << 8 + ors(tcode(a9){4}) else ts(sct,POSI_SHIFT2) = a3 << 8 + ors(tcode(a9){4}) end goto EBL end if tvar2 & 0xff00 = 0x0200 /* position of ornaments, etc. a3 = tvar2 & 0xff * 4 + 1 tsr(sct){a3,4} = tcode(a9){1,4} goto EBL end if tvar2 & 0xff00 = 0x0300 /* printing of actual objects a3 = ors(tcode(a9){1}) if a3 > 6 a3 >>= 1 a3 &= 0x07 &dA &d@ 3 = print object, no extension dot &dA &d@ 4 = print object, include extension dot &dA &d@ 5 = double note length, no extension dot &dA &d@ 6 = double note length, include extension dot &dA &d@ 7 = quadruple note length, no extension dot if a3 > 2 if a3 = 4 or a3 = 6 ts(sct,DOT) = 1 else ts(sct,DOT) = 0 end if a3 > 4 ++ts(sct,NTYPE) end if a3 > 6 ++ts(sct,NTYPE) end ts(sct,SUPER_FLAG) &= 0xfffffffe /* turn off ties end end tsr(sct){1,4} = tcode(a9){1,4} goto EBL end &dA &dA &d@ New Code &dA05/25/03&d@ and &dA05/28/05&d@ &dA if tvar2 & 0xff00 = 0x0400 /* print suggestion for preceding bar line &dK &d@ putc Handling measure print suggestion &dK &d@ putc value of outpnt = ~outpnt loop for c1 = outpnt to 1 step -1 tget [Y,c1] line &dK &d@ putc rec = ~c1 line = ~line if line{1,3} = "J B" sub = 5 c2 = int(line{sub..}) /* bar number c3 = int(line{sub..}) /* obx c4 = int(line{sub..}) /* oby temp = line{sub..} if tvar2 & 0xffff = 0x0400 c4 += 1000000 /* 1 million is flag for fixed length else if tvar2 & 0xffff = 0x0401 c4 += 10000000 /* New &dA05/28/05&d@ 10 million is flag for end /* &dEmid-movement&d@ right justification end line = "J B " // chs(c2) // " " // chs(c3) // " " // chs(c4) // temp tput [Y,c1] ~line &dK &d@ putc new line = ~line c1 = 1 end repeat goto EBL end &dA &dA &d@ New code &dA11/05/05&d@ for implementing location suggestions for tuples &dA if tvar2 & 0xff00 = 0x0500 /* print suggestion for horizontal adjustment c2 = tvar2 & 0xff c2 <<= 16 ts(sct,TUPLE) |= c2 /* horizontal adjustment goto EBL end if tvar2 & 0xff00 = 0x0600 /* print suggestion for vertical adjustment c2 = tvar2 & 0xff c2 <<= 24 ts(sct,TUPLE) |= c2 /* vertical adjustment goto EBL end &dA &d@ End of &dA11/05/05&d@ Code end EBL: repeat old@n += @n &dA ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA ³ End of storing original data in set array ³ &dA ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ &dA &dA &d@ ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» &dA &d@ º N E W S O R T A L G O R I T H M º &dA &d@ ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ &dA &dA &d@ &dA09/30/93&d@ &dA &dA &d@ Reorder set array according to location in measure. Do not &dA &d@ separate extra chord notes from their original lead notes. &dA &d@ Do not change the order of bar/clef/grace-note. Do not &dA &d@ extract signs, words, or marks when they precede a bar, &dA &d@ clef or grace note; otherwise extract them and put them &dA &d@ in front of figures, cues and regular notes. Do not &dA &d@ extract time designations when they precede a bar, &dA &d@ clef or grace note; otherwise extract them and put them &dA &d@ in front of words, signs, marks, figures, cues and regular &dA &d@ notes. &dA &dA &d@ For objects at same location, the order is as follows: &dA &dA &d@ 1. bar, clef, grace note/chord (in original order for each div) &dA &d@ 2. &dA &d@ 3. &dA &d@ 4. change in divisions per quarter &dA &d@ 5. time designation, meter change, key change &dA &d@ 6. word, sign, mark &dA &d@ 7. figure &dA &d@ 8. cue note/chord, cue rest &dA &d@ 9. regular note/chord, regular rest &dANote: this is why we send irests &dA &d@ &dA through the system as rests &dA &d@ &dA and not as marks &dA &d@ Summary of algorithm: &dA &dA &d@ 1. For each division, assign parameters as listed above &dA &d@ 2. bar, clef, and grace note/chord will be assigned numbers &dA &d@ 1, 2, and 3 in the order in which they first occur &dA &d@ in the array on this division &dA &d@ 3. For time designations, words, signs and marks, if &dA &d@ they preceed a type 1,2,or 3, or if they preceed &dA &d@ another or this kind which preceeds a 1,2 or 3, &dA &d@ then they take this respective type &dA &d@ 4. order the elments of mf(.) on each division according &dA &d@ to the parameter numbers assigned to them. mf(.) &dA &d@ will now contain the indexes for the proper order &dA &d@ of ts(.) from oldsct to sct. &dA &d@ 5. reorder the elements of ts(.) accordingly &dA a7 = 0 /* global counter in measure a3 = ts(sct,DIV) /* divisions per measure loop for a2 = 1 to a3 temp = "999888007066606545" /* initial "priority" string (with unknowns = 0) a6 = 0 a8 = a7 /* local counter on this division loop for a1 = oldsct + 1 to sct if ts(a1,DIV) = a2 a4 = ts(a1,TYPE) a5 = int(temp{a4}) if a5 = 0 /* setting "unknowns" in the order they are encountered ++a6 if a4 = 7 or a4 = 8 temp{7} = chs(a6) temp{8} = chs(a6) else temp{a4} = chs(a6) end a5 = a6 end ts(a1,SORTPAR1) = a5 ++a8 mf(a8) = a1 end repeat a5 = 20 loop for a3 = a8 to a7 + 1 step -1 a1 = mf(a3) a4 = ts(a1,SORTPAR1) if a4 = 6 /* time designation, word, sign, mark if a5 < 4 /* bar, clef, grace note/chord or ... ts(a1,SORTPAR1) = a5 a4 = a5 else if ts(a1,TYPE) = DESIGNATION ts(a1,SORTPAR1) = 5 end end end a5 = a4 repeat &dA &dA &d@ Sort this section of mf(.) according to SORTPAR1, taking care &dA &d@ &dAnot&d@ to separate chord tones from their principal tones. &dA if a8 > a7 + 1 /* (1) transfer relevant portion to mf2 array loop for a3 = a7+1 to a8 mf2(a3) = mf(a3) repeat /* (2) move elements back using order of sort priorites &dAonly&d@ a6 = a7 loop for a1 = 1 to 9 /* sort priorities loop for a3 = a7+1 to a8 a5 = mf2(a3) /* a5 is a ts(.) index if a5 <> 1000 a5 = ts(a5,SORTPAR1) /* a5 is a sort priority (0 to 9) if a5 = a1 ++a6 mf(a6) = mf2(a3) /* move element back to mf mf2(a3) = 1000 /* and disqualify this element end end repeat repeat if a6 <> a8 putc Program Error in mf() sort stop end end &dA &dA &d@ End of mf() section sort &dA a7 = a8 repeat /* now sort the ts(.,.) array according to the mf(.) order &dA &d@ loop for a2 = 1 to a8 &dA &d@ putc ~mf(a2) &dA &d@ repeat a5 = sct + 1 /* address of "hole" a1 = oldsct + 1 loop for a2 = 1 to a8 a3 = mf(a2) if a3 <> a1 /* move ts(a1) to "hole" and put ts(a3) in a1 slot loop for a6 = 1 to TS_SIZE ts(a5,a6) = ts(a1,a6) ts(a1,a6) = ts(a3,a6) repeat /* search mf(.) array for reference to a1 element /* and tell it that this element is now in a5 loop for a7 = a2+1 to a8 if mf(a7) = a1 mf(a7) = a5 a7 = a8 end repeat &dA &d@ mf(a2) = a1 /* set a5 to the new "hole", which is a3 a5 = a3 end /* advance the destination, a1 ++a1 repeat &dA &dA &d@ Code added &dA01/07/06&d@ reporting on a possible failure condition &dA &d@ brought on by a faulty stage2 file. &dA a5 = sct - oldsct if a5 <> a8 if a5 > sct dputc I think there is a bug here. If strange things putc happen, look here first. else putc &dEWARNING!&d@ There may be a format error in your stage2 file. putc (possibly having to do with (cue note) durations) putc type to proceed on a probationary basis. getc sct = a8 - oldsct end end &dA &dA &dA &d@ Clear work space &dA loop for a1 = oldsct + 1 to sct ts(a1,SORTPAR1) = 0 repeat loop for a1 = 1 to TS_SIZE ts(sct+1,a1) = 0 repeat goto TS_SORTED &dA &dA &d@ ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» &dA &d@ º O L D S O R T A L G O R I T H M º &dA &d@ ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ &dA &dA &d@ Reorder set array according to location in measure. Do not &dA &d@ separate extra chord notes from their original lead notes. &dA &d@ Do not change the order of bar/clef/grace-note. Do not &dA &d@ extract signs, words, or marks when they precede a bar, &dA &d@ clef or grace note; otherwise extract them and put them &dA &d@ in front of figures, cues and regular notes. &dA &dA &d@ For objects at same location, the order is as follows: &dA &dA &d@ 1. bar, clef, grace note/chord &dA &d@ 2. change in divisions per quarter &dA &d@ 3. time designation, meter change, key change &dA &d@ 4. word, sign, mark &dA &d@ 5. figure &dA &d@ 6. cue note/chord &dA &d@ 7. cue rest &dA &d@ 8. regular note/chord &dA &d@ 9. regular rest &dA &dA &d@ Designations have a certain amount of "glue". If they preceed &dA &d@ a clef change, they want to keep that position. If they &dA &d@ preceed grace notes, they want to stay there also. If they &dA &d@ preceed a bar line, they want to stay there. Otherwise &dA &d@ they get moved in front of everything except changes in divspq &dA &dA &dA &d@ Because the position of words, signs, and marks depends on what &dA &d@ follows, we must assign order priorities starting at the &dA &d@ bottom of the array. &dA TS_SORTED: &dA &dA &d@ Reorder multiple grace notes &dA loop for a3 = 1 to MAX_PASS passpar(a3) = 200 /* reverse order scheme, starting at 200 repeat a6 = 200 a5 = 0 loop for a1 = sct to oldsct step -1 if a1 > oldsct and chr(ts(a1,TYPE)) in [GR_NOTE,XGR_NOTE] if a5 = 0 a5 = a1 end a2 = ts(a1,PASSNUM) ts(a1,SORTPAR1) = passpar(a2) if a6 > passpar(a2) a6 = passpar(a2) end if ts(a1,TYPE) = GR_NOTE --passpar(a2) end else if a5 > 0 /* some grace notes were found a5 -= a1 /* a5 = number of elements a4 = 0 loop for a7 = a6 to 200 a3 = 0 loop for a8 = 1 to a5 if ts(a1+a8,SORTPAR1) = a7 ++a4 mf(a4) = a1 + a8 /* here is where we must add space parameter for GRACE notes if a3 = 0 if ts(a1+a8,BEAM_FLAG) = NO_BEAM ts(a1+a8,SPACING) = hpar(97) /* Removed * 4 / 3 &dA05-15-95 else ts(a1+a8,SPACING) = hpar(97) end a3 = 1 else ts(a1+a8,SPACING) = 0 end end repeat repeat /* mf(.) now contains the locations of array elements (in reordered form) loop for a8 = 1 to a5 a4 = mf(a8) if a1+a8 <> a4 /* what's there now is not what goes there loop for a7 = 1 to TS_SIZE ts(sct+1,a7) = ts(a1+a8,a7) /* make hole for new element ts(a1+a8,a7) = ts(a4,a7) /* move in new element ts(a4,a7) = ts(sct+1,a7) /* put old element in vacancy repeat loop for a7 = 1 to a5 if mf(a7) = a1 + a8 /* this element has been moved mf(a7) = a4 /* now give new location a7 = a5 end repeat mf(a8) = a1 + a8 end repeat /* re-initialize sorting parameters loop for a3 = 1 to MAX_PASS passpar(a3) = 200 repeat a5 = 0 a6 = 200 end end repeat loop for a1 = oldsct+1 to sct ts(a1,SORTPAR1) = 0 repeat &dA ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA ³ End of reorder process. ³ &dA ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ &dA &dA &d@ Check for isolated SIGNS, WORDS, or MARKS &dA a2 = oldsct + 1 a5 = ts(a2,DIV) loop for a1 = oldsct+1 to sct if ts(a1,DIV) <> a5 loop for a3 = a2 to a1 - 1 nodtype = ts(a3,TYPE) if chr(nodtype) not_in [SIGN,WORDS,MARK] a3 = 1000000 end repeat if a3 <> 1000000 loop for a3 = a2 to a1 - 1 ts(a3,ISOLATED) = 1 repeat end a2 = a1 a5 = ts(a2,DIV) end repeat &dA &dA &d@ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@ ³ Before decoding the notes, we must determine if this part ³ &dA &d@ ³ represents more than one independent instrument. If so then ³ &dA &d@ ³ the rules regarding accidentals are slightly different. Each ³ &dA &d@ ³ instrumental part must have its own, independent measax array. ³ &dA &d@ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ &dA &dA &dA &d@ For the case where more than one independent instrument is being &dA &d@ represented on this measure, (vflag > 1) we need to catagorize &dA &d@ the measure into one of three types: &dA &dA &d@ (1) one pass, no chords. &dA &dA &d@ This situation arrises when we have an a2 (zu 2) situation, &dA &d@ i.e., all instruments are active, but are playing the same &dA &d@ music, or a 1. (2. or 3.) situation, i.e., only one &dA &d@ instrument is specifically active -- all other instruments &dA &d@ have been told not to play. In this case, the music is &dA &d@ easy to typeset. &dA &dA &d@ (2) one pass, chords. &dA &dA &d@ This is the situation more than 90% of the time. Two or &dA &d@ more parts (99.99% of the time, it is two parts) are &dA &d@ represented in the measure, and the following conditions &dA &d@ hold true: &dA &dA &d@ a) all parts have the same rhythm (including resting &dA &d@ at the same time) &dA &d@ b) part 1 is at unison or is higher than part 2, etc. &dA &dA &d@ c) all parts have identical slurs and articulations. &dA &d@ This includes slurs entering and leaving the &dA &d@ measure. &dA &dA &d@ d) if there is a unison and it is an eighth note or less, &dA &d@ then it is not attached to a beam. &dA &dA &d@ The parts will be printed as chords. Slurs and articulations &dA &d@ will be attached to the note head at the end of stem. Unison &dA &d@ notes (represented as chords with two or more identical notes) &dA &d@ will be printed in one of two ways: &dA &dA &d@ a) whole notes and larger will be printed side-by-side. &dA &dA &d@ b) half notes and smaller will be printed with two stems &dA &d@ (up and down) regardless of the listed stem direction. &dA &d@ (three unisons cannot be handled by this program) &dA &dA &d@ &dAWith this type, each part (defined by its position in the chord)&d@ &dA &d@ &dAwill have its own measax array. This is because accidentals &dA &d@ &dAmust be repeated, if they appear in different parts. &dA &dA &d@ (3) more than one pass. &dA &dA &d@ With this type, notes occuring on the same division and having &dA &d@ the same duration and same stem direction will be combined into &dA &d@ one chord. &dA As with type (2) above, each part (defined in this &dA &d@ &dAcase by pass number) will have its own measax array. Accidentals&d@ &dA &d@ &dAmust be repeated, if they appear in different parts.&d@ Unison &dA &d@ whole notes and larger will be printed side-by-side. &dA if vflag > 1 if passnum = 1 &dA &d@ &dA &d@ Must determine if there are chords in this measure &dA mcat = 1 loop for a1 = 1 to sct if ts(a1,TYPE) = XNOTE mcat = 2 a1 = sct end repeat else mcat = 3 end else mcat = 0 end &dA &dA &d@ (added &dA10-12-96&d@) &dA &dA &d@ Determine links between tie terminators and earlier pitches &dA &dA &d@ Basically, we look backward through the data to find the pitch &dA &d@ referred to by the tie terminator. If the pitch cannot be found, &dA &d@ this is an error condition. We must search on the correct staff &dA &d@ number. Once we have found the pitch, we need to store its &dA &d@ index number. Later we will determine the STAFFLOC parameter. &dA &d@ This will be used later to generate the mark object and the tie &dA &d@ super object. &dA loop for a1 = oldsct+1 to sct if ts(a1,TYPE) = SIGN and ts(a1,SIGN_TYPE) = TIE_TERM tsdata(ts(a1,TEXT_INDEX)) = tsdata(ts(a1,TEXT_INDEX)) // pad(4) note = tsdata(ts(a1,TEXT_INDEX)){1,4} loop for t7 = a1 to oldsct+1 step -1 if ts(t7,TYPE) <= NOTE_OR_REST if ts(t7,STAFF_NUM) = ts(a1,STAFF_NUM) t8 = ts(t7,4) /* "4" is a cluge, here (see below) if note = tcode(t8) ts(a1,BACKTIE) = t7 /* store ts index of pitch generating tie goto TIE_TERM_FOUND end end end repeat return 10 end TIE_TERM_FOUND: repeat &dA &dA &d@ End of &dA10-12-96&d@ addition &dA &dA &dA &d@ Decode pitches, store &dAunmodified&d@ accidentals in ts(.,AX) &dA loop for a1 = oldsct+1 to sct nodtype = ts(a1,TYPE) if nodtype <= NOTE_OR_REST a2 = ts(a1,4) note = tcode(a2) perform decodenote if @c = 100 @c += ts(a1,CLAVE) /* see "floating rest flag" end ts(a1,CLAVE) = @c /* &dAHere is where CLAVE is definitively set ts(a1,AX) = @d a4 = ts(a1,STAFF_NUM) + 1 if @c < 100 &dK &d@ ts(a1,STAFFLOC) = 52 - @c - cline(a4) + c8flag(a4) * notesize / 2 ts(a1,STAFFLOC) = 52 - @c - cline(a4) + c8flag(a4) + 20 * notesize / 2 - vpar20 end &dA &dA &d@ We need to capture the note shape data now, because it will figure in on &dA &d@ whether a passage is iso-rhythmic; i.e., you can't have iso-rhythm with &dA &d@ different note shapes. Code added &dA02/19/06&d@ &dA a14 = ts(a1,TSR_POINT) a4 = ors(tsr(a14){1}) if a4 > 16 a4 >>= 4 /* upper for bits a4 <<= 20 /* shifted to space 20-23 ts(a1,SUBFLAG_1) |= a4 end &dA end if chr(nodtype) in [SIGN,WORDS,MARK] a4 = ts(a1,STAFF_NUM) + 1 /* staff number a2 = ts(a1,SUPER_TYPE) + 1 / 2 if chr(a2) in [OCT_UP,OCT_DOWN,DBL_OCT_UP,DBL_OCT_DOWN] &dA &dA &d@ adjust c8flag(.) &dA if a2 = OCT_UP c8flag(a4) = -7 end if a2 = OCT_DOWN c8flag(a4) = 7 end if a2 = DBL_OCT_UP c8flag(a4) = -14 end if a2 = DBL_OCT_DOWN c8flag(a4) = 14 end transflag(a4) = 2 * a2 end if ts(a1,SUPER_TYPE) = NORMAL_TRANS c8flag(a4) = 0 /* return to normal if transflag(a4) < 2 * OCT_UP putc Possible Coding error with transpositions putc Type to continue getc end ts(a1,SUPER_TYPE) = transflag(a4) transflag(a4) = 0 end end if nodtype = CLEF_CHG a4 = ts(a1,STAFF_NUM) + 1 /* staff number clef(a4) = ts(a1,CLEF_NUM) perform zjcline (a4) * this resets clef and cline /* ts(a1,CLEF_FONT) += z &dA Unnecessary and, in fact, an error! &d@ ts(a1,TRANS_FLAG) = k /* &dA ts(a1,CLEF_STAFF_POS) = 5 - j * notesize /* &dA Possibly a3 = hpar(8) * 5 / 6 /* &dA unnecessary if ts(a1,CLEF_FONT) >= 128 /* music font /* &dA at this a3 = a3 * 8 / 10 /* &dA point end /* &dA ts(a1,SPACING) = a3 /* &dA end repeat &dA &dA &d@ If mcat = 3, reorganize notes on the same division. If two notes &dA &d@ with different pass numbers have the same duration and stem directions &dA &d@ in the same direction, and these notes do not have beam connections, &dA &d@ then these notes can be combined into one chord. This will save &dA &d@ considerable trouble later during the computing of x-offsets (both &dA &d@ local and global) and the setting of stems. &dA &dA &d@ &dA09/22/93&d@ Actually I would like to expand this section. &dA &dA &d@ (1) I would like to try to combine isorhythmic passages that do connect &dA &d@ to beams &dA &dA &d@ (2) If the entire measure is isorhythmic, then I would like to set &dA &d@ mcat to 2 and reduce the number of passes &dA &dA &d@ (3) Also, if the measure is isorhythmic, I would like to print out &dA &d@ rests only one time &dA &dA &d@ (4) Also, if mcat > 1, accidentals on the same line should NOT be &dA &d@ reprinted. This should be easy to fix, simply by looping though &dA &d@ all simultanities on a staff and removing accidentals that &dA &d@ occur twice on the same pitch. &dA &dA &d@ available variables: a1 --> a16 &dA if mcat = 3 /* %%% add code here for changing ax behavior &dA &dA &d@ First thing: fix accidentals according to pass number &dA loop for a1 = oldsct+1 to sct nodtype = ts(a1,TYPE) if nodtype <= NOTE_OR_REST a4 = ts(a1,PASSNUM) if a4 > 3 putc This code will not work with more than 3 passes examine stop end perform decodeax (a1,a4) end if nodtype = BAR_LINE loop for a3 = 1 to 50 loop for a4 = 1 to 4 /* &dA06/04/08&d@ was 3 &dK &d@ measax(a4,a3) = claveax(a3) measax(a4,a3) = tclaveax(a3) /* New &dA12/14/07&d@ repeat repeat end if nodtype = CLEF_CHG a4 = ts(a1,STAFF_NUM) + 1 /* staff number clef(a4) = ts(a1,CLEF_NUM) perform zjcline (a4) * this resets clef and cline ts(a1,CLEF_FONT) += z /* music font ts(a1,TRANS_FLAG) = k ts(a1,CLEF_STAFF_POS) = 5 - j * notesize a3 = hpar(8) * 5 / 6 /* Added &dA06-24-94&d@ if ts(a1,CLEF_FONT) > 128 /* music font a3 = a3 * 8 / 10 end ts(a1,SPACING) = a3 if nstaves > 1 /* Case: assume one part to stave (usual case) loop for a3 = 1 to 50 &dK &d@ measax(a4,a3) = claveax(a3) measax(a4,a3) = tclaveax(a3) /* New &dA12/14/07&d@ repeat else loop for a4 = 1 to 4 /* &dA06/04/08&d@ was 3 loop for a3 = 1 to 50 &dK &d@ measax(a4,a3) = claveax(a3) measax(a4,a3) = tclaveax(a3) /* New &dA12/14/07&d@ repeat repeat end end repeat &dA &dA &d@ Now you can combine notes into chords (and alter pass numbers) &dA &dA &dA &d@ If there are notes of different note shapes in a measure, this is a &dA &d@ non-starter for combining any notes into chords. All notes must have &dA &d@ the same note shape (bits 20-23 of SUBFLAG_1). This information was &dA &d@ encoded at the same time as pitch. (added &dA02/19/06&d@) &dA a2 = 0 loop for a1 = oldsct+1 to sct nodtype = ts(a1,TYPE) if nodtype <= NOTE_OR_REST if a2 = 0 a2 = a1 end if (ts(a2,SUBFLAG_1) & 0xf00000) <> (ts(a1,SUBFLAG_1) & 0xf00000) goto ISO_DONE end end repeat &dA &dA &dA &d@ First check to see if the entire measure is isorhythmic. This will &dA &d@ save time in the end, and is also necessary in determining whether or &dA &d@ not to eliminate duplicate rests. There are some caviats here: &dA &dA &d@ (1) Notes with lower pass numbers must always be unison or higher &dA &d@ on the staff &dA &d@ (2) All stem directions must be the same (for a particular division) &dA &d@ &dAREMOVED &dA &dA &d@ (3) All beam flags for notes from each pass must be identical. &dA &dA &d@ (4) Every division must have a representative from each pass. These &dA &d@ must be either all notes or all rests. &dA /* %%% add code here for disabling isorhythmic compression loop for a1 = oldsct+1 to sct nodtype = ts(a1,TYPE) if nodtype <= NOTE_OR_REST loop for a2 = a1 + 1 to sct if ts(a2,DIV) <> ts(a1,DIV) or ts(a2,SPACING) <> 0 goto JOL1 end if nodtype = REST or nodtype = CUE_REST if ts(a2,TYPE) <> nodtype goto JOL1 end else if ts(a2,TYPE) <> nodtype and ts(a2,TYPE) <> nodtype + 1 goto JOL1 end end repeat JOL1: --a2 if a2 - a1 + 1 < passnum goto ISO_FAIL end a4 = 0 a5 = 0 a6 = ts(a1,PASSNUM) a7 = 1000 loop for a3 = a1 to a2 if ts(a3,CLAVE) < 100 if ts(a3,STAFF_NUM) <> ts(a1,STAFF_NUM) goto ISO_FAIL end &dA &d@ if bit(1,ts(a3,STEM_FLAGS)) <> bit(1,ts(a1,STEM_FLAGS)) &dA &d@ goto ISO_FAIL &dA &d@ end if ts(a3,BEAM_FLAG) <> ts(a1,BEAM_FLAG) goto ISO_FAIL end if bit(0,ts(a3,SUPER_FLAG)) <> bit(0,ts(a1,SUPER_FLAG)) /* ties goto ISO_FAIL end if bit(2,ts(a3,STEM_FLAGS)) = 0 /* number of "events" ++a4 end if ts(a3,PASSNUM) = a6 /* order of pitches */ if ts(a3,CLAVE) < a7 a7 = ts(a3,CLAVE) end else if ts(a3,CLAVE) > a7 goto ISO_FAIL end a6 = ts(a3,PASSNUM) a7 = ts(a3,CLAVE) end else ++a5 end repeat if a4 = 0 if a5 <> passnum goto ISO_FAIL end else if a4 <> passnum or a5 > 0 goto ISO_FAIL end end a1 = a2 end repeat &dA &dA &d@ The measure meets the conditions of isorhythmic compression. Here is &dA &d@ what we must do: &dA &dA &d@ (1) Rests: Delete duplicate rests. Do this all at one time, &dA &d@ since this involves resizing the ts array. &dA &dA &d@ &dANote on this&d@: I don't think autoscr actually wants to delete &dA &d@ rests, but rather to make them "silent." To do otherwise &dA &d@ might remove time from a track. &dA &dA &d@ (2) Notes--situation 1: Note not connected to a beam &dA &dA &d@ New condition &dA12/20/05&d@: If stem_change_flag < 3, then do the &dA &d@ steps below only if the stem directions are the same. &dA &dA &d@ &dA &d@ If no unison and no chords in separate parts, then combine all &dA &d@ &dA &d@ pitches into one chord &dA &d@ &dA &d@ If separate stem directions do not agree, determine &dA &d@ &dA &d@ best direction; otherwise use common direction &dA &d@ &dA &dA &d@ &dA &d@ TYPE: for each note group, make first type 1,4,7 and &dA &d@ &dA &d@ all others 2,5,8 &dA &d@ &dA &d@ STEM_FLAGS: set all bit2's; set all bit3's for all but first &dA &d@ &dA &d@ member of group &dA &d@ &dA &d@ BEAM_FLAG: zero for all but first member of chord group &dA &d@ &dA &d@ BEAM_CODE: zero for all but first member of chord group &dA &d@ &dA &d@ PASSNUM: equal to PASSNUM for first member of group &dA &d@ &dA &dA &d@ &dA &d@ Otherwise, set the stem direction for the upper pass &dA &d@ &dA &d@ to up and for the lower pass to down. &dA &dA &d@ (3) Notes--situation 2: Note is connected to a beam &dA &dA &d@ For all notes on that beam determine if there are any unisons &dA &d@ or any chords in separate chords. &dA &dA &d@ If no unisons and no chords, then combine all pitches into one chord &dA &d@ If separate stem directions do not agree, determine &dA &d@ best direction; otherwise use common direction &dA &dA &d@ TYPE: for each note group, make first type 1,4,7 and &dA &d@ all others 2,5,8 &dA &d@ STEM_FLAGS: set all bit2's; set all bit3's for all but first &dA &d@ member of group &dA &d@ BEAM_FLAG: zero for all but first member of chord group &dA &d@ BEAM_CODE: zero for all but first member of chord group &dA &d@ PASSNUM: equal to PASSNUM for first member of group &dA &dA &d@ If unisons, then set the stem direction for the upper pass &dA &d@ to up and for the lower pass to down. &dA &dA &d@ (4) If all notes in measure were combined into chords, then &dA &d@ decrease passnum by amount of largest PASSNUM + 1 / 2 &dA &dA &dA &d@ (1) Rests: Delete duplicate rests &dA a1 = oldsct+1 COMPRESS1: nodtype = ts(a1,TYPE) if (nodtype = REST or nodtype = CUE_REST) and rest_collapse = TRUE loop for a2 = a1 + 1 to sct if ts(a2,DIV) <> ts(a1,DIV) or ts(a2,TYPE) <> nodtype goto JOL2 end repeat JOL2: #if AUTOSCR &dA &dA &d@ This section of code different from AUTOSET &dA &d@ if a2 > a1 + 1 /* a2 points beyond last dup. rest if nodtype = CUE_REST a5 = a1 + 1 loop for a3 = a2 to sct loop for a4 = 1 to TS_SIZE ts(a5,a4) = ts(a3,a4) repeat ++a5 repeat loop for a4 = 1 to TS_SIZE /* &dA1/30/96&d@ clear last ts(.,.) line ts(sct,a4) = 0 repeat sct -= a2 - a1 - 1 else loop for a4 = a1 + 1 to a2 - 1 if chr(ts(a4,CLAVE)) in [100,101,200] ts(a4,CLAVE) = 200 ts(a4,PASSNUM) = ts(a1,PASSNUM) /* I hope this works ???? else dputc Program Error: rest found whose CLAVE was improperly set. stop end repeat a1 += (a2 - a1 - 1) /* move a1 to last dup. rest end end &dA #else &dA &dA &d@ This section of code different from AUTOSCR &dA &d@ if a2 > a1 + 1 /* do this only if another rest is found a5 = a1 + 1 loop for a3 = a2 to sct loop for a4 = 1 to TS_SIZE ts(a5,a4) = ts(a3,a4) repeat ++a5 repeat loop for a4 = 1 to TS_SIZE /* &dA1/30/96&d@ clear last ts(.,.) line ts(sct,a4) = 0 repeat sct -= a2 - a1 - 1 end &dA #endif end ++a1 if a1 <= sct goto COMPRESS1 end &dA &dA &d@ (2) (3) Notes-- situations 1 and 2 &dA a16 = 0 /* New &dA12/20/05&d@ and be careful not to modify this in other parts of AUTOSET a15 = 0 /* New &dA12/20/05&d@ a10 = 0 a5 = 0 a6 = 0 a7 = 0 a8 = 0 loop for a1 = oldsct+1 to sct nodtype = ts(a1,TYPE) if nodtype = NOTE or nodtype = CUE_NOTE or nodtype = GR_NOTE loop for a2 = a1 + 1 to sct if ts(a2,DIV) <> ts(a1,DIV) or ts(a2,SPACING) <> 0 goto JOL3 end repeat while ts(a2,TYPE) = nodtype or ts(a2,TYPE) = nodtype + 1 JOL3: --a2 &dA &dA &d@ Move all dynamics for notes on same division to first note (because it is easy &dA &d@ to do at this point) (&dA12/20/05&d@ moving this code inside processing loop) &dA &dK &d@ a4 = 0 &dK &d@ a7 = 0 /* New &dA05/17/03&d@ &dK &d@ loop for a3 = a1 to a2 &dK &d@ a4 |= ts(a3,SUBFLAG_1) & 0x3c00 /* 0000 0000 0011 1100 0000 0000 &dK &d@ ts(a3,SUBFLAG_1) &= 0xffc3ff /* 1111 1111 1100 0011 1111 1111 &dK &d@ a7 |= ts(a3,ED_SUBFLAG_1) & 0x3c00 /* 0000 0000 0011 1100 0000 0000 &dA05/17/03 &dK &d@ ts(a3,ED_SUBFLAG_1) &= 0xffc3ff /* 1111 1111 1100 0011 1111 1111 &dA05/17/03 &dK &d@ repeat &dK &d@ ts(a1,SUBFLAG_1) |= a4 &dK &d@ ts(a1,ED_SUBFLAG_1) |= a7 /* New &dA05/17/03&d@ &dA &dA &d@ Remove duplicate fermatas for notes on same division (because it is easy &dA &d@ to do at this point) &dA a4 = ts(a1,SUBFLAG_1) & 0x0080 /* 0000 0000 0000 0000 1000 0000 a7 = ts(a1,ED_SUBFLAG_1) & 0x0080 /* 0000 0000 0000 0000 1000 0000 &dA05/17/03 loop for a3 = a1 + 1 to a2 if ts(a3,SUBFLAG_1) & 0x0080 = a4 /* 1 1111 1111 1111 1111 1111 0111 1111 "1 1111 " added &dA04/22/08&d@ and &dA10/08/08 ts(a3,SUBFLAG_1) &= 0x1fffff7f end if ts(a3,ED_SUBFLAG_1) & 0x0080 = a7 /* New &dA05/17/03&d@ /* 1 1111 1111 1111 1111 1111 0111 1111 "1 1111 " added &dA04/22/08&d@ and &dA10/08/08 ts(a3,ED_SUBFLAG_1) &= 0x1fffff7f end repeat if a2 - a1 + 1 > passnum a7 = 1 /* chords are present on this division end &dA &dA &d@ Determine if there is a unison in this group &dA &dK &d@ if a7 = 0 if a7 = 0 and stem_change_flag = 3 /* New condition &dA12/20/05 loop for a3 = a1 + 1 to a2 if ts(a3,CLAVE) = ts(a3-1,CLAVE) a7 = 1 end repeat end if a16 = 0 loop for a3 = a1 + 1 to a2 if bit(1,ts(a3,STEM_FLAGS)) <> bit(1,ts(a1,STEM_FLAGS)) a8 = 1 /* conflicting stem directions end repeat end if ts(a1,BEAM_FLAG) <> 0 /* this note is on a beam a15 = 1 /* New &dA12/20/05&d@ "beam flag" if ts(a1,BEAM_FLAG) = START_BEAM a16 = a1 /* index starts (first/top) beam end if ts(a1,BEAM_FLAG) = END_BEAM a16 += INT10000 /* beams end; now use saved value of a1 from above end else a16 = a1 + INT10000 /* "no beam" case end if a16 > INT10000 /* process notes here a16 -= INT10000 /* recover value of starting "a1" &dA &dA &d@ New condition &dA12/20/05&d@: If stem_change_flag < 3, then (for &dA &d@ non-beam case) do steps below only if the stem directions &dA &d@ are the same. (i.e., when a15 = 0, a8 must be zero, &dA &d@ if stem_change_flag < 3) &dA if a15 = 0 /* no beam if stem_change_flag < 3 and a8 = 1 a10 = 1 /* New condition &dA12/20/05 goto NO_STEM_CHANGE end end &dA &dA &d@ At this point: either a15 = 1 (this is a beamed group or set of beamed groups) &dA &d@ or stem_change_flag = 3 (old code situation) &dA &d@ or a8 = 0 (all stems point the same way) &dA &dA &dA &d@ Case 1: either a unison between passes or a chord on one of the passes &dA &d@ (note: in order for a unison to trigger this case, stem_change_flag must = 3 &dA &d@ otherwise, unisons will fall into case 2 &dA if a7 = 1 &dA &dA &d@ New &dA12/20/05&d@ change stem directions only of stem_change_flag = 3 &dA if stem_change_flag = 3 loop for a3 = a16 to a2 /* all notes inclusive a7 = ts(a3,TYPE) if a7 <= NOTE_OR_REST and a7 <> REST and a7 <> CUE_REST if ts(a3,PASSNUM) = ts(a16,PASSNUM) ts(a3,STEM_FLAGS) &= 0xfffd /* stem up for upper pass else ts(a3,STEM_FLAGS) |= 0x0002 /* stem down for lower pass end end repeat end a10 = 1 else &dA &dA &d@ Old Case 2: no unisons, no chords -- combine passes in one chord &dA &d@ (and stem_change_flag = 3) &dA &dA &d@ &dA12/20/05&d@ Case 2: no chords -- combine passes in one chord &dA &d@ (note: unisons may fall into this case if stem_change_flag < 3) &dA &dA if a8 = 1 and stem_change_flag < 3 /* New condition &dA12/20/05 a10 = 1 goto NO_STEM_CHANGE end if a8 = 1 /* determine stem direction a8 = 0 loop for a3 = a16 to a2 a7 = ts(a3,TYPE) if a7 <= NOTE_OR_REST and a7 <> REST and a7 <> CUE_REST a8 += ts(a3,STAFFLOC) end repeat a8 <<= 1 a8 /= notesize a9 = a2 - a16 + 1 a8 += a9 + 1 / 2 a8 /= a9 if a8 >= 5 a9 = UP else a9 = DOWN end else a9 = bit(1,ts(a16,STEM_FLAGS)) end a11 = 0 a12 = 0 loop for a3 = a16 to a2 /* put all notes into chords a7 = ts(a3,TYPE) if a7 <= NOTE_OR_REST and a7 <> REST and a7 <> CUE_REST ts(a3,STEM_FLAGS) &= 0xfffd /* prepare for new stem direction ts(a3,STEM_FLAGS) |= a9 << 1 &dA &dA &d@ Also move all dynamics for notes on same division to first note (This is correct place &dA &d@ to do this operation &dA12/20/05&d@) &dEThis code uses a4, a6 and a14 in a temporary manner &dA if ts(a3,DIV) <> a11 or ts(a3,SPACING) <> 0 or a12 <> a7 or a3 = a16 a12 = a7 a11 = ts(a3,DIV) ts(a3,STEM_FLAGS) |= 0x04 a8 = a3 &dA &dA &d@ Collect dynamics data for this note (a3) &dA12/20/05&d@ &dA /* 1 1100 0000 0000 0011 1100 0000 0000 "1 1100 " added &dA10/08/08&d@ a4 = ts(a3,SUBFLAG_1) & 0x1c003c00 /* 1 1100 0000 0000 0011 1100 0000 0000 "1 1100 " added &dA10/08/08&d@ a6 = ts(a3,ED_SUBFLAG_1) & 0x1c003c00 else ts(a3,TYPE) = ts(a8,TYPE) + 1 ts(a3,STEM_FLAGS) |= 0x0c ts(a3,BEAM_FLAG) = 0 ts(a3,BEAM_CODE) = 0 if ts(a3,PASSNUM) > a5 a5 = ts(a3,PASSNUM) /* save max passnum end ts(a3,PASSNUM) = ts(a8,PASSNUM) &dA &dA &d@ Merge dynamics data with data for first (a8) note &dA /* 1 1100 0000 0000 0011 1100 0000 0000 "1 1100 " added &dA10/08/08&d@ a4 |= ts(a3,SUBFLAG_1) & 0x1c003c00 /* 1 1100 0000 0000 0011 1100 0000 0000 "1 1100 " added &dA10/08/08&d@ a6 |= ts(a3,ED_SUBFLAG_1) & 0x1c003c00 &dA &dA &d@ Turn off dynamics data for this note (a3) &dA /* 0 0011 1111 1111 1100 0011 1111 1111 "0 0011 " added &dA04/22/08&d@ and &dA10/08/08 ts(a3,SUBFLAG_1) &= 0x1fffc3ff /* 0 0011 1111 1111 1100 0011 1111 1111 "0 0011 " added &dA04/22/08&d@ and &dA10/08/08 ts(a3,ED_SUBFLAG_1) &= 0x1fffc3ff &dA &dA &d@ Add in (new) dynamics data to first (a8) note &dA ts(a8,SUBFLAG_1) |= a4 ts(a8,ED_SUBFLAG_1) |= a6 &dA &dA &d@ The following code is untested, and may cause problems. &dA &d@ Note: &dA10/28/07&d@ it has! I will make some changes that fix a definite &dA &d@ bug, but there may still be other problems. &dA &dK &d@ a14 = ts(a3,TSR_POINT) /* combine tsr strings &dK &d@ tbit2 = cbi(tsr(a14)) &dK &d@ a14 = ts(a8,TSR_POINT) &dK &d@ tbit1 = cbi(tsr(a14)) &dK &d@ tbit1 = bor(tbit1,tbit2) &dK &d@ tsr(a14) = cby(tbit1) c4 = ts(a3,TSR_POINT) c5 = ts(a8,TSR_POINT) /* byte 1 c6 = ors(tsr(c4){1}) & 0xff c7 = ors(tsr(c5){1}) & 0xff c7 |= c6 tsr(c5){1} = chr(c7) /* byte 2 c6 = ors(tsr(c4){2}) & 0xff c7 = ors(tsr(c5){2}) & 0xff c7 |= c6 tsr(c5){2} = chr(c7) /* byte 3 = x offset (modification by suggestion) c6 = ors(tsr(c4){3}) & 0xff c7 = ors(tsr(c5){3}) & 0xff if c6 <> c7 putc &dAWARNING&d@ at approximate measure number ~(measnum - 1) putc putc You have asked autoset/scr to combine into a chord two putc pitches which have different x offsets. This will be done, but putc the results are unpredictable. Note combination usually arrises putc when two instruments occupy the same staff (multi track) and have putc simultaneous notes with the same stem direction. If you really putc want different x offsets, you should make the stem directions on putc these notes different. putc end tsr(c5){3} = chr(c7) /* byte 4 = y offset (modification by suggestion) c6 = ors(tsr(c4){4}) & 0xff c7 = ors(tsr(c5){4}) & 0xff if c6 <> c7 putc &dAWARNING&d@ at approximate measure number ~(measnum - 1) putc putc You have asked autoset/scr to combine into a chord two putc pitches which have different y offsets. This will be done, but putc the results are unpredictable. Note combination usually arrises putc when two instruments occupy the same staff (multi track) and have putc simultaneous notes with the same stem direction. If you really putc want different x offsets, you should make the stem directions on putc these notes different. putc end tsr(c5){4} = chr(c7) c7 = TSR_LENG a14 = ts(a3,TSR_POINT) /* combine tsr strings tbit2 = cbi(tsr(a14){5..}) a14 = ts(a8,TSR_POINT) tbit1 = cbi(tsr(a14){5..}) tbit1 = bor(tbit1,tbit2) tsr(a14){5..c7} = cby(tbit1) &dA &dA &d@ End of &dA10/28/07&d@ modifications &dA &dA &d@ End of dynamics merge process (moved here &dA12/20/05&d@) &dA end end repeat end NO_STEM_CHANGE: a16 = 0 a7 = 0 a8 = 0 a15 = 0 /* New &dA12/20/05&d@ end a1 = a2 end repeat &dA &dA &d@ (4) If all notes in measure were combined into chords, then &dA &d@ Adjust PASSNUM for all nodes and decrease passnum by &dA &d@ amount of largest PASSNUM + 1 / 2 (not fully implemented) &dA if a10 = 0 if a5 > 2 putc This program may have problems with more than putc two separate instruments on a staff line end loop for a1 = oldsct+1 to sct ts(a1,PASSNUM) = 1 repeat passnum = 1 end goto ISO_DONE ISO_FAIL: loop for a1 = oldsct+1 to sct nodtype = ts(a1,TYPE) if nodtype <= NOTE_OR_REST and ts(a1,BEAM_FLAG) = NO_BEAM a4 = ts(a1,DIV) /* test note a5 = ts(a1,NOTE_DUR) a6 = bit(1,ts(a1,STEM_FLAGS)) a7 = ts(a1,STAFF_NUM) if nodtype = NOTE or nodtype = CUE_NOTE loop for a3 = a1+1 to sct if ts(a3,DIV) = a4 if ts(a3,TYPE) = nodtype and ts(a3,NOTE_DUR) = a5 if bit(1,ts(a3,STEM_FLAGS)) = a6 and ts(a3,BEAM_FLAG) = NO_BEAM if ts(a3,STAFF_NUM) = a7 &dA &dA &d@ Move this to be part of a chord on test note &dA a9 = a1+1 perform rotate_array (a9,a3) ts(a9,TYPE) = nodtype + 1 /* chord note ts(a9,STEM_FLAGS) |= 0x0c ts(a1,STEM_FLAGS) |= 0x04 /* make note at a1 "first" in chord &dA1/30/96 ts(a9,PASSNUM) = ts(a1,PASSNUM) end end end else a3 = sct end repeat end if nodtype = GR_NOTE a8 = ts(a1,NTYPE) loop for a3 = a1+1 to sct if ts(a3,DIV) = a4 if ts(a3,TYPE) = GR_NOTE and ts(a3,NTYPE) = a8 and ts(a3,SPACING) = 0 if bit(1,ts(a3,STEM_FLAGS)) = a6 and ts(a3,BEAM_FLAG) = NO_BEAM if ts(a3,STAFF_NUM) = a7 &dA &dA &d@ Move this to be part of a chord on test note &dA a9 = a1+1 perform rotate_array (a9,a3) ts(a9,TYPE) = XGR_NOTE ts(a9,STEM_FLAGS) |= 0x0c ts(a1,STEM_FLAGS) |= 0x04 /* make note at a1 "first" in chord &dA1/30/96 ts(a9,PASSNUM) = ts(a1,PASSNUM) end end end else a3 = sct end repeat end end repeat &dA &dA &dA &d@ New code &dA10/14/07&d@ &dA &d@ Without wrecking what already works with autoset, I will now attempt to &dA &d@ combine groups of notes under the same beam for the case where there &dA &d@ is a third "silent" track or other disruptive objects. &dA #if AUTOSCR loop for a1 = oldsct+1 to sct nodtype = ts(a1,TYPE) if nodtype = NOTE and ts(a1,BEAM_FLAG) = START_BEAM a4 = ts(a1,DIV) /* test note a5 = ts(a1,NOTE_DUR) a6 = bit(1,ts(a1,STEM_FLAGS)) a7 = ts(a1,STAFF_NUM) &dA &dA &d@ Question 1: Is there another note on this division? &dA loop for c1 = a1 + 1 to sct if ts(c1,DIV) = a4 if ts(c1,TYPE) = NOTE goto BCOMA_1 end else a1 = c1 - 1 goto NO_BCOMA end repeat goto NO_BCOMA BCOMA_1: &dA &dA &d@ Question 2: Does this note have the proper characteristics? &dA a2 = c1 if ts(a2,BEAM_FLAG) <> START_BEAM goto NO_BCOMA end if ts(a2,NOTE_DUR) <> a5 goto NO_BCOMA end if bit(1,ts(a2,STEM_FLAGS)) <> a6 goto NO_BCOMA end if ts(a2,STAFF_NUM) <> a7 goto NO_BCOMA end &dA &dA &d@ Setup fixup array &dA beam_fixup_cnt = 1 beam_fixup_arr(1,1) = a1 beam_fixup_arr(1,2) = a2 &dA &dA &d@ Go looking for other note pairs &dA c3 = a2 BCOMA_4: loop for c1 = c3 + 1 to sct if ts(c1,TYPE) = NOTE goto BCOMA_2 end repeat goto NO_BCOMA BCOMA_2: loop for c2 = c1 + 1 to sct if ts(c2,TYPE) = NOTE goto BCOMA_3 end repeat goto NO_BCOMA &dA &dA &d@ Note pair found; check fit &dA BCOMA_3: if ts(c1,BEAM_FLAG) = CONT_BEAM or ts(c1,BEAM_FLAG) = END_BEAM if ts(c2,BEAM_FLAG) <> ts(c1,BEAM_FLAG) goto NO_BCOMA end if ts(c2,DIV) <> ts(c1,DIV) or ts(c2,NOTE_DUR) <> ts(c1,NOTE_DUR) goto NO_BCOMA end if bit(1,ts(c1,STEM_FLAGS)) <> a6 or bit(1,ts(c2,STEM_FLAGS)) <> a6 goto NO_BCOMA end if ts(c1,STAFF_NUM) <> a7 or ts(c2,STAFF_NUM) <> a7 goto NO_BCOMA end ++beam_fixup_cnt beam_fixup_arr(beam_fixup_cnt,1) = c1 beam_fixup_arr(beam_fixup_cnt,2) = c2 if ts(c1,BEAM_FLAG) = CONT_BEAM c3 = c2 goto BCOMA_4 /* go look for more pairs end end &dA &dA &d@ Now move these notes to be part of chords on test notes &dA loop for c3 = 1 to beam_fixup_cnt c1 = beam_fixup_arr(c3,1) c2 = beam_fixup_arr(c3,2) ts(c2,TYPE) = nodtype + 1 /* chord note ts(c2,STEM_FLAGS) |= 0x0c ts(c1,STEM_FLAGS) |= 0x04 ts(c2,PASSNUM) = ts(c1,PASSNUM) ts(c1,SUBFLAG_1) |= ts(c2,SUBFLAG_1) /* &dA02-11-96&d@ move subflags to main note ts(c2,SUBFLAG_1) = 0 /* this may cause problems ts(c1,ED_SUBFLAG_1) |= ts(c2,ED_SUBFLAG_1) /* New &dA05/17/03&d@ ts(c2,ED_SUBFLAG_1) = 0 ts(c1,SUBFLAG_2) |= ts(c2,SUBFLAG_2) /* New &dA05/17/03&d@ ts(c2,SUBFLAG_2) = 0 ts(c1,ED_SUBFLAG_2) |= ts(c2,ED_SUBFLAG_2) /* New &dA05/17/03&d@ ts(c2,ED_SUBFLAG_2) = 0 repeat a1 = c2 end NO_BCOMA: repeat &dA &dA &d@ End of &dA10/14/07&d@ New code &dA &dA #else &dA &dA &d@ New code &dA1/30/96&d@ to look for cases where groups of notes might be combined &dA &d@ under the same beam. At the moment, this works only with two parts and &dA &d@ with regular notes. &dA loop for a1 = oldsct+1 to sct nodtype = ts(a1,TYPE) if nodtype = NOTE and ts(a1,BEAM_FLAG) = START_BEAM a4 = ts(a1,DIV) /* test note a5 = ts(a1,NOTE_DUR) a6 = bit(1,ts(a1,STEM_FLAGS)) a7 = ts(a1,STAFF_NUM) a2 = a1 + 1 if ts(a2,TYPE) = NOTE and ts(a2,BEAM_FLAG) = START_BEAM if ts(a2,DIV) = a4 and ts(a2,NOTE_DUR) = a5 if bit(1,ts(a2,STEM_FLAGS)) = a6 and ts(a2,STAFF_NUM) = a7 c1 = a1 + 2 c2 = a2 + 2 loop while ts(c1,BEAM_FLAG) = CONT_BEAM or ts(c1,BEAM_FLAG) = END_BEAM if ts(c2,BEAM_FLAG) <> ts(c1,BEAM_FLAG) goto NO_BCOM end if ts(c1,TYPE) <> NOTE or ts(c2,TYPE) <> NOTE goto NO_BCOM end if ts(c2,DIV) <> ts(c1,DIV) or ts(c2,NOTE_DUR) <> ts(c1,NOTE_DUR) goto NO_BCOM end if bit(1,ts(c1,STEM_FLAGS)) <> a6 or bit(1,ts(c2,STEM_FLAGS)) <> a6 goto NO_BCOM end if ts(c1,STAFF_NUM) <> a7 or ts(c2,STAFF_NUM) <> a7 goto NO_BCOM end c1 += 2 c2 += 2 repeat c1 -= 2 c2 -= 2 if ts(c1,BEAM_FLAG) <> END_BEAM or ts(c2,BEAM_FLAG) <> END_BEAM goto NO_BCOM end &dA &dA &d@ Move these notes to be part of chords on test notes &dA loop for c3 = a1 to c1 step 2 a9 = c3 + 1 ts(a9,TYPE) = nodtype + 1 /* chord note ts(a9,STEM_FLAGS) |= 0x0c ts(c3,STEM_FLAGS) |= 0x04 ts(a9,PASSNUM) = ts(c3,PASSNUM) ts(c3,SUBFLAG_1) |= ts(a9,SUBFLAG_1) /* &dA02-11-96&d@ move subflags to main note ts(a9,SUBFLAG_1) = 0 /* this may cause problems ts(c3,ED_SUBFLAG_1) |= ts(a9,ED_SUBFLAG_1) /* New &dA05/17/03 ts(a9,ED_SUBFLAG_1) = 0 ts(c3,SUBFLAG_2) |= ts(a9,SUBFLAG_2) /* New &dA05/17/03 ts(a9,SUBFLAG_2) = 0 ts(c3,ED_SUBFLAG_2) |= ts(a9,ED_SUBFLAG_2) /* New &dA05/17/03 ts(a9,ED_SUBFLAG_2) = 0 repeat a1 = a9 end end end end NO_BCOM: repeat #endif &dA &dA &d@ Check to see if the number of passes has been reduced &dA &d@ (omitted for the moment; may not be necessary) &dA ISO_DONE: end &dA &dA &d@ Make sure at this point that all chords are oriented with the top &dA &d@ note first. Also, for each note (or set of notes = chord), compute &dA &d@ the position of the note head at the end of the stem, and also &dA &d@ compute the position of the end of the stem. Later, we will make &dA &d@ a "best guess" about what the beam height for those notes belonging &dA &d@ to a beam. Store the note position in VIRT_NOTE (for all notes &dA &d@ of the chord) and the stem position in VIRT_STEM (for all notes &dA &d@ of the chord) &dA loop for a1 = oldsct+1 to sct nodtype = ts(a1,TYPE) if chr(nodtype) in [NOTE,CUE_NOTE,GR_NOTE] if bit(2,ts(a1,STEM_FLAGS)) = 1 /* This is a chord a5 = ts(a1,STEM_FLAGS) & 0x03 /* save lower two bits a2 = a1 + 1 loop while ts(a2,TYPE) = nodtype + 1 ++a2 repeat --a2 /* a2 = last note in chord &dA &dA &d@ Bubble sort &dA loop for a3 = a1 to a2-1 loop for a4 = a3 to a2 if ts(a3,CLAVE) < ts(a4,CLAVE) loop for a7 = 2 to TS_SIZE /* keep primary type on top if a7 <> BEAM_FLAG and a7 <> BEAM_CODE /* and don't move beam flags, etc. ts(sct+1,a7) = ts(a3,a7) /* make hole for new element ts(a3,a7) = ts(a4,a7) /* move in new element ts(a4,a7) = ts(sct+1,a7) /* put old element in vacancy end repeat end repeat repeat &dA &dA &d@ Rewrite stem flags &dA loop for a3 = a1 to a2 if a3 = a1 ts(a3,STEM_FLAGS) = a5 + 0x04 /* turn bit 2 else ts(a3,STEM_FLAGS) = a5 + 0x0c /* turn bits 2 and 3 (&dA01-31-97&d@ added a5) end a4 = a3 - a1 + 1 << 4 ts(a3,STEM_FLAGS) += a4 /* note number in chord repeat else a2 = a1 end &dA &dA &d@ Put in y location of object, y location of end note head &dA &d@ and (tentitive) y location of end of stem. &dA if bit(1,ts(a1,STEM_FLAGS)) = UP a4 = ts(a1,STAFFLOC) a5 = ts(a2,STAFFLOC) a6 = ts(a1,STAFFLOC) if a6 >= vpar(5) c3 = vpar(7) else c3 = vpar(6) if ts(a1,NTYPE) > EIGHTH and a6 < 0 - vpar(1) &dK &d@ c3 -= vpar(1) c3 = vpar(5) end end if nodtype <> NOTE and c3 > vpar(5) &dK &d@ c3 -= vpar(1) if c3 = vpar(6) c3 = vpar(5) else c3 = vpar(6) end end a6 -= c3 a6 += vpar(1) /* &dAFUDGE&d@ if a6 > vpar(5) a6 = vpar(5) end else a4 = ts(a2,STAFFLOC) a5 = ts(a1,STAFFLOC) a6 = ts(a2,STAFFLOC) &dK &d@ if a6 <= vpar(3) if a6 <= vpar(4) /* &dA09/22/05&d@ was vpar(3) c3 = vpar(7) else c3 = vpar(6) if ts(a1,NTYPE) > EIGHTH and a6 >= vpar(10) &dK &d@ c3 -= vpar(1) c3 = vpar(5) end end if nodtype <> NOTE and c3 > vpar(5) &dK &d@ c3 -= vpar(1) if c3 = vpar(6) c3 = vpar(5) else c3 = vpar(6) end end a6 += c3 a6 -= vpar(1) /* &dAFUDGE&d@ if a6 < vpar(3) a6 = vpar(3) end end loop for a3 = a1 to a2 ts(a3,OBY) = a4 ts(a3,VIRT_NOTE) = a5 ts(a3,VIRT_STEM) = a6 repeat a1 = a2 /* advance index to last note of chord end repeat &dA &dA &d@ Now we can make a "best guess" about what the beam height for those &dA &d@ notes (chords) belonging to a beam. Store the modified height &dA &d@ (for all notes of the chord) in VIRT_STEM. &dA loop for a1 = oldsct+1 to sct nodtype = ts(a1,TYPE) if chr(nodtype) in [NOTE,CUE_NOTE,GR_NOTE] c5 = ts(a1,BEAM_FLAG) if c5 <> NO_BEAM c3 = ts(a1,PASSNUM) c4 = nodtype + 2 / 3 /* 1, 2, or 3 if c5 = START_BEAM passcnt(c3,c4) = 0 end ++passcnt(c3,c4) c6 = passcnt(c3,c4) beamdata(c4,c3,c6) = a1 /* index to this note if c5 = END_BEAM stem = bit(1,ts(a1,STEM_FLAGS)) &dA &d@ c8 = 1 &dA &d@ if stem = DOWN &dA &d@ c8 = -1 &dA &d@ end if c4 = 1 c5 = 0 else c5 = 1 end loop for c7 = 1 to c6 c1 = beamdata(c4,c3,c7) mf(c7) = ts(c1,OBY) /* vpar(7) * c8 + ts(c1,VIRT_STEM) beamcode(c7) = ts(c1,BEAM_CODE) repeat perform guessbeam (c10, c11) &dA &dA &d@ Put in "new" values for virtual stem position &dA loop for c7 = 1 to c6 c9 = c7 - 1 * vpar(6) * c10 / BHPAR1 c1 = beamdata(c4,c3,c7) ts(c1,VIRT_STEM) = c11 + c9 repeat end end end repeat loop for a1 = oldsct+1 to sct nodtype = ts(a1,TYPE) if chr(nodtype) in [XNOTE,XCUE_NOTE,XGR_NOTE] ts(a1,VIRT_STEM) = ts(a1-1,VIRT_STEM) end repeat &dA &dA &d@ If mcat = 2, decode all accidentals using a measax array which depends &dA &d@ on the note position in a chord. &dA if mcat = 2 /* %%% add code here for changing ax behavior loop for a1 = oldsct+1 to sct nodtype = ts(a1,TYPE) if nodtype <= NOTE_OR_REST a4 = ts(a1,STEM_FLAGS) >> 4 /* Note number in chord if a4 = 0 a4 = 1 end if a4 > 4 /* &dA06/04/08&d@ was 3 putc This code will not work with more than 4 notes in chord examine stop end perform decodeax (a1,a4) end if nodtype = BAR_LINE loop for a3 = 1 to 50 loop for a4 = 1 to 4 /* &dA06/04/08&d@ was 3 &dK &d@ measax(a4,a3) = claveax(a3) measax(a4,a3) = tclaveax(a3) /* New &dA12/14/07&d@ repeat repeat end if nodtype = CLEF_CHG a4 = ts(a1,STAFF_NUM) + 1 /* staff number clef(a4) = ts(a1,CLEF_NUM) perform zjcline (a4) * this resets clef and cline ts(a1,CLEF_FONT) += z /* music font ts(a1,TRANS_FLAG) = k ts(a1,CLEF_STAFF_POS) = 5 - j * notesize a3 = hpar(8) * 5 / 6 /* Added &dA06-24-94&d@ if ts(a1,CLEF_FONT) > 128 /* music font a3 = a3 * 8 / 10 end ts(a1,SPACING) = a3 if nstaves > 1 /* Case: assume one part to stave (usual case) loop for a3 = 1 to 50 &dK &d@ measax(a4,a3) = claveax(a3) measax(a4,a3) = tclaveax(a3) /* New &dA12/14/07&d@ repeat else loop for a4 = 1 to 4 /* &dA06/04/08&d@ was 3 loop for a3 = 1 to 50 &dK &d@ measax(a4,a3) = claveax(a3) measax(a4,a3) = tclaveax(a3) /* New &dA12/14/07&d@ repeat repeat end end repeat end &dA &dA &d@ Decode all accidentals for all other cases &dA if mcat < 2 loop for a1 = oldsct+1 to sct nodtype = ts(a1,TYPE) if nodtype <= NOTE_OR_REST a4 = ts(a1,STAFF_NUM) + 1 /* staff number perform decodeax (a1,a4) end if nodtype = BAR_LINE loop for a3 = 1 to 50 loop for a4 = 1 to 4 /* &dA06/04/08&d@ was 3 &dK &d@ measax(a4,a3) = claveax(a3) measax(a4,a3) = tclaveax(a3) /* New &dA12/14/07&d@ repeat repeat end if nodtype = CLEF_CHG a4 = ts(a1,STAFF_NUM) + 1 /* staff number clef(a4) = ts(a1,CLEF_NUM) perform zjcline (a4) * this resets clef and cline ts(a1,CLEF_FONT) += z /* music font ts(a1,TRANS_FLAG) = k ts(a1,CLEF_STAFF_POS) = 5 - j * notesize a3 = hpar(8) * 5 / 6 /* Added &dA06-24-94&d@ if ts(a1,CLEF_FONT) > 128 /* music font a3 = a3 * 8 / 10 else a3 = a3 * 6 / 5 /* Added &dA12/09/03&d@ as a cludge end ts(a1,SPACING) = a3 loop for a3 = 1 to 50 &dK &d@ measax(a4,a3) = claveax(a3) measax(a4,a3) = tclaveax(a3) /* New &dA12/14/07&d@ repeat end repeat end &dA &dA &d@ Now remove all places where accidentals have been placed twice on &dA &d@ the same line as a result of multiple parts playing the same &dA &d@ altered note. This code added &dA09/22/93&d@ &dA loop for a1 = oldsct+1 to sct nodtype = ts(a1,TYPE) if nodtype <= NOTE_OR_REST loop for a2 = a1 + 1 to sct repeat while ts(a2,SPACING) = 0 and ts(a2,DIV) = ts(a1,DIV) and ts(a2,TYPE) <= NOTE_OR_REST --a2 if a2 > a1 loop for a3 = a1 to a2 if ts(a3,AX) > 0 loop for a4 = a3 + 1 to a2 if ts(a4,STAFF_NUM) = ts(a3,STAFF_NUM) if ts(a4,CLAVE) = ts(a3,CLAVE) if ts(a4,AX) = ts(a3,AX) ts(a4,AX) = 0 end end end repeat end repeat end a1 = a2 end repeat &dA &dA &d@ Set backtie for division 1 elements in the ts() array. &dA &d@ &dA &d@ If this is the measure in a group of measures, then &dA &d@ BACKTIE for division 1 will point to a ROW element of tiearr, &dA &d@ otherwise (2) BACKTIE for division 1 will point to the ts() ROW &dA &d@ element that originated the tie. &dA &d@ loop for a1 = 1 to MAX_TIES if tiearr(a1,TIE_SNUM) > 0 and tiearr(a1,TIE_FOUND) = 0 &dA &dA &d@ Case 1: division 1 of first measure in group &dA if oldsct = 0 loop for a2 = 1 to sct if ts(a2,DIV) = 1 a3 = tiearr(a1,TIE_NTYPE) a4 = ts(a2,TYPE) xbyte = chr(a3) // chr(a4) if ts(a2,STAFFLOC) = tiearr(a1,TIE_VLOC) if ts(a2,STAFF_NUM) = tiearr(a1,TIE_STAFF) if ts(a2,BACKTIE) = 0 if xbyte in [NOTE,XNOTE] /* i.e., both a3 and a4 are in set ts(a2,BACKTIE) = a1 + INT10000 /* backtie = tie number goto TS1 end if xbyte in [CUE_NOTE,XCUE_NOTE] ts(a2,BACKTIE) = a1 + INT10000 /* backtie = tie number goto TS1 end end end end end repeat return 3 else &dA &dA &d@ Case 2: division 1 for subsequent measures in group &dA loop for a2 = oldsct+1 to sct if ts(a2,DIV) = 1 a3 = tiearr(a1,TIE_NTYPE) a4 = ts(a2,TYPE) xbyte = chr(a3) // chr(a4) if ts(a2,STAFFLOC) = tiearr(a1,TIE_VLOC) if ts(a2,STAFF_NUM) = tiearr(a1,TIE_STAFF) if xbyte in [NOTE,XNOTE] /* i.e., both a3 and a4 are in set ts(a2,BACKTIE) = tiearr(a1,TIE_NDX) /* backtie = ts index tiearr(a1,TIE_SNUM) = 0 /* free-up this ROW element of tiearr goto TS1 end if xbyte in [CUE_NOTE,XCUE_NOTE] ts(a2,BACKTIE) = tiearr(a1,TIE_NDX) /* backtie = ts index tiearr(a1,TIE_SNUM) = 0 /* free-up this ROW element of tiearr goto TS1 end end end end repeat return 3 end TS1: tiearr(a1,TIE_FOUND) = 1 end repeat &dA &dA &d@ Set backtie for all non-division-1 elements in the ts() array. &dA &d@ loop for a1 = oldsct+1 to sct &dA &dA &d@ Special case: Grace note tied to a regular note on the same division &dA11/02/05 &dA if chr(ts(a1,TYPE)) in [GR_NOTE,XGR_NOTE] if bit(0,ts(a1,SUPER_FLAG)) = 1 and a1 < sct /* tie present a4 = ts(a1,DIV) loop for a2 = a1+1 to sct if ts(a2,DIV) = a4 if ts(a1,STAFF_NUM) = ts(a2,STAFF_NUM) if ts(a1,STAFFLOC) = ts(a2,STAFFLOC) if chr(ts(a2,TYPE)) in [NOTE,XNOTE] ts(a2,BACKTIE) = a1 /* Case: backtie = ts index to first note goto SEARCH_DONE end end end else a2 = 1000000 end repeat end end &dA &dA &d@ End of &dA11/02/05&d@ special case &dA if chr(ts(a1,TYPE)) in [NOTE,XNOTE,CUE_NOTE,XCUE_NOTE] if bit(0,ts(a1,SUPER_FLAG)) = 1 and a1 < sct /* tie present a4 = ts(a1,DIV) + ts(a1,NOTE_DUR) &dA &dA &d@ Try it first where pass numbers must be the same (usual case) &dA loop for a2 = a1+1 to sct if ts(a2,DIV) = a4 and ts(a1,PASSNUM) = ts(a2,PASSNUM) if ts(a1,STAFFLOC) = ts(a2,STAFFLOC) if chr(ts(a1,TYPE)) in [NOTE,XNOTE] if chr(ts(a2,TYPE)) in [NOTE,XNOTE] ts(a2,BACKTIE) = a1 /* Case: backtie = ts index to first note goto SEARCH_DONE end else if chr(ts(a2,TYPE)) in [CUE_NOTE,XCUE_NOTE] ts(a2,BACKTIE) = a1 /* Case: backtie = ts index to first note goto SEARCH_DONE end end end end repeat &dA &dA &d@ Now try it where pass numbers need not be the same (unusual case) &dA loop for a2 = a1+1 to sct if ts(a2,DIV) = a4 if ts(a1,STAFFLOC) = ts(a2,STAFFLOC) if chr(ts(a1,TYPE)) in [NOTE,XNOTE] if chr(ts(a2,TYPE)) in [NOTE,XNOTE] ts(a2,BACKTIE) = a1 /* Case: backtie = ts index to first note goto SEARCH_DONE end else if chr(ts(a2,TYPE)) in [CUE_NOTE,XCUE_NOTE] ts(a2,BACKTIE) = a1 /* Case: backtie = ts index to first note goto SEARCH_DONE end end end end repeat &dA &dA &d@ If you reach this point (i.e., you have not found a terminating &dA &d@ note), then you must use the tiearr to temporarily store the &dA &d@ information about this note for future reference. This info must &dA &d@ be discarded before the final processing of the ts() array. &dA * identify free slice of tiearr loop for c7 = 1 to MAX_TIES if tiearr(c7,TIE_SNUM) = 0 goto XXX2 end repeat &dA &dA &d@ Here is where the pseudo tiearr is built &dA XXX2: tiearr(c7,TIE_SNUM) = INT1000000 /* pseudo super number tiearr(c7,TIE_NTYPE) = ts(a1,TYPE) tiearr(c7,TIE_VLOC) = ts(a1,STAFFLOC) tiearr(c7,TIE_NDX) = a1 tiearr(c7,TIE_STAFF) = ts(a1,STAFF_NUM) tiearr(c7,TIE_FOUND) = 0 tiearr(c7,TIE_FORCE) = ts(a1,SLUR_FLAG) >> 24 /* &dA04/20/03&d@: New code c6 = ts(a1,TSR_POINT) tiearr(c7,TIE_SUGG) = ors(tsr(c6){69,4}) end end SEARCH_DONE: repeat &dA &dA &d@ Determine space parameter for notes and figures (and isolated signs, words and marks) &dA loop for a1 = 1 to 120 mf(a1) = 0 repeat a9 = 0 divspq = olddivspq inctype_rem = 0 /* Code added &dA02/24/97&d@ loop for a1 = oldsct+1 to sct nodtype = ts(a1,TYPE) if nodtype = DIV_CHG mdiv = ts(a1,DIV) divspq = ts(a1,DIVSPQ) end if nodtype = METER_CHG perform newnsp end if nodtype > NOTE_OR_REST and nodtype <> FIGURES if chr(nodtype) in [SIGN,WORDS,MARK] and ts(a1,ISOLATED) = 1 else goto TS3 end end if chr(nodtype) not_in [XNOTE,XCUE_NOTE,XGR_NOTE] if nodtype = GR_NOTE goto TS3 /* grace note spacing has already been computed. see GRACE end &dA &dA &d@ determine space and duration for this note/figure &dA if nodtype <= NOTE_OR_REST a5 = a1 perform getspace a7 = a6 a8 = ts(a1,NOTE_DUR) &dA &dA &d@ Code added &dA05-29-94&d@ We cannot allow a8 to be less than time &dA &d@ distance to the next division. &dA &dA &d@ Code added &dA06-18-94&d@ We also cannot allow a8 to be more than the &dA &d@ time distance to the next division, if the &dA &d@ next division contains an isolated sign, &dA &d@ words, or mark. &dA loop for a2 = a1+1 to sct a3 = ts(a2,DIV) - ts(a1,DIV) if a3 > 0 if a3 > a8 a8 = a3 end if chr(ts(a2,TYPE)) in [SIGN,WORDS,MARK] and ts(a2,ISOLATED) = 1 if a3 < a8 a8 = a3 end end a2 = sct end repeat else &dA &dA &d@ case 2: figures (and isolated signs, words, and marks) &dA &dA &d@ 1) determine duration (given or implied) &dA if nodtype = FIGURES and ts(a1,FIG_DUR) > 0 a8 = ts(a1,FIG_DUR) else &dA &d@ if figure is not isolated, adopt a duration, else &dA &d@ impute duration if a1 <> sct loop for a11 = a1+1 to sct if ts(a11,DIV) = ts(a1,DIV) if ts(a11,TYPE) <= NOTE_OR_REST a8 = ts(a11,NOTE_DUR) goto TS4 end else &dA &d@ isolated figure in middle of data a8 = ts(a11,DIV) - ts(a1,DIV) goto TS4 end repeat end &dA &d@ isolated figure at end of data a8 = divspq end &dA &dA &d@ 2) compute space for this duration &dA TS4: a10 = a8 &dA &d@ a) adjust duration for triplet a12 = 0 a11 = divspq / 3 if rem = 0 a11 = a10 / 3 if rem > 0 a10 = a10 * 3 / 2 a12 = 1 end end &dA &d@ b) find index into space parameter array a11 = 35 - a12 a12 = divspq * 16 loop a13 = a10 / a12 a12 >>= 1 a11 -= 3 repeat while a13 = 0 if rem > 0 ++a11 end a7 = nsp(a11) end a14 = a7 &dA &dA &d@ notes and figures re-unified at this point in program &dA &dA &d@ a7 = space for first note/figure in node &dA &d@ a8 = duration for first note/figure in node &dA &d@ a14 = largest space for shortest full duration on this division (initially a14 = a7) &dA ++a9 ts(oldsct+a9,TEMP1) = a7 ts(oldsct+a9,TEMP2) = a8 mf(a9) = a8 &dA &dA &d@ proceeding from this point, we have only regular and cue notes, &dA &d@ rests and chords on this division &dA if a1 < sct loop for a2 = a1+1 to sct if ts(a2,DIV) <> ts(a1,DIV) --a2 goto TS2 else a11 = ts(a2,TYPE) if a11 <> XNOTE and a11 <> XCUE_NOTE a5 = a2 perform getspace a15 = ts(a2,NOTE_DUR) &dA &dA &d@ &dA12/04/05&d@ This code moved from below (before modifying a15) &dA &d@ ++a9 mf(a9) = a15 &dA &d@ if a15 < a8 /* modified &dA3/20/94&d@ a7 = a6 a14 = a7 &dA &dA &d@ Code added &dA05-29-94&d@ We cannot allow the "time-space increment" &dA &d@ to be less than the time distance to the &dA &d@ next division. &dA loop for a3 = a2+1 to sct if ts(a3,DIV) <> ts(a1,DIV) a15 = ts(a3,DIV) - ts(a1,DIV) a8 = a15 a3 = sct end repeat else if a15 = a8 if a6 < a7 a7 = a6 end if a6 > a7 a14 = a6 end end end &dA &d@ &dA12/04/05&d@ Moving this code to a point before a15 is modified &dA &d@ &dA &d@ ++a9 &dA &d@ mf(a9) = a15 &dA &dA ts(oldsct+a9,TEMP1) = a6 ts(oldsct+a9,TEMP2) = a15 end end repeat a2 = sct else a2 = a1 end &dA &d@ a2 = pointer into set for last figure/note/rest/cue &dA &d@ on this division &dA &d@ a7 = smallest space for notes for shortest duration on this division &dA &d@ a8 = duration of notes of shortest duration on this division &dA &d@ a9 = total size of mf array (notes longer than smallest) &dA &d@ a14 = largest space for shortest full duration on this division TS2: a4 = 10000 a5 = 10000 a6 = a7 loop for a3 = 1 to a9 if mf(a3) > 0 if mf(a3) < a4 a4 = mf(a3) end &dA &dA &d@ &dA07/01/03&d@: Fixing this to account for irests with &dEnull&d@ space &dA if ts(oldsct+a3,TEMP2) <= a5 &dK &d@ if ts(oldsct+a3,TEMP2) < a5 a5 = ts(oldsct+a3,TEMP2) if ts(oldsct+a3,TEMP1) > 0 a6 = ts(oldsct+a3,TEMP1) end &dK &d@ a6 = ts(oldsct+a3,TEMP1) end end repeat &dA &d@ a4 = smallest number of divisions from left over notes &dA &d@ a5 = duration of shortest note sounding at this point &dA &d@ a6 = space parameter for this shortest note &dA &d@ a4 < a8 means syncopation &dA &d@ here also is where we set the increment distance flag. &dA &d@ Since we are going to increment the distance, we &dA &d@ know at this point what technique we will be using. &dA &d@ ts(24) describes this technique. if a4 < a8 a7 = a6 * a4 / a5 a8 = a4 else a7 = a14 end &dA &d@ a7 = space parameter for this node &dA &d@ a8 = real duration of this node dv4 = 576 * a8 / divspq inctype_rem += rem /* Code added &dA02/24/97&d@ if inctype_rem > (divspq / 2) inctype_rem -= divspq ++dv4 end /* End of &dA02/24/97&d@ addition ts(a1,DINC_FLAG) = dv4 loop for a3 = 1 to a9 mf(a3) -= a8 if mf(a3) < 0 mf(a3) = 0 end repeat if chr(nodtype) in [SIGN,WORDS,MARK] ts(a1,SPACING) = a7 /* must be small, but non-zero else if nodtype <= NOTE_OR_REST ts(a1,SPACING) = a7 else if a1 = a2 ts(a1,FIG_SPACE) = a7 ts(a1,MIN_FIG_SPAC) = a7 else a6 = a1 + 1 if ts(a6,TYPE) <= NOTE_OR_REST ts(a6,SPACING) = a7 else return 8 end end end end a1 = a2 end TS3: repeat /* &dKfor debug purposes only&d@ if inctype_rem <> 0 putc Logical Problem with typeinc_rem putc Check it out! end &dA &dA &d@ Update olddivspq &dA olddivspq = divspq if mdiv = totdiv /* &dAadded 1-27-93 This code is necessary&d@ qflag = 0 /* &dAto cope with the situation where the end /* &dAdivisions-per-quarter is changed at the&d@ /* &dAend of the measure * loop for a1 = 1 to a9 ts(oldsct+a1,TEMP1) = 0 ts(oldsct+a1,TEMP2) = 0 repeat &dA &dA &d@ Space parameter is initialized &dA &dA &dA &d@ We have computed ts(24), the distance increment flag, for all &dA &d@ regular/cue/figure nodes. This parameter is the time elaps &dA &d@ between this node and the next node in the measure. It is &dA &d@ measured in divisions, with 576 divisions being the equivalent &dA &d@ of a quarter note. In the example below the notes are triplet &dA &d@ eights and regular sixteenths respectively. The distances are &dA &d@ listed by letter. &dA &dA &d@ :=======:=======: &dA &d@ triplet 8ths | | | | a = 144 (reg 16th) &dA &d@ @ @ @ O b = 48 &dA &d@ / a /b/ c / d /e/ f / c = 96 &dA &d@ @ @ @ @ O d = 96 &dA &d@ sixteenths | | | | | e = 48 &dA &d@ |_____|_____|_____| f = 144 (reg 16th) &dA &d@ *=====*=====*=====* &dA &dA &d@ These parameters will be assigned to the first object in the &dA &d@ node FOLLOWING THE DISTANCE, whatever it is. It might, for &dA &d@ example, be a grace note, or some kind of sign. The first &dA &d@ object in the node is the one where we can best describe the &dA &d@ distance that has been traversed. In order to accomplish this, &dA &d@ we do not set the inctype parameter until after the object &dA &d@ containing the ts(24) parameter is processed. When spn rolls &dA &d@ over to a new value, the object in question will be assigned &dA &d@ the prior ts(24) parameter. &dA tfirstsp = 0 &dA &dA &d@*************************************************************** &dA &d@ Debug Information &dA g = measnum - 1 &dK &d@ if bit(2,pmode) = 1 and g >= debug_point &dA &dA &d@ Condition changed &dA01/01/06&d@ &dA if (bit(2,pmode) = 1 or debug_flag = 1) and g >= debug_point putc Set Array at Point No. 1: measure ~g putc Look? getc jtype if jtype = "y" perform display_ts end end &dA &dA &d@ End debug information &dA &d@*************************************************************** &dA &dA &d@ Adjust accidentals for case where tie crosses bar line &dA a10 = 1 loop for a1 = oldsct+1 to sct nodtype = ts(a1,TYPE) if ts(a1,DIV) = a10 and ts(a1,BACKTIE) > 0 if chr(nodtype) in [NOTE,XNOTE,CUE_NOTE,XCUE_NOTE] loop for a3 = a1+1 to sct if ts(a3,DIV) > a10 and ts(a3,TYPE) <= NOTE_OR_REST if ts(a3,CLAVE) = ts(a1,CLAVE) if ts(a3,STAFF_NUM) = ts(a1,STAFF_NUM) /* added &dA3-23-94&d@ if ts(a3,AX) = 0 ts(a3,AX) = ts(a1,AX) end &dA &dA &d@ Now remove any similar accidentals which might have &dA &d@ existed previously on this &dA &d@ combination. &dA loop for a4 = a3 + 1 to sct repeat while ts(a4,SPACING) = 0 and ts(a4,DIV) = ts(a3,DIV) and ts(a4,TYPE) <= NOTE_OR_REST --a4 loop for a5 = a3 + 1 to a4 if ts(a5,STAFF_NUM) = ts(a3,STAFF_NUM) if ts(a5,CLAVE) = ts(a3,CLAVE) if ts(a5,AX) = ts(a3,AX) ts(a5,AX) = 0 end end end repeat goto XD end end end repeat XD: &dK &d@ if ts(a1,AX) > 0 if ts(a1,AX) > 0 and (ts(a1,SUBFLAG_1) & 0x040000) = 0 /* condition added &dA11/05/05 ts(a1,AX) |= 0x10 /* Code added &dA02/25/97&d@. This is the "silent" flag end end end if nodtype = BAR_LINE /* non-controlling case a10 = ts(a1,DIV) end repeat &dA &dA &d@ We have a tiny chore to do here. In the case where we have &dA &d@ a down-up pattern of stems on the same beam, we need to be &dA &d@ sure the spacing between these notes is at least some minimum &dA &d@ distance. (This code will work most of the time). &dA a5 = hpar(4) * 4 / 5 + hpar(82) a4 = 0 loop for a1 = oldsct+1 to sct nodtype = ts(a1,TYPE) if nodtype <= NOTE_OR_REST a3 = nodtype + 1 / 3 /* &dAThis code assumes if rem <> 0 /* &dAXNOTE=2 XCUE_NOTE=5 XGR_NOTE=8&d@ if ts(a1,SPACING) > 0 a4 = a1 /* save index to spacing number end end if nodtype = NOTE or nodtype = GR_NOTE or nodtype = CUE_NOTE if bit(1,ts(a1,STEM_FLAGS)) = UP c12 = ts(a1,BEAM_FLAG) if c12 = CONT_BEAM or c12 = START_BEAM a3 = 0 loop for a2 = a1 + 1 to sct if ts(a2,SPACING) > 0 ++a3 if a3 > 1 goto NEXTNOTE end end if ts(a2,TYPE) = nodtype if ts(a2,PASSNUM) = ts(a1,PASSNUM) if bit(1,ts(a2,STEM_FLAGS)) = DOWN if a4 = 0 putc Program error examine end if ts(a4,SPACING) < a5 ts(a4,SPACING) = a5 end end goto NEXTNOTE end end repeat end end end end NEXTNOTE: repeat &dA &dA &d@ Make space for text &dA &dA &d@ This is not an easy task to perform. I have tried a couple of &dA &d@ methods already and am not too happy with them. Let me start &dA &d@ by summarizing the objectives. &dA &dA &d@ 1) We want to underlay the text in as compact a way as possible &dA &d@ The reason for this is that in the later stages of typesetting &dA &d@ we almost always &dAexpand&d@ the music, so we want to start with &dA &d@ as compact a version as possible. &dA &dA &d@ 2) We want the notes to be as true to their rythmic values as &dA &d@ possible. &dA &dA &d@ 3) We need to preserve spacings attached to grace notes, clef &dA &d@ signs, key changes, etc. &dA a2 = firstoff a3 = hpar(37) + tfirstsp a11 = 0 c11 = 0 /* added &dA12/09/03&d@ loop for a1 = oldsct+1 to sct nodtype = ts(a1,TYPE) if nodtype = NOTE a8 = ts(a1,TEXT_INDEX) temp2 = trm(tsdata(a8)) temp2 = temp2 // pad(1) &dK &d@ if temp2{1} in ['A'..'Z','a'..'z','!'..'(','\','='] &dA &dA &d@ New test for text data &dA09/01/03&d@ &dA c6 = 0 if temp2{1} in ['A'..'Z','a'..'z','!'..'(','\','='] c6 = 1 else temp2 = temp2 // " " loop for c7 = 1 to len(temp2) if temp2{c7} = "|" and temp2{c7+1} in ['A'..'Z','a'..'z','!'..'(','\','='] c6 = 1 c7 = len(temp2) end repeat temp2 = trm(temp2) end if c6 = 1 &dA &dA &d@ End of test &dA09/01/03&d@ &dA c11 = 1 /* added &dA12/09/03&d@ textconflag = OFF &dA &dA &d@ Look for case of multiple text &dA c6 = 0 c7 = 0 temp2 = temp2 // "| " CCCB: if temp2 con "|" ttext = temp2{1,mpt-1} &dK &d@ &dK We don't do this here because it will &dK &d@ perform kernttext &dK screw things up later. We are willing &dK &d@ &dK to live with an approximate word length temp2 = temp2{mpt+1..} c5 = mtfont perform wordspace a6 = len(ttext) if "-_" con ttext{a6} if mpt = 1 a5 -= spc(45) else a5 -= spc(95) end else c7 = 1 end if c6 < a5 c6 = a5 end goto CCCB end a5 = c6 if c7 = 0 /* all words end in "_" or "-" if a1 <> sct and ts(a1+1,TYPE) = NOTE c8 = ts(a1+1,TEXT_INDEX) temp2 = trm(tsdata(c8)) temp2 = temp2 // pad(1) if "-_" con temp2{1} a4 = a5 - ts(a1,SPACING) - hpar(51) / 3 if a4 < 0 a4 = 0 end goto CCCC end end if bit(0,ts(a1,SUPER_FLAG)) = 1 a4 = a5 - ts(a1,SPACING) - hpar(51) / 3 if a4 < 0 a4 = 0 end goto CCCC end &dK &d@ else /* &dA12/09/03&d@ try removing this &dK &d@ if a1 <> oldsct+1 &dK &d@ c8 = ts(a1-1,TEXT_INDEX) /* This code is a cludge and &dK &d@ temp2 = trm(tsdata(c8)) /* and is no longer an addition. &dK &d@ temp2 = temp2 // pad(1) /* The &dA12/09/03&d@ post-adjustment &dK &d@ if "-_" con temp2{1} /* provides a much better fix. &dK &d@ a4 = a5 >> 1 - (spc(45) >> 1) &dK &d@ goto CCCC &dK &d@ end &dK &d@ end end a4 = a5 / 3 - (spc(45) >> 1) CCCC: a6 = a3 - a4 a7 = a2 - a6 &dA &dA &d@ a5 = projected space taken up by syllable &dA &d@ a4 = amount by which a syllable is backed up from the note &dA &d@ position &dA &d@ tfirstsp = amount by which first note is shifted forward to make &dA &d@ space for text &dA &d@ a3 = projected position of current note from bar line &dA &d@ a6 = projected position of beginning of current syllable &dA &d@ firstoff = amount by which last syllable from previous measure &dA &d@ overhangs the space allowed for the last note &dA &d@ a2 = smallest value of a6 allowed &dA &d@ a7 = difference between smallest allowed a6 and current a6 &dA if a7 > 0 if a11 = 0 tfirstsp += a7 &dA &d@ a3 += a7 else if ts(a10,TYPE) = NOTE c8 = ts(a10,TEXT_INDEX) temp2 = trm(tsdata(c8)) temp2 = temp2 // pad(1) if "-_" con temp2{1} c9 = 0 loop for c10 = a10 - 1 to oldsct + 1 step -1 if ts(c10,SPACING) > 0 and ts(c10,TYPE) < GR_NOTE c9 = c10 c10 = 0 end repeat if c9 > 0 ts(c9,SPACING) += a7 >> 1 ts(a10,SPACING) += a7 >> 1 goto CCCA end end end ts(a10,SPACING) += a7 /* a10 set later end &dA &d@ a3 += a7 end CCCA: tsdata(a8) = trm(tsdata(a8)) // "$$$$" // chs(a4) a5 -= a4 a2 = a3 + a5 + hpar(58) /* hpar(58) = space between words end if temp2{1} = "_" a5 = a3 + spc(95) if a5 > a2 a2 = a5 end end temp2 = trm(tsdata(a8)) temp2 = temp2 // pad(1) if temp2{1} = "_" textconflag = ON end sub = 1 a11 = 1 loop while temp2{sub..} con "|" a11 <<= 1 ++sub if temp2{sub} = "_" textconflag += a11 end repeat if temp2 = " " and textconflag > OFF /* code added &dA02-23-95&d@ tsdata(a8) = pad(10) loop for a11 = 0 to 9 if bit(a11,textconflag) = ON tsdata(a8){a11+1} = "~" end repeat tsdata(a8) = trm(tsdata(a8)) textconflag = OFF end a11 = 1 end if nodtype = REST and ts(a1,CLAVE) < 200 /* code added &dA02-23-95&d@ textconflag = OFF end if nodtype = BAR_LINE if a2 - hpar(36) > a3 ts(a10,SPACING) += a2 - hpar(36) - a3 a3 = a2 - hpar(36) end end * a10 = backpointer to prior space for note/rest object set if ts(a1,SPACING) > 0 and ts(a1,TYPE) < GR_NOTE a10 = a1 end firstoff = 0 if a1 = sct a4 = a2 - hpar(36) if a4 > a3 firstoff = a4 - a3 end else a3 += ts(a1,SPACING) end repeat &dA &dA &d@ Adding a new section of code (&dA12/09/03&d@) which attempts to midigate somewhat &dA &d@ the unevenness in note spacing introduced by the addition of text. Code &dA &d@ uses c11 to c17 as temporary variables, as well as a new array variable nspace(.,.) &dA if c11 = 1 c12 = 0 loop for a1 = oldsct+1 to sct nodtype = ts(a1,TYPE) if nodtype = NOTE or nodtype = REST a8 = ts(a1,TEXT_INDEX) temp2 = trm(tsdata(a8)) #if REPORT4 putc a1 = ~a1 .t10 NTYPE = ~ts(a1,NTYPE) .t22 SPACING = ~ts(a1,SPACING) .t37 ... putc TYPE = ~ts(a1,TYPE) .t12 text = ~temp2 #endif ++c12 nspace(c12,1) = a1 &dK &d@ nspace(c12,2) = ts(a1,NTYPE) nspace(c12,2) = ts(a1,NTYPE) & 0xff /* new &dA10/15/07&d@ nspace(c12,3) = ts(a1,SPACING) nspace(c12,4) = ts(a1,TYPE) if temp2 con "$$$$" nspace(c12,5) = int(temp2{mpt+4..}) else nspace(c12,5) = 0 end nspace(c12,6) = 0 nspace(c12,7) = 0 nspace(c12,8) = 0 end repeat &dA &dA &d@ Algorithm. &dA &dA &d@ (1) examine all pairs of notes. Find the pair for which &dA &d@ (a) same duration &dA &d@ (b) if d1 = distance after 1st note, and d2 = distance after 2nd note &dA &d@ and both d1 and d2 are non-zero (added &dA04/10/05&d@) &dA &d@ and abs(d1 - d2) > 1 &dA &d@ (c) smallest distance in this set &dA &dA &d@ (2) try moving 2nd note one unit either towards (d1 > d2) or away from (d2 > d1) first note. &dA &d@ (a) resulting total shift of 2nd note cannot more than 1/2 nspace(.,5) to the right &dA &d@ or more than nspace(.,5) to the left &dA &d@ (b) if note cannot be moved, goto (1) and consider next pair &dA &dA &d@ (3) if (1)+(2) fail, look for situations where &dA &d@ (a) a note of longer duration follows a note of shorter duration, and &dA &d@ the shorter note is allowed more space. Try moving the 2nd note &dA &d@ closer to the first, then goto (1). &dA &d@ (b) a note of shorter duration follows a note of longer duration, and &dA &d@ the shorter note is allowed more space. Try moving the 2nd note &dA &d@ away from the first, then goto (1). &dA &d@ (c) in all cases under (3), principal (2)(a) must be followed, &dA &d@ and both notes in question must have non-zero following distances (added &dA04/10/05&d@) &dA &dA NXPAIR: #if REPORT4 loop for c13 = 1 to c12 loop for c14 = 1 to 6 putc .w8 ~nspace(c13,c14) ... repeat putc repeat putc getc #endif c15 = 1000 c16 = 0 loop for c13 = 1 to c12 - 1 &dK &d@ if nspace(c13,2) = nspace(c13+1,2) (new condition below added &dA04/10/05&d@) if nspace(c13,2) = nspace(c13+1,2) and nspace(c13+1,3) <> 0 and nspace(c13,3) <> 0 c14 = abs(nspace(c13,3) - nspace(c13+1,3)) if c14 > 1 if c14 < c15 if nspace(c13+1,5) = 0 /* next node is a rest, etc. if nspace(c13+1,6) > -6 /* max incroachment is 6 c15 = c14 c16 = c13 end else if nspace(c13,3) > nspace(c13+1,3) /* move 2nd note to the left if nspace(c13+1,6) < 0 if abs(nspace(c13+1,6)) < nspace(c13+1,5) c15 = c14 c16 = c13 end else c15 = c14 c16 = c13 end else /* move 2nd note to the right if nspace(c13+1,6) < (nspace(c13+1,5) + 1 >> 1) c15 = c14 c16 = c13 end end end end end end repeat if c16 > 0 loop for c13 = 1 to c12 nspace(c13,7) = 0 repeat end if c16 = 0 loop for c13 = 1 to c12 - 1 &dK &d@ if nspace(c13,2) = nspace(c13+1,2) (new condition below added &dA04/10/05&d@) if nspace(c13,2) = nspace(c13+1,2) and nspace(c13+1,3) <> 0 and nspace(c13,3) <> 0 c14 = abs(nspace(c13,3) - nspace(c13+1,3)) if c14 = 1 and nspace(c13,7) = 0 if nspace(c13+1,5) = 0 /* next node is a rest, etc. if nspace(c13+1,6) > -6 /* max incroachment is 6 c16 = c13 c13 = c12 end else if nspace(c13,3) > nspace(c13+1,3) /* move 2nd note to the left if nspace(c13+1,6) < 0 if abs(nspace(c13+1,6)) < nspace(c13+1,5) c16 = c13 c13 = c12 end else c16 = c13 c13 = c12 end else /* move 2nd note to the right if nspace(c13+1,6) < (nspace(c13+1,5) + 1 >> 1) c16 = c13 c13 = c12 end end end end end repeat if c16 > 0 nspace(c16,7) = 1 end end if c16 > 0 /* note pair found if nspace(c16,3) > nspace(c16+1,3) if c16 > 1 and nspace(c16-1,2) > nspace(c16,2) and nspace(c16,6) < nspace(c16,5) --nspace(c16,3) ++nspace(c16-1,3) ++nspace(c16,6) else --nspace(c16,3) ++nspace(c16+1,3) --nspace(c16+1,6) end else ++nspace(c16,3) --nspace(c16+1,3) ++nspace(c16+1,6) end goto NXPAIR end loop for c13 = 1 to c12 - 1 if nspace(c13,3) <> 0 and nspace(c13+1,3) <> 0 /* this condition added &dA04/10/05 if nspace(c13,2) > nspace(c13+1,2) if nspace(c13,3) < nspace(c13+1,3) if nspace(c13+1,6) < nspace(c13+1,5) or (nspace(c13+1,4) = 3 and nspace(c13+1,6) < 6) ++nspace(c13,3) --nspace(c13+1,3) ++nspace(c13+1,6) goto NXPAIR end end end if nspace(c13,2) < nspace(c13+1,2) if nspace(c13,3) > nspace(c13+1,3) if abs(nspace(c13+1,6)) < (nspace(c13+1,5) + 1 >> 1) --nspace(c13,3) ++nspace(c13+1,3) --nspace(c13+1,6) goto NXPAIR end end end end repeat #if REPORT4 putc NO MORE IMPROVEMENTS getc #endif c12 = 0 loop for a1 = oldsct+1 to sct nodtype = ts(a1,TYPE) if nodtype = NOTE or nodtype = REST a8 = ts(a1,TEXT_INDEX) temp2 = trm(tsdata(a8)) ++c12 if nspace(c12,1) <> a1 dputc &dAProgram Error&d@ stop end ts(a1,SPACING) = nspace(c12,3) if temp2 con "$$$$" c13 = nspace(c12,5) + nspace(c12,6) temp2 = temp2{1,mpt+3} // chs(c13) // "," // chs(nspace(c12,5)) tsdata(a8) = trm(temp2) end end repeat end &dA &d@ End of &dA12/09/03&d@ addition &dK &dA &dK &dA &d@ Make space for text (very old version) &dK &dA &dK &d@ a2 = firstoff &dK &d@ a3 = hpar(37) + tfirstsp &dK &d@ a11 = 0 &dK &d@ loop for a1 = oldsct+1 to sct &dK &d@ nodtype = ts(a1,TYPE) &dK &d@ if nodtype = NOTE &dK &d@ a8 = ts(a1,TEXT_INDEX) &dK &d@ ttext = trm(tsdata(a8)) &dK &d@ ttext = ttext // pad(1) &dK &d@ if ttext{1} in ['A'..'Z','a'..'z','!'..'(','\','='] &dK &d@ c5 = mtfont &dK &d@ perform wordspace &dK &d@ a6 = len(ttext) &dK &d@ if ttext{a6} = "_" &dK &d@ a5 -= 20 &dK &d@ end &dK &d@ if ttext{a6} = "-" &dK &d@ a5 -= 10 &dK &d@ end &dK &d@ if ttext{a6} = "_" &dK &d@ a4 = a5 - ts(a1,SPACING) - hpar(51) / 3 &dK &d@ if a4 < 0 &dK &d@ a4 = 0 &dK &d@ end &dK &d@ goto CCCA &dK &d@ end &dK &d@ a4 = a5 / 3 - 6 &dKC&d@CCA: a6 = a3 - a4 &dK &d@ a7 = a2 - a6 &dK &dA &dK &dA &d@ a5 = projected space taken up by syllable &dK &dA &d@ a4 = amount by which a syllable is backed up from the note &dK &dA &d@ position &dK &dA &d@ tfirstsp = amount by which first note is shifted forward to make &dK &dA &d@ space for text &dK &dA &d@ a3 = projected position of current note from bar line &dK &dA &d@ a6 = projected position of beginning of current syllable &dK &dA &d@ firstoff = amount by which last syllable from previous measure &dK &dA &d@ overhangs the space allowed for the last note &dK &dA &d@ a2 = smallest value of a6 allowed &dK &dA &d@ a7 = difference between smallest allowed a6 and current a6 &dK &dA &dK &d@ if a7 > 0 &dK &d@ if a11 = 0 &dK &d@ tfirstsp += a7 &dK &d@ else &dK &d@ ts(a10,SPACING) += a7 /* a10 set later &dK &d@ end &dK &d@ a3 += a7 &dK &d@ end &dK &d@ a5 -= a4 &dK &d@ a2 = a3 + a5 + 16 /* 16 = space between words (magic) &dK &d@ end &dK &d@ if ttext{1} = "_" &dK &d@ a5 = a3 + spc(95) &dK &d@ if a5 > a2 &dK &d@ a2 = a5 &dK &d@ end &dK &d@ end &dK &d@ a11 = 1 &dK &d@ end &dK*&d@ a10 = backpointer to prior space for note/rest object set &dK &d@ if ts(a1,SPACING) > 0 &dK &d@ a10 = a1 &dK &d@ end &dK &d@ firstoff = 0 &dK &d@ if a1 = sct &dK &d@ a4 = a2 &dK &d@ if a4 > a3 &dK &d@ firstoff = a4 - a3 &dK &d@ end &dK &d@ else &dK &d@ if nodtype < 11 &dK &d@ a3 += ts(a1,SPACING) &dK &d@ end &dK &d@ end &dK &d@ repeat &dK &dA &d@***************************************************************** &dA &d@ Debugging Information &dA if jtype = "y" &dK &d@ if bit(2,pmode) = 1 and g >= debug_point &dA &dA &d@ Condition changed &dA01/01/06&d@ &dA if (bit(2,pmode) = 1 or debug_flag = 1) and g >= debug_point putc Set Array at Point No. 2: including text, ... putc measure ~g putc firstspace = ~tfirstsp putc perform display_ts end end &dA &dA &d@ If there is more that one pass in this measure, one of the &dA &d@ things we need to know is the number of passes per staff. &dA &d@ If this number is greater than one for a particular staff, &dA &d@ then we are going to need to know (1) whether ties have tips &dA &d@ up or down for each pass, and (2) whether slurs should connect &dA &d@ to note heads or to stems. &dA &dA &d@ I propose the following rule: If there is more than one track &dA &d@ on a particular staff and if stem directions are consistant &dA &d@ for each track on that particular staff, then &dA &dA &d@ (1) tie tips will always go the opposite direction of the &dA &d@ stem direction &dA &d@ (2) slurs should connect to stems rather than to note heads &dA &dA &d@ Before beginning the processing loop, I need to determine the &dA &d@ situation, since it is dependent on what happens in the entire &dA &d@ measure. I propose (6-4-93) to add a new element to the ts(.) &dA &d@ array, in this case, element 29 = MULTI_TRACK flag. The meaning &dA &d@ of this flag will be as follows: &dA &dA &d@ 0 = this note lies on a staff that has notes from only one &dA &d@ pass. &dA &dA &d@ In this situation, mcat can be 0, 1 or 2 &dA &dA &d@ (1) mcat = 0 or mcat = 1. Any tie or slur &dA &d@ starting or ending on this note will follow the &dA &d@ rules for a single part on a staff. &dA &dA &d@ (2) mcat = 2 There is only one pass, but notes &dA &d@ will occur in chords. In this case, slurs and &dA &d@ articulations will mainly fall on the note head at &dA &d@ the end of the stem. In the case where both stem &dA &d@ directions are involved, slurs are generally put &dA &d@ above the notes (tips down) &dA &dA &dA &d@ 1 = this note belongs to one of multiple passes on this &dA &d@ staff and all notes on this pass have stems which &dA &d@ point up. &dA &dA &d@ In this situation, mcat can be either 0 or 3, depending &dA &d@ on the value of vflag. Whatever the case, slurs &dA &d@ will go above the notes (tips down). &dA &dA &dA &d@ 2 = this note belongs to one of multiple passes on this &dA &d@ staff and all notes on this pass have stems which &dA &d@ point down. &dA &dA &d@ In this situation, mcat can be either 0 or 3, depending &dA &d@ on the value of vflag. Whatever the case, slurs &dA &d@ will go below the notes (tips up). &dA &dA &d@ 3 = this note belongs to one of multiple passes on this &dA &d@ staff and the stem directions for the note of at least &dA &d@ one of these passes on this staff are inconsistant &dA &d@ (both up and down). &dA &dA &d@ In this situation, mcat can be either 0 or 3, depending &dA &d@ on the value of vflag. In either case, the placement of &dA &d@ slurs cannot be inferred from this parameter. The note &dA &d@ in question might belong to a track that is "well behaved", &dA &d@ i.e., not the "rogue track". In this case, determining &dA &d@ the type and placement of the slur will be straight- &dA &d@ forward. In the case where mcat = 0 (i.e. vflag = 1), &dA &d@ it is likely that the rules for a single part may work &dA &d@ fairly well. In the case where mcat = 3 (i.e. vflag > 1), &dA &d@ a number of difficult situations can arrise, such as a &dA &d@ slur from a stem-up chord note (pass one) to a stem down &dA &d@ note (pass two). Such situation will have to be handled &dA &d@ in a way that seems best under the particular circumstances. &dA &dA &dA &d@ The MULTI_TRACK parameter will actually be combination of the &dA &d@ multi-track flag and the value of mcat, according to the &dA &d@ formula below: &dA &dA &d@ ts(.,MULTI_TRACK) = multi-track << 2 + mcat &dA loop for a2 = 1 to 3 loop for a3 = 1 to passnum /* assume passnum = total # of passes loop for a4 = 1 to MAX_STAFF multichk(a2,a3,a4) = 0 repeat repeat repeat loop for a1 = oldsct+1 to sct nodtype = ts(a1,TYPE) if nodtype <= NOTE_OR_REST a2 = nodtype + 2 / 3 a3 = ts(a1,PASSNUM) a4 = ts(a1,STAFF_NUM) + 1 /* staff number a6 = multichk(a2,a3,a4) if rem <> 2 a5 = bit(1,ts(a1,STEM_FLAGS)) + 1 if a6 = 0 or a6 = 4 multichk(a2,a3,a4) = a5 else if a6 <> a5 multichk(a2,a3,a4) = 3 end end else if a6 = 0 multichk(a2,a3,a4) = 4 /* rest (stem direction unspecified) end end end repeat loop for a2 = 1 to 3 /* loop through note types i.e. reg,cue,grace loop for a4 = 1 to MAX_STAFF a5 = 0 a6 = 0 loop for a3 = 1 to passnum a7 = multichk(a2,a3,a4) if a7 = 3 /* Case: multiple stem directions a6 = 100 end if a7 > 0 ++a5 if a7 = 4 a8 = a3 + 1 / 2 /* set multichk to 1 for odd passnums, 2 for even multichk(a2,a3,a4) = rem + 1 /* for parts with only rests end end repeat if a6 = 100 and a5 > 1 /* Case: mult passes on staff and ambiguous stem dirs loop for a3 = 1 to passnum multichk(a2,a3,a4) = 3 /* all notes (for this type) on this staff have mt = 3 repeat end if a5 = 1 /* Case: single pass on this staff (for this note type) loop for a3 = 1 to passnum multichk(a2,a3,a4) = 0 /* all notes (for this type) on this staff have mt = 0 repeat end repeat repeat loop for a1 = oldsct+1 to sct nodtype = ts(a1,TYPE) if nodtype <= NOTE_OR_REST a2 = nodtype + 2 / 3 a3 = ts(a1,PASSNUM) a4 = ts(a1,STAFF_NUM) + 1 /* staff number a5 = multichk(a2,a3,a4) << 2 ts(a1,MULTI_TRACK) = a5 + mcat end repeat if oldsct = 0 firstsp = tfirstsp else &dA &dA &d@ Include tfirstsp in the spacing after previous completed bar &dA if ts(oldsct,TYPE) <> BAR_LINE if ts(oldsct,SPACING) = 0 putc There is something you didn't think about examine stop end ts(oldsct,SPACING) += tfirstsp else ts(oldsct,SPACING) += tfirstsp end end &dA &dA &d@ Compute the spn (spacing) parameter &dA loop for a1 = oldsct+1 to sct if ts(a1,TYPE) = DIV_CHG and qflag = 1 qflag = 2 end if qflag = 0 a5 = totdiv - 1 a4 = ts(a1,DIV) - 1 if a5 = a4 spn = 6913 else spn = 6912 / a5 * a4 + 1 end else if qflag = 1 a5 = mdiv - 1 a4 = ts(a1,DIV) - 1 if a5 = a4 spn = 3457 else spn = 3456 / a5 * a4 + 1 end else a5 = totdiv - mdiv a4 = ts(a1,DIV) - mdiv if a5 = a4 spn = 6913 else spn = 3456 / a5 * a4 + 3457 end end end ts(a1,SPN_NUM) = spn repeat &dA &dA &d@ We have a choice at this point whether to do extra calculations on &dA &d@ the placement of notes, note-dots, and note-accidentals, or to wait &dA &d@ to do this until the point when we process the entire array. I think &dA &d@ now is a good time to do this, because (1) I prefer to do work I think &dA &d@ I know how to do earlier rather than later (you never know just what &dA &d@ kinds of tasks you may have to do later, so why not get this one out &dA &d@ of the way), and (2) the information gained in the this process might &dA &d@ help us in the placement of slurs (which we will need to do first &dA &d@ thing when we begin processing the entire array). &dA &dA &d@ Basically we are going to try to compute the following information for &dA &d@ each "musical node". The definition of a "musical node" is the set of &dA &d@ one or more objects (chords + dots + accidentals) occuring on the same &dA &d@ division number and &dAwhich would, if possible, be placed in the same&d@ &dA &d@ &dAx-position on the staff&d@. &dA &dA &d@ (1) the global x-offset. This is the amount by which each &dAobject&d@ &dA &d@ is displaced from the 0 x-position of all objects on this &dA &d@ musical node. I believe the global x-offset is always >= 0. &dA &d@ &dA &d@ (2) the local x-offset for note heads. This is the amount by which &dA &d@ each note head of a particular object is displaced from the &dA &d@ x position of the object. &dA &dA &d@ (3) the location of rests on the staff (based on the position of &dA &d@ other objects at this location). &dA &dA &d@ (4) the x and y offsets for any dot(s) which might follow each &dA &d@ note head of a particular object. &dA Note: the y-position of &dA &d@ &dAan object which has more than one note head (chord) is &dA &d@ &dAthe y position of the note head furthest from the note-end &dA &d@ &dAof the stem (i.e., therefore nearest to the beam end of &dA &d@ &dAthe stem, if there is a beam). &dA &dA &d@ (5) the x offset (as measured to the left) of any accidental(s) &dA &d@ which might precede each note head. &dA &dA &dA &d@ I. How to store this information. &dA &dA &d@ (0) The grouping of elements in the ts(.,.) array into "musical &dA &d@ nodes" can be determined by the space parameter "&dLSPACING&d@". &dA &d@ The first array element of a "musical node" will have a &dA &d@ non-zero space parameter, and any other element in the node &dA &d@ will have a space parameter = 0. &dA &dA &d@ (1) The global x-offset can be stored in the GLOBAL_XOFF element &dA &d@ of the ts(.,.) array. If we further specify that the GLOBAL_XOFF &dA &d@ element will be set to INT10000 * a1 (index of first note in the &dA &d@ chord) + a2 (index of last note in chord), this will give us an &dA &d@ easy way to determine the number of array elements (note heads) &dA &d@ in the object (chord). &dA &dA &d@ (2) The local x-offset for note heads can be stored in the &dA &d@ LOCAL_XOFF element of the ts(.,.) array. &dA &dA &d@ (3) The location of rests on the staff can be stored in the &dA &d@ STAFFLOC element of the ts(.,.) array. &dA &dA &d@ (4) For the x and y offsets for any dots(s), we can use the DOT (modified &dA12-24-96&d@) &dA &d@ element of the ts(.,.) array. Up to this point, the DOT element &dA &d@ could have five values: 0 = no dot; 1 = single dot; 3 = double dot; &dA &d@ 7 = triple dot; 15 = quadruple dot. We need to preserve this &dA &d@ information, which uses bits 0 through 3 of the integer. Since &dA &d@ the x offset is always positive, and the y offset may be positive &dA &d@ or negative, we can construct a number which is x * INT10000 + y, &dA &d@ shift it over 4 and &dAOR&d@ it with the current value of DOT. &dA &dA &d@ (5) For the x offset of any accidental(s), we can use the AX &dA &d@ element of the ts(.,.) array. Up to this point, the AX element &dA &d@ could have sixteen values: 0 to 15. There is also the "silent" &dA &d@ flag in bit 4 (value 16) which we need to preserve. Altogether (added &dA02/25/97&d@) &dA &d@ we need to preserve bits 0 through 4 of the integer. Since &dA &d@ the x offset (measured to the left) is always positive, we can &dA &d@ simply shift this offset over 8 and &dAOR&d@ with the current value &dA &d@ of AX. &dA &dA &d@ II. Method of computation. &dA &dA &d@ The first task will be to compute the global and local x-offset &dA &d@ for the note heads in each musical node. We have a way of doing &dA &d@ this, which we call pseudo-typesetting. A concurrent task will &dA &d@ be to compute the y location of rests in each musical node. &dA &dA &d@ The second task will be to compute the x and y offsets for any &dA &d@ dots(s). The method will be as follows (for each staff): &dA &dA &d@ (1) If there is only one note head on the staff, use the &dA &d@ single note method for determining dot position. &dA &dA &d@ Otherwise, determine the x position for a "row of dots". &dA &d@ This position will be to the right of the right-most &dA &d@ note head on the stave. (Note that the x-offset for &dA &d@ each dot is the x position minus the global x-offset &dA &d@ for each object). &dA &dA &d@ (2) Starting with the left-most objects in the "musical node" &dA &d@ and moving to the right, set dot positions according to &dA &d@ the following algorithm (keeping track of all previous &dA &d@ dots for this stave): &dA &dA &d@ Start with the note head furtherest from note-end of stem &dA &d@ If note on line, &dA &d@ if space above is free, put dot there &dA &d@ else put dot in first free space below &dA &d@ else &dA &d@ if space is free, put dot there &dA &d@ else put dot in first free space in reverse direction &dA &d@ end &dA &dA &d@ The third task will be to compute the x offsets for any &dA &d@ accidental(s) for each note head. The method will be as &dA &d@ follows (for each staff): &dA &dA &d@ (1) Check the left-hand border from the typesetting operation. &dA &d@ If there are any accidentals that could be set on right- &dA &d@ shifted note heads, set these first, starting from the &dA &d@ top down. This defines column 1 of the accidentals. &dA &dA &d@ Otherwise, column one is the first free location to the &dA &d@ left of the left-most note head. &dA &dA &d@ (2) For all remaining accidentals to set, start at the top &dA &d@ of the group. Make successive passes until all accidentals &dA &d@ are set. &dA &dA &d@ (a) moving down, put in as many accidentals as possible &dA &d@ where the distance between eligible notes (delta) >= &dA &d@ vpar(6), with the caviat that you do not put an &dA &d@ accidental on the lower half of a second before the &dA &d@ upper half of a second (as you move down). &dA &dA &d@ (b) move to the left by the largest thickness of accidentals &dA &d@ just placed. Decide on the direction to move for the &dA &d@ next pass and goto (a). The new direction will be &dA &d@ down (again) if the previous pass hit the lowest remaining &dA &d@ accidental; otherwise, the new direction will be up. &dA &dA &dA &d@ Good Luck with all of this! If you get it right, you will have &dA &d@ accomplished a good deal of the task of setting simultaneous &dA &d@ notes! &dA &dA &d@ &dA3-23-94&d@: &dA &dA &d@ I am going to add another element to this process. It turns out that &dA &d@ this is the best time to determine whatever extra space is required &dA &d@ for each object, based on the items previously typeset. (We had been &dA &d@ doing this later, but without the detailed information available in this &dA &d@ part of the process, i.e. global-right boundaries, etc.). &dA &dA &d@ We start with the fact that the process below begins either after the &dA &d@ initial setting of the clef, key and time, or after a controlling bar &dA &d@ line. In either case, we know the profile of "emptyspace" relative &dA &d@ to the position we are about to put something. &dA &dA &d@ After processing each object, we need to be sure two things are done. &dA &dA &d@ (1) If there will be a need to shift the position of a node, the &dA &d@ value of this shift (positive or negative) needs to be stored in the &dA &d@ array element: NODE_SHIFT. &dA &dA &d@ (2) The values of emptyspace need to be updated. &dA olda1 = 0 loop for a1 = oldsct+1 to sct nodtype = ts(a1,TYPE) if nodtype > NOTE_OR_REST &dA &dA &d@ A. Figure out space for Bar Line &dA if nodtype = BAR_LINE a5 = 1000000 loop for a3 = 1 to MAX_STAFF loop for a4 = 1 to 45 if emptyspace(a3,a4) < a5 a5 = emptyspace(a3,a4) end repeat repeat a6 = mindist - hpar(82) - a5 &dA &d@ Task (1) if a6 > 0 ts(a1,NODE_SHIFT) = a6 end &dA &d@ Task (2) a5 = ts(a1,SPACING) - hpar(93) loop for a4 = 1 to MAX_STAFF loop for a3 = 1 to 45 emptyspace(a4,a3) = a5 repeat repeat goto WWWW end &dA &dA &d@ B. Figure out space for Clef change &dA if nodtype = CLEF_CHG a3 = ts(a1,STAFF_NUM) + 1 /* staff number &dA &dA &d@ Check to see if we can "backup" the node position &dA a5 = 1000000 loop for a4 = 1 to 45 if emptyspace(a3,a4) < a5 a5 = emptyspace(a3,a4) /* minimum emptyspace on this staff end repeat &dA &d@ Task (1) if a5 > ts(a1,SPACING) >> 1 a4 = a5 * 2 / 3 a7 = ts(a1,SPACING) c2 = 0 loop for c1 = a1+1 to sct /* check if following note has accidentals if ts(c1,DIV) <> ts(a1,DIV) goto HJKO end a6 = ts(c1,TYPE) if a6 > FIGURES goto HJKO end if a6 <> REST and a6 <> CUE_REST and a6 <> FIGURES if ts(c1,STAFF_NUM) = ts(a1,STAFF_NUM) a6 = ts(c1,AX) & 0x1f &dK &d@ if a6 > 0 and hpar(a6) > c2 if a6 < 0x10 and a6 > 0 and hpar(a6) > c2 /* Code modified &dA02/25/97 c2 = hpar(a6) end end end repeat HJKO: a7 += c2 if a4 > a7 a4 = a7 end ts(a1,NODE_SHIFT) = 0 - a4 /* negative shift else a6 = mindist - hpar(82) - a5 if a6 > 0 ts(a1,NODE_SHIFT) = a6 end end &dA &d@ Task (2) a5 = ts(a1,SPACING) - a4 /* amount by position really advanced a7 = hpar(86) if z > 128 a7 = a7 * 7 / 10 /* use to be 8 / 10 end a7 = ts(a1,SPACING) - a7 /* empty space after clef sign loop for a4 = 1 to MAX_STAFF if a4 = a3 loop for a6 = 1 to 45 emptyspace(a4,a6) = a7 repeat else loop for a6 = 1 to 45 emptyspace(a4,a6) += a5 repeat end repeat goto WWWW end &dA &dA &d@ C. Figure out space for Time change &dA if nodtype = METER_CHG a5 = 1000000 loop for a3 = 1 to MAX_STAFF loop for a4 = 1 to 45 if emptyspace(a3,a4) < a5 a5 = emptyspace(a3,a4) end repeat repeat a6 = hpar(12) - a5 &dA &d@ Task (1) if a6 > 0 ts(a1,NODE_SHIFT) = a6 end &dA &d@ Task (2) loop for a4 = 1 to MAX_STAFF loop for a3 = 1 to 45 emptyspace(a4,a3) = min_space /* replaces hpar(29) &dA11/19/07 repeat repeat goto WWWW end &dA &dA &d@ D. Figure out space for Key change &dA if nodtype = AX_CHG a5 = 1000000 loop for a3 = 1 to MAX_STAFF loop for a4 = 1 to 45 if emptyspace(a3,a4) < a5 a5 = emptyspace(a3,a4) end repeat repeat a6 = hpar(37) - hpar(93) - a5 &dA &d@ Task (1) if a6 > 0 ts(a1,NODE_SHIFT) = a6 end &dA &d@ Task (2) loop for a4 = 1 to MAX_STAFF loop for a3 = 1 to 45 emptyspace(a4,a3) = hpar(12) repeat repeat goto WWWW end &dA &dA &d@ E. Figure out space for Signs, Words and Marks which are Objects &dA &d@ if nodtype = SIGN or nodtype = WORDS or nodtype = MARK ts(a1,NODE_SHIFT) = 0 goto WWWW end &dA &dA &d@ F. Figure out space for Figures &dA &d@ if nodtype = FIGURES c3 = FIG_DATA c11 = 0 c14 = 0 /* Flag for preceding accidentals on figures loop for c2 = 1 to ts(a1,NUMBER_OF_FIG) c12 = 0 &dA &dA &d@ Code added &dA11/16/03&d@ to deal with parentheses around figures &dA c6 = ts(a1,c3) c13 = 0 /* Flag for parentheses around figures if c6 > 1000 c6 -= 1000 if c6 > 1000 /* large parentheses c6 = c6 / 1000 c6 = rem c13 = hpar(138) + hpar(139) else /* small parentheses c13 = hpar(136) + hpar(137) end end &dA &dA &dA &d@ And this code rewritten &dA11/16/03&d@ &dA if c6 > 0 temp = chr(c6+28) if "1389" con temp /* case: accidental x,#,f,n c4 = ts(a1,c3+1) if c4 > 0 /* sub-case: accidental followed by figure c14 = hpar(c4+47) /* result: set flag for preceding accidental if c4 < 20 /* figure if c4 < 10 c12 = hpar(66) else c12 = hpar(66) << 1 end else c12 = hpar(c4+67) end else c12 = hpar(c6+47) /* 20 <= c6 <= 30 --> hpar(67) to hpar(77) end else if c6 < 20 /* case: figure if c6 < 10 c12 = hpar(66) else c12 = hpar(66) << 1 end c4 = ts(a1,c3+1) if c4 > 0 /* accidental following number temp = chr(c4+28) if "01389" con temp c12 += hpar(c4+47) end end else /* cases: isolated +,2+,4+,5+,6\,7\,- c12 += hpar(c6+47) end end end &dA c12 += c13 /* Adding space for parentheses &dA11/16/03 if c12 > c11 c11 = c12 end c3 += 3 repeat c11 += c14 /* Adding space for pre-accidentals &dA11/16/03 c11 += hpar(75) /* free space = width of natural if ts(a1,MIN_FIG_SPAC) < c11 ts(a1,MIN_FIG_SPAC) = c11 end if ts(a1,FIG_SPACE) > 0 and ts(a1,FIG_SPACE) < c11 ts(a1,FIG_SPACE) = c11 end a4 = ts(a1,FIG_SPACE) ts(a1,NODE_SHIFT) = 0 if a4 > 0 loop for a3 = 1 to MAX_STAFF loop for a2 = 1 to 45 emptyspace(a3,a2) += a4 repeat repeat end goto WWWW end goto WWWW end &dA &dA &d@ &dA PROCESSING NOTES AND RESTS NOW &dA npasses = 1 a3 = 1 if a1 = sct /* added &dA01-31-97&d@ a2 = a1 pitchcnt(1) = 1 goto X1 end loop for a2 = a1+1 to sct if ts(a2,SPACING) <> 0 --a2 pitchcnt(npasses) = a3 goto X1 end if ts(a2,TYPE) > NOTE_OR_REST --a2 pitchcnt(npasses) = a3 goto X1 end if nodtype = GR_NOTE if ts(a2,TYPE) = XGR_NOTE ++a3 else pitchcnt(npasses) = a3 a3 = 1 ++npasses end else if ts(a2,TYPE) = XNOTE or ts(a2,TYPE) = XCUE_NOTE ++a3 else pitchcnt(npasses) = a3 a3 = 1 ++npasses end end repeat X1: &dA &dA &d@ a2 = index to last element in node &dA &d@ npasses = number of passes &dA &d@ pitchcnt(.) = size of chord for each pass &dA &dA &d@ if a1 = a2 /* Simple (and most common) case: single element, a2 = a1 &dA if ts(a1,MULTI_TRACK) < 4 and a1 = a2 a3 = ts(a1,STAFF_NUM) + 1 /* staff number c1 = a1 passnum = ts(c1,PASSNUM) &dK &d@ ntype = ts(c1,NTYPE) ntype = ts(c1,NTYPE) & 0xff /* new &dA10/15/07&d@ stem = bit(1,ts(c1,STEM_FLAGS)) if nodtype <= REST passtype = REG passsize = FULLSIZE if bit(16,ts(c1,SUBFLAG_1)) = 1 passsize = CUESIZE /* EXPERIMENT &dA06-24-94&d@ end else passsize = CUESIZE if nodtype <= CUE_REST passtype = CUE else passtype = GRACE end end &dA &dA &d@ a) rests &dA if nodtype = REST or nodtype = CUE_REST if scr_flag = 1 if ts(c1,CLAVE) = 200 /* "silent" rest ts(c1,STAFFLOC) = 0 ts(c1,OBY) = 0 ts(c1,DOT) = 0 ts(a1,NODE_SHIFT) = 0 goto MMMMM end end if nodtype = REST c8 = vpar(4) else c8 = vpar(2) end if ts(c1,STAFFLOC) = 1 c8 = vpar(4) end ts(c1,STAFFLOC) = c8 ts(c1,OBY) = c8 if ts(c1,DOT) > 0 c4 = 0 /* additions to "eighth rest" c2 = 0 /* y shift down for starting rests c6 = 0 /* extra height of dot (negative shift) if ntype <= SIXTEENTH c6 = notesize c4 = EIGHTH - ntype c2 = notesize if ntype < THIRTY_SECOND c2 = THIRTY_SECOND - ntype * notesize + c2 end end if ntype > QUARTER c3 = hpar(30) else c3 = c4 * hpar(54) + hpar(31) c6 *= c4 end if passsize = CUESIZE c3 = c3 * 8 / 10 end c7 = c3 &dA &dA &d@ Minor code modification &dA04/19/08&d@ &dA if ntype <= SIXTEENTH c3 -= hpar(54) end &dA c6 += vpar(1) /* shift to space OK 4-21-95 /* c3 is the x shift to the dot(s) c2 -= c6 /* final y offset c9 = c2 /* x * INT10000 + y, shift it over 4 and &dAOR&d@ it with DOT (code modified &dA12-24-96&d@) c3 *= INT10000 c3 += c2 c3 <<= 4 /* (code modified &dA12-24-96&d@) ts(c1,DOT) |= c3 else c7 = 0 c9 = 0 end &dA &d@ Task (1) a5 = 1000000 loop for a4 = 1 to 45 if emptyspace(a3,a4) < a5 a5 = emptyspace(a3,a4) /* minimum emptyspace on this staff end repeat a6 = mindist - hpar(82) - a5 if a6 > 0 ts(a1,NODE_SHIFT) = a6 end &dA &d@ Task (2) loop for a6 = 1 to 45 gr(a3,a6) = -200 repeat if ts(c1,CLAVE) < 200 or scr_flag = 0 perform rest_occupy_space (c8,a3) /* ntype is read directly end if ts(c1,DOT) > 0 c8 += c9 if c8 >= 0 c8 = 2 * c8 + 1 / vpar(2) else c8 = 2 * c8 - 1 / vpar(2) end c8 = 23 - c8 c7 += hpar(80) if ts(c1,DOT) & 0x0e > 0 /* code modified &dA12-24-96 if ts(c1,DOT) & 0x02 > 0 c7 += hpar(91) /* extra shift to second dot end if ts(c1,DOT) & 0x04 > 0 c7 += hpar(91) /* extra shift to third dot end if ts(c1,DOT) & 0x08 > 0 c7 += hpar(91) /* extra shift to fourth dot end end loop for a6 = c8 - 1 to c8 + 1 gr(a3,a6) += c7 repeat end c10 = ts(c1,SPACING) loop for c11 = 1 to MAX_STAFF if c11 = a3 loop for c6 = 1 to 45 if gr(c11,c6) = -200 emptyspace(c11,c6) += c10 else emptyspace(c11,c6) = c10 - gr(c11,c6) end repeat else loop for c6 = 1 to 45 emptyspace(c11,c6) += c10 repeat end repeat else &dA &dA &d@ b) notes &dA repeater_case = 0 ts(c1,LOCAL_XOFF) = 0 ts(c1,GLOBAL_XOFF) = 0 &dA &dA &d@ Technically, this code must also appear here, although it is highly unlikely &dA &d@ that anyone would want to shift a single note on a stave from its primary position. &dA &dA &d@ All New code &dA05/02/03&d@ &dA &dA &d@ At this point, we need to see if the note object position has been modified &dA &d@ "absolutely" by a print suggestion. If this is the case, we need to make the &dA &d@ adjustment here, AND, elimate the suggestion from the tsr string. &dA c6 = ts(c1,TSR_POINT) c7 = ors(tsr(c6){2}) if bit(0,c7) = 1 px = ors(tsr(c6){3}) if px > 0 px = px - 128 * notesize / 10 pxx = c7 & 0x02 >> 1 if pxx = 1 ts(c1,GLOBAL_XOFF) = px tsr(c6){3} = chr(0) /* here is where suggestion is zerod out end end end &dA &dA &d@ End of new code &dA05/02/03&d@ &dA &dK &d@ c6 = ts(c1,STAFFLOC) / vpar(1) c6 = ts(c1,STAFFLOC) + vpar20 * 2 + 1 / vpar(2) - 20 if ts(c1,DOT) > 0 if ntype > HALF c3 = hpar(32) else c3 = hpar(33) end c10 = ts(c1,STAFFLOC) / notesize c10 = rem /* c10 = 0 means note on line if stem = UP if ts(c1,BEAM_FLAG) = NO_BEAM and ts(c1,NTYPE) < QUARTER c3 += hpar(27) if c10 <> 0 c3 -= hpar(34) end end end c8 = c3 * if dot is on staff line, c10 = 0 if c10 = 0 c2 = 0 - vpar(12) /* lower dot if more than one track and stem is down if bit(3,ts(c1,MULTI_TRACK)) = 1 if stem = DOWN c2 = vpar(12) end end c3 -= hpar(34) else c2 = 0 end if ntype > HALF c8 -= hpar(32) else c8 -= hpar(33) end if c8 < 3 c8 = 0 end if passsize = CUESIZE c3 = c3 * 8 / 10 c8 = c8 * 8 / 10 end /* c3 = x shift /* c2 = y offset c7 = ts(c1,DOT) & 0x0f c7 = int("1.2...3.......4"{c7}) /* convert to SCORE code c7 *= 10 if c2 > 0 c7 += 100 end c8 = c8 * 30 / scr_qwidth /* 100ths part of P9 if c8 > 99 c8 = 99 end c7 = c7 << 8 + c8 ts(c1,AUG_DOTS) = c7 /* x * INT10000 + y, shift it over 2 and &dAOR&d@ it with DOT (code modified &dA12-24-96&d@) c7 = c3 c8 = c2 c3 *= INT10000 c3 += c2 c3 <<= 4 /* code modified &dA12-24-96 ts(c1,DOT) |= c3 end &dK &dK &d@ Delete this code from this location. Add this task below &dK &d@ where limits for accidentals are established &dK &dK &d@ if ts(c1,AX) > 0 &dK &d@ c5 = ts(c1,AX) & 0x0f &dK &d@ c7 = hpar(c5) &dK &d@ /* shift this offset over 4 and &dAOR&d@ with AX &dK &d@ c7 <<= 4 &dK &d@ ts(c1,AX) |= c7 &dK &d@ end &dK &dA &d@ Task (1) loop for c10 = 1 to 45 gl(a3,c10) = 200 pseudo_gl(a3,c10) = 200 gr(a3,c10) = -200 repeat c6 = 23 - c6 if c6 > 45 or c6 < 1 putc putc &dEFAULT CONDITION&d@ putc putc Note out of staff range. Please check clef. putc putc &dAProgram Halted&d@ putc stop end /* Determine thickness of note: c11 if ntype <= HALF or ntype = SLASH8 c11 = hpar(82) else if ntype >= BREVE c11 = hpar(84) else c11 = hpar(83) end end if passsize = CUESIZE c11 = c11 * 8 / 10 end /* Put in limits of note head gl(a3,c6+1) = hpar(95) pseudo_gl(a3,c6+1) = 0 gl(a3,c6) = 0 gr(a3,c6+1) = c11 gr(a3,c6) = c11 - hpar(95) if ntype < WHOLE /* Determine length of stem: c10 if ntype > EIGHTH c10 = 8 /* length of stem else c10 = 7 if ntype < EIGHTH c10 += EIGHTH - ntype end end if passsize = CUESIZE c10 = c10 * 8 / 10 end if ts(c1,BEAM_FLAG) = NO_BEAM and ts(c1,BEAM_CODE) > 0 repeater_case = 1 c13 = ts(c1,BEAM_CODE) / 10 loop while c13 > 0 c13 /= 10 c10 += 2 repeat end /* Determine thickness of stem: c12 if ts(c1,BEAM_FLAG) = NO_BEAM and ntype < QUARTER c12 = hpar(26) if passsize = CUESIZE c12 = c12 * 8 / 10 end else if stem = UP c12 = 0 else c12 = hpar(90) end end /* Put in limits of gl(.,.) and gr(.,.) for stem &dA &dA &d@ &dA06/04/08&d@ Fixing case where there are no-beam repeaters &dA if stem = UP c13 = c6 + c10 if c13 > 45 c13 = 45 end gr(a3,c6+1) = c11 + c12 loop for c14 = c6 + 2 to c6 + 3 /* No repeaters near note head gr(a3,c14) = c11 + c12 gl(a3,c14) = c11 - hpar(90) repeat if repeater_case = 1 c15 = hpar(98) + hpar(90) if ntype >= QUARTER c12 += hpar(98) end else c15 = hpar(90) end loop for c14 = c6 + 4 to c13 /* &dA06/04/08&d@ changing c6 + 2 to c6 + 4 gr(a3,c14) = c11 + c12 gl(a3,c14) = c11 - c15 repeat else c13 = c6 - c10 if c13 < 1 c13 = 1 end loop for c14 = c6 - 2 to c6 - 1 /* No repeaters near note head gr(a3,c14) = c12 gl(a3,c14) = 0 repeat if repeater_case = 1 c11 = hpar(98) else c11 = 0 end loop for c14 = c13 to c6 - 3 /* &dA06/04/08&d@ changing c6 - 1 to c6 - 3 gr(a3,c14) = c12 gl(a3,c14) = 0 - c11 repeat end end &dA &dA &d@ Put in limits of for accidentals &dA &d@ and store location of accidental &dA if ts(c1,AX) > 0 c5 = ts(c1,AX) & 0x0f c7 = passsize perform place_accidental (a3,c6,c5,c7) /* returns c7 = negative offset &dA &dA &d@ Note: place_accidental operates over the entire simultaneity, and therefore &dA &d@ returns an absolute (negative, left <--) shift relative to the &dA &d@ undisplaced musical node. This is exactly the information that &dA &d@ SCORE wants in parameter P5, fractional part. Note that SCORE assigns &dA &d@ the fractional value .00 to the normal position of the accidental, &dA &d@ which in the MUSEDATA I-file is shifted. &dA &dA &d@ One extra twist: SCORE provides no direct way a representing &dA &d@ natural-sharp, and natural-flat in a notehead. We will have to set &dA &d@ the P5 parameter as if the natural were not there and indicate the &dA &d@ relative position where a natural will have to be set using a &dA &d@ CODE-9 item. &dA &dA &d@ Since the code that determines P5 and the CODE-9 item must execute &dA &d@ every time place_accidental runs, I am going to try to put this &dA &d@ code inside the place_accidental procedure. There will be a need &dA &d@ to return data in a second parameter. I propose using the third &dA &d@ parameter in the list. &dA &d@ ts(c1,AX_DISP) = c5 /* capture this parameter, returned from place_accidental /* shift the offset over 8 and &dAOR&d@ with AX c7 = 0 - c7 /* we store positive value c7 <<= 8 /* &dA02/25/97&d@ shift changed from 4 to 8 ts(c1,AX) |= c7 end &dA &dA &d@ Adjust the gr(.,.) array to accommodate space for dots &dA &d@ (added &dA04/04/94&d@) &dA c8 = ts(a1,STAFF_NUM) + 1 /* staff number c3 = ts(a1,DOT) if c3 > 0 /* code modified &dA12-24-96 c4 = c3 & 0x0f /* dot flag /* &dA12-24-96&d@ c3 >>= 4 /* &dA12-24-96&d@ c5 = c3 / INT10000 /* x offset c6 = rem /* y offset if c6 > INT10000 >> 1 c6 -= INT10000 ++c5 end &dK &d@ c6 = c6 + vpar(8) - 1 / vpar(1) - 7 c6 = c6 + vpar(8) * 2 - 1 / vpar(2) - 7 &dK &d@ c6 = 0 - ts(a1,STAFFLOC) / vpar(1) + 23 - c6 c10 = ts(a1,STAFFLOC) + vpar20 * 2 + 1 / vpar(2) - 20 c6 = 23 - c10 - c6 c5 += hpar(80) if c4 > 1 /* modified &dA12-24-96 c5 += hpar(91) /* second dot if c4 > 4 c5 += hpar(91) /* third dot end if c4 > 8 c5 += hpar(91) /* fourth dot end end if c6 < 46 and c6 > 0 gr(c8,c6) = c5 end end /* Calculate NODE_SHIFT c10 = 0 if c1 = 1 or ts(c1-1,TYPE) < CUE_NOTE c6 = min_space /* replaces hpar(29) &dA11/19/07&d@ else c6 = min_space / 2 /* replaces hapr(29) / 2 &dA11/19/07 end loop for c11 = 1 to 45 if gl(a3,c11) > pseudo_gl(a3,c11) gl(a3,c11) = pseudo_gl(a3,c11) end c12 = c6 - gl(a3,c11) - emptyspace(a3,c11) /* should be negative if c12 > c10 /* most of the time c10 = c12 end repeat &dAbefore02/25/97&d@if ts(c1,AX) > 0 and ts(c1,SPACING) = mindist and c10 < hpar(94) if (ts(c1,AX) & 0x0f) > 0 and ts(c1,SPACING) = mindist and c10 < hpar(94) c10 = hpar(94) end if c10 > 0 ts(c1,NODE_SHIFT) = c10 end &dA &d@ Task (2) c10 = ts(c1,SPACING) loop for c11 = 1 to MAX_STAFF if c11 = a3 loop for c6 = 1 to 45 if gr(c11,c6) = -200 emptyspace(c11,c6) += c10 else emptyspace(c11,c6) = c10 - gr(c11,c6) end repeat else loop for c6 = 1 to 45 emptyspace(c11,c6) += c10 repeat end repeat end else &dA &d@ &dAÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»&d@ &dA &d@ &dAº&d@ &dAº&d@ &dA &d@ &dAº&d@ Here is where you deal with chords and with multiple passes &dAº&d@ &dA &d@ &dAº&d@ &dAº&d@ &dA &d@ &dAÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ&d@ &dA &d@ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@ ³ D I S C U S S I O N ³ &dA &d@ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ &dA &dA &d@ To start with, a major difference between the single note version &dA &d@ and this multiple note version is the placement of (1) the note heads &dA &d@ in chords and (2) the chord groups, themselves. The major problem is &dA &d@ to determine the x-offset for each note in a chord and the x-offset for &dA &d@ each chord group. Once this information is known, it will then be &dA &d@ possible to typeset the various entities in a manner somewhat similar &dA &d@ to the case of the single note version above. &dA &dA &d@ The x placement of all of the elements of a multiple note node &dA &d@ requires consideration of all of the elements; i.e., they cannot be &dA &d@ simply put down in a serial fashion. Therefore, we must do a pseudo- &dA &d@ typesetting of the elements, and from this extract the x-offsets we &dA &d@ need to do the real job. I note that set array elements 13 and 19 &dA &d@ are free at this point, so we can use them to store local x-offset and &dA &d@ global x-offset, respectively (&dDLOCAL_XOFF&d@, &dDGLOBAL_XOFF&d@). &dA &dA &d@ Also, the vertical placement of rests must be taken into &dA &d@ consideration. There is no definite parameter in the stage2 source &dA &d@ file that tells us were to locate rests vertically. We have two &dA &d@ indirect parameters available: (1) the pass number, based on the &dA &d@ the order of encoding the material, and (2) the optional track &dA &d@ number. I would favor using the pass number at this point. Where &dA &d@ the maximum pass number is 2, rests could be located "high" and &dA &d@ "low" for passes 1 and 2, respectively; where the maximum pass number &dA &d@ is 3, rests could be located "high", "medium" and "low", etc. In the &dA &d@ case of the grand staff (two or more staves), these locations could &dA &d@ be refined to reflect the staff on which the rests are being put. &dA &dA &dA &d@ &dA ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» &dA &d@ &dA º &d@ &dA º &dA &d@ &dA º &d@ (A) pseudo-typeset the notes &dA º &dA &d@ &dA º &d@ &dA º &dA &d@ &dA ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ &dA &dA &d@ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@ ³ construct note data ³ &dA &d@ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ &dA &d@ &dA &d@ ndata(1) = pass number (set to 0, after chord is typeset) &dA &d@ ndata(2) = stem flag: &dA &d@ bit 0: direction 0 = up, 1 = down &dA &d@ bit 1: repeater 0 = none, 1 = present &dA &d@ bits 2-4: flag flag 0 = no flag &dA &d@ 1 = eighth flag &dA &d@ 2 = sixteenth flag &dA &d@ 3 = 32nd flag &dA &d@ 4 = 64th flag &dA &d@ 5 = 128th flag &dA &d@ 6 = 256th flag &dA &dA &d@ ndata(3) = color 0 = black, 1 = half, 2 = whole, 3 = breve &dA &d@ ndata(4) = dot 0 = none, 1 = dot &dA &d@ ndata(5) = pitch &dA &d@ ndata(6) = position in chord (from note end of stem) &dA &d@ ndata(7) = final x-position of this pitch within chord &dA &d@ ndata(8) = pass number &dA &d@ ndata(9) = staff number &dA &d@ ndata(10) = note size (full size vs. que size) &dA &d@ ndata(11) = ntype &dA &d@ pcnt = total number of notes (and rests) &dA &d@ #define PS_PASS 1 #define PS_STEM 2 #define PS_COLOR 3 #define PS_DOT 4 #define PS_PITCH 5 #define PS_RANK 6 #define PS_XPOS 7 #define PS_PASS2 8 #define PS_STAFF 9 #define PS_NSIZE 10 #define PS_NTYPE 11 loop for i = 1 to 45 /* initialize right and left boundaries gr(1,i) = -200 gr(2,i) = -200 pseudo_gr(1,i) = -200 pseudo_gr(2,i) = -200 pseudo_gl(1,i) = 200 pseudo_gl(2,i) = 200 gl(1,i) = 200 gl(2,i) = 200 repeat pcnt = 0 &dA &d@ putc Note data array &dA &d@ putc ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ c1 = a1 ps_passcount(1) = 0 ps_passcount(2) = 0 loop for thispass = 1 to npasses c2 = ts(c1,STAFF_NUM) + 1 /* staff number ++ps_passcount(c2) c2 = 0 loop for c3 = 1 to pitchcnt(thispass) ++pcnt ndata(pcnt,PS_PASS2) = thispass ndata(pcnt,PS_PASS) = thispass ndata(pcnt,PS_STEM) = bit(1,ts(c1,STEM_FLAGS)) if c3 = 1 and ts(c1,BEAM_FLAG) = NO_BEAM if ts(c1,BEAM_CODE) > 0 ndata(pcnt,PS_STEM) += 2 end if ts(c1,NTYPE) < QUARTER c4 = QUARTER - ts(c1,NTYPE) << 2 ndata(pcnt,PS_STEM) += c4 end end if ts(c1,CLAVE) < 100 /* note if ts(c1,NTYPE) < HALF ndata(pcnt, PS_COLOR) = 0 else ndata(pcnt,PS_COLOR) = ts(c1,NTYPE) - 7 end else &dK &d@ ndata(pcnt,PS_COLOR) = ts(c1,NTYPE) ndata(pcnt,PS_COLOR) = ts(c1,NTYPE) & 0xff /* new &dA10/15/07 end &dK &d@ ndata(pcnt,PS_NTYPE) = ts(c1,NTYPE) ndata(pcnt,PS_NTYPE) = ts(c1,NTYPE) & 0xff /* new &dA10/15/07 if ts(c1,TYPE) <= REST ndata(pcnt,PS_NSIZE) = bit(16,ts(c1,SUBFLAG_1)) else ndata(pcnt,PS_NSIZE) = CUESIZE end ndata(pcnt,PS_DOT) = ts(c1,DOT) if ts(c1,CLAVE) < 100 /* note &dK &d@ ndata(pcnt,PS_PITCH) = 0 - ts(c1,STAFFLOC) / vpar(1) + 23 c10 = ts(c1,STAFFLOC) + vpar20 * 2 + 1 / vpar(2) - 20 ndata(pcnt,PS_PITCH) = 23 - c10 else ndata(pcnt,PS_PITCH) = 100 /* rest end ndata(pcnt,PS_XPOS) = 0 ndata(pcnt,PS_STAFF) = ts(c1,STAFF_NUM) ++c1 &dA &d@ compute horizontal placement of notes for down stems (on the fly) if bit(0,ndata(pcnt,PS_STEM)) = DOWN and c3 > 1 c4 = ndata(pcnt-1,PS_PITCH) - ndata(pcnt,PS_PITCH) if c4 = 1 if c2 = 0 ndata(pcnt,PS_XPOS) = -1 c2 = 1 else c2 = 0 end else c2 = 0 end end &dA &d@ rank the notes in a chord if bit(0,ndata(pcnt,PS_STEM)) = UP ndata(pcnt,PS_RANK) = pitchcnt(thispass) + 1 - c3 else ndata(pcnt,PS_RANK) = c3 end repeat &dA &d@ compute horizontal placement of notes for up stems if pcnt > 0 and bit(0,ndata(pcnt,PS_STEM)) = UP and pitchcnt(thispass) > 1 c5 = pcnt c2 = 0 loop for c3 = 2 to pitchcnt(thispass) c4 = ndata(c5-1,PS_PITCH) - ndata(c5,PS_PITCH) if c4 = 1 and c2 = 0 ndata(c5-1,PS_XPOS) = 1 c2 = 1 else c2 = 0 end --c5 repeat end c2 = pcnt - pitchcnt(thispass) + 1 &dA &d@ loop for c3 = c2 to pcnt &dA &d@ loop for c5 = 1 to 7 &dA &d@ putc .w4 ~ndata(c3,c5) ... &dA &d@ repeat &dA &d@ putc &dA &d@ repeat repeat &dA &dA &d@ determine all clashes between chords &dA loop for c2 = 1 to npasses loop for c3 = 1 to npasses clashes(c2,c3) = 0 repeat repeat loop for c2 = 1 to pcnt - 1 loop for c3 = c2+1 to pcnt c4 = ndata(c2,PS_PASS) c5 = ndata(c3,PS_PASS) if c4 <> c5 and ndata(c2,PS_STAFF) = ndata(c3,PS_STAFF) if ndata(c2,PS_XPOS) = 0 and ndata(c3,PS_XPOS) = 0 if ndata(c2,PS_PITCH) < 100 c6 = ndata(c2,PS_PITCH) - ndata(c3,PS_PITCH) if c6 = 0 /* same pitch if bit(0,ndata(c2,PS_STEM)) = bit(0,ndata(c3,PS_STEM)) clashes(c4,c5) = 1 clashes(c5,c4) = 1 goto PS_D2 end if ndata(c2,PS_COLOR) <> ndata(c3,PS_COLOR) clashes(c4,c5) = 1 clashes(c5,c4) = 1 goto PS_D2 end if ndata(c2,PS_NSIZE) <> ndata(c3,PS_NSIZE) clashes(c4,c5) = 1 clashes(c5,c4) = 1 goto PS_D2 end &dK#&d@if DOT_DIFFERENCE &dA &dA &d@ &dA12/24/05&d@ This optional code is now controlled by dot_difference_flag &dA if dot_difference_flag = 1 if ndata(c2,PS_DOT) <> ndata(c3,PS_DOT) clashes(c4,c5) = 1 clashes(c5,c4) = 1 goto PS_D2 end end &dA &dK#&d@endif if ndata(c2,PS_RANK) * ndata(c3,PS_RANK) <> 1 clashes(c4,c5) = 1 clashes(c5,c4) = 1 goto PS_D2 end &dA &d@ &dA &d@ We must now ask the question: are all notes of first chord either &dA &d@ equal/above all notes of second chord, or equal/below all notes &dA &d@ of second chord. &dA c10 = 0 loop for c9 = 1 to pcnt if ndata(c9,PS_PASS) = ndata(c2,PS_PASS) if ndata(c9,PS_PITCH) <> ndata(c2,PS_PITCH) if ndata(c9,PS_PITCH) > ndata(c2,PS_PITCH) if c10 = -1 c10 = 1000 else c10 = 1 end end if ndata(c9,PS_PITCH) < ndata(c2,PS_PITCH) if c10 = 1 c10 = 1000 else c10 = -1 end end end end repeat if c10 = 1000 clashes(c4,c5) = 1 clashes(c5,c4) = 1 goto PS_D2 end loop for c9 = 1 to pcnt if ndata(c9,PS_PASS) = ndata(c3,PS_PASS) if ndata(c9,PS_PITCH) <> ndata(c3,PS_PITCH) if ndata(c9,PS_PITCH) > ndata(c3,PS_PITCH) if c10 = 0 c10 = -1 end if c10 = 1 c10 = 1000 end end if ndata(c9,PS_PITCH) < ndata(c3,PS_PITCH) if c10 = 0 c10 = 1 end if c10 = -1 c10 = 1000 end end end end repeat if c10 = 1000 clashes(c4,c5) = 1 clashes(c5,c4) = 1 goto PS_D2 end clashes(c4,c5) = 2 clashes(c5,c4) = 2 goto PS_D2 end if c6 = 1 or c6 = -1 clashes(c4,c5) = 1 clashes(c5,c4) = 1 end end end end PS_D2: repeat repeat &dA &dA &d@ typeset all groups of chords for which there are no clashes &dA loop for c2 = 1 to npasses tgroup(c2) = 0 repeat ntgroups = 0 loop for c2 = 1 to npasses c5 = 0 loop for c3 = c2+1 to npasses if clashes(c2,c3) <> 1 and tgroup(c3) = 0 if c5 = 0 ++ntgroups c5 = 1 tgroup(c2) = ntgroups tgroup(c3) = ntgroups else loop for c4 = c2+1 to c3-1 if tgroup(c4) = ntgroups and clashes(c4,c3) = 1 c4 = 1000 end repeat if c4 <> 1000 tgroup(c3) = ntgroups end end end repeat repeat &dA &d@ loop for c3 = 1 to npasses &dA &d@ putc tgroup(~c3 ) = ~tgroup(c3) &dA &d@ repeat c10 = 0 /* initialize right-hand chord boundary loop for c3 = 1 to ntgroups /* number of typeset groups &dA &dA &d@ typeset chords &dA loop for c4 = 1 to 2 /* typeset stem down first c5 = 2 - c4 PS_CC: c6 = 0 c7 = 0 c15 = 0 loop for c2 = 1 to pcnt c9 = ndata(c2,PS_PASS) if c9 > 0 and tgroup(c9) = c3 /* this typeset group if bit(0,ndata(c2,PS_STEM)) = c5 if ndata(c2,PS_PITCH) > c6 /* typeset highest pitch first if c6 > 0 and c15 > EIGHTH /* but check first to see if if ndata(c2,PS_NTYPE) < QUARTER /* type is quarter or greater if ndata(c2,PS_PITCH) - c6 < 3 goto NOSWITCH end end end c6 = ndata(c2,PS_PITCH) c7 = ndata(c2,PS_PASS) c15 = ndata(c2,PS_NTYPE) NOSWITCH: else if c15 < QUARTER and ndata(c2,PS_NTYPE) > EIGHTH if c6 - ndata(c2,PS_PITCH) < 3 c6 = ndata(c2,PS_PITCH) c7 = ndata(c2,PS_PASS) c15 = ndata(c2,PS_NTYPE) end end end end end repeat if c7 > 0 c8 = 100 loop for c2 = 1 to npasses if clashes(c2,c7) = 2 /* unison c8 = c2 c2 = 100 end repeat perform ps_setchord (c7, c8, c10) goto PS_CC end repeat repeat &dA &dA &d@ determine if there are clashes left &dA PS_B: loop for c2 = 1 to pcnt - 1 if ndata(c2,PS_PASS) > 0 and ndata(c2,PS_XPOS) = 0 /* chord(PS_PASS) has not been set loop for c3 = c2+1 to pcnt if ndata(c3,PS_XPOS) = 0 and ndata(c3,PS_PASS) > 0 if ndata(c2,PS_STAFF) = ndata(c3,PS_STAFF) if ndata(c2,PS_PITCH) < 100 c4 = ndata(c2,PS_PITCH) - ndata(c3,PS_PITCH) if c4 = 0 if bit(0,ndata(c2,PS_STEM)) = bit(0,ndata(c3,PS_STEM)) goto PS_CL end if ndata(c2,PS_COLOR) <> ndata(c3,PS_COLOR) goto PS_CL end &dK#&d@if DOT_DIFFERENCE &dA &dA &d@ &dA12/24/05&d@ This optional code is now controlled by dot_difference_flag &dA if dot_difference_flag = 1 if ndata(c2,PS_DOT) <> ndata(c3,PS_DOT) goto PS_CL end end &dA &dK#&d@endif if ndata(c2,PS_RANK) * ndata(c3,PS_RANK) <> 1 goto PS_CL end &dA &d@ &dA &d@ We must now ask the question: are all notes of first chord either &dA &d@ equal/above all notes of second chord, or equal/below all notes &dA &d@ of second chord. &dA c10 = 0 loop for c9 = 1 to pcnt if ndata(c9,PS_PASS) = ndata(c2,PS_PASS) if ndata(c9,PS_PITCH) <> ndata(c2,PS_PITCH) if ndata(c9,PS_PITCH) > ndata(c2,PS_PITCH) if c10 = -1 c10 = 1000 else c10 = 1 end end if ndata(c9,PS_PITCH) < ndata(c2,PS_PITCH) if c10 = 1 c10 = 1000 else c10 = -1 end end end end repeat if c10 = 1000 goto PS_CL end loop for c9 = 1 to pcnt if ndata(c9,PS_PASS) = ndata(c3,PS_PASS) if ndata(c9,PS_PITCH) <> ndata(c3,PS_PITCH) if ndata(c9,PS_PITCH) > ndata(c3,PS_PITCH) if c10 = 0 c10 = -1 end if c10 = 1 c10 = 1000 end end if ndata(c9,PS_PITCH) < ndata(c3,PS_PITCH) if c10 = 0 c10 = 1 end if c10 = -1 c10 = 1000 end end end end repeat if c10 = 1000 goto PS_CL end goto PS_UNIS /* typeset unison end if c4 = 1 or c4 = -1 if ndata(c2,PS_PASS) <> ndata(c3,PS_PASS) goto PS_CL end end end end end repeat end repeat &dA &dA &d@ no clashes found &dA &dA &d@ putc No clashes &dA &dA &d@ typeset chords &dA loop for c4 = 1 to 2 /* typeset stem down first c5 = 2 - c4 PS_C: c6 = 0 c7 = 0 loop for c2 = 1 to pcnt if ndata(c2,PS_PASS) > 0 and bit(0,ndata(c2,PS_STEM)) = c5 if ndata(c2,PS_PITCH) > c6 /* typeset highest pitch first c6 = ndata(c2,PS_PITCH) c7 = ndata(c2,PS_PASS) end end repeat if c7 > 0 c8 = 100 perform ps_setchord (c7, c8, c10) goto PS_C end repeat &dA &dA &d@ Note: When you have reached this point in the code, you have determined &dA &d@ the local position of all notes (but not rests) in the simultaneity. The &dA &d@ arrays gr(.,.) and gl(,.,) have been computed (if there were notes in &dA &d@ the simultaneity). You can now use this information to try to place &dA &d@ any rests vertically as best you can. After this, you need to compute &dA &d@ the NODE_SHIFT parameter (from emptyspace(.,.) and gl(,.,) and then &dA &d@ the new values for emptyspace(.,.) &dA &dA &dA &d@ putc typeset music on page &dA &d@ loop for c2 = 1 to npasses &dA &d@ putc position of chord ~c2 is ~printpos(c2) &dA &d@ repeat &dA &dA &d@ Now store results in set array (watch out for c9 and c10 in this loop) &dA c2 = 0 c5 = 0 pitchcnt(1) = 0 pitchcnt(2) = 0 loop for c1 = a1 to a2 ++c2 c4 = ts(c1,STAFF_NUM) + 1 /* staff number thispass = ndata(c2,PS_PASS2) if thispass <> c5 c5 = thispass ++pitchcnt(c4) end if ndata(c2,PS_PITCH) = 100 /* rest ntype = ndata(c2,PS_COLOR) c6 = ntype << 1 - 1 c8 = int("1008060402020402030303"{c6,2}) c7 = int("0505050505030301000101"{c6,2}) if ps_passcount(c4) = 1 c3 = vpar(4) if ts(c1,MULTI_TRACK) >= 4 c6 = ts(c1,MULTI_TRACK) >> 2 if c6 = 1 c3 -= vpar(2) end if c6 = 2 c3 += vpar(4) end end else if ps_passcount(c4) = 2 if pitchcnt(c4) = 1 if chr(ts(c1+1,TYPE)) in [NOTE,CUE_NOTE] c3 = ts(c1+1,STAFFLOC) else &dA &dA &d@ &dA05/10/05&d@ Addition to allow a single rest (expressing parallel rests) &dA &d@ to be located at vpar(4), the middle staff line. &dA &d@ Note: this work-around may not cover all cases. &dA if ts(c1+1,TYPE) = REST and ts(c1+1,CLAVE) = 200 c3 = vpar(4) goto RTYY3 else c3 = vpar(2) &dK &d@ if ts(c1,NTYPE) < EIGHTH and c3 > 0 if (ts(c1,NTYPE) & 0xff) < EIGHTH and c3 > 0 /* new &dA10/15/07 c3 = 0 end end &dK &d@ c3 = vpar(2) &dK &d@ if ts(c1,NTYPE) < EIGHTH and c3 > 0 &dK &d@ c3 = 0 &dK &d@ end &dA end &dK &d@ c6 = 0 - c3 / vpar(1) + 23 c11 = c3 + vpar20 * 2 + 1 / vpar(2) - 20 c6 = 23 - c11 c13 = c6 loop while gr(c4,c6) <> -200 &dK &d@ c3 -= vpar(1) c3 -= vpar(1) c11 = c3 * 2 / vpar(2) c3 -= rem /* tricky code ++c6 repeat c6 -= c7 /* c7 is lower part of rest loop while gr(c4,c6) <> -200 &dK &d@ c3 -= vpar(1) c3 -= vpar(1) c11 = c3 * 2 / vpar(2) c3 -= rem /* tricky code ++c6 repeat if c6 > c13 + 8 c3 += vpar(2) end if c3 > vpar(2) c3 = vpar(2) end c6 = c3 / notesize if rem <> 0 c3 -= vpar(1) /* OK 4-21-95 end else if chr(ts(c1-1,TYPE)) in [REST,CUE_REST] if ts(c1-1,CLAVE) < 200 or scr_flag = 0 c3 = vpar(8) else c3 = vpar(4) goto RTYY3 end else c3 = ts(c1-1,STAFFLOC) + vpar(2) end &dK &d@ c6 = 0 - c3 / vpar(1) + 23 c11 = c3 + vpar20 * 2 + 1 / vpar(2) - 20 c6 = 23 - c11 c13 = c6 loop while gr(c4,c6) <> -200 &dK &d@ c3 += vpar(1) c11 = c3 * 2 / vpar(2) if rem <> 0 /* tricky code ++c3 end c3 += vpar(1) --c6 repeat c6 += c8 /* c8 is "clearance" at top of rest loop while gr(c4,c6) <> -200 &dK &d@ c3 += vpar(1) c11 = c3 * 2 / vpar(2) if rem <> 0 /* tricky code ++c3 end c3 += vpar(1) --c6 repeat if c6 < c13 - 8 c3 -= vpar(2) end if c3 < vpar(8) c3 = vpar(8) end c6 = c3 / notesize if rem <> 0 &dK &d@ c3 += vpar(1) c3 = c6 + 1 * notesize end end else if pitchcnt(c4) = 1 if chr(ts(c1+1,TYPE)) in [NOTE,CUE_NOTE] c3 = ts(c1+1,STAFFLOC) else c3 = vpar(2) end &dK &d@ if ts(c1,NTYPE) < EIGHTH and c3 > 0 if (ts(c1,NTYPE) & 0xff) < EIGHTH and c3 > 0 /* new &dA10/15/07 c3 = 0 end &dK &d@ c6 = 0 - c3 / vpar(1) + 23 c11 = c3 + vpar20 * 2 + 1 / vpar(2) - 20 c6 = 23 - c11 c13 = c6 loop while gr(c4,c6) <> -200 &dK &d@ c3 -= vpar(1) c3 -= vpar(1) c11 = c3 * 2 / vpar(2) c3 -= rem /* tricky code ++c6 repeat c6 -= c7 /* c7 is lower part of rest loop while gr(c4,c6) <> -200 &dK &d@ c3 -= vpar(1) c3 -= vpar(1) c11 = c3 * 2 / vpar(2) c3 -= rem /* tricky code ++c6 repeat if c6 > c13 + 8 c3 += vpar(2) end if c3 > vpar(2) c3 = vpar(2) end c6 = c3 / notesize if rem <> 0 c3 -= vpar(1) /* OK 4-21-95 end else if pitchcnt(c4) = ps_passcount(c4) if chr(ts(c1-1,TYPE)) in [REST,CUE_REST] if ts(c1-1,CLAVE) < 200 or scr_flag = 0 c3 = vpar(10) else c3 = vpar(4) end else c3 = ts(c1-1,STAFFLOC) + vpar(2) end &dK &d@ c6 = 0 - c3 / vpar(1) + 23 c11 = c3 + vpar20 * 2 + 1 / vpar(2) - 20 c6 = 23 - c11 c13 = c6 loop while gr(c4,c6) <> -200 &dK &d@ c3 += vpar(1) c11 = c3 * 2 / vpar(2) if rem <> 0 /* tricky code ++c3 end c3 += vpar(1) --c6 repeat c6 += c8 /* c8 is "clearance" at top of rest loop while gr(c4,c6) <> -200 &dK &d@ c3 += vpar(1) c11 = c3 * 2 / vpar(2) if rem <> 0 /* tricky code ++c3 end c3 += vpar(1) --c6 repeat if c6 < c13 - 8 c3 -= vpar(2) end if c3 < vpar(8) c3 = vpar(8) end c6 = c3 / notesize if rem <> 0 &dK &d@ c3 += vpar(1) c3 = c6 + 1 * notesize end else &dA &dA &d@ Look for empty space in middle of staff &dA loop for c3 = 45 to 1 step -1 repeat while gr(c4,c3) = -200 if c3 <= 21 /* suppose there's nothing up there c3 += 3 if c3 < 19 c3 = 19 end goto RTYY2 end loop while c3 > 0 --c3 repeat while gr(c4,c3) <> -200 RTYY: loop for c6 = 1 to 8 --c3 repeat while c3 > 0 and gr(c4,c3) = -200 if c6 = 8 or c3 <= 0 c3 += 3 else goto RTYY end RTYY2: &dK &d@ c3 = 23 - c3 * vpar(1) c3 = 43 - c3 / 2 * vpar(2) c3 += rem * vpar(1) c3 -= vpar20 end end end end RTYY3: if ts(c1,CLAVE) < 200 or scr_flag = 0 if ts(c1,STAFFLOC) = 1 c3 = vpar(4) end ts(c1,STAFFLOC) = c3 perform rest_occupy_space (c3,c4) /* ntype is read directly ts(c1,OBY) = ts(c1,STAFFLOC) end else c3 = ndata(c2,PS_COLOR) if c3 < 3 c4 = hpar(82) else if c3 = 3 c4 = hpar(83) else c4 = hpar(84) end end if ndata(c2,PS_NSIZE) = CUESIZE c4 = c4 * 8 / 10 end c4 -= 1 &dA &dA &d@ Note: LOCAL_XOFF will now be set for this notehead, and will not be changed. &dA &d@ The value is negative, zero, or positive by the approximate thickness &dA &d@ of a notehead. This information can be used in the final computation &dA &d@ of P10 for this notehead. &dA ts(c1,LOCAL_XOFF) = c4 * ndata(c2,PS_XPOS) /* uniquely set here &dA &dA &d@ &dA NOTE: Do not call procedure get_topbottom before this point in the program &dA &dA &dA &d@ Note: We are about to set GLOBAL_XOFF for all noteheads in a chord &dA &d@ to the value in printpos(thispass). The spacing of simultaneous &dA &d@ chords in this program is hopelessly complicated. Therefore &dA &d@ we cannot know directly whether a notehead has been shifted &dA &d@ exactly one thickness to the right or left, or whether the &dA &d@ shift has been built up in several parts. All we know is that &dA &d@ the shift adds up to GLOBAL_XOFF. In order to set the NOTE_DISP &dA &d@ parameter properly, we will need to compare GLOBAL_XOFF with autoscr's &dA &d@ normal shift distance = (width of black note - 2). If GLOBAL_XOFF &dA &d@ is within 2 dots either side of +/- (hpar(82) - 2), then we will &dA &d@ infer that the shift was an integral notehead thickness; otherwise &dA &d@ we must record the shift measured in dots. A shift of an &dA &d@ integral notehead thickness will be recorded as -100 or +100. &dA if chr(ts(c1,TYPE)) in [NOTE,CUE_NOTE,GR_NOTE] c9 = c1 ts(c1,GLOBAL_XOFF) = printpos(thispass) &dA &dA &d@ All New code &dA05/02/03&d@ &dA &dA &d@ At this point, we need to see if the note object position has been modified &dA &d@ "absolutely" by a print suggestion. If this is the case, we need to make the &dA &d@ adjustment here, AND, elimate the suggestion from the tsr string. &dA c4 = ts(c1,TSR_POINT) c3 = ors(tsr(c4){2}) if bit(0,c3) = 1 px = ors(tsr(c4){3}) if px > 0 px = px - 128 * notesize / 10 &dA &dA &d@ &dA11/24/07&d@ We need to take action in both the relative and &dA &d@ absolute cases of x-shift. Apparently, there is a difference, &dA &d@ at least here. Relative shift ("x") is added to whatever is &dA &d@ already in the GLOBAL_XOFF; whereas absolute shift ("X") replaces &dA &d@ any value in GLOBAL_XOFF. This holds for note placement, but &dA &d@ I am unclear whether it is true for musical signs, dynamics, etc. &dA pxx = c3 & 0x02 >> 1 if pxx = 1 /* true when "X" is used ts(c1,GLOBAL_XOFF) = px tsr(c4){3} = chr(0) /* here is where suggestion is zeroed out else ts(c1,GLOBAL_XOFF) += px tsr(c4){3} = chr(0) /* here is where suggestion is zeroed out end &dK &d@ if pxx = 1 /* true when "X" is used &dK &d@ ts(c1,GLOBAL_XOFF) = px &dK &d@ tsr(c4){3} = chr(0) /* here is where suggestion is zeroed out &dK &d@ end &dA end end printpos(thispass) = ts(c1,GLOBAL_XOFF) &dA &dA &d@ End of new code &dA05/02/03&d@ &dA #if AUTOSCR c3 = printpos(thispass) if c3 <> 0 if ts(c1,TYPE) = NOTE c4 = hpar(82) - 2 /* autoset doesn't shift full width else c4 = hpar(82) * 8 / 10 - 2 end if abs(c3) > c4 - 3 and abs(c3) < c4 + 3 if c3 > 0 ts(c1,NOTE_DISP) = 100 else ts(c1,NOTE_DISP) = -100 end else ts(c1,NOTE_DISP) = scr_qwidth * INT10000 + c3 end else ts(c1,NOTE_DISP) = 0 end #endif c10 = c1 + 1 loop while ts(c10,TYPE) = ts(c1,TYPE) + 1 ++c10 repeat --c10 else ts(c1,GLOBAL_XOFF) = c9 * INT10000 + c10 /* temporary storage of indexes ts(c1,NOTE_DISP) = ts(c9,NOTE_DISP) end end repeat &dA &dA &d@*************************************************************** &dA &d@ Debug Information &dA &dA &d@ if bit(2,pmode) = 1 and g >= debug_point &dA &dA &d@ Condition changed &dA01/01/06&d@ &dA &dK &d@ g = measnum - 1 &dK &d@ if (bit(2,pmode) = 1 or debug_flag = 1) and g >= debug_point &dK &d@ putc Set Array at Point No. 3: measure ~g &dK &d@ putc Look? &dK &d@ getc jtype &dK &d@ if jtype = "y" &dK &d@ perform display_ts &dK &d@ end &dK &d@ end &dA &dA &d@ End debug information &dA &d@*************************************************************** &dA goto PS_END &dA &dA &d@ Clashes &dA PS_CL: &dA &d@ putc clash c2 = ~c2 c3 = ~c3 c4 = ndata(c2,PS_PASS) c5 = ndata(c3,PS_PASS) if ndata(c2,PS_DOT) > 0 and ndata(c3,PS_DOT) = 0 c7 = c5 goto PS_CLT end if ndata(c2,PS_DOT) = 0 and ndata(c3,PS_DOT) > 0 c7 = c4 goto PS_CLT end if bit(0,ndata(c2,PS_STEM)) = UP and bit(0,ndata(c3,PS_STEM)) = DOWN c7 = c4 goto PS_CLT end if bit(0,ndata(c2,PS_STEM)) = DOWN and bit(0,ndata(c3,PS_STEM)) = UP c7 = c5 goto PS_CLT end if ndata(c2,PS_PITCH) >= ndata(c3,PS_PITCH) c7 = c4 else c7 = c5 end PS_CLT: &dA &d@ putc clash between pitch chords ~c4 and ~c5 c8 = 100 perform ps_setchord (c7, c8, c10) goto PS_B * PS_UNIS: &dA &d@ putc unison c2 = ~c2 c3 = ~c3 c7 = ndata(c2,PS_PASS) c8 = ndata(c3,PS_PASS) perform ps_setchord (c7, c8, c10) goto PS_B PS_END: &dA &dA &d@ At this point you have accomplished tasks (1), (2), and (3) &dA &d@ for the case of multiple note heads on a division. You now &dA &d@ need to do the following (for all ts(.,.) elements from a1 &dA &d@ to a2). &dA &dA &d@ (4) Compute the x and y offsets for any dot(s) which might &dA &d@ follow each note head. &dA &dA &d@ (5) Compute the x offset (as measured to the left) of any &dA &d@ accidental(s) which might precede each note head. &dA &dA &dA &d@ (4) X and Y offsets for dots &dA &dA &d@ (a) determine number and spacing of note heads on each stave &dA &d@ to determine method of placement of dots. Use column &dA &d@ method if note heads (with dots) occur on space and line &dA &d@ on the same staff. Otherwise use conventional placement. &dA &d@ (This code assumes MAX_STAFF <= 3) &dA &dA &d@ First find all staves where all offsets (global and local) &dA &d@ are zero. In these cases, we can use the absolute method. &dA tgroup(1) = 4 tgroup(2) = 4 tgroup(3) = 4 loop for c1 = a1 to a2 c8 = ts(c1,STAFF_NUM) + 1 /* staff number if chr(ts(c1,TYPE)) in [NOTE,CUE_NOTE,GR_NOTE] if ts(c1,GLOBAL_XOFF) > 0 tgroup(c8) = 0 end end if ts(c1,LOCAL_XOFF) > 0 tgroup(c8) = 0 end repeat loop for c1 = a1 to a2 if ts(c1,DOT) > 0 c8 = ts(c1,STAFF_NUM) + 1 /* staff number if tgroup(c8) <> 4 &dK &d@ c9 = ts(c1,STAFFLOC) / vpar(1) c9 = ts(c1,STAFFLOC) + vpar20 * 2 + 1 / vpar(2) - 20 c9 = bit(0,c9) + 1 if tgroup(c8) = 0 tgroup(c8) = c9 else if tgroup(c8) <> c9 tgroup(c8) = 3 /* use column method end end end end repeat &dA &dA &d@ (b) for those staves using the column method, determine the &dA &d@ x offset of the column. &dA c5 = 0 loop for c8 = 1 to 3 if tgroup(c8) = 3 tgroup(c8) = 1 c5 = 1 else tgroup(c8) = 0 end repeat if c5 = 1 loop for c1 = a1 to a2 if ts(c1,GLOBAL_XOFF) < INT10000 c9 = ts(c1,GLOBAL_XOFF) /* global offset end if ts(c1,DOT) > 0 c8 = ts(c1,STAFF_NUM) + 1 /* staff number if tgroup(c8) > 0 c7 = c9 + ts(c1,LOCAL_XOFF) /* note head position c10 = ts(c1,TYPE) / 3 if rem = 0 if ts(c1,NTYPE) > QUARTER c3 = hpar(30) else c3 = hpar(31) end else if ts(c1,NTYPE) > HALF c3 = hpar(32) else c3 = hpar(33) end end if rem = 1 and bit(1,ts(c1,STEM_FLAGS)) = UP if ts(c1,BEAM_FLAG) = NO_BEAM and ts(c1,NTYPE) < QUARTER c3 += hpar(27) end end if ts(c1,TYPE) > REST c3 = c3 * 8 / 10 end c7 += c3 /* dot position for this note head if tgroup(c8) < c7 tgroup(c8) = c7 end end end repeat &dA &d@ &dA &d@ (c) place dots for all staves which use the column method &dA &d@ (relative x placement; absolute y placement) &dA &dA &d@ Starting with the left-most objects in the "musical node" &dA &d@ and moving to the right, set dot positions according to &dA &d@ the following algorithm (keeping track of all previous &dA &d@ dots for this stave): &dA &dA &d@ Start with the note head furtherest from note-end of stem &dA &d@ If note on line, &dA &d@ if space above is free, put dot there &dA &d@ else put dot in first free space below &dA &d@ else &dA &d@ if space is free, put dot there &dA &d@ else put dot in first free space in reverse direction &dA &d@ end &dA loop for c13 = 1 to 3 /* loop though staves if tgroup(c13) > 0 c5 = 0 c10 = 0 /* count up for stems up c11 = 1000 /* count down for stems down &dA &dA &d@ Special case: two notes on stave and multi-tracks on this stave &dA if a2 = a1 + 1 if ts(a1,MULTI_TRACK) >= 4 if abs(ts(a1,STAFFLOC) - ts(a2,STAFFLOC)) > notesize if bit(1,ts(a1,STEM_FLAGS)) <> bit(1,ts(a2,STEM_FLAGS)) loop for c1 = a1 to a2 c8 = ts(c1,GLOBAL_XOFF) if c8 >= INT10000 c8 /= INT10000 c8 = ts(c8,GLOBAL_XOFF) end #if AUTOSCR &dA &dA &d@ Start by setting the SCORE P9 parameter (AUG_DOTS) &dA c16 = ts(c1,STAFFLOC) / notesize c16 = rem /* set 16 to rem c9 = tgroup(c13) if ts(c1,TYPE) > XNOTE c9 = c9 * 10 + 6 / 8 end &dK &d@ if ts(c1,NTYPE) > HALF if (ts(c1,NTYPE) & 0xff) > HALF /* new &dA10/15/07 c9 -= hpar(32) else c9 -= hpar(33) end if c9 < 3 c9 = 0 end if ts(c1,TYPE) > XNOTE c9 = c9 * 8 / 10 end c9 = c9 * 30 / scr_qwidth /* 100ths part of P9 if c9 > 99 c9 = 99 end c10 = ts(c1,DOT) & 0x0f c10 = int("1.2...3.......4"{c10}) /* convert to SCORE code c10 *= 10 if c16 = 0 and bit(1,ts(c1,STEM_FLAGS)) = DOWN c10 += 100 end c10 = c10 << 8 + c9 ts(c1,AUG_DOTS) = c10 #endif c10 = ts(c1,STAFFLOC) c9 = c10 / notesize if rem = 0 /* note on line if bit(1,ts(c1,STEM_FLAGS)) = UP c10 -= vpar(12) else c10 += vpar(12) end end c10 -= ts(c1,OBY) /* convert to relative y offset c9 = tgroup(c13) - c8 /* relative x offset from obx c9 *= INT10000 c9 += c10 c9 <<= 4 /* code modified &dA12-24-96 ts(c1,DOT) |= c9 repeat goto X_DOT end end end end /* global offset loop for c1 = a1 to a2 if ts(c1,GLOBAL_XOFF) < INT10000 c9 = ts(c1,GLOBAL_XOFF) /* global offset end c8 = ts(c1,STAFF_NUM) + 1 /* staff number if ts(c1,DOT) > 0 and c8 = c13 /* dot on this staff ++c5 c12 = bit(1,ts(c1,STEM_FLAGS)) if c12 = UP /* stem up ndata(c5,1) = c10 ++c10 else ndata(c5,1) = c11 --c11 end ndata(c5,1) += c9 * 10000 /* tricky code (for ordering) ndata(c5,2) = c1 ndata(c5,3) = c12 /* stem direction ndata(c5,4) = c9 /* global x offset ndata(c5,5) = 100 end repeat &dA &dA &d@ Sort the ndata array by ndata(.,1) smallest on top &dA &d@ first by global offset, then by stem (up first), then by order &dA &d@ on stem (up in order, down reverse order) &dA loop for c8 = 1 to c5 c6 = 10000000 loop for c4 = 1 to c5 if ndata(c4,5) = 100 and ndata(c4,1) < c6 c6 = ndata(c4,1) c7 = c4 end repeat ndata(c7,6) = c8 ndata(c7,5) = 0 repeat &dA &dA &d@ Typeset dots on this staff &dA loop for c8 = 1 to 50 mf(c8) = 0 repeat loop for c8 = 1 to c5 c7 = ndata(c8,6) /* typeset this note head c1 = ndata(c7,2) /* c1 is the index c9 = tgroup(c13) - ndata(c7,4) /* relative x offset from obx &dK &d@ c4 = 0 - ts(c1,STAFFLOC) / vpar(1) + 23 c16 = ts(c1,STAFFLOC) + vpar20 * 2 + 1 / vpar(2) - 20 c4 = 23 - c16 /* 23 = top line of staff &dA &dA &d@ If note on line, &dA &d@ if space above is free, put dot there &dA &d@ else put dot in first free space below &dA &d@ else &dA &d@ if space is free, put dot there &dA &d@ else put dot in first free space in reverse direction &dA &d@ end &dA if bit(0,c4) = 1 /* if note on line if mf(c4+1) = 0 mf(c4+1) = 1 c10 = c4 + 1 /* absolute y offset (23 = top line) else c10 = 0 --c4 loop if mf(c4) = 0 mf(c4) = 1 c10 = c4 else c4 -= 2 if c4 = 0 putc Program error setting dots stop end end repeat while c10 = 0 end else /* else, note on space if mf(c4) = 0 mf(c4) = 1 c10 = c4 else if ndata(c7,3) = UP /* if stem up, look up c10 = 0 c4 += 2 loop if mf(c4) = 0 mf(c4) = 1 c10 = c4 else c4 += 2 if c4 = 50 putc Program error setting dots stop end end repeat while c10 = 0 else /* else, stem is down; look down c10 = 0 c4 -= 2 loop if mf(c4) = 0 mf(c4) = 1 c10 = c4 else c4 -= 2 if c4 = 0 putc Program error setting dots stop end end repeat while c10 = 0 end end end &dA &dA &d@ c10 is the absolute y position (23 = top line) for the dot(s) &dA &dK &d@ c10 = 23 - c10 * vpar(1) /* convert to absolute staff position c10 = 43 - c10 / 2 * vpar(2) c10 += rem * vpar(1) c10 -= vpar20 #if AUTOSCR &dA &dA &d@ This is all getting pretty hairy, but we need to try to convert &dA &d@ the current shift data to data that SCORE can use. The problem &dA &d@ with SCORE is that it does not allow a dot to be shifted down &dA &d@ by more than one scale step. This creates problems even for &dA &d@ SCORE data entry, but it creates nightmares for conversion, unless &dA &d@ we simply set every dot using CODE-9 items. I will attempt a &dA &d@ compromise. If the y-position is "settable" with a SCORE P9 &dA &d@ parameter, I will do it; otherwise we need to use a CODE-9 item. &dA &d@ I shutter to think of what the output of this will look like. &dA &dA &d@ Use c7,c16,c4,c12 &dA c16 = ts(c1,STAFFLOC) c4 = c16 / notesize c4 = rem if (c4 = 0 and abs(c16 - c10) < vpar(2)) or (c4 <> 0 and c16 = c10) /* can set with SCORE c7 = c9 if ts(c1,TYPE) > XNOTE c7 = c7 * 10 + 6 / 8 end &dK &d@ if ts(c1,NTYPE) > HALF if (ts(c1,NTYPE) & 0xff) > HALF /* new &dA10/15/07&d@ c7 -= hpar(32) else c7 -= hpar(33) end if c7 < 3 c7 = 0 end if ts(c1,TYPE) > XNOTE c7 = c7 * 8 / 10 end c12 = ts(c1,GLOBAL_XOFF) if c12 >= INT10000 c12 /= INT10000 /* index to top note c12 = ts(c12,GLOBAL_XOFF) end c7 = c7 * 30 / scr_qwidth /* 100ths part of P9 if c7 > 99 c7 = 99 end c12 = ts(c1,DOT) & 0x0f c12 = int("1.2...3.......4"{c12}) /* convert to SCORE code c12 *= 10 if c4 = 0 and c10 > c16 /* dot below notehead c12 += 100 end c12 = c12 << 8 + c7 ts(c1,AUG_DOTS) = c12 else ts(c1,AUG_DOTS) = 0x01000000 /* goto CODE-9 ts(c1,AUG_DOTS) += (c9 * INT10000) ts(c1,AUG_DOTS) += c10 end #endif &dA &dA &d@ Store relative values of x and y for this note head &dA &d@ c9 is the relative x shift to the dot(s) from obx &dA &d@ x * INT10000 + y, shift it over 4 and &dAOR&d@ it DOT (modified &dA12-24-96&d@) &dA c9 *= INT10000 c10 -= ts(c1,OBY) /* convert to relative y offset c9 += c10 c9 <<= 4 /* code modified &dA12-24-96&d@ ts(c1,DOT) |= c9 repeat X_DOT: end repeat end &dA &d@ &dA &d@ (d) place dots for all remaining note heads (absolute placement first) &dA old_c2 = 10000 /* added &dA11/26/06&d@ loop for c1 = a1 to a2 if ts(c1,DOT) > 0 and ts(c1,DOT) < INT9000 /* dot not yet placed &dK &d@ ntype = ts(c1,NTYPE) ntype = ts(c1,NTYPE) & 0xff /* new &dA10/15/07 c10 = ts(c1,TYPE) / 3 if rem = 0 /* rests if ntype > QUARTER c3 = hpar(30) else c3 = hpar(31) end else if ntype > HALF c3 = hpar(32) else c3 = hpar(33) end end &dK &d@ c6 = ts(c1,STAFFLOC) / vpar(1) c6 = ts(c1,STAFFLOC) + vpar20 * 2 + 1 / vpar(2) - 20 c5 = ts(c1,STAFFLOC) / notesize c5 = rem /* c5 = 0 means note on line if bit(1,ts(c1,STEM_FLAGS)) = UP if ts(c1,BEAM_FLAG) = NO_BEAM and ts(c1,NTYPE) < QUARTER c10 = ts(c1,TYPE) / 3 if rem = 1 c3 += hpar(27) if c5 <> 0 c3 -= hpar(34) end end end end * if dot is on staff line, c5 = 0 if c5 = 0 c2 = 0 - vpar(12) /* lower dot if more than one track and stem is down if bit(3,ts(c1,MULTI_TRACK)) = 1 if bit(1,ts(c1,STEM_FLAGS)) = DOWN c2 = vpar(12) end end c3 -= hpar(34) else c2 = 0 end if ts(c1,TYPE) <= REST c5 = bit(16,ts(c1,SUBFLAG_1)) else c5 = CUESIZE end if c5 = 1 c3 = c3 * 8 / 10 end c2 += ts(c1,STAFFLOC) #if AUTOSCR if ts(c1,TYPE) <> REST and ts(c1,TYPE) <> CUE_REST &dA &dA &d@ use c7,c16,c4,c12,c5 &dA c16 = ts(c1,STAFFLOC) c4 = c16 / notesize c4 = rem if (c4 = 0 and abs(c16 - c2) < vpar(2)) or (c4 <> 0 and c16 = c2) /* can set with SCORE c7 = c3 if ts(c1,TYPE) > XNOTE c7 = c7 * 10 + 6 / 8 end &dK &d@ if ts(c1,NTYPE) > HALF if (ts(c1,NTYPE) & 0xff) > HALF /* new &dA10/15/07 c7 -= hpar(32) else c7 -= hpar(33) end if c4 = 0 c7 += hpar(34) end if c7 < 3 c7 = 0 end if ts(c1,TYPE) > XNOTE c7 = c7 * 8 / 10 end c12 = ts(c1,GLOBAL_XOFF) if c12 >= INT10000 c12 /= INT10000 c12 = ts(c12,GLOBAL_XOFF) end c7 = c7 * 30 / scr_qwidth /* 100ths part of P9 if c7 > 99 c7 = 99 end c12 = ts(c1,DOT) & 0x0f c12 = int("1.2...3.......4"{c12}) /* convert to SCORE code c12 *= 10 if c4 = 0 and c2 > c16 /* dot below notehead c12 += 100 end c12 = c12 << 8 + c7 ts(c1,AUG_DOTS) = c12 else c12 = ts(c1,DOT) & 0x0f c12 = int("1.2...3.......4"{c12}) /* convert to SCORE code c12 <<= 24 ts(c1,AUG_DOTS) = c12 /* goto CODE-9 ts(c1,AUG_DOTS) += (c3 * INT10000) ts(c1,AUG_DOTS) += c2 end end &dA #endif c2 -= ts(c1,OBY) &dA &dA &d@ This code added &dA11/26/06&d@ (as a cludge) to fix a minor bug in the &dA &d@ placement extension dots when one is "on top of" another. &dA if ts(c1,TYPE) = XNOTE or ts(c1,TYPE) = XCUE_NOTE or ts(c1,TYPE) = XGR_NOTE if abs(old_c2 - c2) < vpar(1) c2 += vpar(2) end end old_c2 = c2 &dA &dA &d@ End of &dA11/26/06&d@ addition /* c3 = x offset to the dot(s) from obx /* c2 = y offset to the dot(s) from oby /* x * INT10000 + y, shift it over 4 and &dAOR&d@ it with DOT (modified &dA12-24-96&d@) c3 *= INT10000 c3 += c2 c3 <<= 4 /* code modified &dA12-24-96 ts(c1,DOT) |= c3 end repeat &dA &dA &d@ Adjust the gr(.,.) array to accommodate space for dots &dA c17 = 0 /* used below loop for c1 = a1 to a2 if ts(c1,GLOBAL_XOFF) < INT10000 c9 = ts(c1,GLOBAL_XOFF) /* global offset end c8 = ts(c1,STAFF_NUM) + 1 /* staff number &dA &dA &dA &d@ Special code added to deal with the discrepency in how single vs. multiple &dA &d@ tracks handle the minimal spacing for dotted rests. &dA04/19/08&d@ &dA &d@ This section computes the value of the right hand border for the dot, c7 &dA &d@ It also sets the exception variable c17 = 1 &dA c7 = 10000 /* "normal" condition if scr_flag = 1 if c1 < a2 and ts(c1,TYPE) = REST if ts(c1+1,TYPE) = REST and ts(c1+1,CLAVE) = 200 if ts(c1,DOT) > 0 c7 = 1 end c17 = 1 /* used below end end end c3 = ts(c1,DOT) if c3 > 0 if c7 = 1 ntype = ts(c1,NTYPE) & 0xff c4 = 0 if ntype <= SIXTEENTH c4 = EIGHTH - ntype end if ntype > QUARTER c7 = hpar(30) else c7 = c4 * hpar(54) + hpar(31) end c7 += hpar(80) if ntype > WHOLE c4 = hpar(87) * 4 / 3 else if ntype > QUARTER c4 = hpar(87) else if ntype > EIGHTH c4 = hpar(88) else c4 = EIGHTH - ntype * hpar(54) + hpar(88) end end end c7 += c4 if ts(c1,DOT) & 0x0e > 0 if ts(c1,DOT) & 0x02 > 0 c7 += hpar(91) /* extra shift to second dot end if ts(c1,DOT) & 0x04 > 0 c7 += hpar(91) /* extra shift to third dot end if ts(c1,DOT) & 0x08 > 0 c7 += hpar(91) /* extra shift to fourth dot end end &dK &dK &d@ dputc &dJgr(.)&d@ = ~c7 &dK end &dA &dA c4 = c3 & 0x0f /* dot flag (modified &dA12-24-96&d@) c3 >>= 4 /* code modified &dA12-24-96 c5 = c3 / INT10000 /* x offset c6 = rem /* y offset if c6 > INT10000 >> 1 c6 -= INT10000 ++c5 end &dK &d@ c6 = c6 + vpar(8) - 1 / vpar(1) - 7 c6 = c6 + vpar(8) * 2 - 1 / vpar(2) - 7 &dK &d@ c6 = 0 - ts(c1,STAFFLOC) / vpar(1) + 23 - c6 c16 = ts(c1,STAFFLOC) + vpar20 * 2 + 1 / vpar(2) - 20 c6 = 23 - c16 - c6 c5 += c9 + ts(c1,LOCAL_XOFF) /* final offset for dot c5 += hpar(80) if c4 > 1 /* code modified &dA12-24-96 c5 += hpar(91) /* second dot if c4 > 4 c5 += hpar(91) /* third dot end if c4 > 8 c5 += hpar(91) /* fourth dot end end if c6 < 46 and c6 > 0 &dA &dA &dA &d@ More code added to deal with the discrepency in how single vs. multiple &dA &d@ tracks handle the minimal spacing for dotted rests. &dA04/19/08&d@ &dA &d@ This section sets the value of the right hand object "border" gr(.,.) &dA &dK &d@ gr(c8,c6) = c5 if c7 = 10000 /* "normal" condition gr(c8,c6) = c5 else gr(c8,c6) = c7 if c6 < 44 gr(c8,c6+1) = c7 gr(c8,c6+2) = c7 end end &dA &dA end end repeat &dA &dA &d@ (5) Compute the x offset (as measured to the left) of any &dA &d@ accidental(s) which might precede each note head. &dA &dA &d@ (a) Check the left-hand border from the typesetting operation. &dA &d@ If there are any accidentals that could be set on right- &dA &d@ shifted note heads, set these first, starting from the &dA &d@ top down. This defines column 1 of the accidentals. &dA &dA &d@ Otherwise, column one is the first free location to the &dA &d@ left of the left-most note head. &dA &dA &d@ (b) For all remaining accidentals to set, start at the top &dA &d@ of the group. Make successive passes until all accidentals &dA &d@ are set. &dA &dA &d@ 1. moving down, put in as many accidentals as possible &dA &d@ where the distance between eligible notes (delta) >= &dA &d@ vpar(6), with the caviat that you do not put an &dA &d@ accidental on the lower half of a second before the &dA &d@ upper half of a second (as you move down). &dA &dA &d@ 2. move to the left by the largest thickness of accidentals &dA &d@ just placed. Decide on the direction to move for the &dA &d@ next pass and goto (a). The new direction will be &dA &d@ down (again) if the previous pass hit the lowest remaining &dA &d@ accidental; otherwise, the new direction will be up. &dA &dA &d@ (Maximum staves for this code is 2, because this is the size of gl(.,.)) &dA tgroup(1) = 0 tgroup(2) = 0 tgroup(3) = 0 c5 = 0 loop for c1 = a1 to a2 if ts(c1,AX) > 0 c8 = ts(c1,STAFF_NUM) + 1 /* staff number ++tgroup(c8) ndata(tgroup(c8),c8) = c1 c5 = 1 end repeat if c5 = 1 /* &dADon't change this variable (c5) /* &dAuntil task (1) is complete loop for c13 = 1 to 2 /* loop though staves if tgroup(c13) > 0 if a1 = a2 /* simple case (one note group) c1 = ndata(1,c13) /* index c3 = ts(c1,AX) & 0x0f &dK &d@ c2 = 0 - ts(c1,STAFFLOC) / vpar(1) + 23 c16 = ts(c1,STAFFLOC) + vpar20 * 2 + 1 / vpar(2) - 20 c2 = 23 - c16 if ts(c1,TYPE) > REST c4 = CUESIZE else c4 = bit(16,ts(c1,SUBFLAG_1)) end perform place_accidental (c13,c2,c3,c4) /* returns c4 = absolute x ts(c1,AX_DISP) = c3 /* capture this parameter, from place_accidental /* shift offset left 8 and &dAOR&d@ with AX c4 = 0 - c4 c4 <<= 8 /* &dA02/25/97&d@ shift changed from 4 to 8 ts(c1,AX) |= c4 else &dA &dA &d@ (1) We must re-order elements so that they are in descending &dA &d@ order on the staff. Use bubble sort. &dA loop for c7 = 1 to tgroup(c13) - 1 loop for c8 = c7+1 to tgroup(c13) c1 = ndata(c7,c13) c2 = ndata(c8,c13) if ts(c1,STAFFLOC) > ts(c2,STAFFLOC) ndata(c7,c13) = c2 ndata(c8,c13) = c1 end repeat repeat &dA &d@ &dA &d@ (2) Try first to set accidentals on "right shifted chords" &dA loop for c8 = 1 to tgroup(c13) c1 = ndata(c8,c13) if c8 > 1 c2 = ndata(c8-1,c13) if c2 < DUMMY_VALUE &dK &d@ if ts(c1,STAFFLOC) - ts(c2,STAFFLOC) = vpar(1) /* second c16 = ts(c1,STAFFLOC) - ts(c2,STAFFLOC) if c16 = vpar(1) or c16 = vpar(1) + 1 /* second if ts(c1,LOCAL_XOFF) < ts(c2,LOCAL_XOFF) /* don't set accidental in this situation goto QQQ1 end end end end &dK &d@ c2 = 0 - ts(c1,STAFFLOC) / vpar(1) + 23 c16 = ts(c1,STAFFLOC) + vpar20 * 2 + 1 / vpar(2) - 20 c2 = 23 - c16 c4 = 200 c12 = ts(c1,AX) & 0x0f c14 = c2 - int("221002200100001"{c12}) /* lower limit c15 = c2 + int("333003300200003"{c12}) /* upper limit loop for c3 = c14 to c15 if c3 > 0 and c3 <= 45 if gl(c13,c3) <= 0 c3 = 1000 else if gl(c13,c3) < c4 c4 = gl(c13,c3) end end end repeat if c3 < 1000 c3 = ts(c1,AX) & 0x0f if ts(c1,TYPE) > REST c4 = CUESIZE else c4 = bit(16,ts(c1,SUBFLAG_1)) end perform place_accidental (c13,c2,c3,c4) /* returns c4 = absolute x ts(c1,AX_DISP) = c3 /* capture this parameter, from place_accidental c3 = ts(c1,GLOBAL_XOFF) if c3 > INT10000 c3 /= INT10000 /* index of top of chord c3 = ts(c3,GLOBAL_XOFF) end c6 = c3 - c4 /* relative x offset (to the left) /* shift offset left 8 and &dAOR&d@ with AX c6 <<= 8 /* &dA02/25/97&d@ shift changed from 4 to 8 ts(c1,AX) |= c6 ndata(c8,c13) = DUMMY_VALUE /* accidental set end QQQ1: repeat &dA &d@ &dA &d@ (3) Now make successive passes until all accidentals are set &dA c10 = DOWN loop c6 = 0 loop for c8 = 1 to tgroup(c13) if ndata(c8,c13) <> DUMMY_VALUE /* accidental not set c6 = c8 end repeat if c6 = 0 goto QQQ2 /* DONE end if c10 = DOWN c11 = 1 c12 = tgroup(c13) c9 = 1 else c11 = tgroup(c13) c12 = 1 c9 = -1 end c10 = UP loop for c8 = c11 to c12 step c9 c1 = ndata(c8,c13) if c1 = DUMMY_VALUE goto QQQ3 end if c8 > 1 c2 = ndata(c8-1,c13) if c2 < DUMMY_VALUE &dK &d@ if ts(c1,STAFFLOC) - ts(c2,STAFFLOC) = vpar(1) /* second c16 = ts(c1,STAFFLOC) - ts(c2,STAFFLOC) if c16 = vpar(1) or c16 = vpar(1) + 1 /* second if ts(c1,LOCAL_XOFF) < ts(c2,LOCAL_XOFF) /* don't set accidental in this situation goto QQQ3 end end end end if c8 = c6 c10 = DOWN end &dK &d@ c2 = 0 - ts(c1,STAFFLOC) / vpar(1) + 23 c16 = ts(c1,STAFFLOC) + vpar20 * 2 + 1 / vpar(2) - 20 c2 = 23 - c16 c3 = ts(c1,AX) & 0x0f if ts(c1,TYPE) > REST c4 = CUESIZE else c4 = bit(16,ts(c1,SUBFLAG_1)) end perform place_accidental (c13,c2,c3,c4) /* returns c4 = absolute x ts(c1,AX_DISP) = c3 /* capture this parameter, from place_accidental c3 = ts(c1,GLOBAL_XOFF) if c3 > INT10000 c3 /= INT10000 /* index of top of chord c3 = ts(c3,GLOBAL_XOFF) end c15 = c3 - c4 /* relative x offset (to the left) /* shift offset left 8 and &dAOR&d@ with AX c15 <<= 8 /* &dA02/25/97&d@ shift changed from 4 to 8 ts(c1,AX) |= c15 ndata(c8,c13) = DUMMY_VALUE /* accidental set QQQ3: repeat repeat QQQ2: end end repeat end &dA &dA &d@ Task (1) Calculate NODE_SHIFT &dA &d@ c10 = 0 if c17 = 0 /* set above loop for a3 = 1 to nstaves loop for c11 = 1 to 45 if gl(a3,c11) > pseudo_gl(a3,c11) gl(a3,c11) = pseudo_gl(a3,c11) end &dA &dA &d@ &dA11/19/07&d@ min_space replaces hpar(29) &dA c12 = min_space - gl(a3,c11) - emptyspace(a3,c11) /* should be negative &dK &d@ if c11 >= 14 and c11 <= 22 &dK &d@ dputc &dLSorry&d@ c12 = ~c12 &dK &d@ putc gl(~a3 ,~c11 ) = ~gl(a3,c11) &dK &d@ putc emptyspace(~a3 ,~c11 ) = ~emptyspace(a3,c11) &dK &d@ end if c12 > c10 /* most of the time c10 = c12 end repeat repeat if c5 > 0 and ts(a1,SPACING) = mindist and c10 < hpar(94) c10 = hpar(94) end else &dA &dA &dA &d@ More code from the &dA04/19/08&d@ cludge &dA &d@ This section uses the single-track formula to compute the &dA &d@ value of this nodes NODE_SHIFT. &dA loop for a3 = 1 to nstaves c7 = 100000 loop for c11 = 1 to 45 if emptyspace(a3,c11) < c7 c7 = emptyspace(a3,c11) /* minimum emptyspace on this staff end repeat c10 = mindist - hpar(82) - c7 repeat &dA &dA end &dK &dK &d@ dputc &dFValue&d@ of c10 is ~c10 &dK if c10 > 0 ts(a1,NODE_SHIFT) = c10 end &dA &d@ Task (2) c10 = ts(a1,SPACING) &dK &dK &d@ dputc &dA &d@ spacing = ~c10 &dK loop for a3 = 1 to nstaves loop for c6 = 1 to 45 if pseudo_gr(a3,c6) > gr(a3,c6) gr(a3,c6) = pseudo_gr(a3,c6) end if gr(a3,c6) = -200 emptyspace(a3,c6) += c10 else emptyspace(a3,c6) = c10 - gr(a3,c6) end &dK &d@ if c6 >= 19 and c6 <= 21 &dK &d@ dputc &dE &d@ gr(1,~c6 ) = ~gr(1,c6) &dK &d@ dputc &dI &d@ emptyspace(1,~c6 ) = ~emptyspace(1,c6) &dK &d@ end repeat repeat &dA &d@ &dAÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»&d@ &dA &d@ &dAº&d@ &dAº&d@ &dA &d@ &dAº&d@ End of where you deal with chords and with multiple passes &dAº&d@ &dA &d@ &dAº&d@ &dAº&d@ &dA &d@ &dAÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ&d@ end MMMMM: &dA &dA &d@ We need to check (for now) if the present simultaneity generates &dA &d@ a "clash" with the previous simultaneity. &dA if olda1 > 0 c6 = -1000 loop for c3 = 1 to 2 loop for c4 = 1 to 45 c5 = oldgr(c3,c4) - gl(c3,c4) if c5 > c6 c6 = c5 end repeat repeat &dK &d@ if c6 > ts(olda1,SPACING) + ts(olda1,NODE_SHIFT) &dK &d@ putc Potential clash, possible program error &dK &d@ end end loop for c3 = 1 to 2 loop for c4 = 1 to 45 oldgr(c3,c4) = gr(c3,c4) repeat repeat olda1 = a1 a1 = a2 WWWW: repeat &dA &dA &d@ &dAÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»&d@ &dA &d@ &dAº&d@ &dAº&d@ &dA &d@ &dAº&d@ End of calculations on the placement of notes, note-dots, &dAº&d@ &dA &d@ &dAº&d@ and note-accidentals. &dAº&d@ &dA &d@ &dAº&d@ &dAº&d@ &dA &d@ &dAÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ&d@ &dA &dA &dA &d@*************************************************************** &dA &d@ Debug Information &dA g = measnum - 1 &dK &d@ if bit(2,pmode) = 1 and g >= debug_point &dA &dA &d@ Condition changed &dA01/01/06&d@ &dA if (bit(2,pmode) = 1 or debug_flag = 1) and g >= debug_point putc Set Array at Point No. 3: measure ~g putc Look? getc jtype if jtype = "y" perform display_ts end end &dA &dA &d@ End debug information &dA &d@*************************************************************** &dA &dA &dA &d@ &dAÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»&d@ &dA &d@ &dAº &d@ &dA º&d@ &dA &d@ &dAº &d@ At this point, we have a decision to make. Either we process the &dA º&d@ &dA &d@ &dAº &d@ ts array now (i.e. typeset the music) or we return from this &dA º&d@ &dA &d@ &dAº &d@ procedure and let the ts array continue to grow. The question that &dA º&d@ &dA &d@ &dAº &d@ must be answered is "will all outstanding slurs be processed when &dA º&d@ &dA &d@ &dAº &d@ the ts array is fully processed?" If "yes", then we can go ahead &dA º&d@ &dA &d@ &dAº &d@ and process the ts array; otherwise, not. &dA º&d@ &dA &d@ &dAº &d@ &dA º&d@ &dA &d@ &dAº &d@ The information we need is contained in the SLUR_FLAG portion &dA º&d@ &dA &d@ &dAº &d@ of the ts array. We need to cycle through the array elements we &dA º&d@ &dA &d@ &dAº &d@ have added, taking note of where slurs terminate and where they &dA º&d@ &dA &d@ &dAº &d@ start. We need a variable to keep track of the state of slur &dA º&d@ &dA &d@ &dAº &d@ completion. We call this variable bstr "outslurs". The relevant &dA º&d@ &dA &d@ &dAº &d@ bits will be bits 1 to 8. When a slur is initiated, the relevant &dA º&d@ &dA &d@ &dAº &d@ bit will be turned on; when a slur is terminated, the relevant &dA º&d@ &dA &d@ &dAº &d@ bit will be turned off. If at the end of this process, &dA º&d@ &dA &d@ &dAº &d@ outslurs = "00000000", then we can process the array. &dA º&d@ &dA &d@ &dAº &d@ &dA º&d@ &dA &d@ &dAÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ&d@ &dA loop for a1 = oldsct+1 to sct nodtype = ts(a1,TYPE) if nodtype <= NOTE_OR_REST a2 = ts(a1,SLUR_FLAG) & 0xff a3 = ts(a1,SLUR_FLAG) >> 8 a3 &= 0xff00 a3 += a2 /* 16 bits, i.e., stop,start,stop,start etc. if a3 > 0 a5 = 1 loop for a4 = 1 to 8 if bit(a5,a3) = 1 if outslurs{a4} = "0" /* can't stop a non-existant slur putc Slur error: Can't stop a non-existant slur (possible missing instigation) stop else outslurs{a4} = "0" end end --a5 if bit(a5,a3) = 1 if outslurs{a4} = "1" /* can't start an existing slur putc Slur error: Can't start an existing slur (possible missing termination) stop else outslurs{a4} = "1" end end a5 += 3 repeat end end repeat if outslurs <> "00000000" return end &dA &dA &d@ At this point we will be working with the entire ts array. First &dA &d@ thing, we must clear the pseudo tiearr ROWs. &dA loop for c7 = 1 to MAX_TIES if tiearr(c7,TIE_SNUM) = INT1000000 /* pseudo super number tiearr(c7,TIE_SNUM) = 0 end repeat &dA &dA &d@ &dASlur Analysis&d@ &dA &dA &d@ We am now in a position to compile complete information on slurs, &dA &d@ so that they can more or less be set properly. We possess the &dA &d@ following information for the notes on which the slur starts and &dA &d@ ends: &dA &d@ &dA &d@ (1) pitch (also whether it is part of a chord, also top or not) &dA &d@ (2) stem direction (dist from end of stem, also if beam connects) &dA &d@ (3) pass number &dA &d@ (4) staff number &dA &d@ (5) values of mcat and MULTI &dA &d@ &dA &d@ In addition, we need to compile the following information for each &dA &d@ slur: &dA &d@ &dA &d@ (1) the "high point" and "low point" for all objects on the &dA &d@ slur staff between the starting and ending notes. &dA &d@ &dA &d@ Based on this analysis, it should be possible to state: &dA &d@ &dA &d@ (1) whether the slur has tips up or down &dA &d@ &dA &d@ (2) the x-shift and y-shift for the start of the slur &dA &d@ &dA &d@ (3) the x-shift and y-shift for the end of the slur &dA &d@ &dA &d@ (4) any extra curviture that might help the situation &dA &d@ &dA &d@ In computing the parameters in (2), (3) and (4), it may be helpful &dA &d@ to something about the profile of the desired slur. For example: &dA &d@ &dA &d@ * * * * * * * * * * * * * &dA &d@ * * * * * * * * * * &dA &d@ * 1. * * 2. * * 3. * * 4. * * 5. * &dA &d@ raise start raise both raise end raise both add to &dA &d@ some a lot curviture &dA &d@ &dA &d@ &dAStorage of Information&d@ &dA &d@ &dA &d@ We need to figure out where we are going to store this information. &dA &d@ The way this program is constructed, it is possible (in theory at &dA &d@ least) for eight slurs to end and for eight slurs to start on the &dA &d@ same note. This could require as many as 32 separate parameters &dA &d@ at one ts(.,.) element, to say nothing about the 16 curviture &dA &d@ numbers, which must be stored somewhere. Rather than extend the &dA &d@ size of the second dimension of the ts array by this amount, I &dA &d@ would rather propose that we add one more element, call it &dA &d@ SLUR_X, which would be a pointer to an additional ROW element in the &dA &d@ ts array, somewhere below sct (the size of ts, after all, must be &dA &d@ much larger than necessary, in order to accommodate 99.99% of all &dA &d@ situations). &dA &dA &d@ While it is possible for eight slurs (four regular and four editorial) &dA &d@ to start or end on one chord, I think it is unlikely that more than &dA &d@ four would do so. I would therefore propose that we use a system of &dA &d@ flags to define the meaning of a data element within the ROW. As &dA &d@ will be explained below, the first 6 elements of the ROW are reserved &dA &d@ for current information about the chord generating the slur, and after &dA &d@ this, elements 7 to 32 can be used to hold data on slurs. We will &dA &d@ need to use two elements to contain all of the data. Let us establish &dA &d@ the convention that the first element will contain the key to the &dA &d@ meaning of data as well as the type of slur (tips up/down), extra &dA &d@ information on curvature, and the x-offset. Specifically, the key &dA &d@ will occupy bits 24-27, with the slur number (1-8) being stored in &dA &d@ bits 24-26, and bit 27 being the the start/end flag (0 = start, &dA &d@ 1 = end). Bit 16 will be the up/down flag (0 = tips up, 1 = tips &dA &d@ down) and bits 17-23 will contain information on extra curvature &dA &d@ (this information is necessary only in a slur-end element). Bits &dA &d@ 0-15 will contain the x-offset + 1000 (always a positive number). &dA &d@ The second element will contain the absolute y-position. Since &dA &d@ there are 26 free elements in the ROW, we can accommodate 13 data &dA &d@ groups in this fashion (surely more than necessary). &dA &dA &d@ Several points to note: &dA &dA &d@ (1) for purposes of these calculations, and temporary data stroage, &dA &d@ it will be simplest to record all y values as absolute y positions &dA &d@ (relative to the staff lines). x values can be stored as offsets. &dA &dA &d@ (2) In cases where more than one slur starts on a note head, or more &dA &d@ than one slur ends on a note head, care must be taken to insure &dA &d@ that the "longer" slur stays "on top" (assuming they have tips &dA &d@ going in the same direction). Let's take the situation pictured &dA &d@ below: &dA &dA &d@ * * * * * * * * slur 1 * * * * * * * * &dA &d@ * * slur 1a &dA &d@ * * * * * slur 2 * * * * * &dA &d@ * * slur 4 * * * slur 3 * * * * &dA &d@ ** * ** * *** &dA &d@ note 1 note 2 note 3 note 4 note 5 &dA &d@ &dA &d@ Slur 1 would be encountered first as we proceeded through the ts &dA &d@ array. If we were to try to process this slur when we first &dA &d@ encountered it, we would discover that another slur (slur 2) &dA &d@ ended on the same note as slur 1. Since slur 2 is shorter than &dA &d@ slur 1, (and therefore should lie "under" it), we cannot fully &dA &d@ process slur 1 until we have processed slur 2. But in looking back &dA &d@ to the beginning of slur 2, we see that another slur (slur 3) also &dA &d@ starts on the same note, and that slur 3 (which also we have not &dA &d@ seen before) must be processed before we can process slur 2. &dA &d@ Clearly we cannot simply follow the rule of "process a slur when &dA &d@ you first come to it". A similar argument can be used to show &dA &d@ that you cannot simply work your way through the ts array from &dA &d@ end to the start. &dA &d@ &dA &d@ Here is how the process must be conducted: You proceed forward &dA &d@ though the ts array, but do nothing until you encounter the end &dA &d@ of a slur (or more than one end, as in the case of note 5 above). &dA &d@ If there is more than one slur ending on this note (chord), you can &dA &d@ determine which one is shorter by looking backward in the array. &dA &d@ The shorter one should be processed first. In this way, you can &dA &d@ always be sure that shorter slurs will be processed before longer &dA &d@ ones. &dA &dA &d@ This method will require extra work in keeping track of what has &dA &d@ already been done. This is the purpose of the first 6 elements of &dA &d@ the extra ts ROW element. In our example above, slur 4 will be the &dA &d@ first to be processed. Since it is the first slur for both note 1 &dA &d@ and note 2, SLUR_X records must be generated for both of these &dA &d@ notes. In the case of note 2, this is the only slur, but for note 1 &dA &d@ we will be processing another slur (slur 1) much later. We need &dA &d@ to keep track of what has already transpired as a result of slur 4. &dA &d@ The first 6 elements of the SLUR_X ROW element will contain the &dA &d@ information listed below: &dA &d@ &dA &d@ (1) current y-position above object for incoming slurs. &dA &d@ (2) " below " " " " . &dA &d@ (3) " above " " outgoing " . &dA &d@ (4) " below " " " " . &dA &d@ (5) y-position for staccato, legato, etc. &dA &d@ (6) 2 = marks above chord; 1 = marks below chord; 0 = don't use &dA &dA &d@ Clearly, the information about what has happened at note 1 will &dA &d@ be available when it comes time to set slur 1. &dA &dA &d@ One more thing: in handling this problem, we must deal with a chord &dA &d@ as one object. A chord may be made up of several elements (notes), &dA &d@ and slurs coming to or leaving this chord may be coded on separate &dA &d@ elements. Nevertheless, the processing of information requires &dA &d@ that all data related to slurs be stored in one place. Therefore, &dA &d@ when a slur ROW element is allocated, the pointer to the element &dA &d@ must be put in SLUR_X for &dGall notes in the chord&d@. &dA &d@ &dA &d@ (3) It should be noted that the smallest meaningful resolution of a &dA &d@ y-position as far as slurs are concerned is vpar(1), since the &dA &d@ printing program treats these shifts as adjusted note positions. &dA &d@ &dA &d@ (4) The curvature parameter should be a number from 0 to 9 (9 being &dA &d@ the most curved). The printing program actually uses a look-up &dA &d@ method to determine which slur to put in a particular position. &dA &d@ One of the characterizations of such a slur is its curvature &dA &d@ (this is part of the slur number). It only makes sense to change &dA &d@ this number if the new curvature is more than the "look up" &dA &d@ value. Since increasing the curvature will put the "cross part" &dA &d@ of the slur at a different height, a new curvature should only &dA &d@ be suggested in those cases where it is thought that the slur &dA &d@ will not be interfering with staff lines. One other thing: &dA &d@ we do not know the final length of the slur until print time. &dA &d@ It turns out that for slurs longer than a certain length &dA &d@ (I think about .6 inches) there are varients available which &dA &d@ are asymmetric (where the relative high point comes either &dA &d@ earlier or later in the slur). It is possible to "make a &dA &d@ suggestion" to the print program that an asymmetric slur &dA &d@ be used, if one is available. Adding 10 to the curvature &dA &d@ will suggest that the high point be delayed; and adding 20 &dA &d@ to the curvature will suggest that the high point come &dA &d@ earlier. Actually, as I remember it, slurs longer about 1.3 &dA &d@ inches only come in asymmetric versions, so for slurs that &dA &d@ appear to be really long (either many notes, or multiple &dA &d@ measures), it might actually be helpful to make a recommendation. &dA &d@ &dA &d@ S U M M A R Y O F I N F O R M A T I O N (TS32) &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &d@ &dA &d@ 1. A slur is processed when its &dGend&d@ is encountered. If there is more &dA &d@ than one slur on a &dGchord&d@, the shortest one is processed first. If &dA &d@ more than one of the same length is encountered, the one on the &dA &d@ lowest note is processed first. &dA &d@ &dA &d@ 2. The first time a slur is encountered on a chord, a new ts ROW &dA &d@ element is allocated and a pointer to it is placed in the SLUR_X &dA &d@ element for all notes in the chord. &dA &d@ &dA &d@ 3. The first six elements of a slur ROW element are reserved for the &dA &d@ following information: &dA &d@ &dA &d@ (1) current y-position above object for incoming slurs. &dA &d@ (2) " below " " " " . &dA &d@ (3) " above " " outgoing " . &dA &d@ (4) " below " " " " . &dA &d@ (5) y-position for staccato, legato, etc. &dA &d@ (6) 2 = marks above chord; 1 = marks below chord; 0 = don't use &dA &d@ &dA &d@ 4. Specific information about slurs coming to or leaving a chord is &dA &d@ stored in groups of three (up from two &dA05/06/03&d@) elements, starting &dA &d@ with element 7. The format is as follows: &dA &d@ &dA &d@ first element &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &d@ bit 27: start/end flag (0 = start, 1 = end) &dA &d@ bits 24-26: slur number - 1 (0 to 7) &dA &d@ bits 17-23: curvature information (end only) &dA &d@ bit 16: up/down flag (0 = tips up, 1 = tips down) (end only) &dA &d@ bits 0-15: x-offset + 1000 (always a positive number) &dA &d@ second element &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &d@ y position relative to the staff &dA &d@ third element (added &dA05/06/03&d@) &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &d@ integer equivalent of 4-byte print suggestion for slur &dA &d@ &dA &dA &d@ &dA ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@ &dA ³ &d@ &dA ³ &dA &d@ &dA ³ &d@ P R O C E S S I N G S L U R S &dA ³ &dA &d@ &dA ³ &d@ &dA ³ &dA &d@ &dA ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ &dA a14 = sct + 2 /* SLUR_X pointer loop for a1 = 1 to sct nodtype = ts(a1,TYPE) if nodtype > NOTE_OR_REST goto YYYY end a4 = ts(a1,SLUR_FLAG) & 0x00aa00aa if a4 > 0 /* a slur ends here &dA &dA &d@ Compile a list of all slurs that end on this note and on any &dA &d@ other (lower) notes in this chord. &dA a5 = a4 >> 1 a5 &= 0x00ff00ff /* a list of starts to look for ndata(1,1) = a5 ndata(1,2) = a1 pcnt = 1 perform get_topbottom (a1,c1,c2) loop for a2 = a1+1 to c2 a4 = ts(a2,SLUR_FLAG) & 0x00aa00aa if a4 > 0 /* a slur ends here a5 = a4 >> 1 a5 &= 0x00ff00ff /* a list of starts to look for ++pcnt ndata(pcnt,1) = a5 ndata(pcnt,2) = a2 end repeat a1 = c2 /* so that we don't look at these notes again &dA &dA &d@ examine /* &dA09/28/93&d@ &dA nsgroups = 0 c9 = pcnt /* moved here from +3 lines &dA09/28/93 loop for c7 = c1-1 to 1 step -1 if ts(c7,TYPE) <= NOTE_OR_REST a6 = ts(c7,SLUR_FLAG) & 0x00550055 /* starts on this note loop for c8 = 1 to pcnt a5 = ndata(c8,1) /* list of starts for this note of chord a2 = ndata(c8,2) /* index to this note of chord a7 = a6 & a5 /* a7 = matches if a7 > 0 &dA &d@ if a7 & 0x00100010 > 0 &dA &d@ This code a2 |= 0x00010000 /* this is a "force over" slur &dA &d@ must be else &dA &d@ changed if a7 & 0x00400040 > 0 &dA &d@ to below a2 |= 0x00020000 /* this is a "force under" slur &dA &d@ &dA10-09-93&d@ end &dA &d@ end c11 = a7 >> 8 c11 &= 0xff00 c11 += a7 & 0xff /* compact a7 into 16 bits a7 = not(a7) a5 &= a7 /* remove this slur from a5 ndata(c8,1) = a5 c10 = 0 /* slur number - 1 c6 = a2 loop while c11 > 0 if bit(0,c11) = 1 c4 = c10 & 0x03 /* slur number mod(4) c5 = 1 << (c4 * 2) c5 <<= 8 if c5 & ts(c7,SLUR_FLAG) > 0 /* this slur is forced c5 <<= 1 if c5 & ts(c7,SLUR_FLAG) = 0 c6 |= 0x00010000 /* this is a "force over" slur else c6 |= 0x00020000 /* this is a "force under" slur end end ++nsgroups sgroup(nsgroups,1) = c7 /* record index starting note sgroup(nsgroups,2) = c6 /* record index ending note (+ flags) sgroup(nsgroups,3) = c10 /* slur number - 1 end c11 >>= 2 ++c10 repeat if a5 = 0 --c9 if c9 = 0 /* no more slurs to look for c7 = 0 end end end repeat end repeat if nsgroups = 0 or c9 > 0 putc Can't find start to a slur examine stop end &dA &d@ &dA &d@ At this point, we have a list of slurs which end on this chord. &dA &d@ We need to decide what to do with them. We certainly can proceed &dA &d@ by looping though the group, but we should probably first learn &dA &d@ something about the chords we are dealing with. For example, &dA &d@ is the stem up or down? Where on the chords do the slurs attach? &dA &d@ Do the note heads (or chords) have staccato, legato or spiccato &dA &d@ marks on them? (Remember that the notes of a chord have been &dA &d@ re-ordered so that the top note comes first; i.e., the top note &dA &d@ head may not be at the note end of the stem.) The purpose of &dA &d@ all of this "research" is basically to answer the following &dA &d@ two questions: &dA &dA &d@ (1) should the slur be oriented with tips up or tips down, and &dA &dA &d@ (2) should the slur take its position from the note head or &dA &d@ from the end of the stem? &dA &dA &d@ I think I have found a system which will at least (1) give an answer &dA &d@ to every possible situation, and (2) give "right" answers for most &dA &d@ situations. Essentially, what I will use is "situation based" &dA &d@ programming, rather than "rule based" programming. I have described &dA &d@ all possible situations under two conditions: (1) the final note &dA &d@ has the multi-track flag = 0, and (2) the final note has the multi-track &dA &d@ flag > 0. These templates are laid out below &dA &dA &d@ I. Final note multi-track flag = 0 &dA &dA &d@ starting note ending note x-shift stem option overrides &dA &d@ stem position stem position tips 1st 2nd 1st 2nd code over under &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÂÄÄÄÄÂÄÄÄÄ &dA &d@ up single up single ³ up ³H H ³ no ³ F ³ l ³ F ³ &dA &d@ (multi-track = 0) up top of many ³down³ no ³s s ³ p ³ p ³ G ³ &dA &d@ up middle of many ³down³nr Y ³ no ³ m ³ p ³ H ³ &dA &d@ up bottom of many ³ up ³H H ³ no ³ F ³ p ³ F ³ &dA &d@ down single ³down³nr H ³s H (if flag)³ j ³ j ³ I ³ &dA &d@ down top of many ³down³ no ³s H ³ o ³ o ³ G ³ &dA &d@ down middle of many ³down³nr H ³ ³ i ³ i ³ O ³ &dA &d@ down bottom of many ³ up ³ no ³H s ³ O ³ o ³ O ³ &dA &d@ ³ ³ ³ ³ ³ ³ ³ &dA &d@ up single up single ³down³nr H ³s s (mid stf)³ l ³ l ³ F ³ &dA &d@ (multi-track > 0) up top of many ³down³ no ³s s ³ p ³ p ³ G ³ &dA &d@ up middle of many ³down³nr Y ³ no ³ m ³ p ³ H ³ &dA &d@ up bottom of many ³ up ³H H ³ no ³ F ³ p ³ F ³ &dA &d@ down single ³down³ no ³s H ³ o ³ j ³ I ³ &dA &d@ down top of many ³down³ no ³s H ³ o ³ o ³ G ³ &dA &d@ down middle of many ³down³nr H ³ ³ i ³ i ³ O ³ &dA &d@ down bottom of many ³ up ³ no ³H s ³ O ³ o ³ O ³ &dA &d@ ³ ³ ³ ³ ³ ³ ³ &dA &d@ up top of many up single ³down³ no ³s s ³ p ³ p ³ F ³ &dA &d@ (multi-track = 0) up top of many ³down³nr n ³s s (no oths)³ h ³ h ³ N ³ &dA &d@ (multi-track > 0) up middle of many ³down³ no ³s s ³ p ³ p ³ F ³ &dA &d@ up bottom of many ³ up ³H H ³ no ³ F ³ p ³ F ³ &dA &d@ down single ³down³ no ³s H ³ o ³ o ³ I ³ &dA &d@ down top of many ³down³nr H ³s H (no oths)³ k ³ k ³ N ³ &dA &d@ down middle of many ³down³ no ³s H ³ o ³ o ³ G ³ &dA &d@ down bottom of many ³down³nr H ³ no ³ i ³ i ³ G ³ &dA &d@ ³ ³ ³ ³ ³ ³ ³ &dA &d@ up middle of many up single ³down³Yr n ³ no ³ f ³ f ³ F ³ &dA &d@ (multi-track = 0) up top of many ³down³Yr n ³ no ³ f ³ f ³ F ³ &dA &d@ (multi-track > 0) up middle of many ³down³nr nl³ no ³ n ³ n ³ N ³ &dA &d@ up bottom of many ³ up ³H H ³ no ³ F ³ r ³ F ³ &dA &d@ down single ³down³Yr H ³ no ³ g ³ g ³ I ³ &dA &d@ down top of many ³down³Yr H ³ no ³ g ³ g ³ G ³ &dA &d@ down middle of many ³down³nr nl³ no ³ n ³ n ³ N ³ &dA &d@ down bottom of many ³ up ³H nl³ no ³ H ³ g ³ H ³ &dA &d@ ³ ³ ³ ³ ³ ³ ³ &dA &d@ up botton of many up single ³ up ³H H ³ no ³ F ³ f ³ F ³ &dA &d@ (multi-track = 0) up top of many ³down³Yr n ³ no ³ f ³ f ³ F ³ &dA &d@ (multi-track > 0) up middle of many ³ up ³H H ³ no ³ F ³ s ³ F ³ &dA &d@ up bottom of many ³ up ³H H ³ no ³ F ³ n ³ F ³ &dA &d@ down single ³ up ³H nl³H s (positio)³ I ³ g ³ I ³ &dA &d@ down top of many ³down³Yr H ³ no ³ g ³ g ³ G ³ &dA &d@ down middle of many ³ up ³H Yl³ ³ G ³ g ³ G ³ &dA &d@ down bottom of many ³ up ³H nl³H s (p n oth)³ J ³ n ³ J ³ &dA &d@ ³ ³ ³ ³ ³ ³ ³ &dA &d@ down single up single ³down³H n ³H s (positio)³ c ³ c ³ B ³ &dA &d@ (multi-track = 0) up top of many ³down³H n ³H s (positio)³ c ³ c ³ B ³ &dA &d@ up middle of many ³down³H Y ³ no ³ e ³ e ³ B ³ &dA &d@ up bottom of many ³ up ³n H ³s H (positio)³ B ³ e ³ B ³ &dA &d@ down single ³down³H H ³ no ³ d ³ d ³ E ³ &dA &d@ down top of many ³down³H H ³ no ³ d ³ d ³ C ³ &dA &d@ down middle of many ³down³H H ³ no ³ d ³ d ³ C ³ &dA &d@ down bottom of many ³ up ³ no ³s s ³ Q ³ d ³ Q ³ &dA &d@ ³ ³ ³ ³ ³ ³ ³ &dA &d@ down single up single ³ up ³n H ³s H (positio)³ B ³ c ³ B ³ &dA &d@ (multi-track > 0) up top of many ³down³H n ³ no ³ a ³ c ³ B ³ &dA &d@ up middle of many ³ up ³n H ³ no ³ A ³ e ³ B ³ &dA &d@ up bottom of many ³ up ³ no ³s H ³ P ³ e ³ B ³ &dA &d@ down single ³ up ³n nl³s s (mid stf)³ E ³ d ³ E ³ &dA &d@ down top of many ³down³H H ³ no ³ d ³ d ³ C ³ &dA &d@ down middle of many ³ up ³ no ³s s ³ Q ³ d ³ C ³ &dA &d@ down bottom of many ³ up ³ no ³s s ³ Q ³ d ³ Q ³ &dA &d@ ³ ³ ³ ³ ³ ³ ³ &dA &d@ down top of many up single ³down³H n ³H s (positio)³ c ³ c ³ K ³ &dA &d@ (multi-track = 0) up top of many ³down³H n ³H s (p n oth)³ b ³ b ³ C ³ &dA &d@ (multi-track > 0) up middle of many ³down³H Y ³ no ³ e ³ e ³ K ³ &dA &d@ up bottom of many ³down³H Y ³ no ³ e ³ e ³ K ³ &dA &d@ down single ³down³H H ³ no ³ d ³ d ³ Q ³ &dA &d@ down top of many ³down³H H ³ no ³ d ³ d ³ N ³ &dA &d@ down middle of many ³down³H H ³ no ³ d ³ d ³ L ³ &dA &d@ down bottom of many ³ up ³Y nl³ no ³ M ³ d ³ M ³ &dA &d@ ³ ³ ³ ³ ³ ³ ³ &dA &d@ down middle of many up single ³ up ³Y H ³ no ³ K ³ c ³ K ³ &dA &d@ (multi-track = 0) up top of many ³down³H n ³ no ³ a ³ a ³ K ³ &dA &d@ (multi-track > 0) up middle of many ³ up ³nr nl³ no ³ N ³ n ³ N ³ &dA &d@ up bottom of many ³ up ³Y H ³ no ³ K ³ a ³ K ³ &dA &d@ down single ³down³H H ³ no ³ d ³ d ³ M ³ &dA &d@ down top of many ³down³H H ³ no ³ d ³ d ³ L ³ &dA &d@ down middle of many ³ up ³nr nl³ no ³ N ³ n ³ N ³ &dA &d@ down bottom of many ³ up ³Y nl³ no ³ M ³ d ³ M ³ &dA &d@ ³ ³ ³ ³ ³ ³ ³ &dA &d@ down bottom of many up single ³ up ³n H ³s H (positio)³ B ³ c ³ B ³ &dA &d@ (multi-track = 0) up top of many ³down³H n ³ no ³ a ³ a ³ K ³ &dA &d@ (multi-track > 0) up middle of many ³ up ³n H ³ no ³ A ³ e ³ A ³ &dA &d@ up bottom of many ³ up ³n H ³ no ³ A ³ n ³ A ³ &dA &d@ down single ³ up ³n nl³s s (mid stf)³ E ³ d ³ E ³ &dA &d@ down top of many ³ up ³n Yl³ no ³ C ³ d ³ C ³ &dA &d@ down middle of many ³ up ³n Yl³ no ³ C ³ d ³ C ³ &dA &d@ down bottom of many ³ up ³n nl³s s (no oths)³ D ³ n ³ D ³ &dA &dA &dA &d@ II. Final note multi-track flag > 0 &dA &dA &d@ starting note ending note x-shift stem option (same) &dA &d@ stem position stem position tips 1st 2nd 1st 2nd code (overrides) &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄ &dA &d@ up single up single ³down³nr H ³s s (mid stf)³ l ³ &dA &d@ (multi-track = 0) up top of many ³down³ no ³s s ³ p ³ &dA &d@ up middle of many ³down³nr Y ³ no ³ m ³ &dA &d@ up bottom of many ³ up ³H H ³ no ³ F ³ &dA &d@ down single ³ up ³H nl³H s (positio)³ I ³ &dA &d@ down top of many ³ up ³H Yl³ no ³ G ³ &dA &d@ down middle of many ³ up ³H Yl³ no ³ G ³ &dA &d@ down bottom of many ³ up ³ no ³H s ³ O ³ &dA &d@ ³ ³ ³ ³ ³ &dA &d@ up single up single ³down³nr H ³s s (mid stf)³ l ³ &dA &d@ (multi-track > 0) up top of many ³down³ no ³s s ³ p ³ &dA &d@ up middle of many ³down³nr Y ³ no ³ m ³ &dA &d@ up bottom of many ³ up ³H H ³ no ³ F ³ &dA &d@ down single ³ up ³ no ³H s ³ O ³ &dA &d@ down top of many ³ up ³H Yl³ no ³ G ³ &dA &d@ down middle of many ³ up ³ no ³H s ³ O ³ &dA &d@ down bottom of many ³ up ³ no ³H s ³ O ³ &dA &d@ ³ ³ ³ ³ ³ &dA &d@ up top of many up single ³down³ no ³s s ³ p ³ &dA &d@ (multi-track = 0) up top of many ³down³nr n ³s s (no oths)³ h ³ &dA &d@ (multi-track > 0) up middle of many ³down³ no ³s s ³ p ³ &dA &d@ up bottom of many ³ up ³H H ³ no ³ F ³ &dA &d@ down single ³down³ no ³s H ³ o ³ &dA &d@ down top of many ³down³nr H ³ no ³ i ³ &dA &d@ down middle of many ³ up ³H Yl³ no ³ G ³ &dA &d@ down bottom of many ³ up ³H nl³ no ³ H ³ &dA &d@ ³ ³ ³ ³ ³ &dA &d@ up middle of many up single ³down³Yr n ³ no ³ f ³ &dA &d@ (multi-track = 0) up top of many ³down³Yr n ³ no ³ f ³ &dA &d@ (multi-track > 0) up middle of many ³down³nr nl³ no ³ n ³ &dA &d@ up bottom of many ³ up ³H H ³ no ³ F ³ &dA &d@ down single ³down³Yr H ³ no ³ g ³ &dA &d@ down top of many ³down³Yr H ³ no ³ g ³ &dA &d@ down middle of many ³ up ³nr nl³ no ³ N ³ &dA &d@ down bottom of many ³ up ³H nl³ no ³ H ³ &dA &d@ ³ ³ ³ ³ ³ &dA &d@ up botton of many up single ³ up ³H H ³ no ³ F ³ &dA &d@ (multi-track = 0) up top of many ³down³Yr n ³ no ³ f ³ &dA &d@ (multi-track > 0) up middle of many ³ up ³H H ³ no ³ F ³ &dA &d@ up bottom of many ³ up ³H H ³ no ³ F ³ &dA &d@ down single ³ up ³H nl³H s (positio)³ I ³ &dA &d@ down top of many ³down³Yr H ³ no ³ g ³ &dA &d@ down middle of many ³ up ³H Yl³ no ³ G ³ &dA &d@ down bottom of many ³ up ³H nl³H s (p n oth)³ J ³ &dA &d@ ³ ³ ³ ³ ³ &dA &d@ down single up single ³down³H n ³H s (positio)³ c ³ &dA &d@ (multi-track = 0) up top of many ³down³H n ³H s (positio)³ c ³ &dA &d@ up middle of many ³down³H Y ³ no ³ e ³ &dA &d@ up bottom of many ³ up ³n H ³s H (positio)³ B ³ &dA &d@ down single ³ up ³n nl³s s (mid stf)³ E ³ &dA &d@ down top of many ³ up ³n Yl³ no ³ C ³ &dA &d@ down middle of many ³ up ³ no ³s s ³ Q ³ &dA &d@ down bottom of many ³ up ³ no ³s s ³ Q ³ &dA &d@ ³ ³ ³ ³ ³ &dA &d@ down single up single ³down³H n ³H s (positin)³ c ³ &dA &d@ (multi-track > 0) up top of many ³down³H H ³ no ³ d ³ &dA &d@ up middle of many ³down³H Y ³ no ³ e ³ &dA &d@ up bottom of many ³ up ³n H ³ no ³ A ³ &dA &d@ down single ³ up ³n nl³s s (mid stf)³ E ³ &dA &d@ down top of many ³ up ³n Yl³ no ³ C ³ &dA &d@ down middle of many ³ up ³ no ³s s ³ Q ³ &dA &d@ down bottom of many ³ up ³ no ³s s ³ Q ³ &dA &d@ ³ ³ ³ ³ ³ &dA &d@ down top of many up single ³down³H n ³H s (positio)³ c ³ &dA &d@ (multi-track = 0) up top of many ³down³H n ³H s (p n oth)³ b ³ &dA &d@ (multi-track > 0) up middle of many ³down³H Y ³ no ³ e ³ &dA &d@ up bottom of many ³down³H Y ³ no ³ e ³ &dA &d@ down single ³down³H H ³ no ³ d ³ &dA &d@ down top of many ³down³H H ³ no ³ d ³ &dA &d@ down middle of many ³ up ³Y Yl³ no ³ L ³ &dA &d@ down bottom of many ³ up ³Y nl³ no ³ M ³ &dA &d@ ³ ³ ³ ³ ³ &dA &d@ down middle of many up single ³ up ³Y H ³ no ³ K ³ &dA &d@ (multi-track = 0) up top of many ³down³H n ³ no ³ a ³ &dA &d@ (multi-track > 0) up middle of many ³ up ³nr nl³ no ³ N ³ &dA &d@ up bottom of many ³ up ³Y H ³ no ³ K ³ &dA &d@ down single ³ up ³Y nl³ no ³ M ³ &dA &d@ down top of many ³down³H H ³ no ³ d ³ &dA &d@ down middle of many ³ up ³nr nl³ no ³ N ³ &dA &d@ down bottom of many ³ up ³Y nl³ no ³ M ³ &dA &d@ ³ ³ ³ ³ ³ &dA &d@ down bottom of many up single ³ up ³n H ³ no ³ A ³ &dA &d@ (multi-track = 0) up top of many ³down³H n ³ no ³ a ³ &dA &d@ (multi-track > 0) up middle of many ³ up ³n H ³ no ³ A ³ &dA &d@ up bottom of many ³ up ³n H ³ no ³ A ³ &dA &d@ down single ³ up ³n nl³s s (mid stf)³ E ³ &dA &d@ down top of many ³ up ³n Yl³ no ³ C ³ &dA &d@ down middle of many ³ up ³n Yl³ no ³ C ³ &dA &d@ down bottom of many ³ up ³n nl³s s (p n oth)³ D ³ &dA &dA &dA &d@ Meaning of codes &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &dA &d@ x-shift stem option &dA &d@ code tips 1st 2nd 1st 2nd &dA &d@ ÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄ &dA &d@ A up n H no &dA &d@ B up n H s H (position) &dA &d@ C up n Yl no &dA &d@ D up n nl s s (no others) &dA &d@ E up n nl s s (mid stuff) &dA &d@ F up H H no &dA &d@ G up H Yl no &dA &d@ H up H nl no &dA &d@ I up H nl H s (position) &dA &d@ J up H nl H s (pos no oth) &dA &d@ K up Y H no &dA &d@ L up Y Yl no &dA &d@ M up Y nl no &dA &d@ N up nr nl no &dA &d@ O up no H s &dA &d@ P up no s H &dA &d@ Q up no s s &dA &dA &d@ a down H n no &dA &d@ b down H n H s (pos no oth) &dA &d@ c down H n H s (position) &dA &d@ d down H H no &dA &d@ e down H Y no &dA &d@ f down Yr n no &dA &d@ g down Yr H no &dA &d@ h down nr n s s (no oths) &dA &d@ i down nr H no &dA &d@ j down nr H s H (if flag) &dA &d@ k down nr H s H (no oths) &dA &d@ l down nr H s s (mid stuff) &dA &d@ m down nr Y no &dA &d@ n down nr nl no &dA &d@ o down no s H &dA &d@ p down no s s &dA &dA &dA &d@ Extra codes &dA &d@ Meaning of codes &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &dA &d@ x-shift 2nd option &dA &d@ code tips 1st 2nd 1st 2nd &dA &d@ ÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄ &dA &d@ R up n nl no &dA &dA &dA &d@ q down nr n no &dA &d@ r down Yr Yl no &dA &d@ s down Yr Y no &dA &d@ t down no H s &dA &dA &d@ This information is combined into a 160 byte string. By correctly &dA &d@ diagnosing the situation, we can therefore determine what actions &dA &d@ should be taken. For both and starting note and the ending note &dA &d@ we need to determine: &dA &dA &d@ (1) multi-track flag? (zero or non-zero) &dA &d@ (2) stem direction? (up or down) &dA &d@ (3) note catagory? (single, top of many, &dA &d@ middle of many, bottom of many) &dA &d@ &dA &d@ &dA ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» &dA &d@ &dA º This is the loop which processes slurs º &dA &d@ &dA ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ loop for a4 = 1 to nsgroups /* loop through all slurs ending on this chord &dA &dA &d@ examine &dA a6 = sgroup(a4,1) a7 = sgroup(a4,2) c7 = a7 >> 16 /* get forced slur flag a7 &= 0xffff /* clean up index &dA &dA &d@ 1a. Get information on starting note &dA &dA &d@ c1 = multi-track flag for this note &dA &d@ c2 = stem direction for this note &dA &d@ c3 = note catagory for this note: 0 = single &dA &d@ 1 = top of many &dA &d@ 2 = middle of many &dA &d@ 3 = bottom of many &dA &d@ c7 = forced slur flag &dA c1 = ts(a6,MULTI_TRACK) >> 2 c2 = bit(1,ts(a6,STEM_FLAGS)) c3 = bit(2,ts(a6,STEM_FLAGS)) if c3 = 1 and bit(3,ts(a6,STEM_FLAGS)) = 1 ++c3 if ts(a6+1,TYPE) <> ts(a6,TYPE) ++c3 end end &dA &dA &d@ 1b. Get information on ending note &dA &dA &d@ c4 = multi-track flag for this note &dA &d@ c5 = stem direction for this note &dA &d@ c6 = note catagory for this note: 0 = single &dA &d@ 1 = top of many &dA &d@ 2 = middle of many &dA &d@ 3 = bottom of many &dA c4 = ts(a7,MULTI_TRACK) >> 2 c5 = bit(1,ts(a7,STEM_FLAGS)) c6 = bit(2,ts(a7,STEM_FLAGS)) if c6 = 1 and bit(3,ts(a7,STEM_FLAGS)) = 1 ++c6 if ts(a7+1,TYPE) <> ts(a7,TYPE) ++c6 end end &dA &dA &d@ 1c. Modify multi-track flags under certain conditions &dA if c1 > 0 and c4 > 0 /* &dACHANGED&d@ from = 3 on 9-10-93 if ts(a6,PASSNUM) = ts(a7,PASSNUM) and c2 = c5 if ts(a6,PASSNUM) = 1 and c2 = DOWN c1 = 0 c4 = 0 end if ts(a6,PASSNUM) = 2 and c2 = UP c1 = 0 c4 = 0 end end end &dA &dA &d@ 2. Derive "situation" letter from c1 - c7. &dA &d@ c8 = c3 if c8 <> 0 or c1 <> 0 ++c8 end if c2 = DOWN c8 += 5 end if c4 > 0 and c7 = 0 c8 += 10 end c8 *= 8 /* c8 ranges by 8's from 0 to 19*8 c8 += c6 if c5 = DOWN c8 += 4 end ++c8 /* c8 ranges from 1 to 160 (1 to 80 for forced slurs) if c7 = 0 slurlet = slurstr{c8} if c1 = 0 and c4 = 0 if chr(ts(a6,TYPE)) in [GR_NOTE,XGR_NOTE] if chr(ts(a7,TYPE)) in [NOTE,XNOTE] slurlet = slurunder{c8} /* force under end end end else if c7 = 1 slurlet = slurover{c8} /* force over else slurlet = slurunder{c8} /* force under end end &dA &dA &d@ 2a. Attempt to account for interfering beams &dA if ts(a6,TYPE) < GR_NOTE or ts(a7,TYPE) > XNOTE if "abcIJijAB" con slurlet if mpt < 6 c12 = ts(a7,BEAM_FLAG) if c12 = CONT_BEAM or c12 = END_BEAM if mpt < 4 /* down-up; tips down; modify end slurlet = "t" else /* up-down; tips up; modify end slurlet = "O" end end else c12 = ts(a6,BEAM_FLAG) if c12 = CONT_BEAM or c12 = START_BEAM if mpt < 8 /* down-up; tips up; modify beginning slurlet = "o" else /* up-down; tips down; modify beginning slurlet = "P" end end end end end &dA &dA &d@ 3. Decompose "compound" situations into separate "simple" situations &dA &dA &d@ (1) if code in [D,J,b,h,k], are there other slurs between the chords? &dA &d@ If yes, then these codes become [R,H,a,q,i] &dA &dA &d@ (2) if code = I or J, is ending note vpar(6) higher than starting note? &dA &d@ If yes, then these codes both become O, otherwise they become H &dA &dA &d@ (3) if code in [B,b,c], is ending note vpar(6) lower than starting note? &dA &d@ If yes, then codes become [P,t,t]; otherwise they become [A,a,a] &dA &dA &d@ (4) if code = j, does starting note have a flag? If yes, it becomes &dA &d@ an "o". Otherwise it is an "i" &dA &dA &d@ (5) if code = l or E, is there anything between the notes (chords) &dA &d@ If yes, they become p and Q; otherwise they are i and R. &dA if "DJbhk" con slurlet c12 = mpt perform get_topbottom (a6,c1,c2) perform get_topbottom (a7,c4,c5) if c2 > c1 and c5 > c4 /* both chords loop for c3 = c1 to c2 /* first chord if c3 <> a6 /* look for other slurs c8 = ts(c3,SLUR_FLAG) & 0x00550055 if c8 > 0 /* slur(s) start(s) c8 <<= 1 /* set of end flags for these slurs loop for c9 = c2 + 1 to c5 c10 = ts(c9,TYPE) if chr(c10) in [NOTE,XNOTE,CUE_NOTE,XCUE_NOTE,GR_NOTE,XGR_NOTE] c11 = ts(c9,SLUR_FLAG) & c8 if c11 > 0 /* slur ends if c9 >= c4 and c9 <> a7 /* condition met! slurlet = "RHaqi"{c12} goto SSEND1 else c11 = not(c11) c8 &= c11 /* turn off this possibility end end end repeat end /* now look for ties if bit(0,ts(c3,SUPER_FLAG)) = 1 loop for c9 = c4 to c5 if c9 <> a7 c10 = ts(c9,BACKTIE) if c10 = c3 /* condition met! (tricky code) slurlet = "RHaqi"{c12} goto SSEND1 end end repeat end end repeat end slurlet = "QJbpo"{c12} end SSEND1: c7 = 0 /* option flag if "IJBbcjlE" con slurlet c8 = ts(a6,BEAM_FLAG) c9 = ts(a7,BEAM_FLAG) goto SS(mpt) SS(1): /* "IJ" if ts(a6,STAFFLOC) - ts(a7,STAFFLOC) > vpar(7) c7 = 1 end if ts(a6,TYPE) < GR_NOTE or ts(a7,TYPE) > XNOTE if c9 = CONT_BEAM or c9 = END_BEAM c7 = 1 end end goto SSEND SS(3): /* "Bbc" if ts(a7,STAFFLOC) - ts(a6,STAFFLOC) > vpar(7) if slurlet = "B" c7 = 1 else /* (New &dA05/17/03&d@) if ts(a7,SUBFLAG_2) & 0x3c > 0 or ts(a7,ED_SUBFLAG_2) & 0x3c > 0 if ts(a7,STAFFLOC) - ts(a6,STAFFLOC) > vpar(9) c7 = 1 end else c7 = 1 end end end if mpt = 3 if c8 = START_BEAM or c8 = CONT_BEAM c7 = 1 end else if c9 = CONT_BEAM or c9 = END_BEAM c7 = 1 end end goto SSEND SS(6): /* "j" if c8 = NO_BEAM if ts(a6,NTYPE) < QUARTER c7 = 1 end else if c8 = START_BEAM or c8 = CONT_BEAM c7 = 1 end end goto SSEND SS(7): /* "lE" beams on both notes of slur? if c8 > NO_BEAM and c9 > NO_BEAM slurlet = " pQ"{mpt} end goto SSEND2 &dA &dA &d@ At this point in the code, a1,a4,a6,a7 and a14 should not be changed &dA SSEND: &dA &dA &d@ Break 'm up &dA &d@ if c7 = 1 slurlet = "OOPttopQ"{mpt} else slurlet = "HHAaaiiR"{mpt} end end &dA &dA &d@ At this point, you have determined the "situation" letter for the &dA &d@ between "a6" and "a7" (with the exception of the cases "l" and "E", &dA &d@ which depend on the material between the slurs). You now need to &dA &d@ compile a profile of whatever material might be between the slurs &dA &d@ on this staff. (organized by advancing division) &dA SSEND2: c12 = 0 if "lE" con slurlet /* we do cases "l" and "E" here c12 = mpt c3 = ts(a6,STAFFLOC) c4 = ts(a7,STAFFLOC) if c3 < c4 c3 = c4 c4 = ts(a6,STAFFLOC) end if mpt = 1 c4 -= vpar(4) else c3 += vpar(4) end end c9 = 0 c7 = 0 c8 = ts(a7,STAFF_NUM) c15 = ts(a6,DIV) c10 = a7 loop while chr(ts(c10,TYPE)) in [XNOTE,XCUE_NOTE,XGR_NOTE] --c10 repeat --c10 /* c10 will not point to the last chord loop for c1 = a6+1 to c10 if ts(c1,STAFF_NUM) = c8 nodtype = ts(c1,TYPE) if chr(nodtype) in [NOTE,CUE_NOTE,GR_NOTE] if bit(1,ts(c1,STEM_FLAGS)) = UP c5 = ts(c1,VIRT_STEM) c6 = ts(c1,VIRT_NOTE) else c5 = ts(c1,VIRT_NOTE) c6 = ts(c1,VIRT_STEM) end else if chr(nodtype) in [REST,CUE_REST] c5 = ts(c1,STAFFLOC) - vpar(3) c6 = ts(c1,STAFFLOC) + vpar(3) else if nodtype = CLEF_CHG c5 = 0 c6 = vpar(8) else &dA &dA &d@ &dA11/26/06&d@ Fixing a minor bug in the placement of slurs &dA &dK &d@ c5 = 10000 if nodtype < METER_CHG c5 = 1000 c6 = -1000 else c5 = 10000 end &dA &d@ End of &dA11/26/06&d@ change end end end if c5 < 10000 if c12 > 0 if c3 > c5 and c4 < c6 c7 = 1 end end if ts(c1,DIV) <> c15 ++c9 /* Case 1: profile(c9,1) = c5 - vpar(2) /* new division profile(c9,2) = c6 + vpar(2) /* else if c9 > 0 c5 -= vpar(2) /* Case 2: c6 += vpar(2) /* more notes if c5 < profile(c9,1) /* on same profile(c9,1) = c5 /* division end /* if c6 > profile(c9,2) profile(c9,2) = c6 end end end end end if ts(c1,TYPE) = BAR_LINE c15 = 0 else c15 = ts(c1,DIV) end repeat if c12 > 0 if c7 = 1 slurlet = "pQ"{c12} else slurlet = "iR"{c12} end end &dA &dA &d@ More modifications to slurlet. If there are staccatos, legatos, &dA &d@ or spiccatos connected to the note head, then under certain &dA &d@ conditions the slur must start at the stem of the note. &dA /* New code rewritten &dA05/17/03&d@ c16 = ts(a6,SUBFLAG_2) | ts(a6,ED_SUBFLAG_2) /* combination subflag_2 at a6 c16 &= 0x3c /* staccato, legato, etc. c17 = ts(a7,SUBFLAG_2) | ts(a7,ED_SUBFLAG_2) /* combination subflag_2 at a7 c17 &= 0x3c /* staccato, legato, etc. if slurlet < chr(96) /* tips up if c16 > 0 if bit(1,ts(a6,STEM_FLAGS)) = DOWN if "ACRKLM" con slurlet slurlet = "PQQPQQ"{mpt} end end end if ts(a6,TYPE) < GR_NOTE and c17 > 0 if bit(1,ts(a7,STEM_FLAGS)) = DOWN if "CGHLMR" con slurlet slurlet = "QOOQQQ"{mpt} end end end else /* tips down if c16 > 0 if bit(1,ts(a6,STEM_FLAGS)) = UP if "fgimqrs" con slurlet slurlet = "poopppp"{mpt} end end end if c17 > 0 if bit(1,ts(a7,STEM_FLAGS)) = UP if slurlet = "o" slurlet = "p" end end end end /* End of &dA05/17/03&d@ rewrite &dA &dA &d@ Updated list of letter codes &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &dA &d@ tips up tips down explanation &dA &d@ code 1st 2nd code 1st 2nd letter meaning &dA &d@ ÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &d@ A n H a H n n note &dA &d@ C n Yl d H H nr start right of note &dA &d@ F H H e H Y nl end left of note &dA &d@ G H Yl f Yr n H head of chord &dA &d@ H H nl g Yr H Y position of object &dA &d@ K Y H i nr H (opposite of H) &dA &d@ L Y Yl m nr Y Yr start right of object &dA &d@ M Y nl n nr nl Yl end left of object &dA &d@ N nr nl o s H s stem &dA &d@ O H s p s s &dA &d@ P s H q nr n &dA &d@ Q s s r Yr Yl &dA &d@ R n nl s Yr Y &dA &d@ t H s &dA &dA &dA &d@ At this point, we need to check to see of this is the first time &dA &d@ either chord has been touched by a slur. When creating the &dA &d@ slur element ROW, we need to write in the first four elements: &dA &dA &d@ (1) current y-position above object for incoming slurs. &dA &d@ (2) " below " " " " . &dA &d@ (3) " above " " outgoing " . &dA &d@ (4) " below " " " " . &dA perform get_topbottom (a6,c1,c2) if ts(a6,SLUR_X) = 0 ++a14 loop for c8 = c1 to c2 ts(c8,SLUR_X) = a14 repeat if bit(1,ts(a6,STEM_FLAGS)) = UP ts(a14,1) = ts(a6,VIRT_STEM) ts(a14,2) = ts(a6,VIRT_NOTE) ts(a14,3) = ts(a6,VIRT_STEM) ts(a14,4) = ts(a6,VIRT_NOTE) else ts(a14,1) = ts(a6,VIRT_NOTE) ts(a14,2) = ts(a6,VIRT_STEM) ts(a14,3) = ts(a6,VIRT_NOTE) ts(a14,4) = ts(a6,VIRT_STEM) end end if bit(1,ts(a6,STEM_FLAGS)) = UP c3 = c2 c2 = c1 c1 = c3 end perform get_topbottom (a7,c3,c4) if ts(a7,SLUR_X) = 0 ++a14 loop for c8 = c3 to c4 ts(c8,SLUR_X) = a14 repeat if bit(1,ts(a7,STEM_FLAGS)) = UP ts(a14,1) = ts(a7,VIRT_STEM) ts(a14,2) = ts(a7,VIRT_NOTE) ts(a14,3) = ts(a7,VIRT_STEM) ts(a14,4) = ts(a7,VIRT_NOTE) else ts(a14,1) = ts(a7,VIRT_NOTE) ts(a14,2) = ts(a7,VIRT_STEM) ts(a14,3) = ts(a7,VIRT_NOTE) ts(a14,4) = ts(a7,VIRT_STEM) end end if bit(1,ts(a7,STEM_FLAGS)) = UP c5 = c4 c4 = c3 c3 = c5 end &dA &dA &d@ a6 = note we are looking at in first chord &dA &d@ c1 = head of first chord &dA &d@ c2 = last note (Y) of first chord &dA &dA &d@ a7 = note we are looking at in second chord &dA &d@ c3 = head of second chord &dA &d@ c4 = last note (Y) of second chord &dA &dA &d@ If this slur starts or ends on an element which has either (1) a &dA &d@ staccato dot and/or a legato line, or (2) a spiccato indication &dA &d@ associated with it, then we need to check to see if this is the &dA &d@ first time the element in question has been encountered, i.e., &dA &d@ element (5) of the slur element ROW is zero. If so, this parameter &dA &d@ needs to be adjusted to make space for the indication. This will &dA &d@ also shift the position of the slur. &dA &dA &dA &d@ (1) starting &dA c5 = ts(a6,SUBFLAG_2) | ts(a6,ED_SUBFLAG_2) /* New &dA05/17/03&d@ /* At the moment, I am treating /* editorial marks the same way /* as regular. In fact, the /* addition of square brackets /* may require additional /* vertical space c14 = ts(a6,SLUR_X) /* index to slur element ROW temp = "FGHOadet" /* note (changed at bottom of loop) temp2 = "PQop" /* stem (changed at bottom of loop) loop for c15 = 2 to 0 step -2 /* cases: 2 = start; 0 = end if c5 & 0x3c > 0 if ts(c14,5) = 0 if temp con slurlet /* if slur starts (ends) on a note &dA &d@ &dA &d@ We need to write elements (5) and (6) and to modify elements &dA &d@ (1) and (3), or elements (2) and (4). &dA &d@ if mpt < 5 /* this works for both cases stem = UP t3 = 1 y = ts(c14,c15+2) else stem = DOWN t3 = -1 y = ts(c14,c15+1) end if c5 & 0x38 > 0 /* staccato or legato t2 = notesize y += t2 * t3 /* check for interference t4 = 1 if stem = DOWN if y >= 0 t1 = y / notesize t4 = rem else y = 0 - notesize / 4 + y end else if y <= vpar(8) t1 = y / notesize t4 = rem else y = notesize / 4 + y end end /* adjust for interference with staff if t4 = 0 /* interference &dK &d@ t2 += vpar(1) c16 = t2 + vpar20 / vpar(2) if rem <> 0 ++t2 end t2 += vpar(1) &dK &d@ y = vpar(1) * t3 + y c16 = t3 + 20 * vpar(2) / 2 - vpar20 y += c16 end c10 = t2 if c5 & 0x10 > 0 /* line over dot y = notesize * t3 + y c10 += notesize end /* write elements ts(c14,5) = y if stem = UP ts(c14,2) += c10 ts(c14,4) += c10 ts(c14,6) = BELOW else ts(c14,1) -= c10 ts(c14,3) -= c10 ts(c14,6) = ABOVE end end if c5 & 0x04 > 0 /* spiccato if stem = DOWN if y > vpar(1) y = vpar(1) end else if y < vpar(7) y = vpar(7) end end y = 5 * notesize / 4 * t3 + y if stem = UP y += vpar(50) end /* write elements ts(c14,5) = y if stem = UP ts(c14,2) = y ts(c14,4) = y ts(c14,6) = BELOW else ts(c14,1) = y - vpar(50) ts(c14,3) = y - vpar(50) ts(c14,6) = ABOVE end end else if temp2 con slurlet /* if slur starts (ends) on the stem &dA &d@ &dA &d@ We need to write element (5) and (6) and to modify elements &dA &d@ (1) and (3), or elements (2) and (4). &dA &d@ if mpt > 2 /* works in both cases stem = UP t3 = -1 y = ts(c14,c15+1) else stem = DOWN t3 = 1 y = ts(c14,c15+2) end if c5 & 0x38 > 0 /* staccato or legato t2 = vpar(1) &dK &d@ y += t2 * t3 &dK &d@ (y = vpar(1) * t3 + y) c16 = t3 + 20 * vpar(2) / 2 - vpar20 y += c16 /* check for interference t4 = 1 if stem = UP if y >= 0 t1 = y / notesize t4 = rem else y = 0 - notesize / 4 + y end else if y <= vpar(8) t1 = y / notesize t4 = rem else y = notesize / 4 + y end end /* adjust for interference with staff if t4 = 0 /* interference &dK &d@ t2 += vpar(1) c16 = t2 + vpar20 / vpar(2) if rem <> 0 ++t2 end t2 += vpar(1) &dK &d@ y = vpar(1) * t3 + y c16 = t3 + 20 * vpar(2) / 2 - vpar20 y += c16 end c10 = t2 if c5 & 0x10 > 0 /* line over dot y = notesize * t3 + y c10 += notesize end /* write elements ts(c14,5) = y if stem = DOWN ts(c14,2) += c10 ts(c14,4) += c10 ts(c14,6) = ABOVE else ts(c14,1) -= c10 ts(c14,3) -= c10 ts(c14,6) = BELOW end end if c5 & 0x04 > 0 /* spiccato if stem = DOWN if y < vpar(8) y = vpar(8) end else if y > 0 y = 0 end end &dK &d@ y = vpar(1) * t3 + y c16 = t3 + 20 * vpar(2) / 2 - vpar20 y += c16 if stem = DOWN y += vpar(50) end /* write elements ts(c14,5) = y if stem = DOWN ts(c14,2) = y ts(c14,4) = y ts(c14,6) = ABOVE else ts(c14,1) = y - vpar(50) ts(c14,3) = y - vpar(50) ts(c14,6) = BELOW end end end end end end &dA &dA &d@ (2) ending &dA c5 = ts(a7,SUBFLAG_2) | ts(a7,ED_SUBFLAG_2) /* New &dA05/17/03&d@; see above. c14 = ts(a7,SLUR_X) /* index to slur element ROW temp = "AFKPdgio" temp2 = "OQpt" repeat &dA &dA &d@ Now you can affix the position of the slur, and store the results &dA &d@ in the appropriate slur element ROWS. Also, the values of elements &dA &d@ (1) (2) (3) or (4) can be updated. &dA &dA &d@ T H E P L A N &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &dA &d@ 1. Using slurlet and elements (1) to (4), determine tentative start-y &dA &d@ and end-y values for slur. Determine orientation (tips up/down) &dA &dA &d@ 2. If c9 = 0, no adjustments are necessary; proceed with placing slur. &dA &dA &d@ 3. Using curve data, convert actual interior y-values to relative &dA &d@ interior y-values. If all interior y-values fall below (above) the &dA &d@ straight line connecting the end points, proceed with placing slur. &dA &dA &d@ 4. Determine interior point with maximum deviation, and raise (lower) &dA &d@ the slur end-point on that side to the next multiple of vpar(1). &dA &d@ If there is more than one interior point at the maximum, or if the &dA &d@ interior point with the maximum is in the center of the slur, &dA &d@ raise (lower) both slur end-points to the next multiple of vpar(1). &dA &dA &d@ 5. If all interior y-values now fall below (above) straight line &dA &d@ connecting the end points, proceed with placing slur. &dA &dA &d@ 6. Determine interior point(s) with maximum deviation. If this point &dA &d@ (all of these points) fall with the 25%-75% region of the slur, &dA &d@ increase the curvature one notch, and goto (3); otherwise goto (4). &dA &dA &d@ To execute this plan, we will need to set up some temporary variables. &dA &dA &d@ y1 = starting point of slur &dA &d@ y2 = ending point of slur &dA &d@ c5 = counting index for interior points &dA &d@ c6 = index for maximum on left &dA &d@ c7 = index for maximum on right &dA &d@ c9 = number of interior points (don't change this) &dA &dA &d@ I think the easiest way to handle the up/down situation is to convert &dA &d@ all down values to 1000 * vpar(1) - down, and treat this as part of the &dA &d@ "up" case. Initial data includes y1, y2 and the profile data. When we &dA &d@ are done, we simply perform the same tranformation to get the final &dA &d@ y1 and y2 values. &dA &dA &dA &dA &d@ New feature &dA05/01/08&d@. If slur_adjust flag is non-zero, then this &dA &d@ should turn off all automatic post adjustment of slur posiiton. I &dA &d@ think we can do this by setting c9 = 0, which essentially turns off &dA &d@ the profile. &dA if slur_adjust <> 0 c9 = 0 end &dA &dA &dA &d@ A C T I O N &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &dA &d@ 1. Using slurlet and elements (1) to (4), determine tentative start-y &dA &d@ and end-y values for slur. Determine orientation (tips up/down) &dA if "ACNRimnq" con slurlet /* slur starts on note y1 = ts(a6,STAFFLOC) else if "KLMfgrs" con slurlet /* slur starts on Y y1 = ts(a6,OBY) else c13 = 3 c14 = ts(a6,SLUR_X) c15 = bit(1,ts(a6,STEM_FLAGS)) if "FGHOadet" con slurlet /* slur starts on H if c15 = UP ++c13 end else if c15 = DOWN ++c13 end end y1 = ts(c14,c13) end end if "HMNRafnq" con slurlet /* slur ends on note y2 = ts(a7,STAFFLOC) else if "CGLemrs" con slurlet /* slur ends on Y y2 = ts(a7,OBY) else c13 = 1 c14 = ts(a7,SLUR_X) c15 = bit(1,ts(a7,STEM_FLAGS)) if "AFKPdgio" con slurlet /* slur ends on H if c15 = UP ++c13 end else if c15 = DOWN ++c13 end end y2 = ts(c14,c13) end end &dA &dA &d@ 2. If c9 = 0, no adjustments are necessary; proceed with placing slur. &dA if c9 = 0 curve = 1 goto PLACE_SLUR end &dK &d@ c10 = 1000 * vpar(1) c10 = 500 * vpar(2) if slurlet < chr(96) /* tips up y1 = c10 - y1 y2 = c10 - y2 loop for c13 = 1 to c9 profile(c13,1) = c10 - profile(c13,2) /* first cut repeat else y1 += c10 y2 += c10 loop for c13 = 1 to c9 profile(c13,1) += c10 repeat end &dA &dA &d@ 3. Using curve data, convert actual interior y-values to relative &dA &d@ interior y-values. If all interior y-values fall below (above) the &dA &d@ straight line connecting the end points, proceed with placing slur. &dA &d@ (see beginning of program for construction of curvedata). &dA t1 = 0 t2 = 0 curve = 1 sflag = 1 &dK &d@ if abs(ts(a6,STAFFLOC) - ts(a7,STAFFLOC)) <= vpar(1) if abs(ts(a6,STAFFLOC) - ts(a7,STAFFLOC)) <= vpar(1) + 1 if bit(1,ts(a6,STEM_FLAGS)) = bit(1,ts(a7,STEM_FLAGS)) sflag = 0 end end NEW_CURVE: if c9 < 9 loop for c10 = 1 to c9 profile(c10,2) = profile(c10,1) + curvedata(c9,curve,c10) repeat else loop for c10 = 1 to 4 profile(c10,2) = profile(c10,1) + curvedata(8,curve,c10) repeat loop for c10 = 5 to c9 - 4 profile(c10,2) = profile(c10,1) + curvedata(8,curve,4) - 1 repeat c11 = 1 loop for c10 = c9 to c9 - 4 step -1 profile(c10,2) = profile(c10,1) + curvedata(8,curve,c11) ++c11 repeat end r1 = flt(y1) + .5 - flt(vpar(2)) r2 = flt(y2 - y1) r3 = flt(c9+1) r2 = r2 / r3 c14 = 0 c15 = 0 c12 = c9 + 1 >> 1 c13 = c9 >> 1 + 1 t5 = 0 t6 = 0 loop for c5 = 1 to c9 r1 += r2 c11 = fix(r1) c11 -= profile(c5,2) if c11 > 0 if c5 <= c12 if c11 > c14 c14 = c11 t5 = c5 end end if c5 >= c13 if c11 > c15 c15 = c11 t6 = c5 end end end repeat if c14 = 0 and c15 = 0 goto FIX_ENDS end &dA &dA &d@ 4. Determine interior point with maximum deviation, and raise (lower) &dA &d@ the slur end-point on that side to the next multiple of vpar(1). &dA &d@ If there is more than one interior point at the maximum, or if the &dA &d@ interior point with the maximum is in the center of the slur, &dA &d@ raise both slur end-points to the next multiple of vpar(1). &dA c7 = 0 if c9 > 4 and bit(0,c9) = 0 /* c6 = c9 >> 1 /* &dA if t5 = c6 or t6 - 1 = c6 /* &dA TRIAL c7 = 1 /* &dA if bit(1,ts(a6,STEM_FLAGS)) <> bit(1,ts(a7,STEM_FLAGS)) /* if abs(ts(a6,STAFFLOC) - ts(a7,STAFFLOC)) <= vpar(10) /* if curve = 1 /* if c15 > c14 /* t1 = 2 /* else /* &dA t2 = 2 /* &dA end /* &dA TRIAL c7 = 0 /* &dA end /* end /* end /* end end NEW_HEIGHT: if c15 = c14 or sflag = 0 or c7 = 1 &dK &d@ y2 /= vpar(1) &dK &d@ --y2 &dK &d@ y2 *= vpar(1) /* raise the end &dK &d@ y1 /= vpar(1) &dK &d@ --y1 &dK &d@ y1 *= vpar(1) /* raise the start y2 -= vpar(1) c16 = y2 * 2 / vpar(2) y2 -= rem y1 -= vpar(1) c16 = y1 * 2 / vpar(2) y1 -= rem if sflag = 0 sflag = 1 end else JKL: if c15 > c14 if t2 > 0 t1 = 0 t2 = 0 end if t1 = 2 t1 = 0 c14 = c15 + 1 else ++t1 &dK &d@ y2 /= vpar(1) &dK &d@ --y2 &dK &d@ y2 *= vpar(1) /* raise the end y2 -= vpar(1) c16 = y2 * 2 / vpar(2) y2 -= rem end end if c14 > c15 if t1 > 0 t1 = 0 t2 = 0 end if t2 = 2 t2 = 0 c15 = c14 + 1 goto JKL else &dK &d@ y1 /= vpar(1) &dK &d@ --y1 &dK &d@ y1 *= vpar(1) /* raise the start y1 -= vpar(1) c16 = y1 * 2 / vpar(2) y1 -= rem end end end &dA &dA &d@ 5. If all interior y-values now fall below (above) straight line &dA &d@ connecting the end points, proceed with placing slur. &dA r1 = flt(y1) + .5 - flt(vpar(2)) r2 = flt(y2 - y1) r3 = flt(c9+1) r2 = r2 / r3 c14 = 0 c15 = 0 c6 = 0 c7 = 0 c12 = c9 + 1 >> 1 c13 = c9 >> 1 + 1 loop for c5 = 1 to c9 r1 += r2 c11 = fix(r1) c11 -= profile(c5,2) if c11 > 0 if c5 <= c12 if c11 > c14 c6 = c5 c14 = c11 end end if c5 >= c13 if c11 > c15 c7 = c5 c15 = c11 end end end repeat if c6 = 0 and c7 = 0 goto FIX_ENDS end t5 = c6 t6 = c7 &dA &dA &d@ 6. Determine interior point(s) with maximum deviation. If this point &dA &d@ (all of these points) fall with the 25%-75% region of the slur, &dA &d@ increase the curvature one notch, and goto (3); otherwise goto (4). &dA c5 = 10000 / (c9 + 1) c6 *= c5 c7 *= c5 if c14 >= c15 and c6 >= 2500 and curve < 4 ++curve goto NEW_CURVE end if c14 <= c15 and c7 <= 7500 and curve < 4 ++curve goto NEW_CURVE end goto NEW_HEIGHT &dA &dA &d@ Transform to actual y-values &dA FIX_ENDS: &dK &d@ c10 = 1000 * vpar(1) c10 = 500 * vpar(2) if slurlet < chr(96) /* tips up y1 = c10 - y1 y2 = c10 - y2 else y1 -= c10 y2 -= c10 end &dA &dA &d@ Adjust slur height if both ends show tuplet &dA if bit(4,ts(a6,SUPER_FLAG)) = 1 and bit(5,ts(a7,SUPER_FLAG)) = 1 c10 = 0 /* = no goto ADJS(tpflag+1) ADJS(1): if ts(a6,BEAM_FLAG) > 0 and ts(a7,BEAM_FLAG) > 0 if ts(a7,MULTI_TRACK) = 0 c10 = 1 end else c10 = 1 end goto ADJSE ADJS(2): /* always c10 = 1 goto ADJSE ADJS(3): /* never goto ADJSE ADJS(4): /* only when tips down if slurlet > chr(96) /* tips down c10 = 1 end goto ADJSE ADJS(5): /* only when tips up if slurlet < chr(96) /* tips up c10 = 1 end ADJSE: if c10 = 1 if slurlet < chr(96) /* tips up if y1 + y2 > vpar(6) << 1 y1 += vpar(2) y2 += vpar(2) end else if y1 + y2 < vpar(4) y1 -= vpar(2) y2 -= vpar(2) end end end end &dA &dA &d@ For both starting and ending chords, (1) find next empty slot in &dA &d@ in each SLUR_X row and construct the following information: &dA &dA &d@ first element &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &d@ bit 27: start/end flag (0 = start, 1 = end) &dA &d@ bits 24-26: slur number - 1 (0 to 7) &dA &d@ bits 17-23: curvature information (end only) &dA &d@ bit 16: up/down flag (0 = tips up, 1 = tips down) (end only) &dA &d@ bits 0-15: x-offset + 1000 (always a positive number) &dA &d@ second element &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &d@ y position relative to the staff &dA &d@ third element (&dA05/06/03&d@) &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &d@ print suggestion for this end of the slur &dA PLACE_SLUR: &dA &dA &d@ Starting point &dA c10 = 1000 /* x-offset if "ACRNimnq" con slurlet /* start on "n" if ts(a6,LOCAL_XOFF) > 0 c10 += ts(a6,LOCAL_XOFF) end if mpt > 3 c10 += hpar(82) * 3 / 4 end else if "KLMfgrs" con slurlet /* start on "Y" if bit(1,ts(a6,STEM_FLAGS)) = UP if ts(c2,LOCAL_XOFF) > 0 c10 += ts(a6,LOCAL_XOFF) end if mpt > 3 c10 += hpar(82) * 3 / 4 end end else if "PQop" con slurlet /* start on "s" if mpt < 3 c10 -= hpar(82) / 3 else c10 += hpar(82) / 3 end end end end c11 = sgroup(a4,3) << 24 /* slur number c11 += c10 /* odd numbered element c12 = ts(a6,SLUR_X) &dK &d@ loop for c13 = 7 to 31 step 2 loop for c13 = 7 to (TS_SIZE - 2) step 3 /* &dA05/06/03&d@ if ts(c12,c13) = 0 goto PLACE_SLUR1 end repeat PLACE_SLUR1: ts(c12,c13) = c11 ++c13 ts(c12,c13) = y1 &dA &dA &d@ Fine tuning for special situation &dA if slurlet = "i" if ts(a6,STAFFLOC) - ts(a7,STAFFLOC) >= 0 c17 = ts(a7,SUBFLAG_2) | ts(a7,ED_SUBFLAG_2) /* New &dA05/17/03 if c17 & 0x3c > 0 /* New ts(c12,c13) -= vpar(2) end end end &dA &dA &d@ Code added &dA05/06/03&d@ get print suggestion for this end of slur &dA ++c13 c11 = sgroup(a4,3) /* 0 to 7 if c11 > 3 c11 -= 4 /* 0 to 3 = (,[,{,z end c11 *= 4 /* 0,4,8,12 c11 += 81 /* 81,85,89,93 (97,101,105,109) c10 = ts(a6,TSR_POINT) ts(c12,c13) = ors(tsr(c10){c11,4}) &dA &dA &d@ End code addition &dA &dK &dK &d@ &dA05-27-94&d@ &dK &d@ Somehow, I can't figure out why this code was written this way &dK &d@ It seems that tips up would automatically imply that the slur &dK &d@ was under the object, and tips down would imply that the slur &dK &d@ was over the object. The revised code reflects this thought &dK &d@ (which may very well be naive). &dK &dK &d@ if "PQadet" con slurlet /* starting from over (3) &dK &d@ ts(c12,3) = y1 /*? - vpar(1) &dK &d@ end &dK &d@ if "FGHOop" con slurlet /* starting from under (4) &dK &d@ ts(c12,4) = y1 /*? + vpar(1) &dK &d@ end &dK if "opadet" con slurlet /* starting from over (3) &dK &d@ ts(c12,3) = y1 - vpar(1) /* new value ts(c12,3) = y1 - vpar(1) c16 = ts(c12,3) * 2 / vpar(2) ts(c12,3) -= rem end if "FGHOPQ" con slurlet /* starting from under (4) &dK &d@ ts(c12,4) = y1 + vpar(1) /* new value ts(c12,4) = y1 c16 = ts(c12,4) * 2 / vpar(2) if rem <> 0 ++ts(c12,4) end ts(c12,4) += vpar(1) end &dA &dA &d@ Ending point &dA c10 = 1000 /* x-offset if "HMNRnafq" con slurlet /* end on "n" if ts(a7,LOCAL_XOFF) < 0 c10 += ts(a6,LOCAL_XOFF) end if mpt < 6 c10 -= hpar(82) * 3 / 4 end else if "CGLrems" con slurlet /* end on "Y" if bit(1,ts(a7,STEM_FLAGS)) = DOWN if ts(c4,LOCAL_XOFF) < 0 c10 += ts(a6,LOCAL_XOFF) end if mpt < 5 c10 -= hpar(82) * 3 / 4 end end else if "OQpt" con slurlet /* end on "s" if mpt < 3 c10 -= hpar(82) / 3 else c10 += hpar(82) / 3 end end end end c11 = sgroup(a4,3) /* slur number c11 += 16 /* end flag c11 <<= 8 c11 += curve << 1 /* curvature if slurlet > chr(96) /* tips up ++c11 /* tips up/down flag end c11 <<= 16 c11 += c10 /* x-offset c12 = ts(a7,SLUR_X) &dK &d@ loop for c13 = 7 to 31 step 2 loop for c13 = 7 to (TS_SIZE - 2) step 3 /* &dA05/06/03&d@ if ts(c12,c13) = 0 goto PLACE_SLUR2 end repeat PLACE_SLUR2: ts(c12,c13) = c11 ++c13 ts(c12,c13) = y2 &dA &dA &d@ Code added &dA05/06/03&d@ get print suggestion for this end of slur &dA ++c13 c11 = sgroup(a4,3) /* 0 to 7 if c11 > 3 c11 -= 4 /* 0 to 3 = (,[,{,z end c11 *= 4 /* 0,4,8,12 c11 += 97 /* 97,101,105,109 c10 = ts(a7,TSR_POINT) ts(c12,c13) = ors(tsr(c10){c11,4}) &dA &dA &d@ End code addition &dA &dK &dK &d@ &dA05-27-94&d@ &dK &d@ See above. I don't understand how this code got written &dK &d@ as it did. It seems self evident that the over-under &dK &d@ question is decided entirely by the direction of the &dK &d@ slur tips. &dK &dK &d@ if "OQdgio" con slurlet /* ending from over (1) &dK &d@ ts(c12,1) = y2 /*? - vpar(1) &dK &d@ end &dK &d@ if "AFKPpt" con slurlet /* ending from under (2) &dK &d@ ts(c12,2) = y2 /* + vpar(1) &dK &d@ end &dK &dK if "ptdgio" con slurlet /* ending from over (1) &dK &d@ ts(c12,1) = y2 - vpar(1) /* new value ts(c12,1) = y2 - vpar(1) c16 = ts(c12,1) * 2 / vpar(2) ts(c12,1) -= rem end if "AFKPOQ" con slurlet /* ending from under (2) &dK &d@ ts(c12,2) = y2 + vpar(1) /* new value ts(c12,2) = y2 c16 = ts(c12,2) * 2 / vpar(2) if rem <> 0 ++ts(c12,2) end ts(c12,2) += vpar(1) end repeat &dA &d@ &dA ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» &dA &d@ &dA º This is the end of the loop which processes slurs º &dA &d@ &dA ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ end YYYY: repeat maxsct = a14 &dA &dA &d@***************************************************************** &dA &d@ Processing loop (loop ends at ZZZ) PROCESSING TS ARRAY &dA &dA &d@ Actions: &dA &dA &d@ I. Construct text sub-object, if present &dA &dA &d@ II. Deal with music &dA &dA &d@ A. Bar Lines &dA &dA &d@ B. Clef changes, Time changes &dA &dA &d@ C. Signs, Words, Marks &dA &dA &d@ D. Figures &dA &dA &d@ E. Notes/Rests &dA &dA &d@ 1. Accidentals &dA &d@ 2. Note heads, dots &dA &d@ 3. Leger lines &dA &d@ 4. Stems and beams &dA &dA &d@ III. Write object records into intermediate file &dA p += firstsp loop for a1 = 1 to sct nodtype = ts(a1,TYPE) a5 = ts(a1,TEXT_INDEX) if a5 > 0 ttext = tsdata(a5) // pad(1) else ttext = pad(1) end sobcnt = 0 obx = p if nodtype = DIV_CHG goto ZZZ end &dA &dA &d@ Get the spn (spacing) parameter &dA spn = ts(a1,SPN_NUM) &dA &dA &dA &d@ I am moving this code to the point where notes are really typeset. &dA &d@ The problem with having it here is that if there are chords with &dA &d@ text, or if there are cue-notes simultaneous with the text, then &dA &d@ the text may not get set. &dA &dA &d@ I. Construct Text Sub-Object &dA &dK &d@ if nodtype = NOTE &dK &d@ if ttext{1} in ['A'..'Z','a'..'z','!'..'(','\','='] &dK &d@ c5 = mtfont &dK &d@ perform spacepar &dK &d@ temp2 = ttext &dK &d@ if temp2 con "$$$$" &dK &d@ ttext = temp2{1,mpt-1} &dK &d@ a4 = int(temp2{mpt+4..}) /* x offset (calculated earlier) &dK &d@ else &dK &d@ putc Program Error at 10052 &dK &d@ end &dK &d@ temp2 = ttext // "| " &dK &d@ ttextcnt = 0 &dKC&d@CCD: &dK &d@ if temp2 con "|" &dK &d@ ttext = temp2{1,mpt-1} &dK &d@ temp2 = temp2{mpt+1..} &dK &d@ ++ttextcnt &dK &d@ ttextarr(ttextcnt) = trm(ttext) &dK &d@ goto CCCD &dK &d@ end &dK &d@ loop for a7 = 1 to ttextcnt &dK &dK &d@ ttext = ttextarr(a7) &dK &dA &dK &dA &d@ determine values of xbytearr &dK &dA &dK &d@ a6 = len(ttext) &dK &d@ xbytearr(a7) = "* " &dK &d@ if "-_" con ttext{a6} &dK &d@ ttext = ttext{1,a6-1} &dK &d@ xbytearr(a7) = "-_"{mpt} // " " &dK &d@ if mpt = 2 &dK &d@ a6 = len(ttext) &dK &d@ if ",.;:!?" con ttext{a6} &dK &d@ ttext = ttext{1,a6-1} &dK &d@ xbytearr(a7) = ",.;:!?"{mpt} // " " &dK &d@ end &dK &d@ end &dK &d@ end &dK &d@ ttextarr(a7) = ttext &dK &d@ repeat &dK &dA &dK &dA &d@ determine length of ttext &dK &dA &dK &d@ a5 = 0 &dK &d@ loop for a7 = 1 to ttextcnt &dK &d@ c5 = 0 &dK &d@ ttext = ttextarr(a7) &dK &d@ loop for c4 = 1 to len(ttext) &dK*&d@ adjust for backslash (\) sequence &dK &d@ if ttext{c4} = "\" &dK &d@ a6 = ors(ttext{c4+2}) &dK &d@ if ttext{c4+1} = "0" &dK &d@ a6 += 128 &dK &d@ end &dK &d@ c4 += 2 &dK &d@ else &dK &d@ a6 = ors(ttext{c4}) &dK &d@ end &dK &d@ c5 += spc(a6) &dK &d@ repeat &dK &d@ if c5 > a5 &dK &d@ a5 = c5 &dK &d@ end &dK &d@ repeat &dK &dA &dK &dA &d@ determine relative position of ttext &dK &dA &dK &d@ x = p - a4 &dK &d@ sobx = x - obx &dK &d@ loop for a8 = 1 to ttextcnt &dK &d@ ttext = ttextarr(a8) &dK &d@ ++sobcnt &dK &d@ temp3 = "T " // chs(sobx) // " " // chs(a8) // " " &dK &d@ if ttext con "=" &dK &d@ ttext{mpt} = "-" &dK &d@ end &dK &d@ temp3 = temp3 // ttext // " " &dK &d@ sobl(sobcnt) = temp3 // xbytearr(a8) // chs(a5) &dK &d@ repeat &dK &d@ end &dK &d@ end &dA &dA &d@ II. Typeset Music &dA &dA &d@ A. Typeset Bar Line &dA if nodtype = BAR_LINE &dA &dA &d@ Zero out the rest_flag(s) &dA03/18/06&d@ &dA loop for a2 = 1 to MAX_PASS rest_flag(a2) = 0 repeat &dA a2 = hpar(36) a14 = ts(a1,BAR_TYPE) &dA &dA &d@ determine location of obx for this object &dA if bit(1,ts(a1,REPEAT)) = 1 /* backward repeat a2 += hpar(43) end a10 = hpar(43) + hpar(93) - hpar(80) &dI &dI Old Version&d@ shift for &dI &d@ forward dots(repeats) &dI &d@ a14 a2+ (add to p) a4 (1st shft) a5 (2nd shft) a8 (inc) a10 &dI &d@ ---- ---- ---- --------- ---- ----- &dI &d@ 1 0 0 0 0 a10 &dI &d@ 2 hpar(79) -hpar(79) 0 0 a10 &dI &d@ 3 0 0 0 0 a10 &dI &d@ 5 hpar(44) -a2 0 0 a10 &dI &d@ 6 hpar(81) + hpar(79) -a2 -hpar(79) 0 a10 &dI &d@ 9 0 0 +hpar(45) hpar(45) a10 + hpar(45) &dI &d@ 10 hpar(45) -hpar(45) 0 hpar(79) hpar(43)+hpar(96)-hpar(80) &dI &dA &dA &d@ hpar(44) = actual white space between two light lines &dA &d@ hpar(45) = actual white space between heavy/light, light/heavy and heavy/heavy combinations &dA &d@ hpar(79) = thickness of light line &dA &d@ hpar(81) = thickness of heavy line &dA &dA &d@ shift for &dA &d@ forward dots(repeats) &dA &d@ a14 a2+ (add to p) a4 (1st shft) a5 (2nd shft) a8 (inc) a10 &dA &d@ ---- ---- ---- --------- ---- ----- &dA &d@ 1 0 0 0 0 a10 &dA &d@ 2 { hpar(81) - hpar(79 a2 0 0 a10 &dA &d@ + 1 } &dA &d@ 3 0 0 0 0 a10 &dA &d@ 5 hpar(44) + hpar(79) a2 0 0 a10 &dA &d@ 6 { hpar(45) + hpar(81) a2 - { hpar(81) - hpar(79) 0 a10 &dA &d@ + 1 } + 1 } &dA &d@ 9 0 0 hpar(81) + hpar(45) a5 a10 + a5 &dA &d@ 10 hpar(81) + hpar(45) a2 0 { hpar(81) - hpar(43)+hpar(96)-hpar(80) &dA &d@ hpar(79) + 1 } &dA a4 = 0 a5 = 0 a8 = 0 if a14 = HEAVY a2 += hpar(81) - hpar(79) + 1 a4 = hpar(81) - hpar(79) + 1 end if a14 = DOUBLE_REG or a14 = DOUBLE_DOTTED a2 += hpar(44) + hpar(79) a4 = hpar(44) + hpar(79) end if a14 = REG_HEAVY a2 += hpar(45) + hpar(81) + 1 a4 = hpar(45) + hpar(81) + 1 a5 = 0 - (hpar(81) - hpar(79) + 1) end if a14 = HEAVY_REG a5 = hpar(81) + hpar(45) a8 = a5 a10 += a5 end if a14 = DOUBLE_HEAVY a2 += hpar(81) + hpar(45) a4 = hpar(81) + hpar(45) a8 = hpar(81) - hpar(79) + 1 a10 = hpar(43) + hpar(96) - hpar(80) end obx = p + a2 if ts(a1,NODE_SHIFT) > 0 &dK &d@ putc node_shift for barline = ~ts(a1,NODE_SHIFT) obx += ts(a1,NODE_SHIFT) end * * put out signet signs (if present) * if bit(1,ts(a1,BAR_FLAGS)) = 1 /* segno sign out = "0" jtype = "D" jcode = 8 + sigflag pcode = 106 /* music font oby = vpar(45) if nstaves = 2 oby += 1000 end putobjpar = 0 jscrdat = "" perform putobj jcode = 5 - sigflag oby = 0 - vpar(43) jscrdat = "" perform putobj if sigflag = 0 sigflag = 1 end end * * put out fermata signs (if present) * if ts(a1,BAR_FLAGS) & 0x000c > 0 putobjpar = 0 if bit(2,ts(a1,BAR_FLAGS)) = 1 /* fermata over bar out = "0" jtype = "D" jcode = 5 pcode = 101 /* music font oby = 0 - vpar(3) obx -= vpar(2) jscrdat = "" perform putobj obx += vpar(2) end if bit(3,ts(a1,BAR_FLAGS)) = 1 /* fermata under bar out = "0" jtype = "D" jcode = 9 pcode = 102 /* music font oby = vpar(3) + vpar(8) if nstaves = 2 oby += 1000 end obx -= vpar(2) jscrdat = "" perform putobj obx += vpar(2) end end oby = 0 &dA &dA &d@ contruct superobject string for bar line &dA supcnt = 0 * look for termination of ending a9 = ts(a1,BACK_ENDING) if a9 <> 0 if esnum > 0 ++supcnt supnums(supcnt) = esnum a6 = esnum else return 4 end esnum = 0 end * look for termination of long trill ~~~~ if bit(0,ts(a1,BAR_FLAGS)) = 0 loop for a3 = 1 to MAX_PASS if tsnum(a3) > 0 ++supcnt /* stop trill supnums(supcnt) = tsnum(a3) end repeat end * look for origination of ending if ts(a1,FORW_ENDING) > 0 ++snum esnum = snum ++supcnt supnums(supcnt) = esnum end * construct supernumber string for object out = chs(supcnt) loop for a3 = 1 to supcnt out = out // " " // chs(supnums(a3)) repeat supcnt = 0 &dA &dA &d@ Typeset elements of the bar line &dA * numbered measure /* Code added &dA02-23-97&d@ a3 = ts(a1,M_NUMBER) if a3 > 0 c5 = 38 perform spacepar c5 = spc(176) >> 1 /* space for small "0" if a3 > 9 c5 <<= 1 end sobl(1) = "W " // "-" // chs(c5) // " 0 38 " sobcnt = 1 if a3 > 9 c5 = a3 / 10 a3 = rem sobl(1) = sobl(1) // "\0" // chs(c5) end sobl(1) = sobl(1) // "\0" // chs(a3) end * back-repeat if bit(1,ts(a1,REPEAT)) = 1 /* backward repeat x = p + hpar(36) x += ts(a1,NODE_SHIFT) /* This line added &dA09/22/03&d@ (but not fully checked) y = vpar(3) z = 44 /* music font kscrdat = "" perform subj y = vpar(5) perform subj end * first of double bar y = 0 if a14 > 3 a3 = a14 & 0x0c z = a3 / 2 + 80 /* music font x = obx - a4 kscrdat = "" perform subj end * second or single bar a3 = ts(a1,BAR_TYPE) & 0x03 z = a3 * 2 + 80 /* music font x = obx + a5 kscrdat = "" perform subj * forward-repeat if bit(0,ts(a1,REPEAT)) = 1 /* forward repeat x = obx + a10 a8 += hpar(43) y = vpar(3) z = 44 /* music font kscrdat = "" perform subj y = vpar(5) perform subj end * put out object (and sub-objects) jtype = "B" jcode = ts(a1,BAR_NUMBER) if sobcnt = 1 pcode = z /* music font else pcode = sobcnt end oby = ts(a1,NUM_STAVES) - 1 * 1000 + a14 putobjpar = 0 jscrdat = tsdata(ts(a1,TEXT_INDEX)) &dA &dA &d@ Strip the operative barnum from the front of jscrdat &dA opbarnum = int(jscrdat) if jscrdat con "+" jscrdat = jscrdat{mpt+1..} end perform putobj &dA &dA * put out ending super-object if a9 <> 0 /* backward ending if ts(a1,FORW_ENDING) > 0 out = "-" // chs(hpar(41)) else out = "0" end &dK &d@ out = out // " -" // chs(vpar(40)) // " " out = out // " -" // chs(ending_height) // " " /* changed &dA01/06/06 out = out // chs(vpar(41)) // " " if a9 > 0 /* ending stops out = out // chs(vpar(41)) else /* ending discontinues a9 = 0 - a9 out = out // "0" end ++outpnt tput [Y,outpnt] H ~a6 E ~a9 0 ~out end * put out long trill super-object if bit(0,ts(a1,BAR_FLAGS)) = 0 loop for c5 = 1 to MAX_PASS if tsnum(c5) > 0 out = "H " // chs(tsnum(c5)) // " R " // chs(ctrarrf(c5)) out = out // " 0" ++outpnt tput [Y,outpnt] ~out -~hpar(42) ~try(c5) tsnum(c5) = 0 ctrarrf(c5) = 0 end repeat end * adjust p p = obx + ts(a1,SPACING) + a8 goto ZZZ end &dA &dA &d@ B. Typeset Clef change, Time change, Key change &dA if nodtype = CLEF_CHG &dA &dA &d@ Code added &dA01/17/04&d@ to deal with time clef in measure groups &dA if ts(a1,DOLLAR_SPN) = 6913 /* 6913 used here as a code, not a value spn = 6913 end /* otherwise don't change spn &dA a3 = ts(a1,STAFF_NUM) + 1 /* staff number if ts(a1,NODE_SHIFT) < 0 a7 = 0 - ts(a1,NODE_SHIFT) &dK &d@ putc backing up clef sign by amount = ~a7 p += ts(a1,NODE_SHIFT) end obx = p clef(a3) = ts(a1,CLEF_NUM) z = ts(a1,CLEF_FONT) /* music font k = ts(a1,TRANS_FLAG) oby = ts(a1,STAFF_NUM) * 1000 /* added &dA5-28-93&d@ oby += ts(a1,CLEF_STAFF_POS) perform putclef (a3) p += ts(a1,SPACING) goto ZZZ end * if nodtype = DESIGNATION &dA &dA &d@ Code added &dA01/17/04&d@ to deal with designation in measure groups &dA if ts(a1,DOLLAR_SPN) = 6913 /* 6913 used here as a code, not a value spn = 6913 end /* otherwise don't change spn &dA c5 = 37 perform spacepar &dA &dA &d@ Introducing optional conversion to ligitures in designations &dA04/22/04 &dA if ligit_flag = 1 if len(ttext) > 1 and ttext{1,2} = "ff" ttext{1,2} = "f\@f" end LIGCON3: if ttext con "ffi" ttext{mpt,3} = "\0:" goto LIGCON3 end if ttext con "ffl" ttext{mpt,3} = "\0;" goto LIGCON3 end if ttext con "ff" ttext{mpt,2} = "\0<" goto LIGCON3 end if ttext con "fi" ttext{mpt,2} = "\0=" goto LIGCON3 end if ttext con "fl" ttext{mpt,2} = "\0>" goto LIGCON3 end end #if AUTOSCR #else perform kernttext /* New &dA04/22/04&d@ #endif jtype = "D" jcode = 5 obx = p oby = ts(a1,STAFF_NUM) * 1000 /* added &dA5-28-93&d@ oby -= tword_height * vpar(1) out = "0" sobl(1) = "" &dK &d@ temp3 = "W 0 0 37 " // ttext temp3 = "W 0 0 " // chs(dtivfont) // " " // ttext pcode = 1 putobjpar = 0 jscrdat = "" perform putobj goto ZZZ end * if nodtype = METER_CHG &dA &dA &d@ Code added &dA01/17/04&d@ to deal with meter changes in measure groups &dA if ts(a1,DOLLAR_SPN) = 6913 /* 6913 used here as a code, not a value spn = 6913 end /* otherwise don't change spn &dA tnum = ts(a1,TIME_NUM) / 100 tden = rem oby = 0 k = p loop for h = 1 to ts(a1,NUM_STAVES) p = k perform settime (a3) oby += 1000 repeat if tnum = 1 and tden = 1 tnum = 4 tden = 4 end if tnum = 0 and tden = 0 tnum = abflg tden = 2 end goto ZZZ end * if nodtype = AX_CHG &dA &dA &d@ Code added &dA01/17/04&d@ to deal with key changes in measure groups &dA if ts(a1,DOLLAR_SPN) = 6913 /* 6913 used here as a code, not a value spn = 6913 end /* otherwise don't change spn &dA h = ts(a1,3) /* new key k = ts(a1,4) /* old key a3 = ts(a1,NUM_STAVES) /* number of staves a4 = 0 a5 = 0 /* added &dA08/23/06&d@ perform key_change (h, k, a3, a4, a5) /* emptyspace(.,.) not set key = h /* &dA08/23/06&d@ 5th variable added to procedure &dA &dA &d@ NOTE: The following instruction was added &dA05/29/05&d@ to fix a minor bug &dA &d@ that I have never seen before. It makes perfect sense that we &dA &d@ should go to the next element in the ts(.) array, and I can't see &dA &d@ how this "bug" has remained hidden for so long. My worry is that &dA &d@ there was a good reason why we wanted to "fall through" to the &dA &d@ note processing section, although this would be &dEvery poor&d@ programming &dA &d@ practice. I do believe, however, in light of the fact that this &dA &d@ program has worked properly for so long, that we need to keep an &dA &d@ eye on this situation. This "goto" instruction &dEis&d@ a major change! &dA goto ZZZ end &dA &dA &d@ C. Typeset Signs, Words and Marks which are Objects &dA if nodtype = SIGN or nodtype = WORDS or nodtype = MARK putobjpar = 0 * obx = p a4 = ts(a1,TEXT_INDEX) ttext = tsdata(a4) ttext = trm(ttext) out = "0" &dA &dA &d@ determine vertical positions of object and superobject &dA if ts(a1,SIGN_TYPE) = SEGNO oby = 0 - vpar(43) else if ts(a1,SIGN_POS) = ABOVE oby = 0 - vpar(44) else oby = vpar(45) end end oby1 = oby oby2 = oby obx1 = obx obx2 = obx &dA &dA &d@ Comment: &dA01/07/06&d@ The code here is somewhat convoluted, but I think &dA &d@ this addition corrects a problem with the way print suggestions &dA &d@ interact with transpositions. Stay alert! &dA if nodtype = MARK oby = 0 end &dA if ts(a1,POSI_SHIFT1) > 0 a3 = ts(a1,POSI_SHIFT1) & 0xff if a3 > 0 oby1 = a3 - 0x80 * vpar(2) / 10 yposi_shift = 0 else a3 = ts(a1,POSI_SHIFT1) >> 8 yposi_shift = a3 & 0xff if yposi_shift > 0 yposi_shift = yposi_shift - 0x80 * vpar(2) / 10 end end xposi_shift = ts(a1,POSI_SHIFT1) >> 16 if xposi_shift > 0 xposi_shift = xposi_shift - 0x80 * vpar(2) / 10 end else yposi_shift = 0 xposi_shift = 0 end save_xposi_shift = xposi_shift obx1 += xposi_shift oby1 += yposi_shift if ts(a1,POSI_SHIFT2) > 0 a3 = ts(a1,POSI_SHIFT2) & 0xff if a3 > 0 oby2 = a3 - 0x80 * vpar(2) / 10 yposi_shift = 0 else a3 = ts(a1,POSI_SHIFT2) >> 8 yposi_shift = a3 & 0xff if yposi_shift > 0 yposi_shift = yposi_shift - 0x80 * vpar(2) / 10 end end xposi_shift = ts(a1,POSI_SHIFT2) >> 16 if xposi_shift > 0 xposi_shift = xposi_shift - 0x80 * vpar(2) / 10 end else yposi_shift = 0 xposi_shift = 0 end obx2 = xposi_shift oby2 += yposi_shift temp = " " // chs(oby1) temp2 = " " // chs(oby2) a2 = ts(a1,SUPER_TYPE) * construct superflags for object if a2 > 0 a3 = a2 + 1 / 2 a8 = 0 if a3 = 4 a8 = 1 a3 = 3 end if rem = 0 /* start of super-object a4 = a3 - WEDGES * 5 + ts(a1,S_TRACK_NUM) /* row element loop for a5 = 1 to 5 if smusdir(a4,1) = 0 /* must be zero to use a5 = 1000 else /* else look at others ++a4 if a4 > a3 * 5 a4 -= 5 /* in the set end end repeat if a5 <> 1000 putc Too many active ... if a3 = WEDGES putc wedges. else if a3 = DASHES putc sets of dashes. else putc transpositions of one type. end end putc Typesetting halted stop end ++snum smusdir(a4,1) = snum smusdir(a4,4) = oby2 if a3 = WEDGES smusdir(a4,2) = ts(a1,WEDGE_SPREAD) smusdir(a4,3) = ts(a1,WEDGE_OFFSET) + obx2 else if a3 = DASHES if ts(a1,FONT_NUM) = 0 c5 = mtfont else c5 = ts(a1,FONT_NUM) end smusdir(a4,3) = c5 perform wordspace smusdir(a4,2) = a5 + obx2 else smusdir(a4,3) = obx2 smusdir(a4,4) -= oby /* tricky code if a3 = OCT_UP smusdir(a4,2) = 0 end if a3 = OCT_DOWN smusdir(a4,2) = 1 end if a3 = DBL_OCT_UP smusdir(a4,2) = 2 end if a3 = DBL_OCT_DOWN smusdir(a4,2) = 3 end end end else /* end of super-object a4 = a3 - WEDGES * 5 + ts(a1,S_TRACK_NUM) /* row element loop for a5 = 1 to 5 if smusdir(a4,1) <> 0 /* must be non zero to use a5 = 1000 else /* else look at others ++a4 if a4 > a3 * 5 a4 -= 5 /* in the set end end repeat if a5 <> 1000 putc Attempt to end a ... if a3 = WEDGES putc wedge ... else if a3 = DASHES putc set of dashes ... else putc transposition of a type ... end end putc that wasn't properly started. putc Typesetting halted stop end save_a4 = a4 end out = "1 " // chs(smusdir(a4,1)) end &dA &dA &d@ if single character, write object &dA a3 = ts(a1,SIGN_TYPE) if a3 = PED or a3 = END_PED pcode = 112 + a3 /* music font jtype = "S" jcode = 0 obx = obx1 oby = ts(a1,STAFF_NUM) * 1000 + oby1 if ts(a1,ISOLATED) = 1 jtype = "I" end jscrdat = "" perform putobj goto VT2 end if a3 = LETTER_DYNAM /* one letter dynamics if ttext con "Z" #if SFZ ttext{mpt,1} = "sfz" #else ttext{mpt,1} = "sf" #endif end if len(ttext) = 1 and "pf" con ttext if mpt = 1 pcode = 108 /* music font else pcode = 110 /* music font end jtype = "S" jcode = 0 obx = obx1 oby = ts(a1,STAFF_NUM) * 1000 + oby1 if ts(a1,ISOLATED) = 1 jtype = "I" end jscrdat = "" perform putobj goto VT2 end end &dA &dA &d@ put out segno signs (as directives) &dA if a3 = SEGNO pcode = 106 /* music font jtype = "D" jcode = 8 + sigflag obx = obx1 oby = ts(a1,STAFF_NUM) * 1000 + vpar(45) /* oby reset here if ts(a1,ISOLATED) = 1 jtype = "I" end jscrdat = "" perform putobj jcode = 5 - sigflag oby = ts(a1,STAFF_NUM) * 1000 + oby1 if ts(a1,ISOLATED) = 1 jtype = "I" end jscrdat = "" perform putobj if sigflag = 0 sigflag = 1 end goto VT2 end &dA &dA &dA &d@ This code added &dA10-12-96&d@ &dA &dA &dA &d@ Put out mark for tie terminator &dA if a3 = TIE_TERM jtype = "M" jcode = 0 obx = obx1 + hpar(81) + hpar(45) /* guarenteed to put you beyond bar line oby = 0 pcode = 0 c7 = ts(a1,BACKTIE) c7 = ts(c7,BACKTIE) out = "1 " // chs(tiearr(c7,TIE_SNUM)) jscrdat = "" perform putobj &dA &dA &d@ Now put out the Tie Super-object &dA &dA &d@ compute sitf (situation flag) &dA &dA &d@ Description of sitf: range 1 to 16 &dA &d@ &dA &d@ If the range were from 0 to 15, then bits 3 to 0 &dA &d@ would have the following meanings: &dA &d@ &dA &d@ zero | one &dA &d@ -------------------------------------------- &dA &d@ bit 3: tips down | tips up &dA &d@ bit 2: note on space | note on line &dA &d@ bit 1: no stem interfenence | stem interference &dA &d@ bit 0: staff interference | no staff interference &dA c9 = tiearr(c7,TIE_VLOC) c10 = tiearr(c7,TIE_FHDIS) /* local x-offset for first note c11 = 0 /* local x-offset for second note c12 = tiearr(c7,TIE_FORCE) /* force flag if c12 = 3 c12 = 9 end &dA &dA &d@ Rules for single note &dA c5 = tiearr(c7,TIE_FSTEM) if c5 = 0 sitf = 9 /* stem up else sitf = 1 end if c12 > 0 sitf = c12 /* forced situation end if tiearr(c7,TIE_FSTEM) = UP and sitf < 9 sitf += 2 /* stem interference end &dA &dA &d@ Note: you won't know if there is staff interference until &dA &d@ you know the final length of the tie &dA c9 += tiearr(c7,TIE_STAFF) * 1000 /* New code added &dA04/20/03&d@, modified &dA05/02/03&d@ c13 = tiearr(c7,TIE_SUGG) & 0xff000000 /* length data c6 = tiearr(c7,TIE_SUGG) & 0xff0000 /* position flags c4 = tiearr(c7,TIE_SUGG) & 0xff00 /* x data c5 = tiearr(c7,TIE_SUGG) & 0xff /* y data c13 >>= 24 c6 >>= 16 c4 >>= 8 if c4 > 0 c4 = c4 - 128 * notesize / 10 end if c5 > 0 c5 = c5 - 128 * notesize / 10 end if bit(2,c6) = 1 c5 += 10000 end c6 = 0 if c13 > 0 c6 = c13 - 128 * notesize / 10 end /* end New code c8 = tiearr(c7,TIE_SNUM) ++outpnt tput [Y,outpnt] H ~c8 T ~c9 ~c10 ~c11 ~c4 ~c5 ~c6 ~sitf 0 tiearr(c7,TIE_SNUM) = 0 ts(a1,BACKTIE) = 0 goto VT2 end &dA &d@ &dA &d@ End of &dA10-12-96&d@ addition &dA &dA if nodtype = MARK jtype = "M" jcode = 0 obx = obx1 oby = 0 pcode = 0 if ts(a1,ISOLATED) = 1 jtype = "I" end jscrdat = "" perform putobj goto VT2 end * words if nodtype = WORDS jtype = "D" jcode = 0 if ttext = "Fine" jcode = 9 end if ttext = "fine" jcode = 9 end if ttext = "[fine]" jcode = 9 end if ttext con " " if ttext{1,mpt-1} = "da" jcode = 9 end if ttext{1,mpt-1} = "dal" jcode = 9 end if ttext{1,mpt-1} = "Dal" jcode = 9 end if ttext{1,mpt-1} = "Da" jcode = 9 end if ttext con " da " jcode = 9 end end if ttext con "D.C." or ttext con "D. C." jcode = 9 end pcode = 1 a4 = ts(a1,FONT_NUM) if a4 = 0 a4 = mdirfont end &dA &dA &d@ &dA &d@ This code moved to this location from below, because we need &dA &d@ to the operative font number for spacing purposes. &dA10/08/08&d@ &dA ttext = ttext // pad(4) if ttext{1} = "!" a4 = int(ttext{2..}) if ttext{sub} = "|" /* New &dA01/17/04&d@: skip over "|" ++sub end ttext = ttext{sub..} end ttext = trm(ttext) &dA &dA if a3 > 4 /* (a3 = SIGN_TYPE here) c5 = a4 if a3 < 7 &dA &dA &d@ Introducing optional conversion to ligitures in words &dA04/22/04&d@ &dA if ligit_flag = 1 if ttext = "ff" ttext = "f\@f" end LIGCON2: if ttext con "ffi" ttext{mpt,3} = "\0:" goto LIGCON2 end if ttext con "ffl" ttext{mpt,3} = "\0;" goto LIGCON2 end if ttext con "ff" ttext{mpt,2} = "\0<" goto LIGCON2 end if ttext con "fi" ttext{mpt,2} = "\0=" goto LIGCON2 end if ttext con "fl" ttext{mpt,2} = "\0>" goto LIGCON2 end end #if AUTOSCR #else perform kernttext /* New &dA04/22/04&d@ #endif perform wordspace &dA &d@ (reminder) &dA &d@³ Inputs: ttext = word ³ &dA &d@³ c5 = font number ³ &dA &d@³ curfont = currently active font ³ &dA &d@³ ³ &dA &d@³ Outputs: a5 = space taken up by word ³ &dA if a3 = 6 a5 /= 2 else a5 += 10 end else &dA &dA &dA &d@ New code (&dA02/03/08&d@) for determining box size and position &dA &d@ for Rehearsal numbers or letters (uses c10,c11,c12,c13,c14,c15,c16,c17) &dA if a3 = REH_MARK perform wordspace c12 = 2 * font_base + zero_height / 3 /* displacement to top c13 = font_height - font_base * 2 / 3 /* displacement to bottom c14 = spc(48) / 2 /* displacement to the left c15 = a5 + (spc(48) * 3 / 5) /* displacement to the right end &dA &dA a5 = 0 end end if a5 > 0 temp3 = "W -" // chs(a5) else temp3 = "W 0" end &dA &dA &d@ This code added &dA10/01/03&d@ to allow for font = 0 (no print) &dA &dK &d@ ttext = ttext // pad(4) &dK &d@ if ttext{1} = "!" &dK &d@ a4 = int(ttext{2..}) &dK &d@ if ttext{sub} = "|" /* New &dA01/17/04&d@: skip over "|" &dK &d@ ++sub &dK &d@ end &dK &d@ ttext = ttext{sub..} &dK &d@ end &dK &d@ ttext = trm(ttext) &dA &dA &d@ (moved to location above on &dA10/08/08&d@) &dA &dA &dA &d@ More code &dA02/03/08&d@ for dealing with boxes &dA if a3 = REH_MARK and box_flag = 1 sobl(1) = temp3 // temp // " " // chs(a4) // " " // ttext c10 = 1 c11 = oby1 - c12 /* actual displacement to top c12 = oby1 + c13 /* actual displacement to bottom c13 = 0 - c14 /* actual displacement to the left c14 = c15 /* actual displacement to the right &dA &dA &d@ First put in horizontal lines of the box &dA c17 = 0 if notesize = 6 c15 = c13 + 1 loop for c16 = 1 to 8 ++c10 sobl(c10) = "K " // chs(c15) // " " // chs(c11) // " 45" ++c10 sobl(c10) = "K " // chs(c15) // " " // chs(c12) // " 45" c15 += 10 if c17 = 1 c16 = 1000 end if c15 > (c14 - 9) c15 = c14 - 9 c17 = 1 end repeat else c15 = c13 loop for c16 = 1 to 8 ++c10 sobl(c10) = "K " // chs(c15) // " " // chs(c11) // " 90" ++c10 sobl(c10) = "K " // chs(c15) // " " // chs(c12) // " 90" if c17 = 1 c16 = 1000 end c15 += 30 if c15 > (c14 - 30) c15 = c14 - 30 c17 = 1 end repeat end &dA &dA &d@ for glyph 45 for glyph 90 for glyph 89 &dA &d@ --------------- --------------- ----------------- &dA &d@ notesize 6 -1 0 10 notesize 6 0 0 30 notesize 6 0 0 1 (6) &dA &d@ notesize 14 -3 0 24 notesize 14 0 1 30 notesize 14 0 1 2 (14) &dA &d@ notesize 16 -3 0 28 notesize 16 0 1 30 notesize 16 0 1 2 (16) &dA &d@ notesize 18 -4 0 32 notesize 18 0 1 30 notesize 18 0 1 3 (18) &dA &d@ notesize 21 -4 0 35 notesize 21 0 2 30 notesize 21 0 1 4 (21) &dA &dA &dA &d@ Now put in vertical lines of the box &dA c17 = 0 c15 = c11 --c14 if notesize > 6 --c14 end if notesize > 16 --c14 end if notesize > 18 --c14 end loop for c16 = 1 to 8 ++c10 sobl(c10) = "K " // chs(c13) // " " // chs(c15) // " 89" ++c10 sobl(c10) = "K " // chs(c14) // " " // chs(c15) // " 89" if c17 = 1 c16 = 1000 end c15 += notesize if c15 > (c12 - notesize) c15 = c12 - notesize c17 = 1 end repeat pcode = c10 else &dA &dA &d@ Need to make a cludge of a modification here &dA01/12/09&d@. The problem &dA &d@ is that when the node is isolated, any non-null xposi_shift becomes &dA &d@ irrelevant, once mskpage takes over. In this case, if we want the &dA &d@ word shifted horizontally, the shift must be in the Word sub-object, &dA &d@ not in the object position. We will adjust the obx position because &dA &d@ it is relevant when printing individual parts &dA if ts(a1,ISOLATED) = 1 temp3 = "W " // chs(save_xposi_shift) // temp // " " // chs(a4) // " " // ttext obx1 -= save_xposi_shift else temp3 = temp3 // temp // " " // chs(a4) // " " // ttext end &dA sobl(1) = "" end &dA &dA &d@ End of &dA02/03/08&d@ Changes obx = obx1 oby = ts(a1,STAFF_NUM) * 1000 if ts(a1,ISOLATED) = 1 jtype = "I" end jscrdat = "" perform putobj goto VT2 end * multi-letter dynamics jtype = "S" jcode = 0 pcode = len(ttext) &dK &dK &d@ putc pcode = ~pcode ttext = ~ttext | &dK obx = obx1 oby = oby1 x = obx y = oby loop for a4 = 1 to pcode if "pmfszr" con ttext{a4} z = mpt + 107 /* music font mpt += 59 kscrdat = "" perform subj x += hpar(mpt) end repeat oby = ts(a1,STAFF_NUM) * 1000 + oby if ts(a1,ISOLATED) = 1 jtype = "I" end jscrdat = "" perform putobj &dA &dA &d@ put out super-objects &dA VT2: a2 = ts(a1,SUPER_TYPE) if a2 > 0 a2 /= 2 if rem = 0 and a2 >= 1 and a2 <= 6 a4 = save_a4 /* this was computed above if a2 = WEDGES * wedges line = chs(smusdir(a4,2)) // " " line = line // chs(ts(a1,WEDGE_SPREAD)) // " " line = line // chs(smusdir(a4,3)) // " " // chs(smusdir(a4,4)) // " " line = line // chs(ts(a1,WEDGE_OFFSET) + obx2) // " " // chs(smusdir(a4,4)) ++outpnt tput [Y,outpnt] H ~smusdir(a4,1) W ~line end if a2 = DASHES * dashes if ts(a1,SIGN_TYPE) = LETTER_DYNAM a6 = obx2 - (2 * hpar(46)) else a6 = obx2 end line = chs(a6) // " " // chs(smusdir(a4,4)) // " 0" a6 = smusdir(a4,3) ++outpnt tput [Y,outpnt] H ~smusdir(a4,1) D ~smusdir(a4,2) ~line ~a6 end * range shifts if chr(a2) in [OCT_UP,OCT_DOWN,DBL_OCT_UP,DBL_OCT_DOWN] if a2 = OCT_UP or a2 = DBL_OCT_UP a5 = smusdir(a4,4) + vpar(47) else a5 = smusdir(a4,4) - vpar(46) end line = chs(smusdir(a4,2)) // " " // chs(smusdir(a4,3)) // " " a6 = obx2 - hpar(47) line = line // chs(a6) // " " // chs(a5) // " " // chs(vpar(41)) ++outpnt tput [Y,outpnt] H ~smusdir(a4,1) V ~line end smusdir(a4,1) = 0 /* clear the row for next use end end if ts(a1,DINC_FLAG) > 0 inctype = ts(a1,DINC_FLAG) end goto ZZZ end &dA &dA &d@ D. Typeset Figures &dA if nodtype = FIGURES obx = p &dA &dA &d@ We need to run a little check here. If there is an element &dA &d@ in the ts array that has the same division number and is a note or &dA &d@ cue-note, then the possibility exist that this object might &dA &d@ have to be shifted to the right in order to be placed under &dA &d@ the note (and not under some accidental to the note). &dA if ts(a1+1,DIV) = ts(a1,DIV) if ts(a1+1,TYPE) = NOTE or ts(a1+1,TYPE) = CUE_NOTE obx += ts(a1+1,NODE_SHIFT) p += ts(a1+1,NODE_SHIFT) ts(a1+1,NODE_SHIFT) = 0 if ts(a1+1,SPACING) < ts(a1,MIN_FIG_SPAC) ts(a1+1,SPACING) = ts(a1,MIN_FIG_SPAC) end end end a3 = FIG_DATA supcnt = 0 * determine if accidentals precede any figures in this set loop for a2 = 1 to 4 mf(a2) = 0 repeat a10 = FIG_DATA loop for a2 = 1 to ts(a1,NUMBER_OF_FIG) a4 = ts(a1,a10) + 28 /* tricky code, possible rewrite &dA &dA &d@ Code added &dA11/16/03&d@ to deal with parentheses around figures &dA if a4 > 1000 a4 = a4 / 1000 a4 = rem end &dA temp = chr(a4) if "1389" con temp if ts(a1,a10+1) > 0 and ts(a1,a10+1) < 20 mf(a2) = a4 - 48 end end a10 += 3 repeat * construct sub-objects oby = vpar(49) y = vpar(49) loop for a2 = 1 to ts(a1,NUMBER_OF_FIG) a6 = ts(a1,a3) &dA &dA &d@ Code added &dA11/16/03&d@ to deal with parentheses around figures &dA a10 = 0 if a6 > 1000 a10 = a6 / 1000 a6 = rem if a6 = 0 a10 = 0 else if a10 = 1 y -= vpar(92) x = obx - hpar(136) if mf(a2) > 0 a9 = mf(a2) + 67 a9 = hpar(a9) x -= a9 end z = 197 /* music font kscrdat = "" perform subj /* small left parenthesis y += vpar(92) else if a10 = 3 /* shift down to bracket 3 figures y += (vpar(48) >> 1) end y += vpar(93) x = obx - hpar(138) if mf(a2) > 0 a9 = mf(a2) + 67 a9 = hpar(a9) x -= a9 end z = 69 /* music font kscrdat = "" perform subj /* large left parenthesis y -= vpar(93) if a10 = 3 y -= (vpar(48) >> 1) end end end end &dA x = obx if a6 > 0 if mf(a2) > 0 a9 = mf(a2) + 67 a9 = hpar(a9) x = obx - a9 z = mf(a2) + 210 /* music font else a9 = hpar(66) if a6 = 30 z = 220 /* music font else if a6 < 10 z = a6 + 199 else if a6 < 20 z = 200 kscrdat = "" perform subj x += a9 z = a6 + 189 else a9 = a6 + 47 a9 = hpar(a9) z = a6 + 190 end end end end kscrdat = "" perform subj x += a9 a6 = ts(a1,a3+1) if a6 > 0 a9 = hpar(66) if a6 < 10 z = a6 + 199 else if a6 < 20 z = 200 kscrdat = "" perform subj x += a9 z = a6 + 189 else a9 = a6 + 47 a9 = hpar(a9) z = a6 + 190 end end kscrdat = "" perform subj x += a9 end &dA &dA &d@ Code added &dA11/16/03&d@ to deal with parentheses around figures &dA if a10 > 0 x -= a9 if a10 = 1 x += hpar(137) y -= vpar(92) z = 198 /* music font kscrdat = "" perform subj /* small right parenthesis y += vpar(92) else if a10 = 3 /* shift down to bracket 3 figures y += (vpar(48) >> 1) end x += hpar(139) y += vpar(93) z = 70 /* music font kscrdat = "" perform subj /* large right parenthesis y -= vpar(93) if a10 = 3 y -= (vpar(48) >> 1) end end x += a9 end &dA end * set up for dealing with continuation lines if ts(a1,a3+2) = 2 ++snum figarr(a2,FIG_SNUM) = snum dv4 = x - obx if a6 > 0 dv4 += (hpar(66) * 3 / 2) /* &dA11/16/03&d@ Experiment: was simply hpar(66) end figarr(a2,FIG_HOFF1) = dv4 ++supcnt supnums(supcnt) = snum end if ts(a1,a3+2) = 1 figarr(a2,FIG_HOFF2) = hpar(77) figarr(a2,FIG_READY) = 1 ++supcnt supnums(supcnt) = figarr(a2,FIG_SNUM) end a3 += 3 y += vpar(48) repeat * put out object and sub-objects out = chs(supcnt) loop for a3 = 1 to supcnt out = out // " " // chs(supnums(a3)) repeat supcnt = 0 jtype = "F" jcode = 0 pcode = sobcnt oby = ts(a1,STAFF_NUM) * 1000 + oby &dA &dA &d@ Now look for print suggestions for this figure object &dA putobjpar = 0 c5 = ts(a1,TSR_POINT) pcontrol = ors(tsr(c5){1}) /* &dA05/02/03&d@ px = ors(tsr(c5){3}) << 8 py = ors(tsr(c5){4}) << 16 a2 = ors(tsr(c5){2}) << 24 putobjpar = a2 + px + py + pcontrol /* Note: order of data has been changed jscrdat = "" perform putobj * write out continuation line super-objects loop for a2 = 1 to MAX_FIG if figarr(a2,FIG_READY) > 0 ++outpnt tput [Y,outpnt] H ~figarr(a2,FIG_SNUM) F ~a2 ~figarr(a2,FIG_HOFF1) ~figarr(a2,FIG_HOFF2) 0 loop for a3 = 1 to 4 figarr(a2,a3) = 0 repeat end repeat a4 = ts(a1,FIG_SPACE) if a4 > 0 p += a4 end if ts(a1,DINC_FLAG) > 0 inctype = ts(a1,DINC_FLAG) end goto ZZZ end &dA &dA &d@ ================================================================= &dA &d@ GENERAL SECTION COMMENT &dA &dA &d@ At this point, we have only notes (grace, regular and cue) &dA &d@ and rests (regular and cue) left to typeset. This is actually &dA &d@ where the process becomes interesting and can be quite complex. &dA &d@ For music on the grand staff (the most complex situation) &dA &d@ there can be as many as &dDten&d@ (&dDMAX_PASS&d@) passes and as many as &dA &d@ &dDsix&d@ notes in a single pass (maximum chord size) &dA &dA &d@ We need to review the way note events are organized in the set &dA &d@ array and how this relates to the way they are organized in the &dA &d@ i-files. In the i-files, the basic unit of organization is the &dA &d@ object. An object can contain a note, a set of notes (chord), or a &dA &d@ rest. Items which normally attach to notes such as accidentals, &dA &d@ ornaments, articulations, leger lines, etc., are included as &dA &d@ sub-objects to the object. Items which normally connect notes such &dA &d@ as beams, ties, and slurs, are represented by superobjects. Among &dA &d@ the parameters associated with an object are (1) &dDhorizontal location&d@, &dA &d@ (2) &dDspace node number&d@, and (3) &dDdistance&d@ &dDincrement flag&d@. &dA &dA &d@ &dDThe first level of organization in the set array is by division&d@. &dA &d@ A division is a time-location with a measure. A division may have &dA &d@ several note events belonging to it (as well as other types of events, &dA &d@ which, at this point in the program have already been dealt with). &dA &d@ &dDAll members of a division will have the same space node number.&d@ &dA &d@ The first object in a division will have a non-zero distance &dA &d@ increment flag. This feature is handled automatically by the &dA &d@ putobj procedure. &dA &dA &d@ Within a division, we first find all of the grace notes (and &dA &d@ grace chord notes). Since grace notes generally precede regular and &dA &d@ cue notes, these notes can have non-zero advance-space parameters &dA &d@ associated with them. This means that grace notes objects can &dA &d@ advance the horizontal location pointer. On the other hand, cue-size &dA &d@ and regular objects will generally have the same horizontal location &dA &d@ (except for for shifts to accomodate clashes). &dA &dA &d@ From the above analysis, we can see that &dDthe next level of&d@ &dA &d@ &dDorganization in the set array is by general location&d@. In particular, &dA &d@ grace notes will tend fall into one or more groups, each having a &dA &d@ separate general location. All cue-size and regular notes (and &dA &d@ rests will have the same general location. &dA &dA &d@ Finally &dDthe lowest level of organization in the set array is by&d@ &dA &d@ &dDactual object&d@. Only notes of the same chord will share the same &dA &d@ object. &dA &dA &d@ We are currently inside a big loop, which begins under the title &dA &d@ "&dLProcessing loop (loop ends at ZZZ)&d@". The loop itself is initiated &dA &d@ by the instruction "&dNloop for a1 = 1 to sct&d@". The variable "spn", &dA &d@ which is the space node number, is retrieved from storage at the top &dA &d@ of this loop. It is based on division number. We do not need to &dA &d@ process all notes and rests on a particular division at one time; we &dA &d@ may proceed down to the next level of organization within the set &dA &d@ array, which is the general location. The key variable in &dA &d@ determining this grouping is the space parameter "&dLSPACING&d@". The &dA &d@ first ts(.,.) ROW element of a general location group will have a &dA &d@ non-zero space parameter, and any other element in such a group will &dA &d@ have a space parameter = 0. &dA &dA &d@ In typesetting a group of notes at a general location, the &dA &d@ following information is required. &dA &dA &d@ (1) The number of passes (chords or single notes) in the group &dA &d@ (2) The number of set array elements in each of these passes &dA &d@ (3) a4 = the spacing parameter for this group &dA &d@ (4) a2 = index to last element in group &dA &d@ &dA &d@ END OF COMMENT &dA &d@ &dA &d@ ================================================================= &dA &d@ &dA &dA &d@ E. Notes/Rests &dA a4 = ts(a1,SPACING) if ts(a1,NODE_SHIFT) > 0 &dK &d@ dputc shifting division number ~ts(a1,DIV) by the amount = ~ts(a1,NODE_SHIFT) p += ts(a1,NODE_SHIFT) end npasses = 1 a3 = 1 loop for a2 = a1+1 to sct if ts(a2,SPACING) <> 0 --a2 pitchcnt(npasses) = a3 goto XX1 end if ts(a2,TYPE) > NOTE_OR_REST --a2 pitchcnt(npasses) = a3 goto XX1 end if nodtype = GR_NOTE if ts(a2,TYPE) = XGR_NOTE ++a3 else pitchcnt(npasses) = a3 a3 = 1 ++npasses end else if ts(a2,TYPE) = XNOTE or ts(a2,TYPE) = XCUE_NOTE ++a3 else pitchcnt(npasses) = a3 a3 = 1 ++npasses end end repeat XX1: &dA &dA &d@ Create objects for this node &dA &dA &d@ a1 = index to first element in node &dA &d@ a2 = index to last element in node &dA &d@ npasses = number of passes (separate chords) in this node &dA &d@ pitchcnt(.) = size of chord for each pass &dA &d@ a4 = space parameter (space following this node) &dA &dA &dA &d@ I. Typeset objects in this node &dA c2 = a1 - 1 loop for a14 = 1 to npasses obx = p c1 = c2 + 1 /* top of chord c2 = c1 + pitchcnt(a14) - 1 /* bottom of chord a3 = ts(c1,STAFF_NUM) + 1 /* staff number passnum = ts(c1,PASSNUM) oby = ts(c1,OBY) &dK &d@ ntype = ts(c1,NTYPE) ntype = ts(c1,NTYPE) & 0xff /* new &dA10/15/07&d@ opt_rest_flag = ts(c1,NTYPE) >> 8 /* new &dA10/15/07&d@ nodtype = ts(c1,TYPE) &dA &dA &dA &d@ I. Construct Text Sub-Object (new to this position &dA06-26-94&d@ ) &dA if nodtype = NOTE c5 = ts(c1,TEXT_INDEX) if c5 > 0 ttext = tsdata(c5) // pad(1) else ttext = pad(1) end &dK &d@ if ttext{1} in ['A'..'Z','a'..'z','!'..'(','\','='] &dA &dA &d@ New test for text data &dA09/01/03&d@ &dA c5 = 0 if ttext{1} in ['A'..'Z','a'..'z','!'..'(','\','='] c5 = 1 else ttext = ttext // " " loop for c4 = 1 to len(ttext) if ttext{c4} = "|" and ttext{c4+1} in ['A'..'Z','a'..'z','!'..'(','\','='] c5 = 1 c4 = len(ttext) end repeat ttext = trm(ttext) end if c5 = 1 &dA &dA &d@ End of test &dA09/01/03&d@ &dA c5 = mtfont perform spacepar temp2 = ttext if temp2 con "$$$$" ttext = temp2{1,sub-1} c4 = int(temp2{sub+4..}) /* x offset (calculated earlier) if sub < len(temp2) org_c4 = int(temp2{sub+1..}) /* original "unbiased" (pre &dA12/09/03&d@) offset else org_c4 = c4 end else dputc Program Error end temp2 = ttext // "| " ttextcnt = 0 CCCD: if temp2 con "|" ttext = temp2{1,mpt-1} if ttext = "_" /* &dA09/01/03&d@ Must flag isolated "_" ttext = "&" end temp2 = temp2{mpt+1..} ++ttextcnt ttextarr(ttextcnt) = trm(ttext) goto CCCD end loop for a7 = 1 to ttextcnt ttext = ttextarr(a7) &dA &dA &d@ determine values of xbytearr &dA a6 = len(ttext) xbytearr(a7) = "* " if "-_" con ttext{a6} ttext = ttext{1,a6-1} xbytearr(a7) = "-_"{mpt} // " " if mpt = 2 a6 = len(ttext) if ",.;:!?" con ttext{a6} ttext = ttext{1,a6-1} xbytearr(a7) = ",.;:!?"{mpt} // " " end end end ttextarr(a7) = ttext repeat &dA &dA &d@ determine relative position of ttext &dA x = p - c4 sobx = x - obx &dA &dA &d@ Code added &dA12/09/03&d@ &dA if org_c4 <> c4 a8 = p - org_c4 sobx2 = a8 - obx else sobx2 = 0 end &dA loop for a8 = 1 to ttextcnt ttext = ttextarr(a8) if ttext <> "&" /* &dA09/01/03&d@ Use flag set above ++sobcnt &dA &dA &d@ Code modified &dA12/09/03&d@ &dA if sobx2 <> 0 temp3 = "T " // chs(sobx) // "|" // chs(sobx2) // " " // chs(a8) // " " else temp3 = "T " // chs(sobx) // " " // chs(a8) // " " end &dK &d@ temp3 = "T " // chs(sobx) // " " // chs(a8) // " " &dA if ttext con "=" if mpt < 3 /* &dA10/19/03&d@ Fixing corner case error ttext{mpt} = "-" else if ttext{mpt-2,3} <> "\0=" ttext{mpt} = "-" end end end &dA &dA &d@ Introducing optional conversion to ligitures in text &dA10/20/03&d@ &dA if ligit_flag = 1 LIGCON1: if ttext con "ffi" ttext{mpt,3} = "\0:" goto LIGCON1 end if ttext con "ffl" ttext{mpt,3} = "\0;" goto LIGCON1 end if ttext con "ff" ttext{mpt,2} = "\0<" goto LIGCON1 end if ttext con "fi" ttext{mpt,2} = "\0=" goto LIGCON1 end if ttext con "fl" ttext{mpt,2} = "\0>" goto LIGCON1 end end #if AUTOSCR #else perform kernttext /* New &dA04/22/04&d@ #endif perform wordspace sobl(sobcnt) = temp3 // ttext // " " // xbytearr(a8) // chs(a5) end repeat else if ttext in [' ','~'] /* code added &dA02-23-95&d@ loop for c15 = len(ttext) to 1 step -1 if ttext{c15} = "~" &dA &dA &d@ I'm going to try something risky here, namely to add a text sub-object &dA &d@ to the previous note: temp variables c13,c14,c15 &dA loop for c13 = outpnt to 1 step -1 tget [Y,c13] temp3 if temp3{1,3} = "J N" &dA &dA &d@ 1. Increment field 6 of record at c13 &dA temp3 = temp3{5..} c14 = int(temp3) c14 = int(temp3{sub..}) c14 = int(temp3{sub..}) temp2 = "J N " // temp3{1..sub} c14 = int(temp3{sub..}) ++c14 temp2 = temp2 // chs(c14) // temp3{sub..} tput [Y,c13] ~temp2 &dA &dA &d@ 2. Create space at c13+1 &dA loop for c14 = outpnt to c13 + 1 step -1 tget [Y,c14] temp3 tput [Y,c14+1] ~temp3 repeat &dA &dA &d@ 3. Add pseudo text record at c13+1 &dA temp3 = "T 0 " // chs(c15) // " ~ * 0" tput [Y,c13+1] ~temp3 &dA &dA &d@ 4. Increment outpnt &dA ++outpnt c13 = 1 /* end of loop end repeat end repeat end end end &dA &dA &dA note_dur = ts(c1,NOTE_DUR) /* Added &dA11-11-93&d@ if nodtype <= REST passtype = REG passsize = FULLSIZE if bit(16,ts(c1,SUBFLAG_1)) = 1 passsize = CUESIZE /* EXPERIMENT &dA06-24-94&d@ end else passsize = CUESIZE if nodtype <= CUE_REST passtype = CUE else passtype = GRACE end end &dA &dA &d@ a) rests &dA if nodtype = REST or nodtype = CUE_REST c3 = ts(c1,STAFF_NUM) * 1000 perform setrest (c9) /* OK 6-23-93 goto ZZZZ end &dA &dA &d@ b) arpeggios (New code &dA01/13/06&d@) &dA if nodtype = GR_NOTE and ntype = ARPEGGIO arpeg_flag = ts(c1,ARPEG_FLAG) arpeg_top = ts(c1,ARPEG_TOP) arpeg_bottom = ts(c1,ARPEG_BOTTOM) perform setarpeggio goto ZZZZ end &dA &dA &d@ c) notes &dA &dA &d@ leger lines hpar(82) = width of black note (for typesetting) &dA &d@ hpar(83) = width of whole note (for typesetting) &dA c7 = c2 c8 = c1 c9 = 0 stem = bit(1,ts(c1,STEM_FLAGS)) if stem = UP chord_spread = ts(c2,STAFFLOC) - ts(c1,STAFFLOC) else chord_spread = ts(c1,STAFFLOC) - ts(c2,STAFFLOC) end super_flag = 0 slur_flag = 0 loop for c3 = c1 to c2 super_flag |= ts(c3,SUPER_FLAG) slur_flag |= ts(c3,SLUR_FLAG) repeat if ntype > HALF c9 = hpar(83) - hpar(82) + 1 end perform setleger /* looks O.K. 6-24-93 &dA &dA &d@ accidentals &dA loop for c3 = c1 to c2 c4 = ts(c3,AX) if c4 > 0 y = ts(c3,STAFFLOC) perform setax /* looks O.K. 6-24-93 end repeat &dA &dA &d@ note heads and dots &dA z1 = 50 - ntype /* music font if z1 > 43 /* music font z1 = 43 /* music font end if passsize = CUESIZE z1 += 128 /* music font end &dA &dA &d@ Adding code for percussion note heads &dA02/19/06&d@ &dA c4 = ts(c1,SUBFLAG_1) & 0xf00000 if c4 > 0 c4 >>= 20 if c4 = 1 z1 = 1001 /* extended music font if passsize = CUESIZE ++z1 /* end end end &dA loop for c3 = c1 to c2 if c3 = c1 &dA &dA &d@ All New code &dA05/02/03&d@ &dA &dA &d@ At this point, we need to see if the note object position has been modified &dA &d@ "absolutely" by a print suggestion. If this is the case, we need to make the &dA &d@ adjustment here, AND, elimate the suggestion from the tsr string. &dA &dK &d@ c4 = ts(c1,TSR_POINT) &dK &d@ c5 = ors(tsr(c4){2}) &dK &d@ if bit(0,c5) = 1 &dK &d@ px = ors(tsr(c4){3}) &dK &d@ if px > 0 &dK &d@ px = px - 128 * notesize / 10 &dK &d@ pxx = c5 & 0x02 >> 1 &dK &d@ if pxx = 1 &dK &d@ ts(c1,GLOBAL_XOFF) = px &dK &d@ tsr(c4){3} = chr(0) /* here is where suggestion is zeroed out &dK &d@ end &dK &d@ end &dK &d@ end &dA &dA &d@ End of new code &dA05/02/03&d@ &dA obx = ts(c1,GLOBAL_XOFF) + p end x = obx + ts(c3,LOCAL_XOFF) y = ts(c3,STAFFLOC) z = z1 &dA &dA &d@ Adding code &dA11/26/06&d@ to allow for mixed colors in chords &dA if mixed_color_flag > 0 z = 50 - ts(c3,NTYPE) if z > 43 /* music font z = 43 /* music font end /* music font if passsize = CUESIZE z += 128 end /* music font end &dA &dA &d@ End of &dA11/26/06&d@ Addition kscrdat = "" #if AUTOSCR perform build_note_kscrdat #endif &dA &d@³ &dA &d@³ Uses inputs: c3 = pointer into set array for this note &dA &d@³ y = vertical position of note &dA &d@³ ntype = type of note (e.g. sixteenth) &dA &d@³ note_dur = duration of note (in divisions) &dA &d@³ divspq = divspq &dA &d@³ nodtype = NOTE, GR_NOTE, or CUE_NOTE &dA &d@³ &dA &d@³ Output: kscrdat string &dA &d@³ &dA &d@³ Operation: Compute full values for: P2 P4 P6 P7 P10 P12 &dA &d@³ Compute partial values for: P5 P9 &dA &d@³ Not computed: P3 P8 &dA &d@³ perform subj c16 = y / notesize if c16 <= 0 --c16 /* guarentee c16 is above position for rem <> 0 end c10 = rem if y <= 0 - notesize if c10 <> 0 &dK &d@ y += vpar(1) y = c16 + 1 * notesize end perform wideleger /* looks O.K. 6-24-93 end if y >= vpar(10) if c10 <> 0 &dK &d@ y -= vpar(1) y = c16 * notesize end perform wideleger end perform setdots /* looks O.K. 6-24-93 repeat &dA &dA &d@ look for forward tie, slur and tuplet super-objects &dA x = obx y = oby perform superfor /* operates on entire chord &dA &dA &d@ set certain articulations above or below notes or stems &dA perform setart /* operates on entire chord &dA &dA &d@ if there are slurs entering or leaving this chord, adjust virtual &dA &d@ endpoints at this time. &dA c14 = ts(c1,SLUR_X) c8 = 0 /* slur present flag if c14 > 0 c5 = ts(c14,1) c4 = ts(c14,3) if c4 <> c5 c8 = 2 /* slur present above (usually) end if c4 < c5 c5 = c4 /* above end c4 = ts(c14,2) c6 = ts(c14,4) if c4 <> c6 c8 = 1 /* slur present below (usually) end if c6 > c4 c4 = c6 /* below end if stem = DOWN c6 = c4 c4 = c5 c5 = c6 if c8 <> 0 c8 = 3 - c8 end end loop for c6 = c1 to c2 ts(c6,VIRT_STEM) = c5 ts(c6,VIRT_NOTE) = c4 repeat else c5 = ts(c1,VIRT_STEM) c4 = ts(c1,VIRT_NOTE) end &dA &dA &d@ Set more indications &dA perform setperf /* operates on entire chord &dA &dA &d@ Set forte and piano (New code &dA05/17/03&d@) &dA c17 = ( ts(c1,SUBFLAG_1) | ts(c1,ED_SUBFLAG_1) ) & 0x1c003c00 /* changed &dA10/08/08&d@ from 0x3c00 if c17 > 0 c7 = stem px = 0 py = 0 pyy = 0 pxx = 0 c5 = 14 /* dynamics code = 14 perform getpxpy (c5,c1) if bit(0,pcontrol) = 1 if bit(1,pcontrol) = 1 if bit(2,pcontrol) = 0 c7 = 1 - stem else c7 = stem end end end c5 = ts(c1,VIRT_STEM) c4 = ts(c1,VIRT_NOTE) c13 = 0 perform yadjust if c7 = stem if stem = DOWN y = c5 + vpar(5) else y = c4 + vpar(5) end else if stem = UP y = c5 - vpar(2) else y = c4 - vpar(2) end end x = obx + px if pyy = 1 y = py else y += py end c7 = c17 >> 10 &dA &d@ New code &dA10/08/08&d@ &dA if c7 > 15 c7 >>= 16 c7 += 15 /* potential range 1 to 23 end &dA c17 = ts(c1,ED_SUBFLAG_1) & 0x1c003c00 /* changed &dA10/08/08&d@ from 0x3c00 &dA &dA &d@ Case I: regular dynmaics &dA if c17 = 0 &dA &d@ New code &dA10/08/08&d@ and &dA01/12/09&d@ and &dA03/16/09&d@ &dA if c7 = 16 or c7 = 17 or c7 = 18 if c7 = 18 /* sff z = 111 /* music font kscrdat = "" perform subj x += hpar(63) z = 110 /* music font perform subj x += hpar(62) z = 110 /* music font perform subj else if c7 = 16 z = 110 kscrdat = "" perform subj /* f x += hpar(140) else z = 109 kscrdat = "" perform subj /* m x += hpar(60) z = 110 end perform subj x += hpar(140) /* f z = 108 perform subj x += hpar(62) /* p end &dA else if c7 < 5 /* p, pp, ppp, pppp z = 108 kscrdat = "" loop while c7 > 0 perform subj x += hpar(60) --c7 repeat else if c7 < 9 /* f, ff, fff, ffff z = 110 kscrdat = "" loop while c7 > 4 perform subj x += hpar(140) --c7 repeat else if c7 < 11 /* mp, mf z = 109 /* music font kscrdat = "" perform subj x = obx + hpar(60) + px z = c7 * 2 + 90 /* music font perform subj else if c7 = 11 /* fp z = 110 /* music font kscrdat = "" perform subj x = obx + hpar(140) + px z = 108 /* music font perform subj else if c7 = 12 /* sfp z = 111 /* music font kscrdat = "" perform subj x = obx + hpar(63) + px z = 110 /* music font perform subj x += hpar(140) z = 108 /* music font perform subj else kscrdat = "" if c7 > 13 /* sfz, rfz z = c7 * 2 + 83 /* music font perform subj c8 = z - 48 x = obx + hpar(c8) + px end z = 110 /* music font perform subj #if SFZ x += hpar(62) z = 112 /* music font perform subj #endif end end end end end end else &dA &dA &d@ Case II: editorial dynamics &dA &dA &dA &d@ Conditional code added &dA02/04/04&d@ to implement Roman editorial dynamics &dA #if ROMAN_EDIT ++sobcnt sobx = x - obx soby = y - oby &dA &d@ New code &dA10/08/08&d@ &dA if c7 = 16 sobl(sobcnt) = "W " // chs(sobx) // " " // chs(soby) // " 31 ffp" &dA else if c7 < 5 /* p, pp, ppp, pppp sobl(sobcnt) = "W " // chs(sobx) // " " // chs(soby) // " 31 " loop while c7 > 0 sobl(sobcnt) = sobl(sobcnt) // "p" --c7 repeat else if c7 < 9 /* f, ff, fff, ffff sobl(sobcnt) = "W " // chs(sobx) // " " // chs(soby) // " 31 " loop while c7 > 4 sobl(sobcnt) = sobl(sobcnt) // "f" --c7 repeat else if c7 < 11 /* mp, mf sobl(sobcnt) = "W " // chs(sobx) // " " // chs(soby) // " 31 m" if c7 = 9 sobl(sobcnt) = sobl(sobcnt) // "p" else sobl(sobcnt) = sobl(sobcnt) // "f" end else if c7 = 11 /* fp sobl(sobcnt) = "W " // chs(sobx) // " " // chs(soby) // " 31 fp" else if c7 = 12 /* sfp sobl(sobcnt) = "W " // chs(sobx) // " " // chs(soby) // " 31 sfp" else if c7 > 13 /* sfz, rfz if c7 = 14 sobl(sobcnt) = "W " // chs(sobx) // " " // chs(soby) // " 31 sf" else sobl(sobcnt) = "W " // chs(sobx) // " " // chs(soby) // " 31 rf" end #if SFZ sobl(sobcnt) = sobl(sobcnt) // "z" #endif end end end end end end end #else &dA &dA &d@ Editorial dynamics using square brackets and the music font &dA &dA &dA &d@ hpar(108) = width of editorial dynamic letter p chr(251) &dA &d@ hpar(109) = width of editorial dynamic letter m chr(252) &dA &d@ hpar(110) = width of editorial dynamic letter f chr(253) &dA &d@ hpar(111) = width of editorial dynamic letter s chr(246) &dA &d@ hpar(112) = width of editorial dynamic letter z chr(247) &dA &d@ hpar(113) = width of editorial dynamic letter r chr(248) &dA &d@ hpar(114) = backup to print square bracket for editorial p [p... chr(195) &dA &d@ hpar(115) = backup to print square bracket for editorial m [m... &dA &d@ hpar(116) = backup to print square bracket for editorial f [f... &dA &d@ hpar(117) = backup to print square bracket for editorial s [sf &dA &d@ hpar(118) = backup to print square bracket for editorial r [rf &dA &d@ hpar(119) = shift to print square bracket following editorial f f] chr(196) &dA &d@ hpar(120) = shift to print square bracket following editorial p p] &dA &d@ hpar(121) = shift to print square bracket following editorial z z] &dA &dA &d@ vpar(84) = vertical shift up for printing square brackets for dynamics &dA &dA &d@ New code &dA10/08/08&d@ &dA if c7 = 16 kscrdat = "" x -= hpar(116) y -= vpar(84) z = 195 perform subj x += hpar(116) y += vpar(84) z = 253 /* editorial f perform subj /* f x += hpar(110) perform subj /* f x += hpar(110) perform subj /* p x += hpar(108) x += hpar(120) &dA else if c7 < 5 /* p, pp, ppp, pppp kscrdat = "" x -= hpar(114) y -= vpar(84) z = 195 perform subj x += hpar(114) y += vpar(84) z = 251 /* editorial p loop while c7 > 0 perform subj x += hpar(108) --c7 repeat x += hpar(120) else if c7 < 9 /* f, ff, fff, ffff kscrdat = "" x -= hpar(116) y -= vpar(84) z = 195 perform subj x += hpar(116) y += vpar(84) z = 253 /* editorial f loop while c7 > 4 perform subj x += hpar(110) --c7 repeat x += hpar(119) else if c7 < 11 /* mp, mf kscrdat = "" x -= hpar(115) y -= vpar(84) z = 195 perform subj x += hpar(115) y += vpar(84) z = 252 /* editorial m perform subj x += hpar(109) if c7 = 9 z = 251 /* editorial p perform subj x += hpar(108) x += hpar(120) else z = 253 /* editorial f perform subj x += hpar(110) x += hpar(119) end else if c7 = 11 /* fp kscrdat = "" x -= hpar(116) y -= vpar(84) z = 195 perform subj x += hpar(116) y += vpar(84) z = 253 /* editorial f perform subj x += hpar(110) z = 251 /* editorial p perform subj x += hpar(108) x += hpar(120) else if c7 = 12 /* sfp kscrdat = "" x -= hpar(117) y -= vpar(84) z = 195 perform subj x += hpar(117) y += vpar(84) z = 246 /* editorial s perform subj x += hpar(111) z = 253 /* editorial f perform subj x += hpar(110) z = 251 /* editorial p perform subj x += hpar(108) x += hpar(120) else if c7 > 13 /* sfz, rfz kscrdat = "" if c7 = 14 x -= hpar(117) y -= vpar(84) z = 195 perform subj x += hpar(117) y += vpar(84) z = 246 /* editorial s perform subj x += hpar(111) else x -= hpar(118) y -= vpar(84) z = 195 perform subj x += hpar(118) y += vpar(84) z = 248 /* editorial r perform subj x += hpar(113) end z = 253 /* editorial f perform subj x += hpar(110) #if SFZ z = 247 /* editorial z perform subj x += hpar(112) #else x += hpar(119) #endif end end end end end end end kscrdat = "" y -= vpar(84) z = 196 perform subj #endif &dA &dA &d@ End of Conditional compile &dA02/04/04&d@ &dA end end &dA &dA &d@ End of New code &dA05/17/03&d@ &dA loop for c3 = c1 to c2 ts(c3,VIRT_NOTE) = c4 ts(c3,VIRT_STEM) = c5 repeat &dA &dA &d@ set stems and beams for this note &dA if stem = UP c3 = c1 else c3 = c2 end perform setstem /* (revised for multiple notes) &dA &dA &d@ determine super-objects &dAwhich end&d@ on this note or which &dA &d@ contain this note (such as beams) &dA &dA &d@ 1) beams &dA if ts(c1,BEAM_FLAG) > 0 ++supcnt supnums(supcnt) = beampar(passtype,passnum,BM_SNUM) end &dA &dA &d@ 2) ties which end on this note &dA loop for c3 = c1 to c2 c7 = ts(c3,BACKTIE) if c7 > 0 if c7 < INT10000 /* c7 = index to ts element which starts the tie c7 = ts(c7,BACKTIE) /* c7 now points to ROW of tiearr else c7 -= INT10000 end ++supcnt supnums(supcnt) = tiearr(c7,TIE_SNUM) end ts(c3,BACKTIE) = c7 /* now set BACKTIE to point directly to ROW of tiearr repeat &dA &dA &d@ 3) slurs (revised for multiple notes) &dA loop for c4 = 1 to 4 c5 = c4 * 2 - 1 if bit(c5,slur_flag) = 1 ++supcnt supnums(supcnt) = slurar(c4,SL_SNUM) end if bit(c5+16,slur_flag) = 1 ++supcnt supnums(supcnt) = slurar(c4+4,SL_SNUM) end repeat &dA &dA &d@ 4) tuplets (revised for multiple notes) &dA if bit(5,super_flag) = 1 ++supcnt supnums(supcnt) = tuar(passtype,passnum,TU_SNUM) end &dA &dA &d@ 5) long trills (revised for multiple notes) &dA if tsnum(passnum) > 0 and bit(3,super_flag) = 1 /* long trill ending ++supcnt supnums(supcnt) = tsnum(passnum) end &dA &dA &d@ New code (&dA11-11-93&d@) Duration attribute of note &dA ++sobcnt sobl(sobcnt) = "A D " // chs(note_dur) // " " // chs(divspq*4) &dA &dA &d@ Write out Object Record and associated Sub-Objects &dA out = chs(supcnt) loop for c4 = 1 to supcnt out = out // " " // chs(supnums(c4)) repeat if nodtype = GR_NOTE or nodtype = XGR_NOTE jtype = "G" else jtype = "N" end jcode = ntype pcode = sobcnt c10 = ts(c1,STAFF_NUM) * 1000 oby += c10 &dA &dA &d@ Now look for print suggestions for this note object &dA putobjpar = 0 c4 = ts(c1,TSR_POINT) pcontrol = ors(tsr(c4){1}) /* &dA05/02/03&d@ px = ors(tsr(c4){3}) << 8 py = ors(tsr(c4){4}) << 16 c8 = ors(tsr(c4){2}) << 24 putobjpar = c8 + px + py + pcontrol /* Note: order of data has been changed if xdata_flag = 1 c4 = ts(c1,STEM_FLAGS) & 0x07 /* first three flags c4 <<= 4 putobjpar |= c4 &dA &dA &d@ Need to add in the effects of some extra x-position &dA &d@ modifications. &dA11/24/07&d@ &dA &dK &d@ c4 = ts(c1,GLOBAL_XOFF) /* ???? I worry about this t1 = putobjpar >> 8 & 0xff if t1 > 0 t1 = t1 - 128 * notesize / 10 end c4 = ts(c1,GLOBAL_XOFF) + t1 /* I worry less about this &dA &d@ /* and I think I may have it fixed. jscrdat = "" if c4 > 0 jscrdat = "| P3=" // chs(c4) else if c4 < 0 c4 = 0 - c4 jscrdat = "| P3=-" // chs(c4) end end end perform putobj oby -= c10 &dA &dA &d@ Write out completed Super-Objects and set up new ones &dA &dA &d@ 1) Tuples &dA if bit(5,super_flag) = 1 /* (revised for multiple notes) &dA &dA &d@ Code added &dA05-31-95&d@ to prevent tuplets over "partial" beams from being &dA &d@ associated with those beams. &dA if beampar(passtype,passnum,BM_TUPLE) > 0 if beampar(passtype,passnum,BM_READY) = 0 beampar(passtype,passnum,BM_TUPLE) = 0 end end c8 = 1 t2 = 0 t1 = (tuar(passtype,passnum,TU_FSTEM) & 0xff) + stem c9 = tuar(passtype,passnum,TU_Y1) c11 = 0 goto TPF(tpflag+1) TPF(1): /* default tuplet placement if beampar(passtype,passnum,BM_TUPLE) > 0 c8 |= 0x08 t2 = beampar(passtype,passnum,BM_SNUM) t1 = oby if ts(c1,MULTI_TRACK) > 0 c8 |= 0x10 else t1 += chord_spread c9 = tuar(passtype,passnum,TU_Y2) end c10 = tuar(passtype,passnum,TU_FSTEM) & 0xff00 c10 >>= 8 if bit(0,c10) = 1 /* bracket present &dA03-21-97&d@ c10 >>= 1 c10 <<= 5 c10 |= 0x02 /* add bracket if beampar(passtype,passnum,BM_TUPLE) = 2 /* this code expanded &dA05/06/03 if bit(4,c8) = 1 c10 |= 0x04 /* tips up end else if bit(4,c8) = 0 c10 |= 0x04 /* tips up end end &dK &d@ if beampar(passtype,passnum,BM_TUPLE) = 2 &dK &d@ c10 |= 0x04 /* tips up &dK &d@ end c8 |= c10 end goto TPFEC else if t1 = 0 goto TPFEA else goto TPFEB end end TPF(2): /* place tuplet near note heads if beampar(passtype,passnum,BM_TUPLE) > 0 c8 |= 0x08 t2 = beampar(passtype,passnum,BM_SNUM) t1 = oby + chord_spread c9 = tuar(passtype,passnum,TU_Y2) c10 = tuar(passtype,passnum,TU_FSTEM) & 0xff00 c10 >>= 8 if bit(0,c10) = 1 /* bracket present &dA03-21-97&d@ c10 >>= 1 c10 <<= 5 c10 |= 0x02 /* add bracket if beampar(passtype,passnum,BM_TUPLE) = 1 c10 |= 0x04 /* tips up end c8 |= c10 end goto TPFEC else if t1 = 0 goto TPFEA else goto TPFEB end end TPF(3): /* place tuplet near stems if beampar(passtype,passnum,BM_TUPLE) > 0 c8 |= 0x18 t2 = beampar(passtype,passnum,BM_SNUM) t1 = oby c10 = tuar(passtype,passnum,TU_FSTEM) & 0xff00 c10 >>= 8 if bit(0,c10) = 1 /* bracket present &dA03-21-97&d@ c10 >>= 1 c10 <<= 5 c10 |= 0x02 /* add bracket if beampar(passtype,passnum,BM_TUPLE) = 2 c10 |= 0x04 /* tips up end c8 |= c10 end goto TPFEC else if t1 > 0 goto TPFEA else c11 = hpar(82) /* shift for stems up goto TPFEB end end TPF(4): /* place all tuplets above notes if beampar(passtype,passnum,BM_TUPLE) > 0 t1 = oby if stem = UP c8 |= 0x18 else c8 |= 0x08 t1 += chord_spread c9 = tuar(passtype,passnum,TU_Y2) end t2 = beampar(passtype,passnum,BM_SNUM) c10 = tuar(passtype,passnum,TU_FSTEM) & 0xff00 c10 >>= 8 if bit(0,c10) = 1 /* bracket present &dA03-21-97&d@ c10 >>= 1 c10 <<= 5 c10 |= 0x02 /* add bracket c8 |= c10 end goto TPFEC else if t1 = 0 c11 = hpar(82) end goto TPFEB end TPF(5): /* place all tuplets below notes if beampar(passtype,passnum,BM_TUPLE) > 0 t1 = oby if stem = UP c8 |= 0x08 t1 += chord_spread c9 = tuar(passtype,passnum,TU_Y2) else c8 |= 0x18 end t2 = beampar(passtype,passnum,BM_SNUM) c10 = tuar(passtype,passnum,TU_FSTEM) & 0xff00 c10 >>= 8 if bit(0,c10) = 1 /* bracket present &dA03-21-97&d@ c10 >>= 1 c10 <<= 5 c10 |= 0x02 /* add bracket c10 |= 0x04 /* tips up c8 |= c10 end goto TPFEC else if t1 > 0 c11 = hpar(82) end goto TPFEA end TPFEA: c9 = tuar(passtype,passnum,TU_Y2) + notesize c9 += vpar(64) if t1 > 0 c9 += vpar(7) t1 = vpar(7) /* add distance if stem is down else t1 = 0 end c10 = notesize * 6 if c9 < c10 c9 = c10 end t1 += oby + notesize + vpar(64) /* t1 set above if t1 < c10 t1 = c10 end c10 = tuar(passtype,passnum,TU_FSTEM) & 0xff00 c10 >>= 8 if bit(0,c10) = 1 /* bracket present &dA03-21-97&d@ c10 >>= 1 c10 <<= 5 c10 |= 0x02 /* add bracket c10 |= 0x04 /* tips up c8 |= c10 end goto TPFEC TPFEB: c9 = tuar(passtype,passnum,TU_Y2) - notesize c10 = 0 - vpar(1) /* OK 4-21-95 if t1 = 0 c9 -= vpar(7) t1 = 0 - vpar(7) /* subtract distance if stem is up else t1 = 0 end if c9 > c10 c9 = c10 end t1 += oby - notesize /* t1 set above if t1 > c10 t1 = c10 end c10 = tuar(passtype,passnum,TU_FSTEM) & 0xff00 c10 >>= 8 if bit(0,c10) = 1 /* bracket present &dA03-21-97&d@ c10 >>= 1 c10 <<= 5 c10 |= 0x02 /* add bracket c8 |= c10 end TPFEC: c9 -= tuar(passtype,passnum,TU_Y1) t1 -= oby &dK &d@ c13 = ts(c1,TUPLE) &dA &dA &d@ Convert c13 to 1000 * n1 + n2 and get x,y adjustments New &dA11/05/05 &dA c13 = ts(c1,TUPLE) & 0xffff c17 = c13 >> 8 c13 &= 0xff c17 *= 1000 c13 += c17 c17 = ts(c1,TUPLE) & 0xff0000 /* x adjustment c17 >>= 16 if c17 > 0 c16 = c17 - 128 /* center to zero else c16 = 0 end c11 += c16 c17 = ts(c1,TUPLE) & 0xff000000 /* y adjustment c17 >>= 24 if c17 > 0 c17 = c17 - 128 /* center to zero else c17 = 0 end c9 += c17 t1 += c17 &dA t3 = tuar(passtype,passnum,TU_SNUM) ++outpnt &dK &d@ tput [Y,outpnt] H ~t3 X ~c8 ~c13 0 ~c9 ~c11 ~t1 ~t2 tput [Y,outpnt] H ~t3 X ~c8 ~c13 ~c16 ~c9 ~c11 ~t1 ~t2 tuar(passtype,passnum,TU_SNUM) = 0 /* &dA05/05/03&d@ adding this (from s2ed) tpflag = global_tpflag end &dA &dA &d@ 2) Beams (O.K. for multiple notes) &dA if beampar(passtype,passnum,BM_READY) > 0 if notesize = 6 if beampar(passtype,passnum,BM_SIZE) = CUESIZE beamfont = 102 else beamfont = 103 end end if notesize = 14 if beampar(passtype,passnum,BM_SIZE) = CUESIZE beamfont = 106 else beamfont = 108 end end if notesize = 16 /* size-16 added &dA12/31/08&d@ if beampar(passtype,passnum,BM_SIZE) = CUESIZE beamfont = 107 else beamfont = 109 end end if notesize = 18 /* size-18 added &dA12/18/04&d@ if beampar(passtype,passnum,BM_SIZE) = CUESIZE beamfont = 107 else beamfont = 110 end end if notesize = 21 if beampar(passtype,passnum,BM_SIZE) = CUESIZE beamfont = 109 else beamfont = 112 end end c4 = beampar(passtype,passnum,BM_CNT) c5 = 1 c6 = 0 c7 = beampar(passtype,passnum,BM_STEM) << 1 loop for c3 = 1 to c4 c7 >>= 1 if c7 & 0x01 <> 1 c6 = 1 end c5 <<= 1 repeat c7 += beampar(passtype,passnum,BM_SUGG) /* New code &dA05/14/03 out = chs(c7) // " " /* first stem direction c8 = beampar(passtype,passnum,BM_STEM) if c6 = 0 or c8 = 0 out = out // "0 " /* consistant stem directions else if c7 & 0x01 = UP /* New code &dA05/14/03 c5 -= 1 /* c5 = 111 ... for number of notes c8 = not(c8) & c5 end out = out // chs(c8) // " " end out = out // chs(beamfont) // " " out = out // chs(beampar(passtype,passnum,BM_READY)) loop for c4 = 1 to beampar(passtype,passnum,BM_READY) out = out // " " out = out // chs(beamdata(passtype,passnum,c4)) repeat ++outpnt tput [Y,outpnt] H ~beampar(passtype,passnum,BM_SNUM) B ~out beampar(passtype,passnum,BM_READY) = 0 beampar(passtype,passnum,BM_TUPLE) = 0 end &dA &dA &d@ 3) Ties (revised for multiple notes) &dA tiecnt = 0 loop for c3 = c1 to c2 c7 = ts(c3,BACKTIE) if c7 > 0 &dA &dA &d@ compute sitf (situation flag) &dA &dA &d@ Description of sitf: range 1 to 16 &dA &d@ &dA &d@ If the range were from 0 to 15, then bits 3 to 0 &dA &d@ would have the following meanings: &dA &d@ &dA &d@ zero | one &dA &d@ -------------------------------------------- &dA &d@ bit 3: tips down | tips up &dA &d@ bit 2: note on space | note on line &dA &d@ bit 1: no stem interfenence | stem interference &dA &d@ bit 0: staff interference | no staff interference &dA c9 = tiearr(c7,TIE_VLOC) c10 = tiearr(c7,TIE_FHDIS) /* local x-offset for first note c11 = ts(c3,LOCAL_XOFF) /* local x-offset for second note c12 = tiearr(c7,TIE_FORCE) /* force flag if c12 = 3 c12 = 9 end c8 = ts(c3,MULTI_TRACK) c6 = c8 >> 2 /* multi-track flag c8 &= 0x03 /* mcat flag &dA &dA &d@ Modify multi-track flag under certain conditions &dA &d@ &dAADDED 9-10-93&d@ &dA if c6 > 0 if ts(c3,PASSNUM) = 1 and bit(1,ts(c3,STEM_FLAGS)) = DOWN c6 = 0 end end if c6 = 0 if c8 < 2 &dA &dA &d@ Rules for single note (or chord) of single part &dA if bit(2,ts(c3,STEM_FLAGS)) = 0 /* &dAsingle note&d@ c5 = tiearr(c7,TIE_FSTEM) + stem if c5 = 0 sitf = 9 /* both stems up else sitf = 1 end if c12 > 0 sitf = c12 /* forced situation end if tiearr(c7,TIE_FSTEM) = UP and sitf < 9 sitf += 2 /* stem interference end else /* &dAchord&d@ if c3 < c2 sitf = 1 else sitf = 9 end if c12 > 0 sitf = c12 /* forced situation end if sitf = 1 if tiearr(c7,TIE_FSTEM) = UP if c10 = 0 sitf += 2 /* stem interference end else if stem = DOWN and c3 <> c1 if c11 = 0 sitf += 2 /* stem interference end end end else if stem = DOWN if c11 = 0 sitf += 2 /* stem interference end end end end else &dA &dA &d@ Rules for chords representing multiple parts &dA if c3 = c2 /* bottom note of chord sitf = 9 else sitf = 1 end if c12 > 0 sitf = c12 /* forced situation end if c3 = c2 if stem = DOWN sitf += 2 /* stem interference end else if c3 = c1 if tiearr(c7,TIE_FSTEM) = UP sitf += 2 /* stem interference end else if tiearr(c7,TIE_FSTEM) = UP or stem = DOWN sitf += 2 /* stem interference end end end end else &dA &dA &d@ Rules for multiple passes on a staff &dA if c6 = 1 sitf = 3 if c12 = 9 sitf = 11 end else if c6 = 2 sitf = 11 if c12 = 1 sitf = 3 end else if c6 = 3 if stem = UP sitf = 1 if c12 > 0 sitf = c12 /* forced situation end if tiearr(c7,TIE_FSTEM) = UP sitf += 2 end else sitf = 11 if c12 = 1 sitf = 3 end end end end end end c5 = c9 / notesize if rem = 0 sitf += 4 /* note on line end &dA &dA &d@ Note: you won't know if there is staff interference until &dA &d@ you know the final length of the tie &dA c9 += tiearr(c7,TIE_STAFF) * 1000 /* New code added &dA04/20/03&d@, modified &dA05/02/03&d@ c13 = tiearr(c7,TIE_SUGG) & 0xff000000 /* length data c6 = tiearr(c7,TIE_SUGG) & 0xff0000 /* position flags c4 = tiearr(c7,TIE_SUGG) & 0xff00 /* x data c5 = tiearr(c7,TIE_SUGG) & 0xff /* y data c13 >>= 24 c6 >>= 16 c4 >>= 8 if c4 > 0 c4 = c4 - 128 * notesize / 10 end if c5 > 0 c5 = c5 - 128 * notesize / 10 end if bit(2,c6) = 1 c5 += 10000 end c6 = 0 if c13 > 0 c6 = c13 - 128 * notesize / 10 end /* end New code c8 = tiearr(c7,TIE_SNUM) ++outpnt tput [Y,outpnt] H ~c8 T ~c9 ~c10 ~c11 ~c4 ~c5 ~c6 ~sitf 0 tiearr(c7,TIE_SNUM) = 0 ts(c3,BACKTIE) = 0 end &dA &dA &d@ If there is a tie leaving this note, build &dA &d@ up a new ROW element of tiearr &dA if bit(0,ts(c3,SUPER_FLAG)) = 1 * identify free slice of tiearr loop for c7 = 1 to MAX_TIES if tiearr(c7,TIE_SNUM) = 0 goto X2 end repeat &dA &dA &d@ Here is where tiearr is built &dA X2: ++tiecnt tiearr(c7,TIE_SNUM) = tv4(tiecnt) tiearr(c7,TIE_NTYPE) = ts(c3,TYPE) tiearr(c7,TIE_VLOC) = ts(c3,STAFFLOC) tiearr(c7,TIE_FHDIS) = ts(c3,LOCAL_XOFF) tiearr(c7,TIE_FSTEM) = bit(1,ts(c3,STEM_FLAGS)) tiearr(c7,TIE_NDX) = c3 tiearr(c7,TIE_STAFF) = ts(c3,STAFF_NUM) tiearr(c7,TIE_FOUND) = 0 tiearr(c7,TIE_FORCE) = ts(c3,SLUR_FLAG) >> 24 /* New code &dA04/20/03&d@ c4 = ts(c3,TSR_POINT) tiearr(c7,TIE_SUGG) = ors(tsr(c4){69,4}) ts(c3,BACKTIE) = c7 /* not used here as a back pointer end repeat &dA &dA &d@ 4) Slurs (revised for multiple notes) &dA loop for c4 = 1 to 8 c5 = c4 * 2 - 1 if c4 > 4 c5 += 8 end &dA &dA &d@ end-slurs &dA &d@ &dA &d@ first element &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &d@ bit 27: start/end flag (0 = start, 1 = end) &dA &d@ bits 24-26: slur number - 1 (0 to 7) &dA &d@ bits 17-23: curvature information (end only) &dA &d@ bit 16: up/down flag (0 = tips up, 1 = tips down) (end only) &dA &d@ bits 0-15: x-offset + 1000 (always a positive number) &dA &d@ second element &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &d@ y position relative to the staff &dA &d@ third element (&dA05/06/03&d@) &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &d@ print suggestion for this end of the slur &dA if bit(c5,slur_flag) = 1 c14 = ts(c1,SLUR_X) &dK &d@ loop for c13 = 7 to 31 step 2 loop for c13 = 7 to (TS_SIZE - 2) step 3 /* &dA05/06/03&d@ c12 = ts(c14,c13) c11 = c12 >> 24 if c11 = c4 + 0x0f /* c4 - 1 + 0x10 (end of slur) c11 = c12 & 0xffff - 1000 /* x-offset c10 = bit(16,c12) /* up/down flag c9 = c12 & 0x000e0000 >> 17 /* curvature (1 to 4) c8 = ts(c14,c13+1) - ts(c1,OBY) /* y-offset c15 = ts(c14,c13+2) /* print suggestion at end of slur (&dA05/06/03&d@) c13 = 100 /* end of loop end repeat if c13 < 100 putc Program error at slur recovery examine stop end sitf = 0 if in_line_edslur > 0 /* New condition &dA01/12/09&d@ if c4 > 2 sitf = 1 /* dotted slur end else if c4 > 4 sitf = 1 /* dotted slur end end if c10 = UP sitf += 12 end c10 = slurar(c4,SL_SNUM) /* slur number c7 = slurar(c4,SL_YSHIFT) /* starting y-shift c6 = slurar(c4,SL_XSHIFT) /* starting x-shift c9 -= 1 c13 = slurar(c4,SL_BEAMF) /* 0 = slur doesn't start on a beam /* 1 = slur starts on a stem up beam /* 2 = slur starts on a stem down beam c16 = slurar(c4,SL_SUGG) /* print sugg. from beginning of slur (&dA05/06/03&d@) c12 = 0 if c13 > 0 if bit(1,ts(c1,BEAM_FLAG)) = 1 if stem = UP and c8 < 0 - vpar(6) c12 = 1 end if stem = DOWN and c8 > vpar(6) c12 = 2 end end if c12 <> c13 c12 = 0 end end &dA &dA &d@ Incorporate print suggestions for slur (&dA05/06/03&d@) &dA &dK &d@ if c16 <> 0 &dK &d@ putc Suggestions from beginning of slur &dK &d@ c17 = c16 & 0xff000000 >> 24 &dK &d@ putc .w6x ~c17 ... &dK &d@ c17 = c16 & 0xff0000 >> 16 &dK &d@ putc .w6x ~c17 ... &dK &d@ c17 = c16 & 0xff00 >> 8 &dK &d@ putc .w6x ~c17 ... &dK &d@ c17 = c16 & 0xff &dK &d@ putc .w6x ~c17 &dK &d@ getc &dK &d@ end &dK &dK &d@ if c15 <> 0 &dK &d@ putc Suggestions from end of slur &dK &d@ c17 = c15 & 0xff000000 >> 24 &dK &d@ putc .w6x ~c17 ... &dK &d@ c17 = c15 & 0xff0000 >> 16 &dK &d@ putc .w6x ~c17 ... &dK &d@ c17 = c15 & 0xff00 >> 8 &dK &d@ putc .w6x ~c17 ... &dK &d@ c17 = c15 & 0xff &dK &d@ putc .w6x ~c17 &dK &d@ getc &dK &d@ end &dA &dA &d@ Code added &dA04/26/05&d@ to implement suppression of slur printing &dA if c16 = -1 sitf = 32 c16 = 0 end &dA c17 = c16 >> 24 /* relative x start c17 &= 0xff if c17 > 0 c17 = c17 - 128 * notesize + 5 / 10 c6 += c17 end c17 = c16 & 0xff0000 >> 16 /* relative y start if c17 > 0 c17 = c17 - 128 * notesize + 5 / 10 c7 += c17 end c17 = c15 >> 24 /* relative x end c17 &= 0xff if c17 > 0 c17 = c17 - 128 * notesize + 5 / 10 c11 += c17 end c17 = c15 & 0xff0000 >> 16 /* relative y end if c17 > 0 c17 = c17 - 128 * notesize + 5 / 10 c8 += c17 end c17 = c15 & 0xff00 >> 8 /* change to curvature if c17 > 0 c17 = c17 - 128 * notesize + 5 / 10 c9 += c17 end c17 = c16 & 0xff00 >> 8 /* global X shift if c17 > 0 c17 = c17 - 128 * notesize + 5 / 10 end c16 = c16 & 0xff /* global Y shift if c16 > 0 c16 = c16 - 128 * notesize + 5 / 10 end ++outpnt tput [Y,outpnt] H ~c10 S ~sitf ~c6 ~c7 ~c11 ~c8 ~c9 ~c12 ~c17 ~c16 end &dA &dA &d@ beginning-slurs &dA --c5 if bit(c5,slur_flag) = 1 c14 = ts(c1,SLUR_X) &dK &d@ loop for c13 = 7 to 31 step 2 loop for c13 = 7 to (TS_SIZE - 2) step 3 /* &dA05/06/03&d@ c12 = ts(c14,c13) c11 = c12 >> 24 if c11 = c4 - 1 /* c4 - 1 (beginning of slur) c11 = c12 & 0xffff - 1000 /* x-offset c8 = ts(c14,c13+1) - ts(c1,OBY) /* y-offset c15 = ts(c14,c13+2) /* print suggestion at beginning of slur c13 = 100 /* end of loop end repeat if c13 < 100 putc Problem finding the end of a slur putc Possible causes: putc 1. A slur has not been closed properly putc 2. Overlapping slurs using the same code putc examine stop end c12 = 0 if ts(c1,BEAM_FLAG) > 1 if stem = UP and c8 < 0 - vpar(6) c12 = 1 end if stem = DOWN and c8 > vpar(6) c12 = 2 end end slurar(c4,SL_SNUM) = slurar(c4,SL_NEXTSNUM) slurar(c4,SL_YSHIFT) = c8 slurar(c4,SL_XSHIFT) = c11 slurar(c4,SL_BEAMF) = c12 /* 0 = slur doesn't start on a beam /* 1 = slur starts on a stem up beam /* 2 = slur starts on a stem down beam slurar(c4,SL_SUGG) = c15 /* (&dA05/06/03&d@) end repeat &dA &dA &d@ 5) Long Trills &dA if bit(3,super_flag) = 1 and tsnum(passnum) > 0 out = "H " // chs(tsnum(passnum)) // " R " // chs(ctrarrf(passnum)) out = out // " 0" ++outpnt if nodtype = GR_NOTE or nodtype = XGR_NOTE tput [Y,outpnt] ~out 0 ~try(passnum) else tput [Y,outpnt] ~out -~hpar(42) ~try(passnum) end tsnum(passnum) = 0 ctrarrf(passnum) = 0 end if pre_tsnum(passnum) > 0 /* substitute preliminary values tsnum(passnum) = pre_tsnum(passnum) ctrarrf(passnum) = pre_ctrarrf(passnum) try(passnum) = pre_try(passnum) pre_tsnum(passnum) = 0 end ZZZZ: repeat p += a4 &dA &dA &d@ Now that you are all done with the notes and rests of &dA &d@ this node, you may set the new inctype &dA if ts(a1,DINC_FLAG) > 0 inctype = ts(a1,DINC_FLAG) end a1 = a2 ZZZ: repeat &dA &dA &d@ End of processing loop &dA &d@************************************************************* &dA return &dA &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³ 2a. getpxpy (code,index) &dA04-08-97&d@ added index variable ³ &dA &d@³ ³ &dA &d@³ Purpose: Save space; get values of px, py, pxx, pyy for ³ &dA &d@³ position modification ³ &dA &d@³ ³ &dA &d@³ Inputs: code = type of subobject referred to ³ &dA &d@³ index = index into ts array ³ &dA &d@³ ³ &dA &d@³ Outputs: pcontrol ³ &dA &d@³ px ³ &dA &d@³ py ³ &dA &d@³ pxx (1 = absolute, 0 = relative) ³ &dA &d@³ pyy (1 = absolute, 0 = relative) ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ &dA procedure getpxpy (code,index) int t2,t3 int code,index getvalue code,index ++code /* all New code &dA05/02/03 code <<= 2 px = 0 py = 0 pxx = 0 pyy = 0 t2 = ts(index,TSR_POINT) pcontrol = ors(tsr(t2){code-3}) t3 = ors(tsr(t2){code-2}) if bit(0,t3) = 1 px = ors(tsr(t2){code-1}) if px > 0 px = px - 128 * notesize / 10 pxx = t3 & 0x02 >> 1 end py = ors(tsr(t2){code}) if py > 0 py = py - 128 * notesize / 10 pyy = t3 & 0x04 >> 2 end end return &dA &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 3. setstem ³ &dA &d@³ ³ &dA &d@³ Purpose: Generate subobjects for note stem, or construct ³ &dA &d@³ beamdata parameters for setting beam. When beam ³ &dA &d@³ is complete, this procedure will call guessbeam. ³ &dA &d@³ ³ &dA &d@³ Inputs: stem = stem direction (0=UP, 1=DOWN) ³ &dA &d@³ ntype = type of note ³ &dA &d@³ passtype = type of pass (reg,cue,grace,cuegrace) ³ &dA &d@³ passsize = size of notes (full size vs. cue-size) ³ &dA &d@³ passnum = pass number ³ &dA &d@³ obx = x co-ordinate of object ³ &dA &d@³ oby = y co-ordinate of object ³ &dA &d@³ c1 = pointer to top note head in array ³ &dA &d@³ c2 = pointer to bottom note head in array ³ &dA &d@³ c3 = pointer to note head at top of stem ³ &dA &d@³ super_flag = composite of SUPER_FLAGs for this chord ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ &dA procedure setstem str temp.80 int t2,t3,t4,t5,t11,t12,t13,t14,t15 int bcount &dA &dA &d@ Determine number of repeaters in "single note" case &dA t11 = 0 if ts(c1,BEAM_FLAG) = NO_BEAM and ts(c1,BEAM_CODE) > 0 t12 = ts(c1,BEAM_CODE) loop t12 /= 10 ++t11 repeat while t12 > 0 end if ntype >= WHOLE if t11 > 0 y = ts(c1,STAFFLOC) - vpar(3) z = 127 kscrdat = "" loop for t12 = 1 to t11 perform subj y -= vpar(2) repeat end else x = obx z = 59 + stem /* music font if passsize = CUESIZE z += 128 /* music font end &dA &dA &d@ Connect notes of chord &dA if c1 <> c2 if stem = UP y = ts(c2,STAFFLOC) kscrdat = "" loop while y > ts(c1,STAFFLOC) perform subj y -= vpar(4) repeat else y = ts(c1,STAFFLOC) kscrdat = "" loop while y < ts(c2,STAFFLOC) perform subj y += vpar(4) repeat end end y = ts(c3,STAFFLOC) if ntype > EIGHTH &dA &dA &d@ Quarter notes and larger &dA if ts(c1,BEAM_FLAG) = NO_BEAM &dK &d@ t3 = y / vpar(1) + 2 c16 = y + vpar20 * 2 + 1 / vpar(2) - 20 t3 = c16 + 2 if stem = UP if t11 = 0 t2 = 8 if t3 <= 0 t2 = t3 - 3 else if t3 < 7 t2 = t3 - 4 else if t3 < 13 t2 = t3 - 5 end end if passsize = CUESIZE ++t2 end end &dK &d@ t2 *= vpar(1) t2 = t2 + 20 * vpar(2) / 2 - vpar20 else t13 = y / notesize t14 = rem if t14 = 0 t15 = 3 /* tricky code else t15 = 2 end t2 = y - vpar(t15) - vpar(79) loop for t13 = t15 to t11 t2 -= vpar(2) repeat t12 = vpar(77) + vpar(6) if t2 > t12 t2 = t12 end if t14 <> 0 and t11 = 1 t14 = y y = t2 - vpar(80) kscrdat = "" perform subj y = t14 end end &dA &dA &d@ Raise bottom of stem if percussion note head &dA02/19/06&d@ &dA t13 = ts(c1,SUBFLAG_1) & 0xf00000 if t13 > 0 t13 >>= 20 if t13 = 1 y -= (vpar(1) - 1) end end &dA kscrdat = "" loop while y > t2 perform subj y -= vpar(4) repeat y = t2 perform subj if t11 > 0 y -= vpar(81) if ts(c1,TUPLE) > 0 &dK &d@ t13 = ts(c1,TUPLE) &dA &dA &d@ New &dA11/05/05&d@ Convert tuple to 1000 * n1 + n2 &dA t13 = ts(c1,TUPLE) & 0xffff t14 = t13 >> 8 t13 &= 0xff t14 *= 1000 t13 += t14 &dA t14 = x + hpar(102) t15 = y - vpar(82) perform typeset_tuple (t13,t14,t15) end z = 125 /* music font (repeater quarters) kscrdat = "" loop for t2 = 1 to t11 perform subj y += vpar(2) repeat end else if t11 = 0 t2 = 0 if t3 > 11 t2 = t3 - 1 else if t3 > 6 t2 = t3 else if t3 >= 0 t2 = t3 + 1 end end if passsize = CUESIZE --t2 end end t2 = t2 * notesize / 2 else t13 = y / notesize t14 = rem if t14 = 0 t15 = 3 /* tricky code else t15 = 2 end t2 = y + vpar(t15) + vpar(79) loop for t13 = t15 to t11 t2 += vpar(2) repeat t12 = vpar(78) - vpar(4) if t2 < t12 t2 = t12 end if t14 <> 0 and t11 = 1 t14 = y y = t2 + vpar(80) kscrdat = "" perform subj y = t14 end end &dA &dA &d@ Adding code (&dA12/10/03&d@) to decrease down stem for music with text for notes &dA &d@ where note is on middle line of staff or one step above that. &dA t15 = ts(c3,TEXT_INDEX) if t15 > 0 temp = trm(tsdata(t15)) if temp <> "" t13 = ts(c3,STAFFLOC) t14 = notesize << 1 t15 = notesize + 1 if t13 <= t14 and t13 > t15 t2 -= (notesize >> 1) end end end &dA &dA &dA &d@ Lower top of stem if percussion note head &dA02/19/06&d@ &dA t13 = ts(c1,SUBFLAG_1) & 0xf00000 if t13 > 0 t13 >>= 20 if t13 = 1 y += (vpar(1) - 1) end end &dA kscrdat = "" loop while y < t2 perform subj y += vpar(4) repeat y = t2 perform subj if t11 > 0 if ts(c1,TUPLE) > 0 &dK &d@ t13 = ts(c1,TUPLE) &dA &dA &d@ New &dA11/05/05&d@ Convert tuple to 1000 * n1 + n2 &dA t13 = ts(c1,TUPLE) & 0xffff t14 = t13 >> 8 t13 &= 0xff t14 *= 1000 t13 += t14 &dA t14 = x + hpar(103) t15 = ts(c1,STAFFLOC) - vpar(82) perform typeset_tuple (t13,t14,t15) end y += vpar(81) z = 125 /* music font (repeater quarters) x -= hpar(101) kscrdat = "" loop for t2 = 1 to t11 perform subj y -= vpar(2) repeat x += hpar(101) end end else * 2) Beams if ts(c1,BEAM_FLAG) = START_BEAM bcount = 1 ++snum beampar(passtype,passnum,BM_SNUM) = snum if bit(4,super_flag) = 1 beampar(passtype,passnum,BM_TUPLE) = 1 + stem end beampar(passtype,passnum,BM_STEM) = stem beampar(passtype,passnum,BM_SIZE) = passsize t2 = ts(c1,TSR_POINT) /* New code &dA05/14/03&d@ t3 = 28 /* 28 = code for beam suggestion ++t3 t3 <<= 2 /* 116 py = ors(tsr(t2){t3-2}) t4 = 0 if py > 0 py = py - 128 if py > 0 t4 = INT100 * py else py = 0 - py t4 = INT100 * INT100 * py end end beampar(passtype,passnum,BM_SUGG) = t4 /* End new code &dA05/14/03 else bcount = beampar(passtype,passnum,BM_CNT) + 1 beampar(passtype,passnum,BM_STEM) <<= 1 beampar(passtype,passnum,BM_STEM) += stem if passsize < beampar(passtype,passnum,BM_SIZE) beampar(passtype,passnum,BM_SIZE) = passsize end end beamdata(passtype,passnum,bcount) = ts(c1,BEAM_CODE) beampar(passtype,passnum,BM_CNT) = bcount if ts(c1,BEAM_FLAG) = END_BEAM beampar(passtype,passnum,BM_READY) = bcount end end else &dA &dA &d@ Eighth notes or smaller &dA if ts(c1,BEAM_FLAG) = NO_BEAM * 1) Flags if passtype = GRACE and ntype = SLASH8 if stem = UP z = 179 /* music font else z = 180 /* music font end y = ts(c3,STAFFLOC) kscrdat = "" perform subj else if stem = UP if ntype = EIGHTH t3 = 53 /* music font (eighth flag) if y <= vpar(4) and passtype = REG and t11 = 0 t3 = 51 /* music font (shortened eighth flag) end t2 = 10 * notesize / 2 else t3 = 55 /* music font (sixteenth flag) t2 = 0 - ntype * 2 + 20 * notesize / 2 end z = 59 /* music font (standard up stem) t4 = notesize t5 = 57 /* music font (extra flag: 32nds, etc) if passsize = CUESIZE t2 -= vpar(1) t3 += 128 /* music font z += 128 /* music font t4 = vpar(36) t5 += 128 /* music font end kscrdat = "" loop while y > t2 perform subj y -= vpar(4) repeat &dK &d@ t2 += vpar(1) c16 = t2 * 2 / vpar(2) if rem <> 0 ++t2 end t2 += vpar(1) y = ts(c3,STAFFLOC) if t11 = 0 /* no repeaters z = t3 /* music font (flag character) if y > t2 y = t2 end kscrdat = "" perform subj if ntype < 5 z = t5 /* music font (extra flag) loop for t3 = 1 to 5-ntype y -= t4 perform subj repeat end else t12 = y / notesize t2 += t11 - 1 * notesize if y > t2 or rem <> 0 /* note on space t13 = t11 - 1 * notesize + vpar(67) t14 = vpar(69) else /* note on line t13 = t11 - 1 * notesize + vpar(68) t14 = vpar(70) end &dA &dA &d@ t13 = amount to "lengthen" stem &dA &d@ t14 = location of first repeater &dA if y > t2 y = t2 end t15 = y kscrdat = "" loop perform subj y -= vpar(4) repeat while y > t15 - t13 y = t15 - t13 z = t3 perform subj if ntype < 5 z = t5 /* music font (extra flag) loop for t3 = 1 to 5-ntype y -= t4 perform subj repeat end y = t15 - t14 z = 126 /* music font (repeater for eights) x = x - hpar(99) loop for t12 = 1 to t11 perform subj y -= notesize repeat x = x + hpar(99) if ts(c1,TUPLE) > 0 &dK &d@ t13 = ts(c1,TUPLE) &dA &dA &d@ New &dA11/05/05&d@ Convert tuple to 1000 * n1 + n2 &dA t13 = ts(c1,TUPLE) & 0xffff t14 = t13 >> 8 t13 &= 0xff t14 *= 1000 t13 += t14 &dA t14 = x + hpar(102) t15 = y - vpar(83) perform typeset_tuple (t13,t14,t15) end end else if ntype = EIGHTH t3 = 54 /* music font (eighth flag) if y >= vpar(5) and passtype = REG and t11 = 0 t3 = 52 /* music font (shortened eighth flag) end t2 = 0 - 2 * notesize / 2 else t3 = 56 /* music font (sixteenth flag) t2 = 2 * ntype - 12 * notesize / 2 end z = 60 /* music font (standard down stem) t4 = notesize t5 = 58 /* music font (extra flag) if passsize = CUESIZE t2 += vpar(1) t3 += 128 /* music font z += 128 /* music font t4 = vpar(36) t5 += 128 /* music font end kscrdat = "" loop while y < t2 perform subj y += vpar(4) repeat &dK &d@ t2 -= vpar(1) t2 -= vpar(1) c16 = t2 * 2 / vpar(2) if rem <> 0 --t2 end y = ts(c3,STAFFLOC) if t11 = 0 z = t3 /* music font (flag character) if y < t2 y = t2 end kscrdat = "" perform subj if ntype < 5 z = t5 /* music font loop for t3 = 1 to 5-ntype y += t4 perform subj repeat end else t12 = y / notesize t2 -= t11 - 1 * notesize if y < t2 or rem <> 0 /* note on space if t11 = 2 t13 = notesize - vpar(71) else t13 = t11 - 1 * notesize - vpar(72) end t14 = vpar(75) else /* note on line if t11 = 2 t13 = notesize - vpar(73) else t13 = t11 - 1 * notesize - vpar(74) end t14 = vpar(76) end &dA &dA &d@ t13 = amount to "lengthen" stem &dA &d@ t14 = location of first repeater &dA if y < t2 y = t2 end t15 = y kscrdat = "" loop perform subj y += vpar(4) repeat while y < t15 + t13 y = t15 + t13 z = t3 perform subj if ntype < 5 z = t5 /* music font (extra flag) loop for t3 = 1 to 5-ntype y += t4 perform subj repeat end y = t15 + t14 z = 126 /* music font (repeater for eights) x = x - hpar(100) loop for t12 = 1 to t11 perform subj y += notesize repeat x = x + hpar(100) if ts(c1,TUPLE) > 0 &dK &d@ t13 = ts(c1,TUPLE) &dA &dA &d@ New &dA11/05/05&d@ Convert tuple to 1000 * n1 + n2 &dA t13 = ts(c1,TUPLE) & 0xffff t14 = t13 >> 8 t13 &= 0xff t14 *= 1000 t13 += t14 &dA t14 = x + hpar(103) t15 = ts(c1,STAFFLOC) - vpar(82) perform typeset_tuple (t13,t14,t15) end end end end else * 2) Beams if ts(c1,BEAM_FLAG) = START_BEAM bcount = 1 ++snum beampar(passtype,passnum,BM_SNUM) = snum if bit(4,super_flag) = 1 beampar(passtype,passnum,BM_TUPLE) = 1 + stem end beampar(passtype,passnum,BM_STEM) = stem beampar(passtype,passnum,BM_SIZE) = passsize t2 = ts(c1,TSR_POINT) /* New code &dA05/14/03&d@ t3 = 28 /* 28 = code for beam suggestion ++t3 t3 <<= 2 /* 116 py = ors(tsr(t2){t3-2}) t4 = 0 if py > 0 py = py - 128 if py > 0 t4 = INT100 * py else py = 0 - py t4 = INT100 * INT100 * py end end beampar(passtype,passnum,BM_SUGG) = t4 /* End new code &dA05/14/03 else bcount = beampar(passtype,passnum,BM_CNT) + 1 beampar(passtype,passnum,BM_STEM) <<= 1 beampar(passtype,passnum,BM_STEM) += stem if passsize < beampar(passtype,passnum,BM_SIZE) beampar(passtype,passnum,BM_SIZE) = passsize end end beamdata(passtype,passnum,bcount) = ts(c1,BEAM_CODE) beampar(passtype,passnum,BM_CNT) = bcount if ts(c1,BEAM_FLAG) = END_BEAM beampar(passtype,passnum,BM_READY) = bcount end end end end return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 4. setax ³ &dA &d@³ ³ &dA &d@³ Purpose: Set accidental ³ &dA &d@³ ³ &dA &d@³ Inputs: c3 = index into ts array ³ &dA &d@³ c4 = accident flag ³ &dA &d@³ passsize = note size (full, cue-size) ³ &dA &d@³ obx = x co-ordinate of object ³ &dA &d@³ oby = y co-ordinate of object ³ &dA &d@³ y = y co-ordinate of note head ³ &dA &d@³ ³ &dA &d@³ Internal: x,y,z sent to subj ³ &dA &d@³ ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure setax int t1,t2,t3,t4 /* &dA02/25/97&d@ shift changed from 4 to 8 t2 = c4 >> 8 /* x-offset (to the left) t1 = c4 & 0x0f /* accidental only t4 = 19 /* New code &dA05/02/03&d@ accidentals code = 19 perform getpxpy (t4,c3) if pxx = 1 x = obx + px else x = obx - t2 + px end /* end New code if bit(2,t1) = 1 /* case: flat-flat or natural-(flat/sharp) z = bit(3,t1) + 64 /* flat or natural t2 = hpar(40) if passsize = CUESIZE z += 128 /* cue size t2 = t2 * 8 / 10 end kscrdat = "" perform subj x += t2 end if t1 & 0x03 = 2 if bit(3,t1) = 1 z = 66 /* double sharp else z = 63 /* regular sharp end else z = bit(1,t1) + 64 /* flat or natural end if passsize = CUESIZE z += 128 /* cue size end kscrdat = "" if bit(4,c4) = 0 perform subj else perform subj2 /* Addition to Code &dA02/25/97&d@ end return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 5. superfor (operates on an entire chord at once) ³ &dA &d@³ ³ &dA &d@³ Purpose: Get new snums for forward tie, forward slurs and ³ &dA &d@³ forward tuplet ³ &dA &d@³ ³ &dA &d@³ Inputs: c1 = pointer to top of chord ³ &dA &d@³ c2 = pointer to bottom of chord ³ &dA &d@³ passtype = type of pass (reg,cue,grace,cuegrace) ³ &dA &d@³ passnum = pass number ³ &dA &d@³ x = x co-ordinate of object ³ &dA &d@³ y = y co-ordinate of object ³ &dA &d@³ super_flag = composite of SUPER_FLAGs for this chord ³ &dA &d@³ slur_flag = composite of SLUR_FLAGs for this chord ³ &dA &d@³ stem = stem direction ³ &dA &d@³ ³ &dA &d@³ Function: If there is a forward tie, this procedure increments ³ &dA &d@³ snum and puts result in tv4(). If there are ³ &dA &d@³ forward slurs, this procedure increments snum and ³ &dA &d@³ stores results in the appropriate ³ &dA &d@³ slurar(.,SL_NEXTSNUM). If there is a forward ³ &dA &d@³ tuplet, this procedure increments snum and ³ &dA &d@³ constructs the tuar for this tuplet. For all ³ &dA &d@³ cases, the procedure increments supcnt and adds ³ &dA &d@³ the new super-object number to supnums(.) for later ³ &dA &d@³ output in the object record. ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure superfor int t1,t2 tiecnt = 0 loop for c3 = c1 to c2 if bit(0,ts(c3,SUPER_FLAG)) = 1 /* if tie starts ++snum ++supcnt supnums(supcnt) = snum ++tiecnt tv4(tiecnt) = snum end repeat loop for t1 = 1 to 8 t2 = t1 * 2 - 2 if t1 > 4 t2 += 8 end if bit(t2,slur_flag) = 1 /* if slur starts ++snum ++supcnt supnums(supcnt) = snum slurar(t1,SL_NEXTSNUM) = snum else slurar(t1,SL_NEXTSNUM) = 0 end repeat if bit(4,super_flag) = 1 ++snum ++supcnt supnums(supcnt) = snum tuar(passtype,passnum,TU_SNUM) = snum tuar(passtype,passnum,TU_Y1) = y if stem = UP tuar(passtype,passnum,TU_Y2) = y else tuar(passtype,passnum,TU_Y2) = ts(c1,STAFFLOC) end tuar(passtype,passnum,TU_FSTEM) = stem t1 = super_flag & 0x3c0 /* bits 6,7,8,9 &dA03-21-97&d@ t1 <<= 2 tuar(passtype,passnum,TU_FSTEM) |= t1 /* tuplet flags &dA03-21-97&d@ end return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 6. setart (operates on an entire chord at once) ³ &dA &d@³ ³ &dA &d@³ Purpose: create sub-objects for dots, spiccato and legato. ³ &dA &d@³ ³ &dA &d@³ Inputs: obx = x-position of object ³ &dA &d@³ oby = y-position of object ³ &dA &d@³ c1 = pointer to top note of chord ³ &dA &d@³ c2 = pointer to bottom note of chord ³ &dA &d@³ stem = stem direction (UP or DOWN) ³ &dA &d@³ ³ &dA &d@³ Outputs: Program may modify virtual endpoints in the ts ³ &dA &d@³ array. ³ &dA &d@³ ³ &dA &d@³ Operation: There are two rules that can be followed ³ &dA &d@³ Rule 1: (chord = single note, or dot on middle note ³ &dA &d@³ of chord, or more than one dot) ³ &dA &d@³ If there is a slur, and slur starts (ends) near ³ &dA &d@³ the dot, put dot under (over) slur; ³ &dA &d@³ otherwise, if multi-track > 0, put dot on stem; ³ &dA &d@³ otherwise put dot on note head. ³ &dA &d@³ ³ &dA &d@³ Rule 2: (all other situations) ³ &dA &d@³ If dot on note at stem end, put dot on stem; ³ &dA &d@³ otherwise, put dot at head end of chord. ³ &dA &d@³ ³ &dA &d@³ If there is a slur into or out of this chord, then ³ &dA &d@³ information on the placement of dot/legato or ³ &dA &d@³ spiccato has already been compiled and is stored ³ &dA &d@³ in the SLUR_X ROW element. Otherwise, the place- ³ &dA &d@³ ment needs to be computed here. ³ &dA &d@³ ³ &dA &d@³ Virtual endpoints are modified in all cases. ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure setart int t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13 int dot_xshift /* New &dA05/14/05&d@ t2 = 0 t9 = 0 loop for t1 = c1 to c2 t10 = ts(t1,SUBFLAG_2) & 0x3c /* &dA05/17/03&d@ Editorial arts not yet supported if t10 > 0 ++t2 t3 = t1 t9 |= t10 /* composite flag for chord end &dA &dA &d@ Using grace dot to typeset editorial staccato &dA02/06/04&d@ &dA t10 = ts(t1,ED_SUBFLAG_2) & 0x0c /* editorial staccato & spiccato if t10 > 0 t10 <<= 8 /* put this in higher order byte ++t2 t3 = t1 t9 |= t10 end &dA repeat if t2 = 0 return end &dA &dA &d@ Step 1: determine starting position for dot/legatos or spiccatos &dA t13 = 0 /* &dA03/24/97&d@ potential modification to x position of articulation if c1 = c2 or (t3 <> c1 and t3 <> c2) or t2 > 1 /* follow rule 1 t4 = ts(c1,SLUR_X) if t4 > 0 and ts(t4,6) > 0 /* there is a slur effecting dot y = ts(t4,5) t5 = ts(t4,6) /* above/below flag t8 = 0 /* no adjustment to virtual end points else t10 = ts(c1,MULTI_TRACK) >> 2 if t10 > 0 /* &dACHANGED&d@ from = 3 on &dA03/24/97 if ts(c1,PASSNUM) = 1 and stem = DOWN t10 = 0 end if ts(c1,PASSNUM) = 2 and stem = UP t10 = 0 end end &dA &dA &d@ Code added &dA03/24/97&d@ to check for print suggestions for articulations &dA t12 = 1 /* articulation code = 1 if t9 & 0x04 > 0 /* spiccato code = 2 &dA05/02/03 ++t12 end perform getpxpy (t12,c1) if pcontrol & 0x03 = 0x03 /* major location change flag if bit(2,pcontrol) = 1 /* place below t5 = BELOW if stem = UP y = ts(c1,VIRT_NOTE) t8 = notesize else y = ts(c1,VIRT_STEM) t8 = vpar(1) if ts(c1,BEAM_FLAG) > NO_BEAM t8 = vpar(2) end end else t5 = ABOVE if stem = UP y = ts(c1,VIRT_STEM) t8 = vpar(1) if ts(c1,BEAM_FLAG) > NO_BEAM t8 = vpar(2) end else y = ts(c1,VIRT_NOTE) t8 = notesize end end else &dA &dA &d@ End of &dA03/24/97&d@ addition &dA if t10 > 0 y = ts(c1,VIRT_STEM) if stem = UP t5 = ABOVE else t5 = BELOW end t8 = vpar(1) if ts(c1,BEAM_FLAG) > NO_BEAM t8 = vpar(2) end else y = ts(c1,VIRT_NOTE) if stem = UP t5 = BELOW else t5 = ABOVE end t8 = notesize end &dA &dA &d@ New &dA11/10/07&d@ We need some code here which disables the interference section &dA &d@ below when there is a y-position modifier, &dA if pcontrol & 0x01 > 0 if (py = 0 and pyy = 0) or pyy = 1 t8 = 0 end end &dA end if pyy > 0 y = py else y += py end t13 = px end else /* follow rule 2 &dA &dA &d@ Code added &dA03/24/97&d@ to check for print suggestions for articulations &dA t12 = 1 /* articulation code = 1 if t9 & 0x04 > 0 /* spiccato code = 2 &dA05/02/03 ++t12 end perform getpxpy (t12,c1) if pcontrol & 0x03 = 0x03 /* major location change flag if bit(2,pcontrol) = 1 /* place below t5 = BELOW if stem = UP y = ts(c1,VIRT_NOTE) t8 = notesize else y = ts(c1,VIRT_STEM) t8 = vpar(1) end else t5 = ABOVE if stem = UP y = ts(c1,VIRT_STEM) t8 = vpar(1) else y = ts(c1,VIRT_NOTE) t8 = notesize end end else &dA &dA &d@ End of &dA03/24/97&d@ addition &dA if stem = UP if t3 = c1 /* top note t5 = ABOVE y = ts(c1,VIRT_STEM) t8 = vpar(1) else t5 = BELOW y = ts(c1,VIRT_NOTE) t8 = notesize end else if t3 = c1 /* top note t5 = ABOVE y = ts(c1,VIRT_NOTE) t8 = notesize else t5 = BELOW y = ts(c1,VIRT_STEM) t8 = vpar(1) end end &dA &dA &d@ New &dA11/10/07&d@ We need some code here which disables the interference section &dA &d@ below when there is a y-position modifier, &dA if pcontrol & 0x01 > 0 if (py = 0 and pyy = 0) or pyy = 1 t8 = 0 end end &dA end if pyy > 0 y = py else y += py end t13 = px end &dA &dA &d@ New (&dA05/14/05&d@) code to set value of dot_xshift for staccato over (under) stem &dA dot_xshift = 0 if t5 = ABOVE if stem = UP dot_xshift = hpar(19) if ts(c1,BEAM_FLAG) <= NO_BEAM y -= vpar(1) end end else if stem = DOWN dot_xshift = 0 - hpar(19) if ts(c1,BEAM_FLAG) <= NO_BEAM y += vpar(1) end end end &dA &dA &dA &d@ check for interference in cases where y is based on VIRT_ &dA if t8 <> 0 if (stem = DOWN and t5 = ABOVE) or (stem = UP and t5 = BELOW) t11 = HEAD else t11 = TAIL end &dK &d@ if t9 & 0x04 > 0 /* spiccato is special case if (t9 & 0x04 > 0) or (t9 & 0x400 > 0) /* spiccato is special case (&dA02/06/04&d@) if stem = DOWN if t5 = ABOVE /* note if y > vpar(1) y = vpar(1) end y -= 5 * notesize / 4 else if y < vpar(8) y = vpar(8) end y += vpar(1) + vpar(50) /* OK 4-22-95 end else /* UP if t5 = ABOVE if y > 0 y = 0 end &dK &d@ y -= vpar(1) y -= vpar(1) c16 = y * 2 / vpar(2) if rem <> 0 --y end else /* note if y < vpar(7) y = vpar(7) end y += 5 * notesize / 4 + vpar(50) end end else t6 = 1 if t5 = ABOVE y -= t8 if y >= 0 t6 = y / notesize t6 = rem else y = 0 - notesize / 4 + y end t7 = -1 else y += t8 if y <= vpar(8) t6 = y / notesize t6 = rem else y = notesize / 4 + y end t7 = 1 end &dA &dA &d@ adjust for interference with staff &dA if t6 = 0 &dK &d@ y = vpar(1) * t7 + y c16 = t7 + 20 * vpar(2) / 2 - vpar20 y += c16 end end end &dA &dA &d@ Step 2: write out articulations &dA &dA &dA &d@ Code addition &dA01/06/06&d@: If art_flag = 48, then please set all staccatos and/or &dA &d@ legatos above the note and above the staff lines. &dA if art_flag = 48 if t9 & 0x38 > 0 if y > (0 - vpar(1)) y = 0 - vpar(1) end end end &dA x = obx + t13 kscrdat = "" if t9 & 0x18 > 0 /* staccato z = 96 /* music font x += dot_xshift /* New &dA05/14/05&d@ perform subj x -= dot_xshift /* New &dA05/14/05&d@ y = notesize * t7 + y end if t9 & 0x30 > 0 /* legato z = 99 /* music font x += dot_xshift /* New &dA05/14/05&d@ perform subj x -= dot_xshift /* New &dA05/14/05&d@ y = notesize * t7 + y end &dA &dA &d@ Using grace dot to typeset editorial staccato &dA02/06/04&d@ &dA if t9 & 0x800 > 0 z = 172 /* grace dot used as editorial staccato x += vpar(1) / 2 x += dot_xshift / 2 /* New &dA05/14/05&d@ and &dA09/22/05&d@ kscrdat = "" perform subj x -= dot_xshift / 2 /* New &dA05/14/05&d@ and &dA09/22/05&d@ x -= vpar(1) / 2 y = notesize * t7 + y end &dA &dA &d@ Using ordinary spiccato for the moment to typeset editorial spiccato &dA02/06/04 &dA if t9 & 0x400 > 0 /* spiccato z = 98 /* music font if t5 = ABOVE --z /* music font end x += dot_xshift /* New &dA05/14/05&d@ &dA &dA &d@ Code added &dA05/26/05&d@ to implement arbitrary placement of editorial spiccatos &dA kscrdat = "" if bit(2,art_flag) = 1 t13 = y if stem = UP y = oby + vpar(4) else y = oby - (vpar(5) / 2) end perform subj y = t13 else perform subj end &dA x -= dot_xshift /* New &dA05/14/05&d@ if t5 = BELOW y -= vpar(50) end if y >= 0 y = y * 2 + 1 / vpar(2) else y = y * 2 - 1 / vpar(2) end y = y * vpar(2) / 2 else &dA if t9 & 0x04 > 0 /* spiccato z = 98 /* music font if t5 = ABOVE --z /* music font end x += dot_xshift /* New &dA05/14/05&d@ &dA &dA &d@ Code added &dA05/26/05&d@ to implement arbitrary placement of spiccatos &dA kscrdat = "" if bit(2,art_flag) = 1 t13 = y if stem = UP y = oby + vpar(4) else y = oby - (vpar(5) / 2) end perform subj y = t13 else perform subj end &dA x -= dot_xshift /* New &dA05/14/05&d@ if t5 = BELOW y -= vpar(50) end &dK &d@ y = y / vpar(1) * vpar(1) if y >= 0 y = y * 2 + 1 / vpar(2) else y = y * 2 - 1 / vpar(2) end y = y * vpar(2) / 2 else y -= notesize * t7 end end &dA &dA &d@ Step 3: adjust virtual end points &dA if t8 <> 0 if t11 = HEAD loop for t8 = c1 to c2 ts(t8,VIRT_NOTE) = y repeat else loop for t8 = c1 to c2 ts(t8,VIRT_STEM) = y repeat end end return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 7. setperf (operates on an entire chord at once) ³ &dA &d@³ ³ &dA &d@³ Purpose: create sub-objects for turns, trills, shakes, ³ &dA &d@³ mordents, horizontal accents, thumb positions, ³ &dA &d@³ open string, numbers, harmonics, down-bows, ³ &dA &d@³ up-bows, fermatas. (and tremulos as of &dA01/07/06&d@) ³ &dA &d@³ ³ &dA &d@³ Inputs: obx = x-position of object ³ &dA &d@³ oby = y-position of object ³ &dA &d@³ c1 = pointer to top of chord ³ &dA &d@³ c2 = pointer bottom of chord ³ &dA &d@³ c4 = virtual vertical position of controlling ³ &dA &d@³ note head ³ &dA &d@³ c5 = virtual vertical position of end of stem ³ &dA &d@³ c8 = slur present flag ³ &dA &d@³ 0 = not present (usually) ³ &dA &d@³ 1 = present at head ³ &dA &d@³ 2 = present at stem ³ &dA &d@³ stem = stem direction 0 = up ³ &dA &d@³ 1 = down ³ &dA &d@³ super_flag = composite of SUPER_FLAGs for this chord ³ &dA &d@³ ³ &dA &d@³ Operation: If multi-track > 0, put indications at the stem ³ &dA &d@³ end of the chord; ³ &dA &d@³ else, put indications above the chord ³ &dA &d@³ ³ &dA &d@³ Internal: c4,c5,c7,c9,c13 used to communicate with yadjust ³ &dA &d@³ ³ &dA &d@³ &dA04-08-97&d@ Modification. ³ &dA &d@³ ³ &dA &d@³ It turns out that for turns, trill, shakes, and mordents, ³ &dA &d@³ and tremulos, as of &dA01/07/06&d@, ³ &dA &d@³ we want to allow multiple ornaments on a chord. Therefore, ³ &dA &d@³ these ornaments need to be processed individually, and not ³ &dA &d@³ grouped, as are accents, numbers, up and down bows, fermatas, ³ &dA &d@³ etc. ³ &dA &d@³ ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure setperf str temp.100 /* &dA04/24/03&d@ bstr bs.600,bt.600 int t1,t2,t3,t4,t5,t7,t8,t9,t10 int ed_subflag_1,ed_subflag_2 /* New variables &dA05/17/03&d@ int merged_subflag_1,merged_subflag_2 int lsqx,rsqx,sqy,glyph,sq_glyph &dA &dA &d@ 1. Determine placement: c7 = situation flag: 0 = place on note head &dA &d@ 1 = place on stem &dA if ts(c1,MULTI_TRACK) >> 2 > 0 c7 = 1 else c7 = 1 - stem end &dA &dA &d@ 2. Long trill &dA if super_flag & 0x06 > 0 /* if begin ~~~~~ subflag_1 = 0 loop for t8 = c1 to c2 /* loop added &dA11/05/05&d@ to accomodate all ornaments subflag_1 = subflag_1 | ts(t8,SUBFLAG_1) /* on notes of a chord repeat t5 = ts(c1,PASSNUM) ++snum pre_tsnum(t5) = snum ++supcnt supnums(supcnt) = snum c13 = vpar(53) pre_ctrarrf(t5) = bit(2,super_flag) /* tr. trill if pre_ctrarrf(t5) = 0 c13 = vpar(51) end if pre_ctrarrf(t5) = 1 /* tr. present t3 = subflag_1 & 0x70 >> 4 /* t3 = 0 to 7 (&dA05/17/03&d@ editorial not supported yet) t3 = int("01312311"{t3+1}) pre_ctrarrf(t5) += t3 if subflag_1 & 0x80000 > 0 /* bit 19 is set &dA11/05/05&d@ pre_ctrarrf(t5) += 3 /* add 3 to R super-object parameter 4 end end ++pre_ctrarrf(t5) perform yadjust pre_try(t5) = y - oby /* Code added &dA02/24/97&d@ t2 = 4 /* ornament code = 4 perform getpxpy (t2,c1) if pyy > 0 pre_try(t5) = py else pre_try(t5) += py end /* End of &dA02/24/97&d@ addition else &dA &dA &d@ 3. Back ties (sub-objects) New code &dA04/22/08&d@ &dA &dA &d@ Note: Back ties are handled like ornaments. This means that a note with &dA &d@ a back tie can have at most one ornament attached to it. Limitation?? &dA sugg_flg2 = 0 /* added &dA05/02/03&d@ for ornaments, use also /* with back ties loop for t8 = c1 to c2 /* loop accomodates back ties on all chord notes subflag_1 = ts(t8,SUBFLAG_1) t5 = subflag_1 & 0x03000000 /* 000000&dE11&d@ 00000000 00000000 00000000 if t5 > 0 t2 = 4 + sugg_flg2 /* ornament code = 4 if sugg_flg2 = 0 /* New code &dA05/02/03&d@ ++sugg_flg2 end x = obx - vpar(4) t5 >>= 24 if t5 = 1 /* overhand back tie y = 0 - vpar(2) z = 2036 /* overhand tie character else y = vpar(2) z = 2164 /* underhand tie charachter end y += oby perform getpxpy (t2,t8) x += px if pyy > 0 py -= y pyy = 0 end y += py kscrdat = "" #if AUTOSCR #else perform subj /* this feature not implemented in autoscr yet #endif end repeat &dA &dA &d@ 4+5. Ornaments and their accidentals need to be handled together &dA &dA &d@ New code rewrite &dA05/17/03&d@ to accommodate editorial ornaments and their accidentals &dA loop for t8 = c1 to c2 /* loop added &dA04-08-97&d@ to accomodate all ornaments subflag_1 = ts(t8,SUBFLAG_1) /* on notes of a chord subflag_2 = ts(t8,SUBFLAG_2) ed_subflag_1 = ts(t8,ED_SUBFLAG_1) ed_subflag_2 = ts(t8,ED_SUBFLAG_2) merged_subflag_1 = subflag_1 | ed_subflag_1 merged_subflag_2 = subflag_2 | ed_subflag_2 t5 = merged_subflag_1 & 0x0f /* turn,tr,shake,mordent, etc. &dK &d@ if t5 > 0 and t5 < 6 /* &dA5 ornaments&d@ at the moment if t5 > 0 and t5 < 7 /* &dA6 ornaments&d@ as of &dA01/07/06 &dA &dA &d@ Raise (lower) turn, if slur and turn are present on note head &dA if c7 = 0 and c8 = 1 if t5 = 1 /* turn if stem = UP c16 = c4 * 2 / vpar(2) if rem <> 0 ++c4 end c4 += vpar(1) else c4 -= vpar(1) c16 = c4 * 2 / vpar(2) if rem <> 0 --c4 end end end end &dA &dA &d@ a. We must know definitively whether ornament goes above or below notes, &dA &d@ and we must determine whether there is an "intervening" accidental. &dA t7 = c7 /* save c7 t2 = 4 + sugg_flg2 /* ornament code = 4 if sugg_flg2 = 0 /* New code &dA05/02/03&d@ ++sugg_flg2 end perform getpxpy (t2,t8) if bit(0,pcontrol) = 1 if bit(1,pcontrol) = 1 if bit(2,pcontrol) = 0 c7 = 1 - stem else c7 = stem end end end t1 = c7 + stem /* t1 = 1 means ornament goes above t2 = 0 t3 = merged_subflag_1 & 0x3f0 >> 4 t9 = ed_subflag_1 & 0x3f0 >> 4 t10 = 0 /* 0 will mean actual, as opposed to editorial if t3 > 0 if t1 = 1 if t3 > 7 /* ax under on ornament above t2 = 1 if t9 > 7 t10 = 1 /* and this is editorial end end else if t3 & 0x07 > 0 /* ax over on ornament below t2 = 2 if t9 & 0x07 > 0 t10 = 1 /* and this is editorial end end end end if t2 > 0 /* put accidental first if t2 = 1 t4 = t3 >> 3 else t4 = t3 & 0x07 end c13 = vpar(56) perform yadjust if c9 <> 1 y -= vpar(1) c16 = y * 2 / vpar(2) if rem <> 0 --y end end x = obx if t2 = 1 and (t5 = 1 or t5 = 5) x += hpar(70) end x += px if pyy > 0 py -= y pyy = 0 end y += py kscrdat = "" &dA &dA &d@ Deal with case where ornament is real, but accidental is editorial &dA if subflag_1 & 0x0f > 0 and t10 = 1 x -= hpar(124) y -= vpar(86) z = 244 /* open square bracket perform subj x += hpar(124) y += vpar(86) end &dA &dA &d@ Put out "first" accidental &dA z = int("39389"{t4}) /* music font z += 210 /* music font perform subj if t4 < 3 z = int("39"{t4}) /* music font x += hpar(z+67) /* hpar(70) or hpar(76) z += 210 /* music font if t2 = 1 and (t5 = 1 or t5 = 5) x += hpar(70) end perform subj end &dA &dA &d@ Deal with case where ornament is real, but accidental is editorial &dA if subflag_1 & 0x0f > 0 and t10 = 1 x += hpar(125) y -= vpar(86) z = 245 /* close square bracket perform subj end end &dA &dA &d@ b. Now put out turn, tr., shake, mordent, delayed turn &dA &d@ tremulo added &dA01/07/06&d@ (primary only) &dA t3 = t5 if c3 = 5 c3 = 1 end c13 = 51 + t3 c13 = vpar(c13) &dA &d@ &dA01/07/06&d@ for tremulos if t3 = 6 c13 = vpar(4) end &dA perform yadjust if c9 <> 1 y -= vpar(1) c16 = y * 2 / vpar(2) if rem <> 0 --y end end x = obx x += px if pyy > 0 py -= y pyy = 0 end y += py kscrdat = "" &dA &dA &d@ Deal with case where ornament is editorial &dA if ed_subflag_1 & 0x0f > 0 if t3 = 1 or t3 = 5 /* turn and delayed turn lsqx = hpar(126) rsqx = hpar(127) sqy = vpar(87) glyph = 242 /* turn ornament sq_glyph = 244 /* small square bracket else if t3 = 2 /* tr. trill &dA &dA &d@ Conditional code added &dA02/04/04&d@ to implement Roman editorial trills &dA #if ROMAN_EDIT &dK &d@ y -= vpar(1) ++sobcnt sobx = x - obx soby = y - oby sobl(sobcnt) = "W " // chs(sobx) // " " // chs(soby) // " " sobl(sobcnt) = sobl(sobcnt) // "31 tr" goto SETP01 &dA #else lsqx = hpar(122) rsqx = hpar(123) sqy = vpar(85) glyph = 254 /* editorial trill ornament sq_glyph = 195 /* cue square bracket #endif else if t3 = 3 /* shake lsqx = hpar(128) rsqx = hpar(129) sqy = vpar(88) glyph = 239 /* shake ornament sq_glyph = 244 /* small square bracket else /* mordant lsqx = hpar(130) rsqx = hpar(131) sqy = vpar(89) glyph = 238 /* mordant ornament sq_glyph = 244 /* small square bracket end end end x -= lsqx y -= sqy z = sq_glyph /* open square bracket perform subj x += lsqx y += sqy z = glyph perform subj x += rsqx y -= sqy z = sq_glyph + 1 /* close square bracket perform subj else &dA &dA &d@ Deal with case where ornament is primary &dA &dA &d@ &dA01/07/06&d@ Adding code to deal with tremulo ornament (T) &dA &dK &d@ z = int("71437"{t3}) /* music font &dK &d@ z += 235 /* music font &dK &d@ perform subj if t3 < 6 z = int("71437"{t3}) /* music font z += 235 /* music font perform subj else c16 = y z = 127 perform subj y -= vpar(3) / 2 perform subj y -= vpar(3) / 2 perform subj y = c16 end end &dA &dA &d@ c. Put out remaining accidentals above or below notes. &dA SETP01: /* t1 = 1 means ornament goes above t2 = 0 t3 = merged_subflag_1 & 0x3f0 >> 4 t9 = ed_subflag_1 & 0x3f0 >> 4 t10 = 0 /* 0 will mean actual, as opposed to editorial if t3 > 0 if t1 = 1 if t3 & 0x07 > 0 /* ax over on ornament above t2 = 1 if t9 & 0x07 > 0 t10 = 1 /* and this is editorial end end else if t3 > 7 /* ax under on ornament below t2 = 2 if t9 > 7 t10 = 1 /* and this is editorial end end end end if t2 > 0 /* put accidental if t2 = 1 t4 = t3 & 0x07 else t4 = t3 >> 3 end c13 = vpar(56) perform yadjust if c9 <> 1 y -= vpar(1) c16 = y * 2 / vpar(2) if rem <> 0 --y end end x = obx if t2 = 2 and (t5 = 1 or t5 = 5) x += hpar(70) end x += px if pyy > 0 py -= y pyy = 0 end y += py kscrdat = "" &dA &dA &d@ Deal with case where ornament is real, but accidental is editorial &dA if subflag_1 & 0x0f > 0 and t10 = 1 x -= hpar(124) y -= vpar(86) z = 195 /* open square bracket perform subj x += hpar(124) y += vpar(86) end &dA &dA &d@ Put out "second" accidental &dA z = int("39389"{t4}) /* music font z += 210 /* music font perform subj if t4 < 3 z = int("39"{t4}) /* music font x += hpar(z+67) /* hpar(70) or hpar(76) z += 210 /* music font if t2 = 2 and (t5 = 1 or t5 = 5) x += hpar(70) end perform subj end &dA &dA &d@ Deal with case where ornament is real, but accidental is editorial &dA if subflag_1 & 0x0f > 0 and t10 = 1 x += hpar(125) y -= vpar(86) z = 196 /* close square bracket perform subj end end c7 = t7 /* restore "real" c7 end repeat end &dA &dA &d@ End of code rewrite for editorial ornaments and their accidentals &dA &dA &d@ 6. Construct composite subflag_1 and subflag_2, ed_subflag_1 and ed_subflag_2 &dA &dA &d@ New code rewrite &dA05/17/03&d@ to accommodate other editorial marks &dA subflag_1 = ts(c1,SUBFLAG_1) subflag_2 = ts(c1,SUBFLAG_2) ed_subflag_1 = ts(c1,ED_SUBFLAG_1) ed_subflag_2 = ts(c1,ED_SUBFLAG_2) if c2 > c1 t5 = ts(c1,TSR_POINT) bs = cbi(tsr(t5){5..68}) /* &dA04/24/03&d@ merge only subobj suggs. loop for t3 = c1+1 to c2 subflag_1 |= ts(t3,SUBFLAG_1) subflag_2 |= ts(t3,SUBFLAG_2) ed_subflag_1 |= ts(t3,ED_SUBFLAG_1) ed_subflag_2 |= ts(t3,ED_SUBFLAG_2) t4 = ts(t3,TSR_POINT) bt = cbi(tsr(t4){5..68}) /* &dA04/24/03&d@ merge only subobj suggs. bs = bor(bs,bt) repeat temp = cby(bs) t3 = TSR_LENG tsr(t5) = tsr(t5){1,4} // temp // tsr(t5){69..t3} /* &dA05/02/03&d@ end merged_subflag_1 = subflag_1 | ed_subflag_1 merged_subflag_2 = subflag_2 | ed_subflag_2 &dA &dA &d@ 7. Horizontal and vertical accents &dA if merged_subflag_2 & 0x01c0 > 0 &dA &dA &d@ Lower (raise) horizontal accent, if it and slur are present on note head &dA if c7 = 0 and c8 = 1 if bit(6,merged_subflag_2) = 1 /* horizontal accent if stem = UP c4 -= vpar(1) c16 = c4 * 2 / vpar(2) if rem <> 0 --c4 end else c16 = c4 * 2 / vpar(2) if rem <> 0 ++c4 end c4 += vpar(1) end end end t7 = c7 t2 = 3 /* accent code = 3 perform getpxpy (t2,c1) if bit(0,pcontrol) = 1 if bit(1,pcontrol) = 1 if bit(2,pcontrol) = 0 c7 = 1 - stem else c7 = stem end end end x = obx + px &dK &d@ if bit(6,subflag_2) = 1 if bit(6,merged_subflag_2) = 1 /* &dA01/26/08&d@ Fixing a small bug c13 = vpar(57) glyph = 93 /* horizontal accent lsqx = hpar(132) rsqx = hpar(133) sqy = vpar(90) sq_glyph = 195 /* cue square bracket end &dK &d@ if bit(7,subflag_2) = 1 if bit(7,merged_subflag_2) = 1 /* &dA01/26/08&d@ Fixing a small bug c13 = vpar(58) glyph = 94 /* vertical accent--point up lsqx = hpar(134) rsqx = hpar(135) sqy = vpar(91) sq_glyph = 244 /* small square bracket end &dK &d@ if bit(8,subflag_2) = 1 if bit(8,merged_subflag_2) = 1 /* &dA01/26/08&d@ Fixing a small bug c13 = vpar(58) glyph = 95 /* vertical accent--point down lsqx = hpar(134) rsqx = hpar(135) sqy = vpar(91) sq_glyph = 244 /* small square bracket end perform yadjust if c9 <> 1 y -= vpar(1) c16 = y * 2 / vpar(2) if rem <> 0 --y end end if pyy > 0 y = py else y += py end kscrdat = "" if ed_subflag_2 & 0x01c0 > 0 x -= lsqx y -= sqy z = sq_glyph /* open square bracket perform subj x += lsqx y += sqy end z = glyph perform subj if ed_subflag_2 & 0x01c0 > 0 x += rsqx y -= sqy z = sq_glyph + 1 /* close square bracket perform subj end c7 = t7 end &dA &dA &d@ 8. harmonics &dA if merged_subflag_2 & 0x0200 > 0 t2 = 7 /* harmonics code = 7 perform getpxpy (t2,c1) x = obx + px z = 123 /* music font c13 = vpar(59) t7 = c7 if stem = 0 c7 = 1 else c7 = 0 end perform yadjust /* c9 set by yadjust c7 = t7 if pyy > 0 y = py else y += py end kscrdat = "" perform subj end &dA &dA &d@ 9. thumb positions, open string &dA c9 = merged_subflag_2 & 0x0c00 if c9 > 0 t2 = 8 /* thumb-open code = 8 perform getpxpy (t2,c1) x = obx + px if bit(10,merged_subflag_2) = 1 z = 124 /* music font c13 = vpar(60) else z = 199 /* music font c13 = vpar(48) end t7 = c7 if stem = 0 c7 = 1 else c7 = 0 end perform yadjust /* c9 set by yadjust c7 = t7 if pyy > 0 y = py else y += py end kscrdat = "" perform subj end &dA &dA &d@ 10. fingerings (above staff for the moment) Note: suggestions for fingerings &dA &d@ not yet implemented here. &dA c9 = merged_subflag_2 >> 12 if c9 > 0 &dA &dA &d@ If above the staff, reverse the flags &dA t4 = 0 VVV2: t1 = 0x0f t3 = 4 VVV1: t2 = c9 & t1 if t2 > t1 >> 1 t1 = t1 << 4 + t1 t3 += 4 goto VVV1 end t4 <<= t3 t4 += t2 c9 >>= t3 if c9 > 0 goto VVV2 end t5 = t4 VVV4: t1 = 0x0f t3 = 4 VVV3: t2 = t5 & t1 if t2 > t1 >> 1 t1 = t1 << 4 + t1 t3 += 4 goto VVV3 end &dA &dA &d@ Typeset t2 &dA c13 = vpar(48) perform yadjust /* c9 set by yadjust t4 = t3 - 1 >> 2 * (hpar(73) / 2) x = obx - t4 VVV5: t4 = t2 & 0x0f z = t4 & 0x07 + 199 /* music font kscrdat = "" perform subj if t4 > 7 x += hpar(73) &dK &d@ z = 220 /* music font &dK &d@ perform subj &dK &d@ x += hpar(73) t2 >>= 4 goto VVV5 end t5 >>= t3 if t5 > 0 goto VVV4 end end &dA &dA &d@ 11. up-bows, down-bows &dA if merged_subflag_2 & 0x03 > 0 t2 = 6 /* bowing code = 6 perform getpxpy (t2,c1) x = obx + px if bit(0,merged_subflag_2) = 1 c13 = vpar(61) z = 117 /* music font else c13 = vpar(62) z = 116 /* music font end t7 = c7 if stem = 0 c7 = 1 else c7 = 0 end perform yadjust c7 = t7 if c9 <> 1 y -= vpar(1) c16 = y * 2 / vpar(2) if rem <> 0 --y end end if pyy > 0 y = py else y += py end kscrdat = "" perform subj end &dA &dA &d@ 12. fermatas &dA if bit(14,merged_subflag_1) = 1 t2 = 15 /* upright fermata code = 15 perform getpxpy (t2,c1) x = obx + px c13 = vpar(63) z = 101 /* music font perform yadjust if pyy > 0 y = py else y += py end kscrdat = "" perform subj end if bit(15,merged_subflag_1) = 1 t2 = 16 /* inverted fermata code = 16 perform getpxpy (t2,c1) x = obx + px c13 = vpar(63) z = 102 /* music font t7 = c7 if stem = 0 c7 = 0 else c7 = 1 end perform yadjust c7 = t7 y -= vpar(63) if pyy > 0 y = py else y += py end kscrdat = "" perform subj end return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 9. yadjust (operates on an entire chord at once) ³ &dA &d@³ ³ &dA &d@³ Purpose: to work in conjunction with setperf to adjust ³ &dA &d@³ the y position so that the indication will ³ &dA &d@³ fall on c4/c5 or above/below the staff line, ³ &dA &d@³ whichever is higher/lower. Procedure also ³ &dA &d@³ determines a new value of the virtual endpoints, ³ &dA &d@³ c4/c5 based on the y position and the vertical ³ &dA &d@³ space parameter, c13, which is passed to the ³ &dA &d@³ procedure. ³ &dA &d@³ ³ &dA &d@³ Inputs: c4 = virtual vertical position of controlling ³ &dA &d@³ note head ³ &dA &d@³ c5 = virtual vertical position of end of stem ³ &dA &d@³ stem = stem direction 0 = up ³ &dA &d@³ 1 = down ³ &dA &d@³ c7 = situation flag 0 = place on note head ³ &dA &d@³ 1 = place on stem ³ &dA &d@³ c13 = vertical space of next character to set ³ &dA &d@³ ³ &dA &d@³ Outputs: c4 = updated vertical position of controlling ³ &dA &d@³ note head ³ &dA &d@³ c5 = updataed vertical position of end of stem ³ &dA &d@³ c9 = position flag (1 = place on top of staff) ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure yadjust int t1 if c7 = 0 if stem = DOWN if c4 > vpar(1) c4 = vpar(1) end else if c4 < vpar(7) c4 = vpar(7) end end else if stem = DOWN if c5 < vpar(8) c5 = vpar(8) end else if c5 > 0 c5 = 0 end end end * determine y location c9 = stem + c7 t1 = 1 if c9 = 1 t1 = -1 end if c7 = 0 y = 5 * notesize / 4 * t1 + c4 if stem = UP y += c13 end else y = vpar(2) * t1 + c5 /* &dAwas vpar(1)&d@ if stem = DOWN y += c13 end end * compute new vertual endpoints if c7 = 1 c5 += c13 * t1 else c4 += c13 * t1 end return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 10. setleger ³ &dA &d@³ ³ &dA &d@³ Purpose, set leger lines for a chord (object) ³ &dA &d@³ ³ &dA &d@³ Inputs: obx = x-position of object ³ &dA &d@³ passsize = note size (full, cue-size) ³ &dA &d@³ c7 = pointer to lowest note in chord ³ &dA &d@³ c8 = pointer to highest note in chord ³ &dA &d@³ c9 = extra width of leger lines ³ &dA &d@³ stem = stem direction 0 = up, 1 = down ³ &dA &d@³ ³ &dA &d@³ Internal: x,y,z sent to subj ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure setleger z = passsize * 128 + 45 /* music font x = obx if stem = UP ++x end if ts(c8,STAFFLOC) < 0 y = 0 - notesize kscrdat = "" loop while y >= ts(c8,STAFFLOC) perform subj if c9 > 0 x += c9 perform subj x -= c9 end y -= notesize repeat end if ts(c7,STAFFLOC) > vpar(9) y = vpar(10) kscrdat = "" loop while y <= ts(c7,STAFFLOC) perform subj if c9 > 0 x += c9 perform subj x -= c9 end y += notesize repeat end return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 11. wideleger ³ &dA &d@³ ³ &dA &d@³ Purpose: set wide a leger line for a note head located on, ³ &dA &d@³ above, or below a leger line ³ &dA &d@³ ³ &dA &d@³ Inputs: obx = x-position of object ³ &dA &d@³ oby = y-position of object ³ &dA &d@³ x = x-position of note head ³ &dA &d@³ y = y-position of note head ³ &dA &d@³ passsize = note size (full size, cue size) ³ &dA &d@³ c10 = note-on-line flag: 0 = on line, 1 = on space ³ &dA &d@³ ³ &dA &d@³ Internal: x,y,z sent to subj ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure wideleger int t1 z = passsize * 128 + 45 /* music font t1 = x if c10 = 0 --x end kscrdat = "" perform subj if c10 = 0 x += hpar(106) else x += hpar(107) end perform subj x = t1 return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 12. number ³ &dA &d@³ ³ &dA &d@³ Purpose: Create subobject for number ³ &dA &d@³ ³ &dA &d@³ Inputs: a = number ³ &dA &d@³ dv2 = center position for number ³ &dA &d@³ ³ &dA &d@³ Outputs: dv3 = right boundary of number ³ &dA &d@³ ³ &dA &d@³ x,z sent to subj ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure number x = dv2 - hpar(21) if a > 99 x = dv2 + hpar(21) else if a > 9 x = dv2 end end dv3 = x + hpar(20) kscrdat = "" NU1: a /= 10 z = rem + 71 /* music font perform subj if a = 0 return end x -= hpar(20) goto NU1 &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 13. setdots ³ &dA &d@³ ³ &dA &d@³ Purpose: typeset sub-object dot(s) ³ &dA &d@³ ³ &dA &d@³ Inputs: c3 = pointer into set array for this note ³ &dA &d@³ obx = horizontal position of object ³ &dA &d@³ oby = vertical position of object ³ &dA &d@³ passsize = note size (full size, cue size) ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure setdots int t1,t2,t3,t4,t5,t6 t4 = ts(c3,DOT) if t4 > 0 t1 = t4 >> 4 /* code modified &dA12-24-96&d@ t1 /= INT10000 t2 = rem if t2 > (INT10000 >> 1) t2 -= INT10000 ++t1 end t6 = 18 /* New code &dA05/02/03&d@ extension dot code = 18 perform getpxpy (t6,c3) if pxx = 1 x = obx + px else x = obx + t1 + px end if pyy = 1 y = oby + py else y = oby + t2 + py end /* end New code z = 128 * passsize + 44 /* music font kscrdat = "" perform subj /* first dot if t4 & 0x03 = 3 t3 = hpar(91) if passsize = CUESIZE t3 = t3 * 8 / 10 end x += t3 perform subj /* second dot end &dA &d@ added code &dA12-24-96&d@ if t4 & 0x04 = 4 t3 = hpar(91) if passsize = CUESIZE t3 = t3 * 8 / 10 end x += t3 perform subj /* third dot end if t4 & 0x08 = 8 t3 = hpar(91) if passsize = CUESIZE t3 = t3 * 8 / 10 end x += t3 perform subj /* fourth dot end end return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 14. setrest (t6) ³ &dA &d@³ ³ &dA &d@³ Purpose: write object rest ³ &dA &d@³ ³ &dA &d@³ Inputs: c1 = pointer into set array for this rest ³ &dA &d@³ obx = horizontal position of rest ³ &dA &d@³ oby = vertical position of rest ³ &dA &d@³ c3 = oby offset (for grand staff) ³ &dA &d@³ ntype = type of note (e.g. sixteenth) ³ &dA &d@³ passsize = rest type (full size, cue size) ³ &dA &d@³ passtype = type of pass (reg,cue,grace,cuegrace) ³ &dA &d@³ passnum = pass number for this rest ³ &dA &d@³ inctype = increment type for next node ³ &dA &d@³ with a new spn (used in putobj) ³ &dA &d@³ opt_rest_flag = put out rest with small r ³ &dA &d@³ ³ &dA &d@³ Output: t6 = amount of space taken up ³ &dA &d@³ ³ &dA &d@³ Operation: In addition to writing the object rest, this ³ &dA &d@³ procedure must also check to see if the rest is ³ &dA &d@³ the beginning or end of a tuplet group. In the ³ &dA &d@³ former case, the tuplet array, tuar, must be ³ &dA &d@³ constructed; in the latter case, the tuplet ³ &dA &d@³ super-object must be compiled and written out. ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure setrest (t6) str temp.100 int t1,t2,t3,t4,t5,t6,t7,t8,t9 int t10 int staff,track,pri_staff,p21,p22,p4,p5,p6,p71,p72,p8,p12 if scr_flag = 1 pri_staff = 0 track = ts(c1,TRACK_NUM) staff = ts(c1,STAFF_NUM) + 1 if track > 0 pri_staff = trackstave(opbarnum,track,3) end &dA &dA &d@ Compute values for P2 P4 P5 P6 P7 P8 and P12 &dA p21 = staff p22 = track t1 = oby &dA &dA &d@ P4 may be modified by print suggestions &dA t4 = ts(c1,TSR_POINT) t8 = ors(tsr(t4){2}) /* &dA05/02/03&d@ code revised if bit(0,t8) = 1 t5 = ors(tsr(t4){4}) if t5 > 0 t5 = t5 - 128 * notesize if t5 >= 0 t5 = t5 + 5 / 10 else t5 = t5 - 5 / 10 /* verified as working properly end if bit(2,t8) = 1 /* position is "absolute" t1 = t5 else /* position is "relative" t1 = t1 + t5 end end end &dA &dA &d@ Assumed defaults for rests &dA &d@ ============================ &dA &d@ rest MUSED SCORE &dA &d@ w 28 0 &dA &d@ h 28 0 &dA &d@ q 28 0 &dA &d@ e 28 0 &dA &d@ s 28 0 &dA &d@ t 14 0 &dA &d@ x 14 0 &dA p4 = (0 - t1) / vpar(1) + 4 if ntype < SIXTEENTH p4 -= 2 end p5 = 7 - ntype /* MUSEDATA q = 7, SCORE q = 0 if ts(c1,CLAVE) = 200 p6 = -1 else p6 = 0 t3 = ts(c1,DOT) t8 = t3 & 0x0f if t8 > 0 p6 = int("1.2...3.......4"{t8}) end end p71 = 10000 * note_dur / divspq p71 = p71 / 10000 p72 = rem p8 = 0 if bit(14,ts(c1,SUBFLAG_1)) = 1 p8 = 1 /* actually -1 end p12 = 0 if pri_staff > 0 if pri_staff = 1 and staff = 2 p12 = 2 end if pri_staff = 2 and staff = 1 p12 = 1 end p21 = pri_staff /* set P2 to primary staff end if ts(c1,CLAVE) = 200 and pri_staff > 0 p12 = 0 /* force "silent" rests to primary staff end kscrdat = " | P2=" // chs(p21) // "." // chs(p22) // " P4=" // chs(p4) kscrdat = kscrdat // " P5=" // chs(p5) // " P6=" // chs(p6) kscrdat = kscrdat // " P7=" // chs(p71) // "." if p72 < 10 kscrdat = kscrdat // "0" end if p72 < 100 kscrdat = kscrdat // "0" end if p72 < 1000 kscrdat = kscrdat // "0" end kscrdat = kscrdat // chs(p72) if p8 = 0 kscrdat = kscrdat // " P8=" else kscrdat = kscrdat // " P8=-" end kscrdat = kscrdat // chs(p8) // " P12=" // chs(p12) end t10 = c3 x = obx y = oby t1 = 0 if ts(c1,CLAVE) = 200 and scr_flag = 1 t6 = 0 z = 0 perform subj kscrdat = "" goto SRST1 end if ntype > QUARTER t6 = hpar(87) /* total horizontal space taken else t6 = hpar(88) /* total horizontal space taken end if ntype > SIXTEENTH z = 128 * passsize + 55 - ntype /* music font perform subj kscrdat = "" else y += notesize if ntype < THIRTY_SECOND y = 4 - ntype * notesize + y end z = 128 * passsize + 49 /* music font perform subj kscrdat = "" ++z if passsize = FULLSIZE t3 = notesize t4 = hpar(54) else t3 = vpar(65) t4 = hpar(89) end t2 = ntype loop while t2 < EIGHTH y -= t3 x += t4 t6 += t4 /* total horizontal space taken ++t1 perform subj ++t2 repeat end if ts(c1,DOT) > 0 t3 = ts(c1,DOT) t8 = t3 & 0x0f /* actual DOT code (modified &dA12-24-96&d@) t3 >>= 4 /* code modified &dA12-24-96&d@ t3 /= INT10000 t7 = rem if t7 > (INT10000 >> 1) t7 -= INT10000 ++t3 end y = oby + t7 x += t3 t6 = vpar(1) if passsize = CUESIZE t6 = t6 * 8 / 10 /* space for dot end t6 += t3 z = 128 * passsize + 44 /* music font perform subj /* first dot if t8 & 0x02 = 2 t5 = hpar(91) x += t5 perform subj /* second dot t6 += t5 end &dA &d@ code added &dA12-24-96&d@ if t8 & 0x04 = 4 t5 = hpar(91) x += t5 perform subj /* third dot t6 += t5 end if t8 & 0x08 = 8 t5 = hpar(91) x += t5 perform subj /* fourth dot t6 += t5 end end SRST1: passback t6 /* total horizontal space taken &dA &dA &d@ New &dA10/15/07&d@ &dA &dK &d@ jtype = "R" if opt_rest_flag = 0 jtype = "R" else jtype = "r" end jcode = ntype out = "0" if bit(4,ts(c1,SUPER_FLAG)) = 1 /* if begin tuplet ++snum tuar(passtype,passnum,TU_SNUM) = snum tuar(passtype,passnum,TU_Y1) = y tuar(passtype,passnum,TU_Y2) = y tuar(passtype,passnum,TU_FSTEM) = DOWN /* (default) t7 = 0 if bit(6,ts(c1,SUPER_FLAG)) = 1 /* tuplet has a bracket t7 = ts(c1,SUPER_FLAG) & 0x3c0 /* bits 6,7,8,9 &dA03-21-97&d@ t7 <<= 2 end tuar(passtype,passnum,TU_FSTEM) += t7 /* tuplet flags &dA03-21-97&d@ out = "1 " // chs(snum) end if bit(5,ts(c1,SUPER_FLAG)) = 1 /* if end tuplet t7 = tuar(passtype,passnum,TU_FSTEM) & 0xff goto TPFF(tpflag+1) TPFF(1): /* default tuplet placement TPFF(2): /* place tuplet near note heads if t7 = UP goto TPFFA else goto TPFFB end TPFF(3): /* place tuplet near stems if t7 = UP goto TPFFB else goto TPFFA end TPFF(4): /* place all tuplets above notes goto TPFFB TPFF(5): /* place all tuplets below notes goto TPFFA TPFFA: t3 = tuar(passtype,passnum,TU_Y2) + notesize + vpar(64) t4 = notesize * 6 if t7 <> UP t3 += vpar(7) end if t3 < t4 t3 = t4 end t9 = 4 /* tips up &dA03-21-97&d@ goto TPFFC TPFFB: t3 = tuar(passtype,passnum,TU_Y2) - notesize t4 = 0 - vpar(1) if t7 = UP t3 -= vpar(7) end if t3 > t4 t3 = t4 end t9 = 0 /* tips down &dA03-21-97&d@ TPFFC: t3 -= tuar(passtype,passnum,TU_Y1) t5 = t4 - oby out = "1 " // chs(tuar(passtype,passnum,TU_SNUM)) end &dA &dA &d@ fermata over rest &dA kscrdat = "" if bit(14,ts(c1,SUBFLAG_1)) = 1 t2 = 15 /* upright fermata code = 15 perform getpxpy (t2,c1) x = obx + px if pyy > 0 y = py else y = py - vpar(1) end z = 101 /* music font perform subj end if bit(15,ts(c1,SUBFLAG_1)) = 1 t2 = 16 /* inverted fermata code = 16 perform getpxpy (t2,c1) x = obx + px z = 102 /* music font y = vpar(10) /* changed &dA05/02/03&d@ if pyy > 0 y = py else y += py end perform subj end &dA &dA &d@ New code (&dA11-11-93&d@) Duration attribute of rest &dA ++sobcnt sobl(sobcnt) = "A D " // chs(note_dur) // " " // chs(divspq*4) if sobcnt = 1 pcode = z else pcode = sobcnt end t7 = inctype if ts(c1,CLAVE) = 101 /* if movable rest inctype = 10000 end &dA &dA &d@ New code add 01/03/04 to deal with special case of type 7 whole rests &dA if ts(c1,CLAVE) = 102 /* flag whole rest as potentially "removable" inctype = 10001 end oby += t10 &dA &dA &d@ Now look for print suggestions for this note object &dA putobjpar = 0 t4 = ts(c1,TSR_POINT) pcontrol = ors(tsr(t4){1}) /* &dA05/02/03&d@ px = ors(tsr(t4){3}) << 8 py = ors(tsr(t4){4}) << 16 t1 = ors(tsr(t4){2}) << 24 putobjpar = t1 + px + py + pcontrol /* Note: order of data has been changed jscrdat = "" perform putobj inctype = t7 if bit(5,ts(c1,SUPER_FLAG)) = 1 /* if end tuplet t1 = tuar(passtype,passnum,TU_FSTEM) >> 8 /* tuplets flags &dA03-21-97 if t1 > 0 t1 >>= 1 /* remove bracket present flag t1 <<= 5 t9 |= t1 t9 |= 0x02 /* bracket present flag else t9 = 1 end ++outpnt &dA &dA &d@ New &dA11/05/05&d@ Convert TUPLE to 1000 * n1 + n2 format and get x,y adjustments &dA t1 = ts(c1,TUPLE) & 0xffff t2 = t1 >> 8 t1 &= 0xff t2 *= 1000 t1 += t2 t6 = ts(c1,TUPLE) & 0xff0000 /* x adjustment t6 >>= 16 if t6 > 0 t6 = t6 - 128 /* center to zero else t6 = 0 end t4 = ts(c1,TUPLE) & 0xff000000 /* y adjustment t4 >>= 24 if t4 > 0 t4 = t4 - 128 /* center to zero else t4 = 0 end t3 += t4 t5 += t4 &dA &dK &d@ tput [Y,outpnt] H ~tuar(passtype,passnum,TU_SNUM) X ~t9 ~ts(c1,TUPLE) 0 ~t3 0 ~t5 0 tput [Y,outpnt] H ~tuar(passtype,passnum,TU_SNUM) X ~t9 ~t1 ~t6 ~t3 ~t6 ~t5 0 tuar(passtype,passnum,TU_SNUM) = 0 /* New added from s2ed tpflag = global_tpflag end return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 15. putobj ³ &dA &d@³ ³ &dA &d@³ Purpose: write object and sub-objects to intermediate list ³ &dA &d@³ ³ &dA &d@³ Inputs: jtype = object type (field 2) ³ &dA &d@³ jcode = object code (field 3) ³ &dA &d@³ obx = object offset from staff x-position (field 4) ³ &dA &d@³ oby = object offset form staff y-position (field 5) ³ &dA &d@³ pcode = print code (field 6) (or sobl counter) ³ &dA &d@³ spn = space node (field 7) ³ &dA &d@³ inctype = increment type for next node with a new spn ³ &dA &d@³ out = fields 9 -- ³ &dA &d@³ temp3 = occationally temp3 is used in place of ³ &dA &d@³ sobl(1) when there is only 1 subobject ³ &dA &d@³ sobl() = subobject line ³ &dA &d@³ jscrdat = SCORE data appended to end of object &dA(03/21/03)&d@ &dA &d@³ c1,c2 = pointer to first and last elements in ³ &dA &d@³ ts(.,.) array for this object ³ &dA &d@³ ³ &dA &d@³ putobjpar = parameters modifying operation of putobj ³ &dA &d@³ ³ &dA &d@³ putobjpar & 0x01 = control 0 = no modifications ³ &dA &d@³ in this byte ³ &dA &d@³ 1 = possible mods in ³ &dA &d@³ this byte ³ &dA &d@³ ³ &dA &d@³ putobjpar & 0x06 = blank flag 0 = no blanking ³ &dA &d@³ 2 = blank all sub-obj ³ &dA &d@³ 4 = replace all sub-obj³ &dA &d@³ with one ³ &dA &d@³ extension dot ³ &dA &d@³ ³ &dA &d@³ putobjpar & 0xf0 = (four) various flags ³ &dA &d@³ For Notes, Grace Notes, Cue Notes ("NGQ" con jtype)³ &dA &d@³ 0x10 = stem present ³ &dA &d@³ 0 = no stem ³ &dA &d@³ 1 = stem ³ &dA &d@³ 0x20 = stem direction ³ &dA &d@³ 0 = UP ³ &dA &d@³ 1 = DOWN ³ &dA &d@³ 0x40 = note/chord ³ &dA &d@³ 0 = single note ³ &dA &d@³ 1 = chord ³ &dA &d@³ ³ &dA &d@³ ³ &dA &d@³ putobjpar & 0x00ff00 = x position data + 128 ³ &dA &d@³ (in tenths of notesize) ³ &dA &d@³ 0 = no data ³ &dA &d@³ ³ &dA &d@³ putobjpar & 0xff0000 = y position data + 128 ³ &dA &d@³ (in tenths of notesize) ³ &dA &d@³ 0 = no data ³ &dA &d@³ ³ &dA &d@³ putobjpar & 0xff000000 = position data flags ³ &dA &d@³ ³ &dA &d@³ 0x01 = data active flag ³ &dA &d@³ 0x02 = x data flag ³ &dA &d@³ 1 = x location relative to ³ &dA &d@³ obx ³ &dA &d@³ 0 = modification to ³ &dA &d@³ x location as calculated³ &dA &d@³ 0x04 = y data flag ³ &dA &d@³ 1 = y location on staff ³ &dA &d@³ 0 = modification to ³ &dA &d@³ y location as calculated³ &dA &d@³ ³ &dA &d@³ fix_next_inctype = static variable initialized at BIG, ³ New &dA01/19/04 &dA &d@³ set and used only by putobj. ³ &dA &d@³ Variable provides a means for putobj ³ &dA &d@³ to "remember" when it has altered an ³ &dA &d@³ inctype, and a way to "add back" any ³ &dA &d@³ amount taken away. ³ &dA &d@³ ³ &dA &d@³ Outputs: sobcnt set to 0 ³ &dA &d@³ supcnt set to 0 ³ &dA &d@³ ³ &dA &d@³ Internal variable: oldspn = spn from previous object ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure putobj str temp.180,super.180 str params.30(20) int oldspn,t int t1,t2,t3,t4,t5,t6,t7,t8,t9 int s1,s2,s3,s4,s5,s6,s7,s8,s9 int stem,chord int high,low,highpoint,lowpoint int highstem,lowstem,stemlength int nflags,slash,pcnt int grflag &dA &dA &d@ This code added &dA01/19/04&d@ to fix the accumulation of inctypes &dA if fix_next_inctype > 0 and inctype > 0 putc Attempting to adjust the next Inctype from ~inctype ... inctype -= fix_next_inctype if inctype < 0 inctype = 0 end putc to ~inctype fix_next_inctype = 0 end &dA &dA &dA &d@ New Code &dA09/14/03&d@ &dA &d@ ----------------- &dA &d@ If jtype = "I", then inctype may need to be recalculated from the ts(.) array &dA if jtype = "I" and a1 > 1 t3 = 10000 loop for t1 = a1 - 1 to 1 step -1 t2 = ts(t1,DIV) if t2 < ts(a1,DIV) t3 = ts(a1,DIV) - t2 * 576 / divspq t1 = 1 end repeat if t3 <> 10000 and t3 <> inctype putc &dA Caution &d@ Inctype for "I" type object changed from ~inctype to ~t3 fix_next_inctype = t3 - inctype /* fix_next_inctype set &dA01/19/04 inctype = t3 end end t = inctype if t <> 10000 and t <> 10001 /* 10001 added &dA01/03/04&d@ if spn = oldspn t = 0 end if spn = 1 t = 0 end end stem = 0 if "NGQ" con jtype and jcode < WHOLE stem = putobjpar & 0xf0 stem >>= 4 putobjpar &= 0xffffff0f /* strip stem codes from putobjpar end &dA &dA &d@ Determine: t1 = final obx as modified by print suggestions &dA &d@ t2 = final oby &dA05/02/03 &dA px = putobjpar >> 8 & 0xff py = putobjpar >> 16 & 0xff if px > 0 px = px - 128 * notesize / 10 end t1 = obx + px if py > 0 py = py - 128 * notesize / 10 t4 = putobjpar >> 24 & 0xff if bit(2,t4) = 1 t2 = py if oby > 700 t2 += 1000 end else t2 = oby + py end else t2 = oby end &dA &dA &d@ If putobjpar & 0x01 = 1, then we are dealing with certain rennaisance notation &dA &d@ which allows a note duration to extend beyond a bar line. In this case, &dA &d@ the note beyond the barline may be blanked entirely (putobjpar & 0x02 = 1), &dA &d@ or it may be replaced with an extension dot (putobjpar & 0x04 = 1). &dA if (bit(0,putobjpar)) = 1 putobjpar &= 0xff t3 = pcode t4 = putobjpar >> 1 if t4 = 1 or t4 = 2 if t3 > 0 and t3 < 32 if sobl(1) = "" t3 = 0 else t6 = 0 if t4 = 2 ++t6 t8 = t2 / vpar(2) if rem = 0 t8 = vpar(1) - notesize else t8 = 0 end t9 = DOT_CHAR sobl(t6) = "K 0 " // chs(t8) // " " // chs(t9) end loop for t5 = 1 to t3 if sobl(t5){1} = "A" ++t6 sobl(t6) = sobl(t5) end repeat t3 = t6 end end end else t3 = pcode end ++outpnt &dA &dA &d@ &dA11/20/06&d@ This code added for special case of a slur terminating &dA &d@ on a non-printed note. &dA if jtype = "N" and jcode = 0 t3 = 0 end &dA &d@ End of &dA11/20/06&d@ addition if scr_flag = 1 tput [Y,outpnt] J ~jtype ~jcode ~t1 ~t2 ~t3 ~spn ~t ~out ~jscrdat #if OBJ_REPORT dputc J ~jtype ~jcode ~t1 ~t2 ~t3 ~spn ~t ~out ~jscrdat #endif else tput [Y,outpnt] J ~jtype ~jcode ~t1 ~t2 ~t3 ~spn ~t ~out #if OBJ_REPORT dputc J ~jtype ~jcode ~t1 ~t2 ~t3 ~spn ~t ~out #endif end &dA &dA &d@ Look for marks that could be incorporated with this object &dA super = "" if jtype = "N" tget [Y,outpnt-1] temp .t5 s1 s2 s3 s4 s5 s6 s7 s8 if temp{1} = "H" super = temp tget [Y,outpnt-2] temp .t5 s1 s2 s3 s4 s5 s6 s7 s8 end if temp{1,3} = "J M" and s2 = t1 and s5 = spn and s7 = 1 if super = "" --outpnt else outpnt -= 2 end out = trm(out) out = out // " " s9 = int(out) ++s9 out = chs(s9) // out{sub..} // chs(s8) t = s6 if scr_flag = 1 tput [Y,outpnt] J ~jtype ~jcode ~t1 ~t2 ~t3 ~spn ~t ~out ~jscrdat else tput [Y,outpnt] J ~jtype ~jcode ~t1 ~t2 ~t3 ~spn ~t ~out end else super = "" end end oldspn = spn if t3 > 0 and t3 < 32 if sobl(1) = "" ++outpnt tput [Y,outpnt] ~temp3 #if OBJ_REPORT dputc ~temp3 #endif else if scr_flag = 1 &dA &dA &d@ We are going to get a little fancy here. At this point, we can determine &dA &d@ some information that SCORE would like to have. &dA &dA &d@ A. For NOTE heads: By having information on stem direction and &dA &d@ note vs. chord, by looking at the note-object record and by &dA &d@ searching through the sub-objects, we can determine: &dA &dA &d@ 1. whether the note/chord has a separate stem or is &dA &d@ allied with a beam &dA &dA &d@ 2. if the note/chord has a separate stem, &dA &dA &d@ a) which notehead is at the note-end of the chord &dA &dA &d@ b) the stem direction, stem length, and number of &dA &d@ flags for this chord (elements of P5, P8, and P9), &dA &d@ which can be attached to this notehead sub-object. &dA &dA &d@ 3. if the note/chord is allied with a beam, &dA &dA &d@ a) whether this is a single note or a chord &dA &dA &d@ b) if a chord, which notehead is at the note-end &dA &d@ of the chord and the stem direction (number &dA &d@ of flags is zero), both of which can be &dA &d@ attached to this notehead sub-object. &dA &dA &d@ Note: In theory, autoscr had this information at the time it &dA &d@ typeset the sub-objects, but I looked through the code &dA &d@ and found it problematic to deduce precisely what &dA &d@ autoscr is doing. We could do this, but it would take &dA &d@ quite a while to get everything right. Instead, why not &dA &d@ just analyze what autoscr actually did in each situation &dA &d@ and report this to SCORE. &dA if "GNQ" con jtype and jcode < WHOLE grflag = mpt & 0x01 if bit(0,stem) = 0 putc stem = ~stem putc No stem direction specified for half note or less dputc &dAProgram needs fixing&d@, and so does the stage2 file. stop end chord = stem >> 2 /* 1 = chord stem &= 0x02 /* just look at this bit stem >>= 1 /* 0 = UP 1 = DOWN nflags = 0 slash = 0 stemlength = 0 highstem = 10000 lowstem = -10000 high = 10000 low = -10000 loop for sobcnt = 1 to t3 temp = sobl(sobcnt) temp = temp // pad(80) if temp{1} = "K" sub = 2 t4 = int(temp{sub..}) t5 = int(temp{sub..}) t6 = int(temp{sub..}) if chr(t6) in [42,43,170,171] if t5 < high highpoint = sobcnt high = t5 end if t5 > low lowpoint = sobcnt low = t5 end end if chr(t6) in [51..62,179..190] t7 = t5 t8 = t5 if t6 = 59 /* 59 full length up t7 = t5 - 28 goto POJ1 end if t6 = 60 /* 60 full length down t8 = t5 + 29 goto POJ1 end if t6 < 55 nflags = 1 if t6 = 53 /* 53 up-eighth t7 = t5 - 47 goto POJ1 end if t6 = 54 /* 54 down-eighth t8 = t5 + 47 goto POJ1 end if t6 = 51 /* 51 short up-eighth t7 = t5 - 40 goto POJ1 end if t6 = 52 /* 52 short down-eighth t8 = t5 + 40 goto POJ1 end end if t6 < 59 if t6 = 55 /* 55 up-sixteenth t7 = t5 - 51 nflags = 2 goto POJ1 end if t6 = 56 /* 56 down-sixteenth t8 = t4 + 51 nflags = 2 goto POJ1 end if t6 = 57 /* 57 up-add-eighth t7 = t5 - 51 ++nflags goto POJ1 end if t6 = 58 /* 58 down-add-eighth t8 = t4 + 51 ++nflags goto POJ1 end end if t6 = 61 /* 61 notesize up t7 = t5 - 14 goto POJ1 end if t6 = 62 /* 62 notesize down t8 = t5 + 15 goto POJ1 end if t6 = 179 /* 179 up-eight + slash t7 = t5 - 38 nflags = 1 slash = 1 goto POJ1 end if t6 = 181 /* 181 up-eighth t7 = t5 - 38 nflags = 1 goto POJ1 end if t6 = 180 /* 180 down-eight + slash t8 = t5 + 38 nflags = 1 slash = 1 goto POJ1 end if t6 = 182 /* 182 down-eighth t8 = t5 + 38 nflags = 1 goto POJ1 end if t6 = 183 /* 183 up-sixteenth nflags = 2 t7 = t5 - 41 end if t6 = 184 /* 184 down-sixteenth nflags = 2 t8 = t5 + 41 end if t6 = 185 /* 185 up-add-eighth ++nflags t7 = t5 - 41 end if t6 = 186 /* 186 down-add-eighth ++nflags t8 = t5 + 37 end if t6 = 187 /* 187 full length up t7 = t5 - 28 end if t6 = 188 /* 188 full length down t8 = t5 + 29 end if t6 = 189 /* 189 notesize up t7 = t5 - 14 end if t6 = 190 /* 190 notesize down t8 = t5 + 15 end POJ1: if t7 < highstem highstem = t7 end if t8 > lowstem lowstem = t8 end end end repeat stemlength = lowstem - highstem t8 = low - high /* t8 = spread if t8 + vpar(3) >= stemlength - 2 /* then this unit is under a beam stemlength = 100000 /* P8 for notes under a beam else stemlength *= 100 /* work in 100ths if grflag = 1 /* a fudge, but it may work stemlength += (260 * vpar(1)) end if jcode >= EIGHTH t8 = 700 * vpar(1) /* set zero to 7 scale steps else t8 = 793 * vpar(1) /* set zero to 7.93 scale steps end /* SCORE printing style stemlength -= t8 stemlength /= vpar(1) /* reduce to scale steps now end if stem = UP t8 = lowpoint else t8 = highpoint end temp = sobl(t8) // pad(120) loop for t7 = 1 to 20 params(t7) = "" repeat sub = 1 POJ2: if temp{sub..} con "P" t4 = sub t7 = int(temp{sub+1..}) if temp{sub..} con " " t5 = sub end params(t7) = temp{t4..t5} goto POJ2 end &dA &dA &d@ Note: The code below is potentially in ERROR because it may need to &dA &d@ be applied to all notes in the chord, not just the controlling note. &dA &d@ (&dE07/28/03&d@) &dA if temp con "Dots" t4 = sub-1 if temp{sub..} con " " t5 = sub end params(20) = temp{t4..t5} end &dK &d@ if "GQ" con jtype &dK &d@ t4 = int(params(4){4..}) &dK &d@ params(4) = "P4=" &dE07/28/03&d@ &dK &d@ if t4 < 0 This code is in the wrong &dK &d@ t4 = 0 - t4 place. It must be applied &dK &d@ params(4) = params(4) // "-" to all notes on a chord, not &dK &d@ end just the controlling note. &dK &d@ t4 += 100 See new code below. &dK &d@ params(4) = params(4) // chs(t4) // " " &dK &d@ end if params(5) = "" t5 = stem + 1 * 10 params(5) = "P5=" // chs(t5) // " " else t5 = stem + 1 params(5) = "P5=" // chs(t5) // params(5){4..} end if stemlength < 0 stemlength = 0 - stemlength params(8) = "P8=-" else params(8) = "P8=" end t4 = stemlength / 100 t5 = rem if slash = 1 stemlength += 100 end params(8) = params(8) // chs(t4) // "." if t5 < 10 params(8) = params(8) // "0" end params(8) = params(8) // chs(t5) if nflags > 0 if params(9) = "" params(9) = "P9=" // chs(nflags) // ".00" else t5 = int(params(9){4..}) t6 = sub t5 += nflags params(9) = "P9=" // chs(t5) // params(9){t6..} end end if temp con "|" temp = temp{1,mpt} end loop for t7 = 1 to 9 params(t7) = trm(params(t7)) if params(t7) <> "" temp = temp // " " // params(t7) end repeat params(20) = trm(params(20)) if params(20) <> "" temp = temp // " " // params(20) end loop for t7 = 10 to 19 params(t7) = trm(params(t7)) if params(t7) <> "" temp = temp // " " // params(t7) end repeat sobl(t8) = temp &dA &dA &d@ If note is Grace or Cue, you must modify P4 for all notes in a chord (&dE07/28/03&d@) &dA if "GQ" con jtype loop for sobcnt = 1 to t3 temp = sobl(sobcnt) temp = temp // pad(170) if temp{1} = "K" if temp con "P4=" t4 = sub if temp{sub..} con " " t5 = sub end params(4) = temp{t4..t5} /* e.g. "P4=12 " t7 = int(params(4){4..}) params(4) = "P4=" if t7 < 0 t7 = 0 - t7 params(4) = params(4) // "-" end t7 += 100 params(4) = params(4) // chs(t7) // " " /* e.g. "P4=112 " temp = temp{1..t4-1} // params(4) // temp{t5+1..} if jcode = 0 &dK &d@ dputc Line = ~temp if temp con "P8=" t4 = sub if temp{sub..} con " " t5 = sub end params(8) = temp{t4..t5} /* e.g. "P8=0.09 " t7 = int(params(8){4..}) if params(8){sub} = "." t8 = int(params(8){sub+1..}) /* e.g. t8 = 9 else t8 = 0 end params(8) = "P8=" if t7 < 0 t7 = 0 - t7 params(8) = params(8) // "-" end t7 += 100 params(8) = params(8) // chs(t7) if t8 > 0 if t8 < 10 params(8) = params(8) // ".0" /* e.g. "P8=100.09 " else params(8) = params(8) // "." end params(8) = params(8) // chs(t8) // " " else params(8) = params(8) // " " end temp = temp{1..t4-1} // params(8) // temp{t5+1..} end &dK &d@ dputc New Line = ~temp end sobl(sobcnt) = trm(temp) end end repeat end end &dA &dA &d@ End of &dE07/28/03&d@ addition &dA end &dA &dA &d@ New &dA03/18/06&d@ constructing "A" type records &dA &dA &d@ 1. First identify all ties connected to notes &dA if xdata_flag = 1 and scr_flag = 0 if "NGR" con jtype s5 = mpt s2 = 0 if s5 < 3 s3 = 0 loop for s1 = c1 to c2 if bit(0,ts(s1,SUPER_FLAG)) = 1 /* if tie starts ++s2 end ++s3 repeat &dA &dA &d@ 2. Append "tie" digit to "A D" record &dA s4 = 0 if s2 > 0 s4 = 1 if s2 < s3 s4 = 2 end end sobl(t3) = sobl(t3) // " " // chs(s4) else sobl(t3) = sobl(t3) // " 0" end &dA &dA &d@ 3. Construct "A P" records for this node &dA loop for s1 = c1 to c2 ++t3 s6 = ts(s1,TRACK_NUM) if s6 = 0 if tracknum_flag = 0 s6 = 1 else putc Missing track number. Possible error in stage2 file. putc Run program again with measure numbers (Pxsm) to see putc this might be. putc putc &dAProgram Halted&d@ putc stop end end sobl(t3) = "A P " // chs(s6) // " " // chs(ts(s1,BASE_40)) if s5 < 3 if bit(0,ts(s1,SUPER_FLAG)) = 1 /* if tie starts sobl(t3) = sobl(t3) // " 1" else sobl(t3) = sobl(t3) // " 0" end rest_flag(s6) = 0 else sobl(t3) = sobl(t3) // " 0" /* tricky code s7 = rest_flag(s6) if s7 > 0 /* fixup previous rest for this track tget [Y,s7] temp s8 = int(temp{5..}) if temp{1,3} <> "A P" or s8 <> s6 putc Program error. No rest fixup possible else temp = trm(temp) temp{..} = "1" tput [Y,s7] ~temp --s7 tget [Y,s7] temp temp = trm(temp) temp{..} = "1" tput [Y,s7] ~temp end end rest_flag(s6) = outpnt + t3 end repeat end end &dA &dA &d@ End of &dA03/18/06&d@ addition loop for sobcnt = 1 to t3 ++outpnt tput [Y,outpnt] ~sobl(sobcnt) #if OBJ_REPORT dputc ~sobl(sobcnt) #endif repeat end end sobcnt = 0 supcnt = 0 if super <> "" ++outpnt tput [Y,outpnt] ~super end return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 16. subj ³ &dA &d@³ ³ &dA &d@³ Purpose: write sub-object to intermediate list ³ &dA &d@³ ³ &dA &d@³ Inputs: x = horizontal position of sub-object ³ &dA &d@³ y = vertical position of sub-object ³ &dA &d@³ z = character number ³ &dA &d@³ obx = object offset from staff x-position ³ &dA &d@³ oby = object offset from staff y-position ³ &dA &d@³ sobcnt = counter in intermediate list ³ &dA &d@³ kscrdat = SCORE info to append to end of ³ &dA &d@³ sub-object record ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure subj ++sobcnt sobx = x - obx soby = y - oby sobl(sobcnt) = "K " // chs(sobx) // " " // chs(soby) // " " if scr_flag = 1 sobl(sobcnt) = sobl(sobcnt) // chs(z) // kscrdat else sobl(sobcnt) = sobl(sobcnt) // chs(z) end return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 16a. subj2 /* Addition to Code &dA02/25/97&d@ ³ &dA &d@³ ³ &dA &d@³ Purpose: write "invisible" sub-object to ³ &dA &d@³ intermediate list ³ &dA &d@³ ³ &dA &d@³ Inputs: x = horizontal position of sub-object ³ &dA &d@³ y = vertical position of sub-object ³ &dA &d@³ z = character number ³ &dA &d@³ obx = object offset from staff x-position ³ &dA &d@³ oby = object offset from staff y-position ³ &dA &d@³ sobcnt = counter in intermediate list ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure subj2 ++sobcnt sobx = x - obx soby = y - oby sobl(sobcnt) = "k " // chs(sobx) // " " // chs(soby) // " " sobl(sobcnt) = sobl(sobcnt) // chs(z) return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 17. cancelsig (m, j, h, klave) ³ &dA &d@³ ³ &dA &d@³ Purpose: Write out cancellation of sharps or flats ³ &dA &d@³ ³ &dA &d@³ Inputs: obx = object location ³ &dA &d@³ oby = " " ³ &dA &d@³ x = x starting point ³ &dA &d@³ h = number of sharps or flats to cancel ³ &dA &d@³ j = one less than starting point in zak(.,.) ³ &dA &d@³ m = selection 1 = sharps ³ &dA &d@³ 2 = flats ³ &dA &d@³ 3 = sharps (clef = tenor) ³ &dA &d@³ klave = line on which to start calcellations ³ &dA &d@³ (from which y is computed) ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure cancelsig (m, j, h, klave) int m,j,h,klave,tenor getvalue m, j, h, klave tenor = 0 if m = 3 m = 1 tenor = 1 /* exception for sharps in the tenor cler end z = 64 kscrdat = "" loop for g = 1 to h if tenor = 0 or klave >= 0 y = klave + 20 * notesize / 2 - vpar20 else y = klave + 27 * notesize / 2 - vpar20 end perform subj ++j &dK &d@ y += zak(m,j) klave += zak(m,j) x += hpar(11) repeat passback klave return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 18. setmrest ³ &dA &d@³ ³ &dA &d@³ Purpose: Set multiple rests and terminating bar line ³ &dA &d@³ ³ &dA &d@³ Inputs: p = horizontal starting point ³ &dA &d@³ mrest = number of rests to set ³ &dA &d@³ measnum = measure number for terminating bar line ³ &dA &d@³ wrest = optional type 7 whole rest flag (&dA01/03/04&d@) ³ &dA &d@³ jscrdat = SCORE info to append to end of ³ &dA &d@³ terminating bar line ³ &dA &d@³how_much_mrest(2) = divspq, divspm ³ &dA &d@³ ³ &dA &d@³ Outputs: p = new horizontal point ³ &dA &d@³ mrest = 0 ³ &dA &d@³ ³ &dA &d@³ Operation: For multiple rests we need to communicate ³ &dA &d@³ P7 = rest's rhythmic duration ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure setmrest str temp.80 int i,j int a2,a3,a4 int t1 /* New &dA10/29/08&d@ if scr_flag = 1 temp = jscrdat /* save measure object's jscrdat string i = how_much_mrest(1) j = how_much_mrest(2) j = j * 10000 / i j /= 10000 i = rem jscrdat = " | P7=" // chs(j) // "." if i < 10 jscrdat = jscrdat // "0" end if i < 100 jscrdat = jscrdat // "0" end if i < 1000 jscrdat = jscrdat // "0" end jscrdat = jscrdat // chs(i) end putobjpar = 0 if mrest > 1 p += hpar(22) obx = p oby = vpar(3) x = obx y = oby z = 62 kscrdat = "" perform subj y = oby + vpar(11) perform subj z = 92 x = obx y = vpar(4) loop for i = 1 to 3 perform subj x += 30 p += 30 repeat y = oby z = 62 perform subj y = oby + vpar(11) perform subj dv2 = p - 45 a = mrest &dA &d@ Slight code modification &dA11/18/08&d@ &dA &dA &d@ In the case of musical parts, for notesize 21 anyway, I think &dA &d@ the number above a multiple rest is easier to read if it is 2 dots &dA &d@ above the middle line. Admittedly, this is a magic number at the &dA &d@ moment. &dA if notesize = 21 y = vpar(4) - 2 else y = vpar(4) end &dA &dA perform number jtype = "S" jcode = 4 out = "0" pcode = sobcnt spn = mrest perform putobj p += hpar(23) t1 = 1 /* New &dA10/29/08&d@: 1 was the old value for J B (field 8) else obx = p + hpar(24) oby = vpar(4) ++outpnt &dA &dA &d@ New code &dA01/03/04&d@, modified &dA03/13/06&d@ to remove type 6 and type 7 Symbol objects &dA if scr_flag = 1 if wrest = 1 tput [Y,outpnt] J R 9 ~obx ~oby 46 1 10001 0 ~jscrdat else tput [Y,outpnt] J R 9 ~obx ~oby 46 1 10000 0 ~jscrdat end else if wrest = 1 &dK &d@ tput [Y,outpnt] J S 7 ~obx ~oby 46 0 0 0 tput [Y,outpnt] J R 9 ~obx ~oby 46 1 10001 0 else &dK &d@ tput [Y,outpnt] J S 6 ~obx ~oby 46 0 0 0 tput [Y,outpnt] J R 9 ~obx ~oby 46 1 10000 0 end end &dA p += hpar(25) &dA &d@ New &dA10/29/08&d@ &dA &dA &d@ We need to try to compute a J B (field 8) value that mirrors &dA &d@ the expected distance increment flag in a normal measure. &dA &d@ We will use the data in: how_much_mrest(2) = divspq, divspm &dA t1 = 576 * how_much_mrest(2) / how_much_mrest(1) &dA &dA end obx = p + hpar(36) if scr_flag = 1 jscrdat = temp /* restore measure object's jscrdat string else jscrdat = "" end &dA &dA &d@ &dA03/07/06&d@ Adding capability of setmrest to set "mdotted", "mdouble", &dA &d@ "mheavy2", "mheavy3", in addition to "measure". No repeat dots, &dA &d@ endings, or other signs are allowed here. &dA if mrest_line{2,6} = "easure" ++outpnt &dA &d@ tput [Y,outpnt] J B ~measnum ~obx 1 82 6913 1 0 ~jscrdat /* Line below is new &dA10/29/08 tput [Y,outpnt] J B ~measnum ~obx 1 82 6913 ~t1 0 ~jscrdat p = obx + hpar(37) end if mrest_line{2,6} = "dotted" ++outpnt &dA &d@ tput [Y,outpnt] J B ~measnum ~obx 3 86 6913 1 0 ~jscrdat /* Line below is new &dA10/29/08 tput [Y,outpnt] J B ~measnum ~obx 3 86 6913 ~t1 0 ~jscrdat p = obx + hpar(37) end &dA &dA &d@ hpar(44) = actual white space between two light lines &dA &d@ hpar(45) = actual white space between heavy/light, light/heavy and heavy/heavy combinations &dA &d@ hpar(79) = thickness of light line &dA &d@ hpar(81) = thickness of heavy line &dA if mrest_line{2,6} = "double" a2 = hpar(44) + hpar(79) a4 = obx + a2 ++outpnt &dA &d@ tput [Y,outpnt] J B ~measnum ~a4 5 2 6913 1 0 ~jscrdat /* Line below is new &dA10/29/08 tput [Y,outpnt] J B ~measnum ~a4 5 2 6913 ~t1 0 ~jscrdat ++outpnt tput [Y,outpnt] K -~a2 0 82 ++outpnt tput [Y,outpnt] K 0 0 82 p = a4 + hpar(37) end if mrest_line{2,6} = "heavy3" a2 = hpar(45) + hpar(81) ++outpnt &dA &d@ tput [Y,outpnt] J B ~measnum ~obx 9 2 6913 1 0 ~jscrdat /* Line below is new &dA10/29/08 tput [Y,outpnt] J B ~measnum ~obx 9 2 6913 ~t1 0 ~jscrdat ++outpnt tput [Y,outpnt] K 0 0 84 ++outpnt tput [Y,outpnt] K ~a2 0 82 p = obx + hpar(37) + a2 end if mrest_line{2,6} = "heavy2" a2 = hpar(45) + hpar(81) + hpar(79) - 1 a3 = hpar(81) - 1 a4 = obx + a2 ++outpnt &dA &d@ tput [Y,outpnt] J B ~measnum ~a4 6 2 6913 1 0 ~jscrdat /* Line below is new &dA10/29/08 tput [Y,outpnt] J B ~measnum ~a4 6 2 6913 ~t1 0 ~jscrdat ++outpnt tput [Y,outpnt] K -~a2 0 82 ++outpnt tput [Y,outpnt] K -~a3 0 84 p = a4 + hpar(37) end loop for i = 1 to MAX_STAFF loop for j = 1 to 45 emptyspace(i,j) = hpar(37) repeat repeat mrest = 0 return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 19. getspace ³ &dA &d@³ ³ &dA &d@³ Purpose: Determine space parameter for particular note value ³ &dA &d@³ ³ &dA &d@³ Inputs: a5 = pointer into set array ³ &dA &d@³ ³ &dA &d@³ Outputs: a6 = space parameter ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure getspace int t1, t2, t3 int gsp_ntype /* new &dA10/15/07&d@ if scr_flag = 1 if ts(a5,CLAVE) = 200 /* silent rest gets no space a6 = 1 /* &dA10/13/07 TEST&d@ return end end if ts(a5,CLAVE) = 101 or ts(a5,CLAVE) = 102 /* movable rest (altered &dA01/03/04&d@) a6 = hpar(24) + hpar(25) - hpar(37) return end &dK &d@ a6 = ts(a5,NTYPE) * 3 gsp_ntype = ts(a5,NTYPE) & 0xff /* new &dA10/15/07&d@ a6 = gsp_ntype * 3 /* new &dA10/15/07&d@ if a6 = 0 a6 = 3 end --a6 if ts(a5,DOT) > 0 ++a6 else &dK &d@ if ts(a5,TUPLE) > 2 if (ts(a5,TUPLE) & 0xffff) > 2 /* New &dA11/05/05&d@ --a6 end end a6 = nsp(a6) * make extra space for up-flags if ts(a5,TYPE) = NOTE and bit(1,ts(a5,STEM_FLAGS)) = UP &dK &d@ if ts(a5,BEAM_FLAG) = NO_BEAM and ts(a5,NTYPE) < QUARTER if ts(a5,BEAM_FLAG) = NO_BEAM and gsp_ntype < QUARTER /* new &dA10/15/07 a6 += hpar(28) t3 = hpar(26) + hpar(28) + hpar(82) if a6 < t3 loop for t1 = a5+1 to sct if ts(t1,DIV) > ts(a5,DIV) loop for t2 = t1 to sct if ts(t2,DIV) = ts(t1,DIV) if ts(t2,TYPE) <= NOTE_OR_REST if ts(t2,STAFF_NUM) = ts(a5,STAFF_NUM) if ts(t2,CLAVE) >= ts(a5,CLAVE) a6 = t3 t2 = sct end end end else t2 = sct end repeat t1 = sct end repeat end end end * allow mininum extra space if next note on staff has stem-down repeaters * make extra space for sixteenth and smaller rests &dK &d@ if ts(a5,TYPE) = REST and ts(a5,NTYPE) < EIGHTH if ts(a5,TYPE) = REST and gsp_ntype < EIGHTH /* new &dA10/15/07 &dK &d@ a6 = 6 - ts(a5,NTYPE) * hpar(54) + a6 a6 = 6 - gsp_ntype * hpar(54) + a6 /* new &dA10/15/07 end * shrink space if cue-size flag is set if bit(16,ts(a5,SUBFLAG_1)) = CUESIZE a6 = a6 * 8 / 10 end return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 20. wordspace ³ &dA &d@³ ³ &dA &d@³ Purpose: Calculate length of word ³ &dA &d@³ ³ &dA &d@³ Inputs: ttext = word ³ &dA &d@³ c5 = font number ³ &dA &d@³ curfont = currently active font ³ &dA &d@³ ³ &dA &d@³ Outputs: a5 = space taken up by word ³ &dA &d@³ ³ &dA &d@³ curfont possibly modified ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure wordspace int t1,t2,d1 a5 = 0 * get new spacing parameters, if needed perform spacepar &dA &dA &dA &d@ Rewriting this section &dA04/22/04&d@ &dA loop for t2 = 1 to len(ttext) if ttext{t2} = "\" if t2 = len(ttext) return 5 end if "!@#$%^&*(-=" con ttext{t2+1} if mpt < 10 ++t2 a5 += mpt goto NXC else ++t2 a5 -= (mpt - 9) goto NXC end end &dA &dA &d@ New &dA02/02/09&d@ &dA if ttext{t2+1} = "+" ++t2 a5 += spc(32) goto NXC end &dA if t2 + 1 = len(ttext) return 5 end ++t2 if ttext{t2} = "0" t1 = ors(ttext{t2+1}) + 128 if chr(t1) in [160,206,212,224] return 5 end ++t2 a5 += spc(t1) goto NXC end if ttext{t2} = "\" t1 = ors(ttext{t2}) a5 += spc(t1) goto NXC end if ttext{t2} in ['a'..'z','A'..'Z'] d1 = ors(ttext{t2}) if "1345789" con ttext{t2+1} t1 = ors(ttext{t2}) else if ttext{t2+1} = "2" if ttext{t2} = "s" t1 = 244 /* German ss else t1 = ors(ttext{t2}) end else return 5 end end ++t2 else --t2 t1 = ors(ttext{t2}) end else t1 = ors(ttext{t2}) end a5 += spc(t1) NXC: repeat &dK &d@ loop for t2 = 1 to len(ttext) &dK*&d@ adjust for backslash (\) sequence &dK &d@ if ttext{t2} = "\" &dK &d@ if t2 + 2 > len(ttext) &dK &d@ return 5 &dK &d@ end &dK &d@ ++t2 &dK &d@ if ttext{t2} in ['0'..'9'] or ttext{t2+1} in ['0'..'9'] &dK &d@ if ttext{t2,2} con ['0'..'9'] &dK &d@ if ttext{t2} in ['0'..'9'] &dK &d@ t1 = ors(ttext{t2+1}) &dK &d@ if ttext{t2} = "0" &dK &d@ t1 += 128 &dK &d@ end &dK &d@ else &dK &d@ t1 = ors(ttext{t2}) &dK &d@ if ttext{t2+1} = "0" &dK &d@ t1 += 128 &dK &d@ end &dK &d@ end &dK &d@ ++t2 &dK &d@ else &dK &d@ return 5 &dK &d@ end &dK &d@ else &dK &d@ t1 = ors(ttext{t2}) &dK &d@ end &dK &d@ a5 += spc(t1) &dK &d@ if t1 = 171 &dK &d@ a5 -= hpar(57) &dK &d@ end &dK &d@ repeat &dA &dA &d@ End of &dA04/22/04&d@ rewrite &dA &dA return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 20a. kernttext NEW &dA04/22/04&d@ ³ &dA &d@³ ³ &dA &d@³ Purpose: Apply kerning to ttext ³ &dA &d@³ ³ &dA &d@³ Inputs: ttext = word ³ &dA &d@³ c5 = current font ³ &dA &d@³ ³ &dA &d@³ Outputs: revised ttext ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure kernttext str tline.300 int t1,t2,t3,t4 if ttext = "" return end ttext = ttext // " " tline = "" loop for t1 = 1 to len(ttext) if "abcdefghijklmnopqrstuvwxyz" con ttext{t1} t2 = mpt if "abcdefghijklmnopqrstuvwxyz" con ttext{t1+1} t3 = mpt if kernmap(t2,t3) = 0 tline = tline // ttext{t1} else if kernmap(t2,t3) = -1 tline = tline // ttext{t1} // "\-" else if kernmap(t2,t3) = 1 tline = tline // ttext{t1} // "\!" end end end else if t1 < len(ttext) - 2 and ttext{t1+1,2} = "\0" and ":=;><" con ttext{t1+3} if mpt < 3 t3 = 9 /* i else if mpt < 5 t3 = 12 /* l else t3 = 6 /* f end end if kernmap(t2,t3) = 0 tline = tline // ttext{t1} else if kernmap(t2,t3) = -1 tline = tline // ttext{t1} // "\-" else if kernmap(t2,t3) = 1 tline = tline // ttext{t1} // "\!" end end end else tline = tline // ttext{t1} end end else if "ABCDEFGHIJKLMNOPQRSTUVWXYZ" con ttext{t1} t2 = mpt + 26 if "abcdefghijklmnopqrstuvwxyz" con ttext{t1+1} t3 = mpt if kernmap(t2,t3) = 0 tline = tline // ttext{t1} else if kernmap(t2,t3) = -1 tline = tline // ttext{t1} // "\-" else if kernmap(t2,t3) = -2 tline = tline // ttext{t1} // "\=" end end end else if t1 < len(ttext) - 2 and ttext{t1+1,2} = "\0" and ":=;><" con ttext{t1+3} if mpt < 3 t3 = 9 /* i else if mpt < 5 t3 = 12 /* l else t3 = 6 /* f end end if kernmap(t2,t3) = 0 tline = tline // ttext{t1} else if kernmap(t2,t3) = -1 tline = tline // ttext{t1} // "\-" else if kernmap(t2,t3) = 1 tline = tline // ttext{t1} // "\!" end end end else tline = tline // ttext{t1} end end else /* ffi,fi,ffl,fl,ff if t1 < len(ttext) - 2 and ttext{t1,2} = "\0" and ":=;><" con ttext{t1+2} if mpt < 3 t2 = 9 /* i else if mpt < 5 t2 = 12 /* l else t2 = 6 /* f end end if "abcdefghijklmnopqrstuvwxyz" con ttext{t1+3} t3 = mpt if kernmap(t2,t3) = 0 tline = tline // ttext{t1,3} t1 += 2 else if kernmap(t2,t3) = -1 tline = tline // ttext{t1,3} // "\-" t1 += 2 else if kernmap(t2,t3) = 1 tline = tline // ttext{t1,3} // "\!" t1 += 2 end end end else tline = tline // ttext{t1} end else tline = tline // ttext{t1} end end end repeat t1 = len(tline) - 1 ttext = tline{1,t1} return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 21. spacepar ³ &dA &d@³ ³ &dA &d@³ Purpose: Be sure that proper space parameters are loaded ³ &dA &d@³ ³ &dA &d@³ Inputs: c5 = font number ³ &dA &d@³ ³ &dA &d@³ Outputs: valid spc(.) array for this font ³ &dA &d@³ font_base, font_height, zero_height ³ &dA &d@³ for this font (new &dA02/03/08&d@) ³ &dA &d@³ valid kernmap(.,.) for this font ³ &dA &d@³ updated value of curfont ³ &dA &d@³ ³ &dA &d@³ Internal Variables: ³ &dA &d@³ ³ &dA &d@³ int bfont(4,4) Spacepar keeps a record of past calls ³ &dA &d@³ together with the number of times ³ &dA &d@³ a particular font has been asked for. ³ &dA &d@³ If the number of fonts exceeds 4, ³ &dA &d@³ spacepar will replace the space data ³ &dA &d@³ from the memory block [bspc(.,.)] ³ &dA &d@³ least current. ³ &dA &d@³ int bspc(4,255) Four memory blocks for space data ³ &dA &d@³ int bfont_specs(4,3) 4 x (font parameters) (&dA02/03/08&d@) ³ &dA &d@³ int bkernmap(4,52,26) ³ &dA &d@³ Four memory blocks for backup kernmap ³ &dA &d@³ int time pseudo timer ³ &dA &d@³ ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure spacepar str file.200 str line.120,kfile1.80,kfile2.80 int bfont(4,4),bspc(4,255),time int bfont_specs(4,3) /* New &dA02/03/08&d@ int bkernmap(4,52,26) int t1,t2,t3,t4,t5,t6,t7 if c5 <> curfont font_base = 0 /* New &dA02/03/08&d@ font_height = 0 /* New &dA02/03/08&d@ zero_height = 0 /* New &dA02/03/08&d@ t2 = 1000000 loop for t1 = 1 to 4 if c5 = bfont(t1,1) /* font found in reserve ++time bfont(t1,2) = time loop for t3 = 1 to 255 spc(t3) = bspc(t1,t3) repeat &dA &dA &d@ New code &dA04/22/04&d@ &dA loop for t3 = 1 to 52 loop for t5 = 1 to 26 kernmap(t3,t5) = bkernmap(t1,t3,t5) repeat repeat &dA &dA &d@ New code &dA02/03/08&d@ &dA font_base = bfont_specs(t1,1) font_height = bfont_specs(t1,2) zero_height = bfont_specs(t1,3) &dA curfont = c5 return end if bfont(t1,2) < t2 t2 = bfont(t1,2) t7 = t1 /* t7 is the oldest block end repeat &dA &dA &d@ New code &dA02/03/08&d@ &dA if box_flag = 1 file = DISP_DISK // ":/musprint/new/xfonts/tms/fonthite" open [4,1] file t1 = c5 - 29 /* 1 <= t1 <= 19 t2 = XFonts(sizenum,t1) - 50 /* 1 <= t2 <= 90 (text font) --t2 loop for t1 = 1 to t2 getf [4] repeat getf [4] font_base font_height zero_height close [4] end bfont_specs(t7,1) = font_base bfont_specs(t7,2) = font_height bfont_specs(t7,3) = zero_height &dA &dA &dA &d@ New code &dA03/19/04&d@ &dA file = DISP_DISK // ":/musprint/new/xfonts/tms/fontspac" open [4,1] file t1 = c5 - 29 /* 1 <= t1 <= 19 t2 = XFonts(sizenum,t1) - 50 /* 1 <= t2 <= 90 (text font) t2 = Fspacex(t2) - 1 /* t2 = offset in fontspac &dA loop for t1 = 1 to t2 getf [4] repeat t3 = 61 loop for t2 = 1 to 31 spc(t2) = 0 repeat loop for t2 = 32 to 127 if t3 = 61 t3 = 1 getf [4] line end spc(t2) = int(line{t3,2}) t3 += 3 repeat loop for t2 = 128 to 159 spc(t2) = 0 repeat t3 = 61 loop for t2 = 160 to 255 if t3 = 61 t3 = 1 getf [4] line end spc(t2) = int(line{t3,2}) t3 += 3 repeat close [4] loop for t1 = 1 to 255 bspc(t7,t1) = spc(t1) repeat bfont(t7,1) = c5 ++time bfont(t7,2) = time curfont = c5 &dA &dA &d@ New code &dA04/22/04&d@ &dA t1 = c5 - 29 /* 1 <= t1 <= 19 t2 = XFonts(sizenum,t1) - 50 /* 1 <= t2 <= 90 (text font) t3 = t2 * 4 - 3 if t2 <= 30 kfile1 = DISP_DISK // ":/musprint/new/xfonts/tms/stnd/kmaps/" // kernfiles{t3,4} kfile2 = DISP_DISK // ":/musprint/new/xfonts/tms/stnd/kmaps2/" // kernfiles{t3,4} else if t2 <= 60 kfile1 = DISP_DISK // ":/musprint/new/xfonts/tms/bold/kmaps/" // kernfiles{t3,4} kfile2 = DISP_DISK // ":/musprint/new/xfonts/tms/bold/kmaps2/" // kernfiles{t3,4} else kfile1 = DISP_DISK // ":/musprint/new/xfonts/tms/italic/kmaps/" // kernfiles{t3,4} kfile2 = DISP_DISK // ":/musprint/new/xfonts/tms/italic/kmaps2/" // kernfiles{t3,4} end end open [4,1] kfile1 getf [4] getf [4] loop for t4 = 1 to 26 getf [4] line t6 = 0 loop for t5 = 5 to 55 step 2 ++t6 if line{t5} = " " kernmap(t4,t6) = 0 else if line{t5} = "1" kernmap(t4,t6) = -1 else if line{t5} = "0" kernmap(t4,t6) = 1 else putc kernmap file error stop end end end repeat getf [4] line if t4 = 16 getf [4] line getf [4] line end repeat close [4] open [4,1] kfile2 getf [4] getf [4] loop for t4 = 1 to 26 getf [4] line t6 = 0 loop for t5 = 5 to 55 step 2 ++t6 if line{t5} = " " kernmap(t4+26,t6) = 0 else if line{t5} = "1" kernmap(t4+26,t6) = -1 else if line{t5} = "2" kernmap(t4+26,t6) = -2 else putc kernmap file error stop end end end repeat getf [4] line if t4 = 16 getf [4] line getf [4] line end repeat close [4] loop for t3 = 1 to 52 loop for t5 = 1 to 26 bkernmap(t7,t3,t5) = kernmap(t3,t5) repeat repeat end return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 22. newnsp ³ &dA &d@³ ³ &dA &d@³ Purpose: Calculate new nsp array ³ &dA &d@³ ³ &dA &d@³ Inputs: scnt = next logical record in input table ³ &dA &d@³ divspq = number of divisions per quarter note ³ &dA &d@³ xmindist = minimum distance between notes (x100) ³ &dA &d@³ mindist = minimum distance between notes ³ &dA &d@³ ³ &dA &d@³ Outputs: new nsp array for this section ³ &dA &d@³ ³ &dA &d@³ Internal variables: t1,t2,t3,t4,t5,t6 ³ &dA &d@³ mtot ³ &dA &d@³ ³ &dA &d@³ Strategy: (1) read through file until the next time ³ &dA &d@³ signature change or until the end ³ &dA &d@³ (2) count number of measures where shortest ³ &dA &d@³ duration occurs ³ &dA &d@³ (3) if this represents more than xx% of the ³ &dA &d@³ outstanding measures, then this is ³ &dA &d@³ the shortest note ³ &dA &d@³ (4) otherwise, the shortest note is the ³ &dA &d@³ next one up; i.e. ³ &dA &d@³ triplets --> regular ³ &dA &d@³ regular --> double regular ³ &dA &d@³ ³ &dA &d@³ nsp(32) will be space for longa ³ &dA &d@³ nsp(29) will be space for breve ³ &dA &d@³ nsp(26) will be space for whole ³ &dA &d@³ ... ³ &dA &d@³ nsp(5) will be space for 128th note ³ &dA &d@³ nsp(2) will be space for 256th note ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure newnsp int t1,t2,t3,t4,t5,t6,t7 int mtot str line.120 t6 = scnt /* temporary counter in input loop for t1 = 1 to 33 nsp(t1) = xmindist /* New &dA12/16/03&d@ &dK &d@ nsp(t1) = mindist repeat if minshort <> 0 t1 = minshort * 4 rem = 0 /* sloppy code goto NOCALC end t2 = 100 mtot = 0 t7 = 0 /* "durations found" flag (initialize at 0) loop t1 = 0 tget [X,t6] line .t6 t1 ++t6 /* increment temporary counter line = line // pad(4) if line{1,4} = "/END" or line{1,4} = "/FIN" goto NW1 end if line{1} = "$" and line con "T:" and t7 = 1 goto NW1 end if t6 > 9990 putc putc &dEFAULT CONDITION&d@ putc putc In searching for something, like for example, the end of a slur, putc AUTOSET has searched past the end of the file. There definitely putc &dEis&d@ an error in the stage2 file. Please find and correct. putc putc &dAProgram Halted&d@ putc stop end if line{1,3} = "mea" ++mtot t4 = 0 end * if line{1} in ['A'..'G','r'] and t1 > 0 /* positive dur t7 = 1 if t1 < t2 t2 = t1 /* new shortest note t3 = 0 t4 = 0 end if t1 = t2 and t4 = 0 t4 = 1 ++t3 /* inc number of measures end end repeat &dA &dA &d@ t2 = shortest note value &dA &d@ t3 = number of measures where this note occurs &dA NW1: if t7 = 0 /* No durations found (unusual case) mtot = 1 t2 = 1 t3 = 1 end t5 = divspq * 16 / t2 if t5 > 96 t4 = 0 /* case 1: always double shortest note else if t5 > 48 t4 = 5 /* case 2: double if less than 16% else if t5 > 24 t4 = 8 /* case 3: double if less than 11% else t4 = 10 /* case 4: double if less than 9% end end end * t1 = mtot / t3 if t1 > t4 t1 = divspq / 3 if rem = 0 t1 = t2 / 2 if rem = 0 t2 = t1 * 3 else t2 *= 2 end else t2 *= 2 end end * t1 = divspq * 16 / t2 &dA &d@ if t1 = 1, shortest note is longa &dA &d@ if t1 = 2, shortest note is breve &dA &d@ if t1 = 4, shortest note is whole &dA &d@ if t1 = 8, shortest note is half, etc t2 = t1 / 3 if rem = 0 t1 = t2 * 2 end NOCALC: t5 = 32 /* 32 = code for longa t4 = 160 * t1 >>= 1 loop while t1 > 0 /* i.e., if t1 started as 16th (t1 = 64), loop 6 times t5 -= 3 t4 -= 20 t1 >>= 1 repeat * if rem = 0 /* sloppy code. See up 100 lines for expl. nsp(t5) = xmindist * 10 / 9 /* New &dA12/16/03&d@ &dK &d@ nsp(t5) = mindist * 10 / 9 end if t4 > 100 nsp(t5) = nsp(t5) * t4 / 100 end nsp(t5+1) = nsp(t5) * 12 / 10 t1 = 13 * loop while t5 < 31 t4 = t5 + 3 nsp(t4) = nsp(t5) * t1 / 10 ++t1 t5 = t4 nsp(t5-1) = nsp(t5) * 9 / 10 nsp(t5+1) = 2 * nsp(t5) - nsp(t5-3) repeat &dA &dA &d@ Now reduce all nsp(.) numbers by factor of 100 (&dA12/16/03&d@) &dA loop for t1 = 1 to 33 nsp(t1) = nsp(t1) + 50 / 100 repeat &dA return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 23. settime (t1) ³ &dA &d@³ ³ &dA &d@³ Purpose: Set time signature ³ &dA &d@³ ³ &dA &d@³ Inputs: tnum = time numerator ³ &dA &d@³ tden = time denominator ³ &dA &d@³ p = current x position ³ &dA &d@³ oby = 0 or 1000 (staff 0 or 1) ³ &dA &d@³ spn = space node (obj field 7) ³ &dA01/17/04&d@ &dA &d@³ ³ &dA &d@³ Outputs: p = new x position ³ &dA &d@³ t1 = amount of empty space ³ &dA &d@³ ³ &dA &d@³ Internal variables: @e,a,dv2,dv3,dv4 ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure settime (t1) int t1 jcode = tnum * 100 + tden putobjpar = 0 @e = 0 if tnum = 1 and tden = 1 @e = 1 end if tnum = 0 and tden = 0 @e = 2 end * putc Time = ~tnum :~tden * set time signature jtype = "T" out = "0" if @e > 0 obx = p oby += vpar(6) pcode = 1 a = 36 + @e sobl(1) = "K 0 0 " // chs(a) jscrdat = "" perform putobj p += hpar(14) t1 = hpar(14) - hpar(92) oby -= vpar(6) else dv2 = p + hpar(16) if tden < 10 and tnum < 10 dv2 = p + hpar(17) end * obx = dv2 * y = vpar(4) + oby a = tnum perform number dv4 = dv3 y = vpar(8) + oby a = tden perform number pcode = sobcnt jscrdat = "" perform putobj if dv3 > dv4 dv3 = dv4 end p = dv3 + hpar(18) t1 = hpar(18) end passback t1 return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 24. process_section ³ &dA &d@³ ³ &dA &d@³ Purpose: Set parameters for new section ³ &dA &d@³ ³ &dA &d@³ Inputs: @b = new key ³ &dA &d@³ divspq = divisions per quarter ³ &dA &d@³ @e = time signature flag ³ &dA &d@³ tnum = time numerator ³ &dA &d@³ tden = time denominator ³ &dA &d@³ @n = set array counter (for ³ &dA &d@³ changes within measure) ³ &dA &d@³ line = "$" control code line ³ &dA &d@³ ³ &dA &d@³ Outputs: p = new x position ³ &dA &d@³ ³ &dA &d@³ Internal variables: @e,a,dv2,dv3,dv4 ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure process_section int h, hh, pp, qq int @spn /* New &dA01/17/04&d@ &dA &d@ &dAÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿&d@ &dA &d@ &dA³ BEGINNING OF SECTION PROCESSING ³&d@ &dA &d@ &dAÀÄÄ-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ&d@ &dA &dA &d@ New code for single line staff &dA12/18/05&d@ &dA if line con "C:0" single_line = 1 end &dA &dK &d@ if @n > 0 &dA &dA &d@ Code changed and added &dA01/17/04&d@ to fix time change bug &dA if @n > 0 or outslurs <> "00000000" if @n = 0 @spn = 6913 else @spn = 0 /* code for "don't use this information" end &dA &dA &dA &d@ examine &dA if line con "I:" vflag = int(line{mpt+2..}) if vflag < 1 vflag = 1 end if vflag > 3 vflag = 3 end end if line con "S:" nstaves = int(line{mpt+2..}) if nstaves < 1 nstaves = 1 end if nstaves > 2 nstaves = 2 end end if line con "C:" or line con "C1:" ++@n tv1(@n) = CLEF_CHG if line{mpt+2} = ":" ++mpt end tv2(@n) = int(line{mpt+2..}) tv3(@n) = 0 /* staff number if line con "D:" or line con "D1:" or large_clef_flag > 0 /* New &dA02/02/09 tcode(@n) = "0" /* music font else tcode(@n) = "128" /* music font end tv5(@n) = @spn /* added &dA01/17/04&d@ end if line con "C2:" ++@n tv1(@n) = CLEF_CHG tv2(@n) = int(line{mpt+3..}) tv3(@n) = 1 /* staff number if line con "D2:" or large_clef_flag > 0 /* New &dA02/02/09 tcode(@n) = "0" /* music font else tcode(@n) = "128" /* music font end nstaves = 2 tv5(@n) = @spn /* added &dA01/17/04&d@ end if line con "D:" or line con "D1:" ++@n tv1(@n) = DESIGNATION tv2(@n) = 0 tv3(@n) = 0 /* staff number tcode(@n) = "" if line{mpt+1} <> ":" ++mpt end line2 = trm(line{mpt+2..}) tdata(@n,1) = mrt(line2) tv5(@n) = @spn /* added &dA01/17/04&d@ end if line con "D2:" ++@n tv1(@n) = DESIGNATION tv2(@n) = 0 tv3(@n) = 1 /* staff number tcode(@n) = "" line2 = trm(line{mpt+3..}) tdata(@n,1) = mrt(line2) nstaves = 2 tv5(@n) = @spn /* added &dA01/17/04&d@ end &dA &dA &d@ Another change on &dA05/29/05&d@. In this case, I am moving the keychange "K:" &dA &d@ code from below the "Q:" code to above the time "T:" code. This conforms &dA &d@ with the normal way sections are introduced. What I don't know, however, &dA &d@ is whether this conflicts with some other convention, or whether the program &dA &d@ code depended in some way on the old order. Again, we must watch this &dA &d@ and see if it produces strange results in the future. &dA if line con "K:" ++@n tv1(@n) = AX_CHG tv2(@n) = int(line{mpt+2..}) tv3(@n) = nstaves tcode(@n) = "" tv5(@n) = @spn /* added &dA01/17/04&d@ end &dA if line con "T:" ++@n tv1(@n) = METER_CHG tnum = int(line{mpt+2..}) if line con "/" tden = int(line{mpt+1..}) else return 6 end tv2(@n) = 100 * tnum + tden tv3(@n) = nstaves tcode(@n) = "" tv5(@n) = @spn /* added &dA01/17/04&d@ end if line con "Q:" ++@n tv1(@n) = DIV_CHG tv2(@n) = int(line{mpt+2..}) tv3(@n) = 0 tcode(@n) = "" tv5(@n) = @spn /* added &dA01/17/04&d@ end &dA &dA &d@ Moving this code to above the time "T:" code (&dA05/29/05&d@) &dA &dK &d@ if line con "K:" &dK &d@ ++@n &dK &d@ tv1(@n) = AX_CHG &dK &d@ tv2(@n) = int(line{mpt+2..}) &dK &d@ tv3(@n) = nstaves &dK &d@ tcode(@n) = "" &dK &d@ tv5(@n) = @spn /* added &dA01/17/04&d@ &dK &d@ end &dA &dA &d@ /* old system; better to use print suggestions &dA &dK &d@ if line con "P:" &dK &d@ mindist = int(line{mpt+2..}) * notesize / 16 &dK &d@ end return end * spn = 6913 &dA &dA &d@ "P:" is the old system; it's actually better to use the &dA &d@ new system of print suggestions to change note spacing &dA &dK &d@ if line con "P:" &dK &d@ mindist = int(line{mpt+2..}) * notesize / 16 &dK &d@ end if line con "I:" vflag = int(line{mpt+2..}) if vflag < 1 vflag = 1 end if vflag > 3 vflag = 3 end end if line con "S:" nstaves = int(line{mpt+2..}) if nstaves < 1 nstaves = 1 end if nstaves > 2 nstaves = 2 end end if line con "D2:" nstaves = 2 end &dA &dA &d@ (1) clef &dA if line con "C:" or line con "C1:" or line con "C2:" i = 0 h = 0 if line con "C:" or line con "C1:" if line{mpt+1} = ":" i = mpt + 2 else i = mpt + 3 end end if line con "C2:" h = mpt + 3 nstaves = 2 end if i*h = 0 /* Case1: only one clef designator if i > 0 k = 1 else i = h k = 2 end clef(k) = int(line{i..}) &dA &dA &d@ Special code for single line instruments &dA12/18/05&d@ &dA if single_line = 1 clef(1) = 4 end &dA perform zjcline (k) if p > 0 p -= hpar(37) end p += hpar(5) * print clef obx = p oby = 5 - j * notesize oby = (k - 1) * 1000 + oby if single_line = 0 /* New condition &dA12/18/05&d@ perform putclef (k) end else /* Case2: two clef designators k = 1 clef(k) = int(line{i..}) perform zjcline (k) if p > 0 p -= hpar(37) end p += hpar(5) * print clef on staff 1 obx = p oby = 5 - j * notesize perform putclef (k) k = 2 clef(k) = int(line{h..}) perform zjcline (k) * print clef on staff 2 obx = p oby = 5 - j * notesize oby += 1000 perform putclef (k) end * advance horizontal pointer p += hpar(8) pp = hpar(8) - hpar(86) loop for h = 1 to MAX_STAFF loop for hh = 1 to 45 emptyspace(h,hh) = pp repeat repeat end &dA &dA &d@ (2) key signature &dA if line con "K:" @b = int(line{mpt+2..}) if line{sub} = "(" /* new code &dA08/23/06&d@ if line{sub+1} = "+" h = int(line{sub+2..}) else h = int(line{sub+1..}) end else h = 0 end hh = 1 perform key_change (@b, key, nstaves, hh, h) /* fifth variable added &dA08/23/06 /* this sets key = @b and resets claveax(.), emptyspace(.,.) etc. end &dA &dA &d@ (3) divisions per quarter &dA if line con "Q:" olddivspq = int(line{mpt+2..}) end &dA &dA &d@ (4) time word &dA if line con "D:" or line con "D1:" or line con "D2:" a1 = 6913 if line not_con "T:" a1 = 1 &dA &dA &d@ f4 is set when a directive is placed with spn = 1. This &dA &d@ directive takes its position from the next controlling &dA &d@ object in the part. Therefore, it must not be followed &dA &d@ by a multiple rest. &dA f4 = 1 end if line con "D:" temp3 = trm(line{mpt+2..}) temp3 = mrt(temp3) oby = 0 - tword_height * vpar(1) ++outpnt tput [Y,outpnt] J D 5 ~p ~oby 1 ~a1 0 0 ++outpnt tput [Y,outpnt] W 0 0 ~dtivfont ~temp3 end if line con "D1:" temp3 = trm(line{mpt+2..}) temp3 = mrt(temp3) oby = 0 - tword_height * vpar(1) ++outpnt tput [Y,outpnt] J D 5 ~p ~oby 1 ~a1 0 0 ++outpnt tput [Y,outpnt] W 0 0 ~dtivfont ~temp3 end if line con "D2:" temp3 = trm(line{mpt+2..}) temp3 = mrt(temp3) oby = 0 - tword_height * vpar(1) oby += 1000 ++outpnt tput [Y,outpnt] J D 5 ~p ~oby 1 ~a1 0 0 ++outpnt tput [Y,outpnt] W 0 0 ~dtivfont ~temp3 end end &dA &dA &d@ (5) time signature (also new note spacing calculations) &dA if line con "T:" tnum = int(line{mpt+2..}) if line con "/" tden = int(line{mpt+1..}) else return 6 end oby = 0 pp = p loop for hh = 1 to nstaves p = pp perform settime (h) &dA &dA &d@ Actually, we will set emptyspace to hpar(29), the mimimum space &dA &d@ space allowed before an accidental. This way, no note-type &dA &d@ objects will be able to crowd the time signature. If this &dA &d@ works, we can remove the code that returns the value (h) from &dA &d@ settime. (We actually shouldn't be interested in this value &dA &d@ anyway, because we do NOT want to get too close to the time &dA &d@ signature.) &dA loop for qq = 1 to 45 emptyspace(hh,qq) = min_space /* replaces hpar(29) &dA11/19/07 repeat oby += 1000 repeat if tnum = 1 and tden = 1 tnum = 4 tden = 4 end if tnum = 0 and tden = 0 tnum = abflg tden = 2 end &dA &dA &d@ determine note spacing &dA &d@ ---------------------- &dA divspq = olddivspq perform newnsp end return &dA &d@ &dAÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿&d@ &dA &d@ &dA³ END OF SECTION PROCESSING ³&d@ &dA &d@ &dAÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ&d@ &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 25. key_change (newkey, oldkey, nstaves, t1, t2) ³ &dA &d@³ ³ &dA &d@³ Purpose: Typeset a key change ³ &dA &d@³ ³ &dA &d@³ Inputs: int newkey new key ³ &dA &d@³ int oldkey old key ³ &dA &d@³ int nstaves number of staves ³ &dA &d@³ int t1 operation code ³ &dA &d@³ 1 = change emptyspace ³ &dA &d@³ 0 = don't do it ³ &dA &d@³ int t2 part of new key in ³ &dA &d@³ parenthesis &dA08/23/06&d@ ³ &dA &d@³ ³ &dA &d@³ Global variables: ³ &dA &d@³ ³ &dA &d@³ sobcnt subobject counter ³ &dA &d@³ p x position pointer ³ &dA &d@³ x actual x-coordinate ³ &dA &d@³ y actual y-coordinate ³ &dA &d@³ z font number ³ &dA &d@³ obx object x-coordinate ³ &dA &d@³ oby object y-coordinate ³ &dA &d@³ clef(.) current clef ³ &dA &d@³ measax(.,.) current measure ax array ³ &dA &d@³ claveax(.) global ax array ³ &dA &d@³ jtype object type ³ &dA &d@³ jcode object code ³ &dA &d@³ pcode number of sub objects ³ &dA &d@³ out ASCII string ³ &dA &d@³ ³ &dA &d@³ Outputs: p = new x position ³ &dA &d@³ emptyspace(.,.) changed (if t1 = 1) ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure key_change (newkey, oldkey, nstaves, t1, t2) /* t2 added &dA08/23/06 int newkey, oldkey, nstaves int save_oldkey /* added &dA11/05/05&d@ int sy int a, m, h, i, j, k int hh int t1,t2,t3 /* t2,t3 added &dA08/23/06&d@ int klave,sklave int tenor int m1,m2,m3,m4,m5,m6 /* added &dA08/23/06&d@ getvalue newkey, oldkey, nstaves, t1, t2 if t2 <> 0 /* magic numbers for editorial [] &dA08/23/06 m1 = (2 * notesize + 3 / 6) m2 = (4 * notesize + 3 / 6) m3 = (7 * notesize + 3 / 6) m4 = notesize + 3 / 6 m5 = (5 * notesize + 3 / 6) m6 = notesize end t3 = newkey /* added &dA08/23/06&d@ newkey = newkey + t2 /* added &dA08/23/06&d@ &dA &dA &d@ This code added &dA11/26/06&d@ to allow reprint of existing key signature &dA if newkey = oldkey and key_reprint_flag > 0 oldkey = 0 end &dA &d@ End of &dA11/26/06&d@ addition &dA &dA &dA &d@ New code. &dA10/15/07&d@. It used to be the case that a non key &dA &d@ change in an orchestra part (such as horns) simply returned &dA &d@ at this point. No i-file entry was generated because none was &dA &d@ needed. The problem created by this was that if the mskpage &dA &d@ program was looking for a key change node (because other parts &dA &d@ had one) and didn't find one, this could cause a misalignment &dA &d@ of control node. It turns out that the program crashed only &dA &d@ when the key change came at the end of a line, so nothing was &dA &d@ done about it. (The bug was rare, and difficult to identify). &dA &d@ The advent of justification made the bug more likely to occur, &dA &d@ and it did (once too often). So I decided on this fix, namely: &dA &d@ &dA &d@ From now on, all key changes will generate a "J K" node, even &dA &d@ if there is none to be printed. In this case, the node will &dA &d@ have no sub-objects and will therefore be "silent." This seems &dA &d@ to have caused no other problems with the programs. &dA if newkey = oldkey loop for hh = 1 to nstaves putobjpar = 0 sobcnt = 0 oby = 0 obx = p x = obx jtype = "K" jcode = newkey pcode = 0 out = "0" oby = (hh - 1) * 1000 jscrdat = "" perform putobj repeat return end &dA &dA &d@ End of &dA10/15/07&d@ addition &dA &dA &d@ &dA &dA &dA &d@ New code. &dA11/02/07&d@. Another situation has come up, which &dA &d@ I believe can be dealt with here. In the case where the timpani &dA &d@ plays on the notes B-flat and F, the notation shows these two &dA &d@ pitches without a key signature. In order to make this work, the &dA &d@ encoder used the pitches B-natural and F, and a key signature of &dA &d@ 0 (no sharps or flats). This of course would wreck havoc in a &dA &d@ midi file. It would be far better to encode the key as -1 (one &dA &d@ flat) and then encode the pitches B-flat and F, as they would &dA &d@ actually sound. The problem with this is that the key signature &dA &d@ would appear at the beginning of every line. We need to have &dA &d@ a way to suppress this. I propose a new global flag, suppress_key, &dA &d@ which can be set by the "k" global suggestion. The following &dA &d@ code deals with this situation. &dA if suppress_key > 0 save_oldkey = oldkey loop for hh = 1 to nstaves * set up new global accidentals for claveax oldkey = newkey loop for i = 1 to 50 claveax(i) = 0 repeat h = newkey if h > 0 k = 4 loop for i = 1 to h loop for a = k to 50 step 7 claveax(a) = 2 repeat k += 4 if k > 7 k -= 7 end repeat end if h < 0 h = 0 - h k = 7 loop for i = 1 to h loop for a = k to 50 step 7 claveax(a) = 3 repeat k -= 4 if k < 1 k += 7 end repeat end oldkey = save_oldkey putobjpar = 0 sobcnt = 0 oby = 0 obx = p x = obx jtype = "K" jcode = 0 pcode = 0 out = "0" oby = (hh - 1) * 1000 jscrdat = "" perform putobj repeat loop for i = 1 to 50 loop for h = 1 to 4 /* &dA06/04/08&d@ was 3 measax(h,i) = claveax(i) repeat repeat oldkey = newkey /* moved &dA11/05/05&d@ passback oldkey return end &dA &dA &d@ End of &dA11/02/07&d@ addition &dA &dA &d@ putobjpar = 0 save_oldkey = oldkey /* added &dA11/05/05&d@ loop for hh = 1 to nstaves sobcnt = 0 oby = 0 i = clef(hh) / 10 klave = rem - 1 * 2 i /= 3 k = 2 - rem * 3 klave -= k obx = p x = obx tenor = 0 if clef(hh) = 12 tenor = 2 end * sharps if newkey > 0 * cancellations? &dK &d@ sy = y sklave = klave if oldkey > newkey loop for j = 1 to newkey &dK &d@ y += zak(1,j) klave += zak(1,j) repeat h = oldkey - newkey m = 1 + tenor perform cancelsig (m,j,h,klave) end if oldkey < 0 h = 0 - oldkey &dK &d@ y += vpar(4) klave += 4 j = 0 m = 2 perform cancelsig (m,j,h,klave) end &dK &d@ y = sy klave = sklave * set new key kscrdat = "" if t2 = 0 loop for j = 1 to newkey z = 63 if tenor = 0 or klave >= 0 y = klave + 20 * notesize / 2 - vpar20 else y = klave + 27 * notesize / 2 - vpar20 /* exception for tenor clef end perform subj &dK &d@ y += zak(1,j) klave += zak(1,j) x += hpar(9) repeat else &dA &dA &d@ This code added &dA08/23/06&d@ to deal with editorial additions of sharps &dA if t2 > 0 loop for j = 1 to t3 z = 63 if tenor = 0 or klave >= 0 y = klave + 20 * notesize / 2 - vpar20 else y = klave + 27 * notesize / 2 - vpar20 /* exception for tenor clef end &dK &d@ y = klave + 20 * notesize / 2 - vpar20 perform subj klave += zak(1,j) x += hpar(9) repeat loop for j = t3 + 1 to newkey x += m1 /* magic number z = 67 if tenor = 0 or klave >= 0 y = klave + 20 * notesize / 2 - vpar20 else y = klave + 27 * notesize / 2 - vpar20 /* exception for tenor clef end &dK &d@ y = klave + 20 * notesize / 2 - vpar20 perform subj x += m2 /* magic number z = 63 perform subj x += m3 /* magic number z = 68 perform subj klave += zak(1,j) x += (hpar(9) - m3) /* magic number repeat end &dA &dA &d@ End of &dA08/23/06&d@ addition end end * no sharps or flats if newkey = 0 * cancellations? j = 0 if oldkey > 0 h = oldkey m = 1 + tenor perform cancelsig (m,j,h,klave) end if oldkey < 0 h = 0 - oldkey m = 2 &dK &d@ y += vpar(4) klave += 4 perform cancelsig (m,j,h,klave) end end * flats if newkey < 0 * cancellations? &dK &d@ sy = y sklave = klave if oldkey < newkey h = 0 - newkey &dK &d@ y += vpar(4) klave += 4 loop for j = 1 to h &dK &d@ y += zak(2,j) klave += zak(2,j) repeat h = newkey - oldkey m = 2 perform cancelsig (m,j,h,klave) end if oldkey > 0 h = oldkey j = 0 m = 1 + tenor perform cancelsig (m,j,h,klave) end &dK &d@ y = sy + vpar(4) klave = sklave + 4 * set new key kscrdat = "" if t2 = 0 h = 0 - newkey loop for j = 1 to h z = 65 y = klave + 20 * notesize / 2 - vpar20 &dA &dA &d@ Code added &dA09/13/06&d@ to fix flats in soprano clef &dA if y > vpar(8) y -= vpar(7) end &dA perform subj &dK &d@ y += zak(2,j) klave += zak(2,j) x += hpar(11) repeat else &dA &dA &d@ This code added &dA08/23/06&d@ to deal with editorial additions of flats &dA if t2 < 0 t3 = 0 - t3 h = 0 - newkey loop for j = 1 to t3 z = 65 y = klave + 20 * notesize / 2 - vpar20 &dA &dA &d@ Code added &dA09/13/06&d@ to fix flats in soprano clef &dA if y > vpar(8) y -= vpar(7) end &dA perform subj klave += zak(2,j) x += hpar(9) repeat loop for j = t3 + 1 to h x += m4 /* magic number z = 67 y = klave + 20 * notesize / 2 - vpar20 &dA &dA &d@ Code added &dA09/13/06&d@ to fix flats in soprano clef &dA if y > vpar(8) y -= vpar(7) end &dA perform subj x += m5 /* magic number z = 65 perform subj x += m6 /* magic number z = 68 perform subj klave += zak(2,j) x += (hpar(11) - m6) /* magic number repeat end &dA &dA &d@ End of &dA08/23/06&d@ addition end end * Write out object and subobjects jtype = "K" jcode = newkey pcode = sobcnt out = "0" oby = (hh - 1) * 1000 jscrdat = "" perform putobj * if newkey = 0 and oldkey = 0 i = hpar(13) if t1 = 1 loop for j = 1 to 45 emptyspace(hh,j) += i repeat end else i = hpar(12) if t1 = 1 loop for j = 1 to 45 emptyspace(hh,j) = i repeat end end if hh = nstaves p = x + i end * set up new global accidentals for claveax oldkey = newkey loop for i = 1 to 50 claveax(i) = 0 repeat h = newkey if h > 0 k = 4 loop for i = 1 to h loop for a = k to 50 step 7 claveax(a) = 2 repeat k += 4 if k > 7 k -= 7 end repeat end if h < 0 h = 0 - h k = 7 loop for i = 1 to h loop for a = k to 50 step 7 claveax(a) = 3 repeat k -= 4 if k < 1 k += 7 end repeat end oldkey = save_oldkey /* changed &dA11/05/05&d@ (was oldkey = newkey) repeat loop for i = 1 to 50 loop for h = 1 to 4 /* &dA06/04/08&d@ was 3 measax(h,i) = claveax(i) repeat repeat oldkey = newkey /* moved &dA11/05/05&d@ passback oldkey return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 26. display_ts ³ &dA &d@³ ³ &dA &d@³ Purpose: Display parameters in ts(.,.) array ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure display_ts str temp.TSR_LENG int t1,t2,t3 putc TYPE DIV CLAV AX NTYP DOT TPLE VLOC SPAC STEM BMFG BMCD ... putc SUPF SLUR SUB1 SUB2 YSH SRT2 TEXT PASS BTIE NDUR DINC MULT loop for t2 = 1 to TS_SIZE putc .t2w4 ~t2 ... repeat putc putc ... loop for t2 = 1 to 6 putc ==== ==== ==== ==== ==== ==== ... repeat putc loop for t1 = 1 to sct loop for t2 = 1 to TS_SIZE putc .t2w4 ~ts(t1,t2) ... repeat putc repeat DTS1: putc putc Type a number (pointer value in col 34) to see the tsr string for an item. t3 = 0 getc t3 if t3 = 0 return end temp = tsr(t3) putc TSR string at pointer ~t3 putc Item byte1 byte2 byte3 byte4 loop for t1 = 1 to (TSR_LENG >> 2) putc .w4 ~t1 ... loop for t2 = -3 to 0 step 1 t3 = ors(temp{t1*4+t2}) putc .w7x ~t3 ... repeat putc repeat goto DTS1 return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 27. zjcline (staff) ³ &dA &d@³ ³ &dA &d@³ Purpose: Compute values of z, j, and cline from clef ³ &dA &d@³ ³ &dA &d@³ Inputs: staff = staff number (1 or 2) ³ &dA &d@³ clef(.) = clef flag ³ &dA &d@³ ³ &dA &d@³ Outputs: z = clef font ³ &dA &d@³ j = vertical postion of clef ³ &dA &d@³ cline(.) = location of middle C ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure zjcline (staff) int g,h,i,k,m int staff getvalue staff i = clef(staff) / 10 j = 6 - rem k = i / 3 h = rem if rem = 0 z = 33 else z = 34 + h end m = j * 2 + 20 g = 0 if k > 0 if k = 1 g = 7 else g = -7 end end cline(staff) = h - 1 * 4 + m + g return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 28. putclef (staff) ³ &dA &d@³ ³ &dA &d@³ Purpose: write clef sign to intermediate file ³ &dA &d@³ ³ &dA &d@³ Inputs: staff = staff number (1 or 2) ³ &dA &d@³ clef(.) = clef code ³ &dA &d@³ obx = x offset ³ &dA &d@³ oby = y offset ³ &dA &d@³ z = clef font ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure putclef (staff) int staff int g,h,i,k,m getvalue staff i = clef(staff) / 10 k = i / 3 h = rem jtype = "C" jcode = clef(staff) out = "0" kscrdat = "" if h = 0 x = obx y = oby perform subj ++z perform subj if k = 1 x = obx + hpar(52) y = oby + vpar(23) z = 234 perform subj end pcode = sobcnt else pcode = z end putobjpar = 0 jscrdat = "" perform putobj return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 29. rotate_array (t1,t2) ³ &dA &d@³ ³ &dA &d@³ Purpose: Move ts array elements at t2 to t1 position. ³ &dA &d@³ Rotate all other elements down one ³ &dA &d@³ ³ &dA &d@³ Inputs: t1 = top of rotation ³ &dA &d@³ t2 = bottom of rotation (t2 > t1) ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure rotate_array (t1,t2) int temp(TS_SIZE) int t1,t2,t3,t4 getvalue t1,t2 if t2 = t1 return end if t2 < t1 putc Program error at rotate examine stop end loop for t3 = 1 to TS_SIZE temp(t3) = ts(t2,t3) /* create hole at the bottom (save bottom) repeat loop for t4 = t2 to t1+1 step -1 /* loop in backwards order loop for t3 = 1 to TS_SIZE ts(t4,t3) = ts(t4-1,t3) /* copy each row from the one above it repeat repeat loop for t3 = 1 to TS_SIZE ts(t1,t3) = temp(t3) /* store bottem piece at top repeat return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 30. get_topbottom (t1,t2,t3) ³ &dA &d@³ ³ &dA &d@³ Purpose: If t1 points to a ts row element which is a note ³ &dA &d@³ head, then t2 will point to the ts row element ³ &dA &d@³ which is the top of the chord, and t3 will point ³ &dA &d@³ to the ts row element which is the bottom of the ³ &dA &d@³ chord ³ &dA &d@³ ³ &dA &d@³ Inputs: t1 = index to ts row element ³ &dA &d@³ ³ &dA &d@³ Outputs: t2 = index to top of chord ³ &dA &d@³ t3 = index to bottom of chord ³ &dA &d@³ ³ &dA &d@³ Note: Do not call this procedure before GLOBAL_XOFF is set ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure get_topbottom (t1,t2,t3) int t1,t2,t3,t4 getvalue t1 t4 = ts(t1,GLOBAL_XOFF) if t4 > INT10000 t2 = t4 / INT10000 t3 = rem else t4 = ts(t1+1,GLOBAL_XOFF) if t4 > INT10000 t2 = t4 / INT10000 t3 = rem else t2 = t1 t3 = t1 end end passback t2,t3 return &dA &dA &dA &d@ &dA &dA &d@ &dA PROCEDURES FOR PSEUDO-TYPESETTING &dA &d@ &dA &dA &dA &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 31. ps_setchord (p1,p2,p3) ³ &dA &d@³ ³ &dA &d@³ Purpose: Add a chord to the simultaneity ³ &dA &d@³ ³ &dA &d@³ Inputs: p1 = pass number (chord number) ³ &dA &d@³ p2 = second chord number (for unisons) or 100 ³ &dA &d@³ p3 = initialize parameter (0 = initialize) ³ &dA &d@³ ³ &dA &d@³ Outputs: p3 = initialize parameter (1 = don't initialize) ³ &dA &d@³ printpos(.) = print position for this chord ³ &dA &d@³ ³ &dA &d@³ Method: construct the left boundary of the new chord. ³ &dA &d@³ Move the chord to the right until it bumps ³ &dA &d@³ with previous chords. ³ &dA &d@³ ³ &dA &d@³ Output: when a note for a chord is set, ndata(*,PASS) ³ &dA &d@³ for that note is set to zero. ³ &dA &d@³ ³ &dA &d@³ printpos(p1) and maybe printpos(p2) ³ &dA &d@³ ³ &dA &d@³ ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure ps_setchord (p1,p2,p3) int a,b,c,d,e,x int aa,bb,cc,dd int tr(2,45),tl(2,45) int pseudo_tr(2,45) int pseudo_tl(2,45) int f,g,h,i,j,k int ff,gg,hh int p1, p2, p3 int ps_width int stem_up_flag int stem_down_flag getvalue p1,p2,p3 if p3 = 0 p3 = 1 x = 10000 else x = 0 end passback p3 &dA &dA &d@ putc Calling ps_setchord pass = ~p1 pass2 = ~p2 &dA &d@ putc &dA ff = 0 hh = 0 loop for j = 1 to 45 tl(1,j) = 200 tr(1,j) = -200 pseudo_tr(1,j) = -200 pseudo_tl(1,j) = 200 tl(2,j) = 200 tr(2,j) = -200 pseudo_tr(2,j) = -200 pseudo_tl(2,j) = 200 repeat stem_up_flag = 0 stem_down_flag = 0 repeater_case = 0 c = 100 loop for i = 1 to pcnt if ndata(i,PS_PASS) = p1 or ndata(i,PS_PASS) = p2 b = ndata(i,PS_XPOS) a = ndata(i,PS_PITCH) &dA &dA &d@ putc set note ~i pitch = ~ndata(i,PS_PITCH) ... &dA &d@ putc shift = ~ndata(i,PS_XPOS) &dA if a = 100 ndata(i,PS_PASS) = 0 return end if c = 100 c = ndata(i,PS_STAFF) + 1 /* staff number d = ndata(i,PS_COLOR) if d < 3 ps_width = hpar(82) else if d = 3 ps_width = hpar(83) else ps_width = hpar(84) end end if ndata(i,PS_NSIZE) = CUESIZE ps_width = ps_width * 8 / 10 end end if bit(0,ndata(i,PS_STEM)) = UP /* stem up if b = 0 if tl(c,a) > 0 tl(c,a) = 0 end if tl(c,a+1) > hpar(95) tl(c,a+1) = hpar(95) end if pseudo_tl(c,a) > 0 pseudo_tl(c,a) = 0 end if pseudo_tl(c,a+1) > 0 pseudo_tl(c,a+1) = 0 end if tr(c,a) < ps_width - hpar(95) tr(c,a) = ps_width - hpar(95) end if tr(c,a+1) < ps_width tr(c,a+1) = ps_width end if pseudo_tr(c,a) < ps_width pseudo_tr(c,a) = ps_width end if pseudo_tr(c,a+1) < ps_width pseudo_tr(c,a+1) = ps_width end else dd = ps_width << 1 - hpar(90) if tr(c,a) < dd - hpar(95) tr(c,a) = dd - hpar(95) end if tr(c,a+1) < dd tr(c,a+1) = dd end if pseudo_tr(c,a) < dd + hpar(49) pseudo_tr(c,a) = dd + hpar(49) end if pseudo_tr(c,a+1) < dd + hpar(49) pseudo_tr(c,a+1) = dd + hpar(49) end end if ff = 0 ff = a + 8 /* 8 = length of stem end stem_up_flag |= ndata(i,PS_STEM) >> 2 else if b = 0 if tr(c,a) < ps_width - hpar(95) tr(c,a) = ps_width - hpar(95) end if tr(c,a+1) < ps_width tr(c,a+1) = ps_width end if pseudo_tr(c,a) < ps_width pseudo_tr(c,a) = ps_width end if pseudo_tr(c,a+1) < ps_width pseudo_tr(c,a+1) = ps_width end if tl(c,a) > 0 tl(c,a) = 0 end if tl(c,a+1) > hpar(95) tl(c,a+1) = hpar(95) end if pseudo_tl(c,a) > 0 pseudo_tl(c,a) = 0 end if pseudo_tl(c,a+1) > 0 pseudo_tl(c,a+1) = 0 end else if tl(c,a) > hpar(90) - ps_width tl(c,a) = hpar(90) - ps_width end if tl(c,a+1) > hpar(90) - ps_width + hpar(95) tl(c,a+1) = hpar(90) - ps_width + hpar(95) end if pseudo_tl(c,a) > hpar(90) - ps_width - hpar(49) pseudo_tl(c,a) = hpar(90) - ps_width - hpar(49) end if pseudo_tl(c,a+1) > hpar(90) - ps_width - hpar(49) pseudo_tl(c,a+1) = hpar(90) - ps_width - hpar(49) end end if hh = 0 hh = a - 1 end stem_down_flag |= ndata(i,PS_STEM) >> 2 end repeater_case |= bit(1,ndata(i,PS_STEM)) if ndata(i,PS_PASS) = p1 ndata(i,PS_PASS) = 0 end if ndata(i,PS_PASS) = p2 ndata(i,PS_PASS) = 0 end end repeat if hh > 45 hh = 45 end if ff > 0 /* put in stem up restraints e = ps_width - hpar(90) /* &dAOLD&d@ ps_width - hpar(85) d = ps_width /* &dAOLD&d@ ps_width + hpar(85) if repeater_case = 1 aa = e - hpar(98) bb = d + hpar(98) else aa = e bb = d end if stem_up_flag > 0 if stem_up_flag > 2 ff += stem_up_flag - 2 << 1 end dd = d + hpar(26) else dd = d end if ff > 45 ff = 45 end loop for i = ff - 6 to ff if tl(c,i) > aa tl(c,i) = aa end if tr(c,i) < bb tr(c,i) = bb end if pseudo_tr(c,i) < dd pseudo_tr(c,i) = dd end repeat loop for i = a + 2 to ff - 7 if tl(c,i) > e tl(c,i) = e end if tr(c,i) < d tr(c,i) = d end repeat end if hh > 0 /* put in stem down restraints a = a - 7 if stem_down_flag > 0 if stem_down_flag > 2 a -= stem_down_flag - 2 << 1 end dd = hpar(90) + hpar(26) else dd = hpar(90) end if a < 1 a = 1 end &dA &dA &d@ Fixing the left border on stems down with repeaters &dA &d@ &dA06/04/08&d@ plus bug correction &dA11/23/09&d@ &dA #if XPOS_FIXED loop for i = a + 4 to hh if tl(c,i) > 0 /* aa tl(c,i) = 0 /* aa end if tr(c,i) < hpar(90) /* bb tr(c,i) = hpar(90) /* bb end if pseudo_tr(c,i) < dd pseudo_tr(c,i) = dd end repeat #else loop for i = a + 4 to hh if tl(c,i) > 0 /* aa tl(c,i) = 0 /* aa end if tr(c,i) < bb tr(c,i) = bb end if pseudo_tr(c,i) < dd pseudo_tr(c,i) = dd end repeat #endif if repeater_case = 1 aa = 0 - hpar(98) bb = hpar(90) + hpar(98) else aa = 0 bb = hpar(90) end loop for i = a to a + 3 /* 4 is magic number if tl(c,i) > aa /* Repeaters only at bottom tl(c,i) = aa end if tr(c,i) < bb tr(c,i) = bb end if pseudo_tr(c,i) < dd pseudo_tr(c,i) = dd end repeat end if x = 10000 loop for i = 1 to 45 gr(c,i) = tr(c,i) gl(c,i) = tl(c,i) pseudo_gr(c,i) = pseudo_tr(c,i) repeat x = 0 /* amount shifted to the right else ff = 1000 loop for i = 1 to 45 gg = 1000 - gr(c,i) + tl(c,i) - 5 if gg < ff ff = gg end repeat x = 1000 - ff /* amount shifted to the right loop for i = 1 to 45 gg = x + tr(c,i) if gg > gr(c,i) and tr(c,i) <> -200 gr(c,i) = gg end gg = x + pseudo_tr(c,i) if gg > pseudo_gr(c,i) and pseudo_tr(c,i) <> -200 pseudo_gr(c,i) = gg end gg = x + tl(c,i) if gg < gl(c,i) gl(c,i) = gg end repeat end loop for j = 1 to 45 if pseudo_gl(1,j) > pseudo_tl(1,j) pseudo_gl(1,j) = pseudo_tl(1,j) end if pseudo_gl(2,j) > pseudo_tl(2,j) pseudo_gl(2,j) = pseudo_tl(2,j) end repeat &dK &d@ loop for j = 1 to 1 &dK &d@ putc Left Right Pseudo Left Pseudo Right &dK &d@ loop for i = 45 to 1 step -1 &dK &d@ putc .w5 ~gl(j,i) ~gr(j,i) ~pseudo_gl(j,i) ~pseudo_gr(j,i) &dK &d@ repeat &dK &d@ putc ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ &dK &d@ repeat &dK &d@ getc printpos(p1) = x if p2 <> 100 printpos(p2) = x end &dA &d@ putc print position equals ~x &dA &d@ putc return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 32. guessbeam (slope, t12) ³ &dA &d@³ ³ &dA &d@³ ³ &dA &d@³ Purpose: Make a guess about the position of a beam ³ &dA &d@³ ³ &dA &d@³ Inputs: int c6 = number of notes under beam ³ &dA &d@³ int mf(.) = y-position of note ³ &dA &d@³ int beamcode(.) = beam code ³ &dA &d@³ int stem = stem direction (UP/DOWN) ³ &dA &d@³ int c5 = size: 0 = regular; 1 = small ³ &dA &d@³ ³ &dA &d@³ Outputs: int slope = BHPAR1 * slope of beam ³ &dA &d@³ int t12 = end point of first stem (relative to top of staff) ³ &dA &d@³ ³ &dA &d@³ Internal variables: beamfy = y coordinate of first note under beam ³ &dA &d@³ vrange = vertical range of note set ³ &dA &d@³ zstaff = top of staff line ³ &dA &d@³ slope = slope of beam ³ &dA &d@³ ypiv = temporary variable ³ &dA &d@³ (x1,y1) = temporary coordinates ³ &dA &d@³ (x2,y2) = temporary coordinates ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure guessbeam (slope, t12) int t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12 int zstaff,ypiv,slope int x1,x2,y1,y2,vrange,beamfy int xf(100) int beamh,beamt,bthick int beamtype int loopcnt * if c5 = 0 beamh = bvpar(16) beamt = bvpar(32) bthick = vpar(2) * 6 / 14 else beamh = bvpar(16) * 4 / 5 beamt = bvpar(32) * 4 + 3 / 5 bthick = vpar(2) * 5 / 14 end t6 = 0 loop for t5 = 1 to c6 xf(t5) = t6 t6 += vpar(6) /* average x increment (a guess) repeat beamfy = mf(1) * reverse if stem down t3 = 0 if stem = DOWN &dK &d@ t3 = 300 * vpar(1) - vpar(8) t3 = 150 * vpar(2) - vpar(8) loop for t6 = 1 to c6 &dK &d@ mf(t6) = 300 * vpar(1) - mf(t6) mf(t6) = 150 * vpar(2) - mf(t6) repeat end zstaff = t3 * determine slope and pivot of beam t9 = 0 x1 = 5000 y1 = 5000 t11 = 6 t1 = 0 t4 = 0 /* changes in absolute height t2 = 0 t5 = mf(1) &dA &dA &d@ identify: t9 = 6 - smallest note type under beam &dA &d@ (x1,y1) = position of note closest to beam &dA &d@ (x2,y2) = position of note next closest to beam &dA &d@ t1 = y coordinate of note furthest from beam &dA loop for t6 = 1 to c6 * also compute sum of absolute changes in vertical height t8 = t5 - mf(t6) testfor t8 < 0 if t2 = 0 t2 = -1 end if t2 = 1 t2 = 2 end t8 = 0 - t8 else (>) if t2 = 0 t2 = 1 end if t2 = -1 t2 = 2 end end t5 = mf(t6) t4 += t8 * t8 = 0 /* number of additional beams on this note loop while beamcode(t6) > 9 ++t8 beamcode(t6) /= 10 repeat if t8 > t9 t9 = t8 /* max number of additional beams end if t8 < t11 t11 = t8 /* min number of additional beams end t8 = mf(t6) if t8 > t1 t1 = t8 /* lowest y co-ord of notes in beam set end if t8 < y1 y2 = y1 x2 = x1 y1 = t8 /* nearest y co-ord x1 = xf(t6) else if t8 < y2 y2 = t8 x2 = xf(t6) end end repeat &dA &dA &d@ Check point one: (x1,y1); (x2,y2); t1 set &dA vrange = t1 - y1 &dA &dA &d@ Formula for initial stem length &dA &dA &d@ note t9 y1-t8 &dA &d@ ÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄÄ &dA &d@ 8th: 0 beamh &dA &d@ 16th: 1 beamh + (1 * notesize / 4) &dA &d@ 32th: 2 beamh + (4 * notesize / 4) &dA &d@ 64th: 3 beamh + (7 * notesize / 4) &dA &d@ 128th: 4 beamh + (10 * notesize / 4) &dA &d@ 256th: 5 beamh + (13 * notesize / 4) &dA beamtype = t9 if t9 = 0 t8 = y1 - beamh else t8 = t9 * 3 - 2 t8 = 0 - notesize * t8 / 4 - beamh + y1 end t1 = x1 * deal with case of severe up-down pattern if t2 = 2 t4 /= c6 if t4 > bvpar(18) slope = 0 goto GSB1 end end * slope = y1 - y2 * 2 * BHPAR1 t7 = x1 - x2 slope /= t7 &dA &dA &d@ Comment: slope is (2*BHPAR1) times slope between two notes &dA &d@ nearest the beam &dA t7 = mf(c6) - mf(1) * 2 * BHPAR1 t6 = xf(c6) if t6 < vpar(5) t6 = vpar(5) end t7 /= t6 &dA &dA &d@ Comment: t7 is (2*BHPAR1) times slope between outside notes &dA &dA &d@ Formula: slope = (slope + t7) / 6 provided &dA &dA &d@ |slope| must be equal to or less than |t7| &dA t6 = abs(slope) - abs(t7) if t6 > 0 if slope > 0 slope -= t6 else slope += t6 end end * slope = slope + t7 / 6 GSB1: t7 = abs(slope) if t7 > BHPAR1 / 2 t7 = BHPAR1 / 2 end * Soften slant for thirty-seconds and smaller if t9 > 2 and t7 > 5 t7 = 0 - t9 / 2 + t7 end if t7 < 0 t7 = 0 end &dA &dA &d@ set reduce slant if end note are closer than vpar(6) &dA t4 = xf(c6) if t4 <= vpar(6) and t7 > bvpar(35) t7 = bvpar(35) end &dA &dA &d@ shorten shortest stem, if gradual slope and large vertical range &dA &d@ and relatively high note &dA if vrange > vpar(3) t4 = t9 * beamt + t8 - zstaff t4 = 0 - t4 if t4 > vpar(3) if t7 < 6 if x1 > 0 and x1 < xf(c6) t8 += bvpar(17) end if c6 = 2 t8 += bvpar(17) end end end end * if slope < 0 slope = 0 - t7 else slope = t7 end &dA &dA &d@ slope = BHPAR1 * slope of beam &dA &d@ t8 = y coordinate of pivot point (on highest note) of first beam &dA &d@ t7 = absolute value of @m &dA &d@ t3 = y coordinate of top of staff line &dA &d@ (x1,y1) = coordinate of note closest to beam (highest note) &dA &d@ (x2,y2) = coordinate of second closest note to beam (2nd highest note) &dA &d@ t9 = 6 - smallest note type number (number of beams - 1 &dA &d@ t11 = 6 - largest note type number &dA ypiv = t8 ++t9 &dA &dA &d@ Check point two: t9 = number of beams, current slope = slope &dA &dA &d@ Adjust slope and t8 so that beams will fall properly on staff lines &dA &dA &d@ Case I: slope = 0 &dA GCSI: if slope = 0 t2 = t9 - 1 * notesize + t8 if t2 >= t3 &dA &dA &d@ Adjust flat beam height &dA t5 = t2 - t3 / notesize if t9 = 1 and rem <= bvpar(20) rem += bvpar(20) end if t9 = 2 if rem <= bvpar(20) rem += bvpar(34) else rem = rem - notesize + bvpar(20) end end if t9 = 3 rem += bvpar(34) end if t9 = 4 if t5 = 3 beamt = bvpar(33) end if t5 < 3 t5 = rem t5 -= vpar(1) / 2 rem = t5 end end t8 -= rem * (*) extremely low notes if t9 = 1 t2 = vpar(4) + zstaff else t2 = 4 - t9 * vpar(2) + zstaff end if t8 > t2 t8 = t2 if t9 > 3 and c5 = 0 beamt = bvpar(33) end end end else &dA &dA &d@ Case II: slope <> 0 &dA loopcnt = 0 GCSII: ++loopcnt t6 = 0 - x1 * slope / BHPAR1 + t8 t5 = xf(c6) * slope / BHPAR1 + t6 t2 = t5 + t6 / 2 if t9 > 1 if t11 > 0 t2 += beamt if t9 = 2 t2 += 2 end end t10 = bvpar(22) else t10 = bvpar(23) end &dA &d@ t6 = starting point of top beam &dA &d@ t5 = stopping point of top beam &dA &d@ t2 = average height of beam (second beam if always 2 or more) &dA &d@ t10 = fudge factor t4 = t3 t3 -= notesize if t9 > 2 t3 -= notesize end if t2 > t3 &dA &dA &d@ Adjust slanted beam height &dA if t9 > 2 if t2 > t4 beamt = bvpar(33) else t2 -= 2 end end t4 = abs(t5 - t6) t5 = t2 - t3 / notesize t5 = rem &dA &d@ t4 = rise/fall of beam &dA &d@ t5 = amount by which the average beam height lies below a line if t4 < bvpar(24) if t5 >= t10 t5 -= notesize if t9 = 1 ++t5 end else if t9 = 1 --t5 end end t8 -= t5 goto GCV end if t4 < beamt if loopcnt > 4 goto GCV end if t7 > 1 goto GCSJJ end ++t7 if slope < 0 slope = 0 - t7 else slope = t7 end goto GCSII end if t4 < bvpar(25) &dK &d@ t5 += vpar(1) c16 = t5 * 2 / vpar(2) if rem <> 0 ++t5 end t5 += vpar(1) if t5 > t10 t5 -= notesize end t8 -= t5 goto GCV end if t4 > bvpar(26) if t5 > t10 t5 -= notesize end t8 -= t5 goto GCV end if t7 = 2 &dK &d@ t5 += vpar(1) c16 = t5 * 2 / vpar(2) if rem <> 0 ++t5 end t5 += vpar(1) if t5 > t10 t5 -= notesize end t8 -= t5 goto GCV end if loopcnt > 4 goto GCV end GCSJJ: --t7 if slope < 0 slope = 0 - t7 else slope = t7 end goto GCSII else if t9 < 4 t8 = notesize / 3 + t8 end end * Check for extra low notes GCV: t4 = 0 - x1 * slope / BHPAR1 + t8 t6 = xf(c6) - x1 * slope / BHPAR1 + t8 t5 = 0 if t9 = 1 t2 = vpar(4) + zstaff - 2 else t2 = 4 - t9 * notesize + zstaff - 2 end if slope > 0 if t4 > t2 t5 = 1 t4 = t2 + 1 end else if t6 > t2 t5 = 1 t6 = t2 + 1 end end t2 = t2 + bvpar(20) + 2 if slope > 0 if t6 > t2 t5 = 1 t6 = t2 end else if t4 > t2 t5 = 1 t4 = t2 end end if t5 = 1 * Correction necessary t7 = xf(c6) slope = t6 - t4 * BHPAR1 / t7 t8 = x1 * slope / BHPAR1 + t4 t7 = abs(slope) end t8 -= vpar(1) / 2 end * t12 = slope * t1 t12 = t8 * BHPAR1 - t12 &dA &dA &d@ Check point three: beam slope = slope; &dA &d@ y intercept (times BHPAR1) = t12 &dA &dA &d@ Post adjustment: sometimes the stems of sixteenths are too &dA &d@ short. This will be the case when (y2-t8) - ((t9-1)*beamt) < xxx &dA &d@ where xxx is some number. In this case, we should raise the &dA &d@ beam by some small amount, yyy. &dA t6 = 0 - (t9 - 1) * beamt + y2 - t8 if t6 < bvpar(29) t12 -= bvpar(30) * BHPAR1 end &dA &dA &d@ In the case where c6 = 4, compare sum of the first two notes &dA &d@ verses the last two notes. If the direction is different from &dA &d@ the slope, then the slope should be zero. &dA if c6 = 4 t2 = mf(1) + mf(2) t3 = mf(3) + mf(4) if t2 > t3 if slope > 0 goto GSB2 end end t2 = t2 - t3 * slope if t2 > 0 goto GSB2 end goto GSB3 GSB2: slope = 0 t3 = zstaff t8 = ypiv goto GCSI end GSB3: &dA &dA &d@ slope = BHPAR1 * slope of beam &dA &d@ t12 = y-intercept of beam (times BHPAR1) &dA t8 = vpar(6) / 7 if beamtype > 0 t8 = vpar(5) / 4 end t12 /= BHPAR1 if stem = DOWN &dK &d@ t12 = 300 * vpar(1) - t12 + bthick - t8 t12 = 150 * vpar(2) - t12 + bthick - t8 slope = 0 - slope else t12 += t8 end passback slope, t12 return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 33. display_array ³ &dA &d@³ ³ &dA &d@³ ³ &dA &d@³ Purpose: Print out the current state of the ts array ³ &dA &d@³ Used for debugging ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure display_array int g g = measnum - 1 &dK &d@ if bit(2,pmode) = 1 and g >= debug_point &dA &dA &d@ Condition changed &dA01/01/06&d@ &dA if (bit(2,pmode) = 1 or debug_flag = 1) and g >= debug_point putc Set Array at procedure call: measure ~g putc Look? getc jtype if jtype = "y" perform display_ts end end return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 34. rest_occupy_space (t1,t2) ³ &dA &d@³ ³ &dA &d@³ ³ &dA &d@³ Purpose: For a given location on the staff line and ³ &dA &d@³ a given type of rest, set the gr(.,.) and ³ &dA &d@³ gl(.,.) arrays to reflect the placement ³ &dA &d@³ of the rest in this spot ³ &dA &d@³ ³ &dA &d@³ Inputs: ntype = type of rest ³ &dA &d@³ t1 = position on staff (0 = top line) ³ &dA &d@³ (i.e.,STAFFLOC) ³ &dA &d@³ t2 = staff number ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure rest_occupy_space (t1,t2) int t1,t2,t3,t4,t5,t6,t7,t8 getvalue t1,t2 &dK &d@ t1 = 0 - t1 / vpar(1) + 23 c16 = t1 + vpar20 * 2 + 1 / vpar(2) - 20 t1 = 23 - c16 t5 = ntype << 1 - 1 t3 = int("1008060402020402030303"{t5,2}) t4 = int("0505050505030301000101"{t5,2}) if ntype > WHOLE t6 = hpar(87) * 4 / 3 else if ntype > QUARTER t6 = hpar(87) else if ntype > EIGHTH t6 = hpar(88) else t6 = EIGHTH - ntype * hpar(54) + hpar(88) end end end &dA &d@ t6 += hpar(85) t7 = t1 - t4 if t7 < 1 t7 = 1 end t8 = t1 + t3 if t8 > 45 t8 = 45 end loop for t5 = t7 to t8 gr(t2,t5) = t6 gl(t2,t5) = 0 repeat return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 35. place_accidental (t1,t2,t3,t4) ³ &dA &d@³ ³ &dA &d@³ ³ &dA &d@³ Purpose: Determine the absolute x-location of an ³ &dA &d@³ accidental, given gl(.,.) and the imputs: ³ &dA &d@³ ³ &dA &d@³ Inputs: t1 = staff number ³ &dA &d@³ t2 = position on staff (23 = top line) ³ &dA &d@³ t3 = accidental code ³ &dA &d@³ t4 = note size (full size vs. cue size) ³ &dA &d@³ ³ &dA &d@³ Output: t4 = absolute x location ³ &dA &d@³ t3 = SCORE P5 data: ³ &dA &d@³ t3 & 0x00ff = P5 fractional position data ³ &dA &d@³ t3 & 0x0f00 = P5 one's data ³ &dA &d@³ t3 & 0xff0000 = left shift (dots) for natural ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure place_accidental (t1,t2,t3,t4) int t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,savet3,savet4,t14 getvalue t1, t2, t3, t4 t14 = t4 if t2 > 42 or t2 < 3 or t3 = 10 /* use old system t5 = t2 - int("221002200100001"{t3}) /* lower limit t6 = t2 + int("333003300200003"{t3}) /* upper limit t8 = 200 loop for t7 = t5 to t6 if t7 > 0 and t7 <= 45 if gl(t1,t7) < t8 t8 = gl(t1,t7) end end repeat t9 = hpar(t3) if t14 = CUESIZE t9 = t9 * 8 / 10 /* cue or grace size end t4 = t8 - t9 /* absolute x position loop for t7 = t5 to t6 if t7 > 0 and t7 <= 45 gl(t1,t7) = t4 /* new global left boundary end repeat passback t4 t10 = 0 if t3 = 6 or t3 = 7 t10 = 0 - t4 /* relative leftward position of CODE-9 natural &dA &dA &d@ In SCORE, the position of an ax is the right, not left boundary &dA if t14 = CUESIZE t10 -= (hpar(1) * 8 / 10) else t10 -= hpar(1) end t3 -= 4 /* remove natural from code end t8 = 0 - t8 if t8 < 0 t8 = 0 end &dA &dA &d@ New &dA10/25/07&d@ &dA &dA &d@ In SCORE, the shifting of an accidental to the left is coded as .25 units &dA &d@ per accidental width. Dmuse units are in dots, so there needs to be a &dA &d@ conversion. The formula would be something like this: &dA &dA &d@ 14 dots = 25 units &dA &d@ t8 (in units) = t8 (in dots) * 25 / vpar(2) &dA t8 = t8 * 25 / vpar(2) &dA t3 = int("321......5....4"{t3}) /* converting form MUSEDATA code to SCORE code t3 = t3 << 8 t3 += (t10 << 16) t3 += t8 passback t3 return end &dA &d@ hpar(1) = shift following accidental natural &dA &d@ hpar(2) = shift following accidental sharp &dA &d@ hpar(3) = shift following accidental flat &dA &d@ hpar(6) = shift following accidental natural-sharp &dA &d@ hpar(7) = shift following accidental natural-flat &dA &d@ hpar(10) = shift following accidental double sharp &dA &d@ hpar(15) = shift following accidental double flat &dA &dA &d@ (1) determine absolute x location &dA if chr(t3) in [3,7,15] t5 = hpar(3) * 7 / 10 t6 = gl(t1,t2+3) + t5 loop for t7 = t2 - 1 to t2 + 2 if gl(t1,t7) < t6 t6 = gl(t1,t7) end repeat if t3 = 7 and gl(t1,t2-2) + hpar(3) < t6 t6 = gl(t1,t2-2) + hpar(3) end else if chr(t3) in [2,6] t5 = hpar(2) * 2 / 10 t6 = gl(t1,t2+3) + t5 loop for t7 = t2 - 1 to t2 + 2 if gl(t1,t7) < t6 t6 = gl(t1,t7) end repeat if t6 > gl(t1,t2-2) + t5 t6 = gl(t1,t2-2) + t5 end else t5 = hpar(3) * 6 / 10 t6 = gl(t1,t2+3) + t5 loop for t7 = t2 - 2 to t2 + 2 if gl(t1,t7) < t6 t6 = gl(t1,t7) end repeat end end t5 = hpar(t3) if t14 = CUESIZE t5 = t5 * 8 / 10 /* cue or grace size end t4 = t6 - t5 /* absolute x position passback t4 savet3 = t3 t10 = 0 if t3 = 6 or t3 = 7 t10 = 0 - t4 /* relative leftward position of CODE-9 natural &dA &dA &d@ In SCORE, the position of an ax is the right, not left boundary &dA if t14 = CUESIZE t10 -= (hpar(1) * 8 / 10) else t10 -= hpar(1) end t3 -= 4 /* remove natural from code end t6 = 0 - t6 if t6 < 0 t6 = 0 end &dA &dA &d@ New &dA10/25/07&d@ &dA &dA &d@ In SCORE, the shifting of an accidental to the left is coded as .25 units &dA &d@ per accidental width. Dmuse units are in dots, so there needs to be a &dA &d@ conversion. The formula would be something like this: &dA &dA &d@ 14 dots = 25 units &dA &d@ t6 (in units) = t6 (in dots) * 25 / vpar(2) &dA t6 = t6 * 25 / vpar(2) &dA t3 = int("321......5....4"{t3}) /* converting from MUSEDATA code to SCORE code t3 = t3 << 8 t3 += (t10 << 16) t3 += t6 passback t3 t3 = savet3 &dA &dA &d@ (2) determine new values for gl(.,.) &dA if chr(t3) in [1,6,7] loop for t7 = t2 - 1 to t2 + 3 gl(t1,t7) = t4 /* new global left boundary repeat gl(t1,t2-2) = hpar(1) / 2 + t4 else if chr(t3) in [3,15] loop for t7 = t2 - 1 to t2 + 3 gl(t1,t7) = t4 /* new global left boundary repeat else t5 = hpar(2) / 10 gl(t1,t2+3) = t4 + t5 loop for t7 = t2 - 1 to t2 + 2 gl(t1,t7) = t4 /* new global left boundary repeat gl(t1,t2-2) = t4 + t5 end end return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 36. typeset_tuple (t1,t2,t3) ³ &dA &d@³ ³ &dA &d@³ Purpose: Typeset tuple companion to repeater ³ &dA &d@³ ³ &dA &d@³ Inputs: t1 = tuple number ³ &dA &d@³ t2 = centered x-location to place tuple ³ &dA &d@³ t3 = y-location to place tuple ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure typeset_tuple (t1,t2,t3) int t1,t2,t3 int savex,savey,savez getvalue t1,t2,t3 savex = x savey = y savez = z x = t2 y = t3 kscrdat = "" if t1 > 9 x -= hpar(104) z = t1 / 10 + 221 t1 = rem perform subj x += hpar(105) z = t1 + 221 perform subj else z = t1 + 221 perform subj end x = savex y = savey z = savez return #if AUTOSCR &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 37. build_note_kscrdat ³ &dA &d@³ ³ &dA &d@³ Purpose: build the kscrdat string for note heads ³ &dA &d@³ ³ &dA &d@³ Inputs: c3 = pointer into set array for this note ³ &dA &d@³ y = vertical position of notehead on staff ³ &dA &d@³ ntype = type of note (e.g. sixteenth) ³ &dA &d@³ note_dur = duration of note (in divisions) ³ &dA &d@³ divspq = divspq ³ &dA &d@³ nodtype = NOTE, GR_NOTE, or CUE_NOTE ³ &dA &d@³ ³ &dA &d@³ Output: kscrdat string ³ &dA &d@³ ³ &dA &d@³ Operation: Compute full values for: P2 P4 P6 P7 P10 P12 ³ &dA &d@³ Compute partial values for: P5 P9 ³ &dA &d@³ Not computed here: P3 P8 ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure build_note_kscrdat int t1,t2,t3,t4 int staff,track,pri_staff,p21,p22,p4,p5,p61,p62,p71,p72,p8,p9,p10,p12 pri_staff = 0 track = ts(c3,TRACK_NUM) staff = ts(c3,STAFF_NUM) + 1 if track > 0 pri_staff = trackstave(opbarnum,track,3) end &dA &dA &d@ Compute values for P2 P4 P5 P6 P7 P8 P9 P10 P12 &dA p12 = 0 if pri_staff > 0 if pri_staff = 1 and staff = 2 p12 = 2 end if pri_staff = 2 and staff = 1 p12 = 1 end p21 = pri_staff else p21 = staff end p22 = track p4 = (0 - y) / vpar(1) + 11 kscrdat = " | P2=" // chs(p21) // "." // chs(p22) // " P4=" // chs(p4) t1 = ts(c3,AX_DISP) if t1 = 0 kscrdat = kscrdat // " P5=0" else t2 = t1 & 0xff t3 = t1 & 0xff00 >> 8 kscrdat = kscrdat // " P5=" // chs(t3) // "." if t2 < 10 kscrdat = kscrdat // "0" end kscrdat = kscrdat // chs(t2) t1 >>= 16 if t1 <> 0 kscrdat = kscrdat // "+Nat@" // chs(t1) // "<-" end end if ntype < 8 p61 = 0 else p61 = ntype - 7 end &dK &d@ p62 = ts(c3,BASE_40) p62 = ts(c3,BASE_40) + pitch_mod /* New &dA11/27/09&d@ kscrdat = kscrdat // " P6=" // chs(p61) // "." if p62 < 10 kscrdat = kscrdat // "0" end if p62 < 100 kscrdat = kscrdat // "0" end kscrdat = kscrdat // chs(p62) if nodtype = NOTE or nodtype = CUE_NOTE p71 = 10000 * note_dur / divspq p71 = p71 / 10000 p72 = rem kscrdat = kscrdat // " P7=" // chs(p71) // "." if p72 < 10 kscrdat = kscrdat // "0" end if p72 < 100 kscrdat = kscrdat // "0" end if p72 < 1000 kscrdat = kscrdat // "0" end kscrdat = kscrdat // chs(p72) else /* GR_NOTE &dK &d@ kscrdat = kscrdat // " P7=-1.0000" /* needs further clarification kscrdat = kscrdat // " P7=65.00" end t1 = ts(c3,AUG_DOTS) if t1 > 0 t2 = t1 >> 24 if t2 = 0 t3 = t1 & 0xff t2 = t1 & 0xff00 >> 8 kscrdat = kscrdat // " P9=" // chs(t2) // "." if t3 < 10 kscrdat = kscrdat // "0" end kscrdat = kscrdat // chs(t3) else kscrdat = kscrdat // " " // chs(t2) // "Dots@x+" t1 &= 0xffffff t1 /= INT10000 if rem > (INT10000 >> 1) t2 = INT10000 - rem ++t1 kscrdat = kscrdat // chs(t1) // "y-" // chs(t2) else kscrdat = kscrdat // chs(t1) // "y" // chs(rem) end end end t1 = ts(c3,NOTE_DISP) /* can be 100,0,-100 or large t2 = ts(c3,LOCAL_XOFF) if t2 > 0 /* set t2 to 100,0,or -100 t2 = 100 end if t2 < 0 t2 = -100 end if t2 + t1 <> 0 if t2 + t1 = 100 kscrdat = kscrdat // " P10=10" else if t2 + t1 = -100 kscrdat = kscrdat // " P10=20" else if t2 + t1 = 200 kscrdat = kscrdat // " P10=6" else if t2 + t1 = -200 kscrdat = kscrdat // " P10=-6" else t1 = t1 / INT10000 if rem > (INT10000 >> 1) t3 = INT10000 - rem ++t1 else t3 = rem end t3 = t3 * 300 / t1 /* 100 times too big t2 *= 3 /* 100 times too big t3 += t2 if t3 > 0 t3 = t3 / 100 t1 = rem kscrdat = kscrdat // " P10=" // chs(t3) // "." else t3 = 0 - t3 t3 = t3 / 100 t1 = rem kscrdat = kscrdat // " P10=-" // chs(t3) // "." end if t1 < 10 kscrdat = kscrdat // "0" end kscrdat = kscrdat // chs(t1) end end end end end kscrdat = kscrdat // " P12=" // chs(p12) return #endif &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 38. setarpeggio (New &dA01/13/06&d@) ³ &dA &d@³ ³ &dA &d@³ Purpose: write object arpeggio ³ &dA &d@³ ³ &dA &d@³ Inputs: c1 = pointer into set array for arpeggio ³ &dA &d@³ obx = horizontal position of arpeggio ³ &dA &d@³ arpeg_top = top of arpeggio ³ &dA &d@³ arpeg_bottom = bottom of arpeggio ³ &dA &d@³ arpeg_flag = extra length to span grand staff ³ &dA &d@³ ntype = ARPEGGIO ³ &dA &d@³ passnum = pass number for this arpeggio ³ &dA &d@³ inctype = increment type for next node ³ &dA &d@³ with a new spn (used in putobj) ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure setarpeggio int t1,t2,t3,t4,t5,t6,t7,t8,t9 t3 = ts(c1,STAFF_NUM) * 1000 oby = arpeg_top * 2 - 1 * vpar(2) / 2 sobcnt = 0 x = obx y = oby t1 = arpeg_bottom * 2 - 1 * vpar(2) / 2 if arpeg_flag > 0 t1 += arpeg_flag end z = 120 /* music font for arpeggio perform subj t2 = t1 - vpar(4) loop while y <= t2 perform subj y += vpar(4) repeat y -= vpar(2) if y <= t2 perform subj end jtype = "G" jcode = EIGHTH out = "0" &dA &dA &d@ Duration attribute of arpeggio &dA ++sobcnt sobl(sobcnt) = "A D 1 8" pcode = sobcnt oby += t3 putobjpar = 0 t4 = ts(c1,TSR_POINT) pcontrol = ors(tsr(t4){1}) /* &dA05/02/03&d@ px = ors(tsr(t4){3}) << 8 py = ors(tsr(t4){4}) << 16 t1 = ors(tsr(t4){2}) << 24 putobjpar = t1 + px + py + pcontrol /* Note: order of data has been changed perform putobj oby -= t3 return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P 39. survay_file ³ &dA &d@³ ³ &dA &d@³ Purpose: Survay the entire file and make a map of the ³ &dA &d@³ number of tracks in each measure and of their staff ³ &dA &d@³ position; also determine divspm and divspq for each ³ &dA &d@³ measure; also determine if and where there are any time ³ &dA &d@³ gaps. ³ &dA &d@³ ³ &dA &d@³ ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure survay_file str line2.200 int i,j loop for i = 1 to MAX_MEAS loop for j = 1 to 9 trackstave(i,j,1) = 0 trackstave(i,j,2) = 0 trackstave(i,j,3) = 0 repeat repeat loop for i = 1 to 15000 timegaps(i,1) = 0 timegaps(i,2) = 0 timegaps(i,3) = 0 repeat scnt = 11 /* the first record better be a $ record or else! GET_DOLLAR: tget [X,scnt] line ++scnt if line{1} = "P" or line{1} = "@" goto GET_DOLLAR end line = line // pad(100) if line{1} <> "$" putc Program error, or file error: expecting initial $ record. putc putc This is most likely a file error. The most common error putc is a misrepresentation of the group membership structure putc in lines 11ff. of the data file. putc stop end if line con "C2:" staves = 2 else staves = 1 end if line con "Q:" divspq = int(line{mpt+2..}) else putc Program error, or file error: divspq not specified. putc Record ~(scnt+12) &dA~line stop end MMPR: ++barnum measuremap(barnum,1) = 0 measuremap(barnum,2) = 0 measuremap(barnum,3) = 0 measuremap(barnum,4) = 0 measuremap(barnum,5) = divspq durflag = 0 divpoint = 0 loop for i = 1 to 9 trackdivpnt(i) = 0 repeat track = 1 staff = 1 if track_flag = 1 loop for i = 1 to 9 trackstave(barnum,i,3) = track_assign(i) repeat end MPR: tget [X,scnt] line ++scnt line = line // pad(80) if line{8} <> " " d = int(line{6,3}) /* possible duration end g = int(line{9,4}) /* possible measure number if line{1} = "$" if line con "Q:" divspq = int(line{mpt+2..}) if durflag = 0 measuremap(barnum,5) = divspq /* divspq can be set before durations in a meas. end end sugg_flg = 0 goto MPR end if line{1} = "P" goto MPR end if line{1} = "@" if line con "track assignment:" line2 = line{mpt+17..} line2 = line2 // " *" loop while line2 con "(" a1 = int(line2{mpt+1..}) a2 = int(line2{sub+1..}) line2 = line2{sub+1..} trackstave(barnum,a1,3) = a2 /* re-assign track a1 to staff a2 track_assign(a1) = a2 /* and make change in assignment array repeat end if line con "instrument number:" line2 = line{mpt+18..} line2 = line2 // " *" instrument_number = int(line2) end if line con "transposition:" line2 = line{mpt+14..} line2 = line2 // " *" transposition = int(line2) end goto MPR end if "ABCDEFGri" con line{1} /* note or rest durflag = 1 if line{8} = " " putc File error: expecting a duration for this record putc Record ~(scnt+12) &dA~line stop end if "123456789" con line{15} track = mpt else track = 1 end if "123456789" con line{24} staff = mpt else staff = 1 end if trackdivpnt(track) <> divpoint /* time gap exists here if trackdivpnt(track) > divpoint putc File format error: track events out of time order putc Record ~(scnt+12) &dA~line stop end ++tgpnt if measuremap(barnum,2) = 0 measuremap(barnum,3) = tgpnt end ++measuremap(barnum,2) timegaps(tgpnt,1) = track timegaps(tgpnt,2) = trackdivpnt(track) timegaps(tgpnt,3) = divpoint - trackdivpnt(track) trackdivpnt(track) = divpoint end trackdivpnt(track) += d divpoint += d trackstave(barnum,track,staff) += d goto MPR end if line{1} = " " /* chord? if "123456789" con line{15} if track = mpt /* true chord goto MPR end track = mpt else goto MPR /* true chord end if "123456789" con line{24} staff = mpt end if trackdivpnt(track) <> divpoint - d /* time gap exists here if trackdivpnt(track) > divpoint - d putc File format error: track events out of time order putc Record ~(scnt+12) &dA~line stop end ++tgpnt timegaps(tgpnt,1) = track timegaps(tgpnt,2) = trackdivpnt(track) timegaps(tgpnt,3) = divpoint - d - trackdivpnt(track) trackdivpnt(track) = divpoint - d end trackdivpnt(track) += d trackstave(barnum,track,staff) += d goto MPR end if line{1} = "c" putc Warning: cue notes may not be handled properly in this program goto MPR end if line{1} = "b" /* backup command divpoint -= d goto MPR end if line{1} = "m" loop for i = 1 to 9 if trackdivpnt(i) > divpoint putc File error: time pointer not fully advanced at end of measure putc Record ~(scnt+12) &dA~line stop end if trackdivpnt(i) > 0 and trackdivpnt(i) < divpoint /* time gap exists here ++tgpnt if measuremap(barnum,2) = 0 measuremap(barnum,3) = tgpnt end ++measuremap(barnum,2) timegaps(tgpnt,1) = i timegaps(tgpnt,2) = trackdivpnt(i) timegaps(tgpnt,3) = divpoint - trackdivpnt(i) trackdivpnt(i) = divpoint end repeat measuremap(barnum,4) = divpoint loop for i = 1 to 9 if trackstave(barnum,i,1) > 0 or trackstave(barnum,i,2) > 0 ++measuremap(barnum,1) end repeat goto MMPR end if line{1} <> "/" goto MPR end --barnum &dA &dA &d@ Check for time gaps &dA loop for i = 1 to barnum if measuremap(i,2) > 0 i = MAX_MEAS * 10 end repeat if i > MAX_MEAS * 9 putc putc A survay of this stage2 file detected some &dEtime gaps&d@, which may putc be perfectly legal in terms of the MUSEDATA stage2 format, but putc which introduce added complexity in music searching and in score putc conversion. These applications require that the time gaps be putc filled before proceeding any further with the i-file compilation putc process. The report below shows the bar numbers where the time putc gaps occur. Be sure to use the correct track number when you putc add irests (the most common solution to filling time gaps). putc You will probably also need to make use of the backup command putc (&dLback #&d@ record) to keep the division pointer in the right place. putc putc &dE ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» putc &dE º R E P O R T º putc &dE ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ putc putc This movement has ~barnum bars. &dANote:&d@ Some of these may putc be double bars or heavy bars within normal bars, and may not putc have bar numbers. In this situation, the bar number column putc below &dAwill not&d@ correspond to actual meausure numbers. putc putc Active Time putc Bar number ³ Tracks Gaps divspm divspq putc ÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ loop for i = 1 to barnum putc .w6 ~i ³~measuremap(i,1) ~measuremap(i,2) ~measuremap(i,4) ~measuremap(i,5) repeat putc ÄÅÄ putc putc Detail on Time Gaps putc ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ putc putc Gap starts Lasts # putc Bar number ³ Track at div # divisions putc ÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ loop for i = 1 to barnum k = measuremap(i,3) - 1 loop for j = 1 to measuremap(i,2) ++k putc .w6 ~i ³~timegaps(k,1) ~timegaps(k,2) ~timegaps(k,3) repeat repeat putc ÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ putc putc &dA ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ putc &dA ³ Program Halted ³ putc &dA ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ putc stop end if staves = 2 and track_flag = 0 putc putc This stage2 file displays music on the grand staff. This putc means that it is possible for tracks to jump between staves. putc SCORE requires that every musical track be assigned to a putc "primary" staff, on a measure-by-measure basis. Most tracks putc will live their entire lives on the top or the bottom stave, putc but some will jump around. In many of these cases, it is putc still possible that the "primary" staff will remain the same putc throughout the movement. However, there are some cases putc where the primary staff really does change. Where this putc happens is not always easy to determine. There are many putc factors to consider, such as voice range, what else is on putc the staff, and the presence of ties. Perhaps some day putc autoscr will be able to make these decisions automatically, putc but for the time being, we must ask you, the user, to help putc us with this. putc putc The report below shows the track activity for the first 6 tracks putc on a bar-by-bar basis. Only those tracks that appear on both putc staves are in question. putc putc Type "Enter" getc putc &dE ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» putc &dE º R E P O R T º putc &dE ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ putc putc T R A C K A C T I V I T Y putc ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ putc putc Track-1 Track-2 Track-3 Track-4 Track-5 Track-6 putc Bar ³ S1 S2 S1 S2 S1 S2 S1 S2 S1 S2 S1 S2 putc ÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ loop for i = 1 to barnum putc .w3 ~i ³ ~trackstave(i,1,1) ~trackstave(i,1,2) ³ ... putc .w3 ~trackstave(i,2,1) ~trackstave(i,2,2) ³ ... putc .w3 ~trackstave(i,3,1) ~trackstave(i,3,2) ³ ... putc .w3 ~trackstave(i,4,1) ~trackstave(i,4,2) ³ ... putc .w3 ~trackstave(i,5,1) ~trackstave(i,5,2) ³ ... putc .w3 ~trackstave(i,6,1) ~trackstave(i,6,2) ³ repeat putc ÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ putc Type "Enter" getc putc loop for i = 1 to 9 h = 0 k = 0 loop for j = 1 to barnum if trackstave(j,i,1) > 0 ++h end if trackstave(j,i,2) > 0 ++k end repeat if h > 0 and k = 0 putc Track ~i will be assigned to stave 1 loop for j = 1 to barnum trackstave(j,i,3) = 1 repeat end if h = 0 and k > 0 putc Track ~i will be assigned to stave 2 loop for j = 1 to barnum trackstave(j,i,3) = 2 repeat end if h > 0 and k > 0 AQQQ: a3 = 1 putc We need help with &dETrack ~i putc Which staff should be primary staff at the start of the piece? (1 or 2) getc a1 putc &dETrack ~i &d@ will start with &dIstaff ~a1 &d@ as primary AQQ: a2 = 3 - a1 putc putc At what bar number should &dEtrack ~i &d@ change its primary staff to &dIstaff ~a2 &d@? putc If no change, enter 1000. (or any number greater than total number of meas + 1) getc a4 if a4 > barnum + 1 a4 = barnum + 1 end loop for j = a3 to a4 - 1 trackstave(j,i,3) = a1 repeat if a4 < barnum + 1 a1 = a2 a3 = a4 goto AQQ end putc You have designated the following pattern for the primary staves of track ~i putc putc Track-~i putc Bar ³ S1 S2 putc ÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄ loop for j = 1 to barnum if trackstave(j,i,3) = 1 putc .w3 ~j ³&dA ~trackstave(j,i,1) &d@ ~trackstave(j,i,2) else putc .w3 ~j ³ ~trackstave(j,i,1) &dI ~trackstave(j,i,2) end repeat putc ÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄ putc putc Type Enter to accept. A non-empty line will allow you to enter the data again. getc line line = trm(line) if line <> "" goto AQQQ end end repeat end &dA &dA &d@ Now check to see that every active track is assigned to a stave &dA if staves = 2 a3 = 0 loop for a1 = 1 to barnum loop for a2 = 1 to 9 if trackstave(a1,a2,1) + trackstave(a1,a2,2) > 0 if trackstave(a1,a2,3) = 0 if a3 = 1 putc There are some measures where an active track is not assigned to a staff putc The problem can be corrected by either: putc (1) adding @ SCORECON track assignment records at the putc measures in question, or putc (2) deleting all @ SCORECON track assignment records from putc the stage2 file putc end a3 = 1 putc Track ~a2 in measure ~a1 is unassigned end end repeat repeat if a3 = 1 putc putc &dAProgram Halted&d@ putc stop end end &dA &dA &d@ To re-cap at this point, we now have gathered the following information &dA &d@ to help us develop the parameters necessary to convert stage2 data to &dA &d@ Score data: &dA &dA &d@ 1. The total number of barlines in this movement is &dEbarnum&d@ &dA &dA &d@ 2. number of staves for this stage2 file is &dEstaves&d@ &dA &dA &d@ 3. For each measure, we know &dA &dA &d@ a) the number of active tracks in this measure is &dEmeasuremap(.,1)&d@ &dA &dA &d@ b) there are no time gaps &dA &dA &d@ c) number of divisions in this measure is &dEmeasuremap(.,4)&d@ &dA &dA &d@ d) governing divspq for this measure is &dEmeasuremap(.,5)&d@ &dA &dA &d@ e) if staves = 2, the primary staff for each track is &dEtrackstave(.,.,3) &dA &dA &d@ f) a track is active if &dEtrackstave(.,.,1) + trackstave(.,.,2) > 0&d@ &dA &dA &d@ g) a track spans both staves if &dEtrackstave(.,.,1) > 0&d@ and &dEtrackstave(.,.,2) > 0 &dA &dA &dA return &dA &d@ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ &dA &d@³P. XXX check_for_lib (slib,nlib ³ &dA &d@³ ³ &dA &d@³ Operation: This procedure looks into the directory "slib" for the ³ &dA &d@³ sub-directory "nlib". ³ &dA &d@³ ³ &dA &d@³ if nlib does not appear in the sub-diretory, ³ &dA &d@³ it is created as a sub-directory ³ &dA &d@³ else ³ &dA &d@³ if nlib does appear in the sub-diretory, and ³ &dA &d@³ if it appears as a FILE, ³ &dA &d@³ an error message is printed and a stop command issued. ³ &dA &d@³ else ³ &dA &d@³ the procedure returns with no action taken. ³ &dA &d@³ end ³ &dA &d@³ end ³ &dA &d@³ end ³ &dA &d@³ ³ &dA &d@³ Inputs: slib = directory to look into ³ &dA &d@³ nlib = sub-directory to look for, and possibly create ³ &dA &d@³ ³ &dA &d@³ Possible Outcomes: ³ &dA &d@³ nlib is there, no action ³ &dA &d@³ nlib is not there, and is created ³ &dA &d@³ nlib is there, but as a FILE. Error and stop ³ &dA &d@ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ procedure check_for_lib (slib,nlib) str slib.200,nlib.80 str fname.200 getvalue slib,nlib nlib = trm(nlib) open [7,1] slib loop getf [7] line fname = line{33..} fname = trm(fname) if fname = nlib if line{1,5} = "" /* this is a directory, not a file close [7] return else putc ~nlib already exists as a &dEFILE&d@ and cannot be created as a directory putc For purposes of this program, this is unexpected and must be considered putc an &dAERROR&d@. putc &dAProgram Halted&d@ putc stop end end repeat eof7: close [7] line = slib // "/" // nlib createdir line return run &dA &dA Extra Lines for Debugging &dA perform display_array /* &dADEBUG&d@ if measnum - 1 >= 291 examine end