DixShtix

com.dixshtix.niff
Class ChunkLengthTable

java.lang.Object
  |
  +--com.dixshtix.niff.ChunkLengthTable

public class ChunkLengthTable
extends java.lang.Object

Defines fixed-length of NIFF file chunks to allow backward compatibility.

Each NIFF file chunk has a fixed-length part and a variable length part. The fixed-length part is composed of a set of required elements described by each chunk definition. The variable length part is composed of a series of optional tags which may be used occasionally or only by certain programs.

Corrected from NIFF 6a, FONTIDX has replaced FONTPTR.

See Also:
ChnkLenTable

Field Summary
static FourByteConstant Accidental
          Represents an accidental symbol attached to a Notehead.
static FourByteConstant AltEndingGraphic
          Graphical symbols used on alternate endings.
static FourByteConstant Arpeggio
          The symbol in front of a chord indicating that the notes of the chord are to be played successively from lowest to highest pitch, rather than simultaneously.
static FourByteConstant Articulation
          Attached to a stem are various articulation symbols.
static FourByteConstant AugDot
          Graphic indication of lengthening of a note.
static FourByteConstant Barline
          Mark the end of a measure.
static FourByteConstant Beam
          Link note stems into a metrical unit.
static FourByteConstant ChnkLenTable
          The Chunk Length Table allows for future changes in the fixed length part of the chunk structures, without disturbing existing programs.
static FourByteConstant ChordSymbol
          The chord symbols placed above a staff.
static FourByteConstant Clef
          Indicates that the following musical symbols are to be interpreted in the specified clef.
static FourByteConstant CustomGraphicChk
          Used when a custom graphic is to be placed on the page, with no musical function or sound.
private static java.util.List defaultOrder
           
private static java.util.Map defaultTable
           
static FourByteConstant DefaultValues
          Default Renderings.
static FourByteConstant Dynamic
          Affects dynamics (velocity) of playback.
static FourByteConstant EpsGraphic
          Part of the Custom Graphics list which is an optional table in the Setup Section which contains fonts and graphics.
static FourByteConstant FiguredBass
          Used to describe the numerals and accidentals of a basso continuo.
static FourByteConstant Fingering
          Describe which finger is used to play.
static FourByteConstant FontDescription
          Font Description chunks define a particular combination of font name, font size, and font style.
static FourByteConstant FontSymbol
          A standard music font character that is to be placed on page or system outside of a staff, without its normal sound or function.
static FourByteConstant Glissando
          Used to describe a line that functions as a glissando, a rapid swoop from a lower to a higher note passing all half-steps in between.
static FourByteConstant GuitarGrid
          Display a fret diagram for a stringed intrument.
static FourByteConstant GuitarTabNum
          Used to indicate numbers to be placed on a guitar tablature staff.
static FourByteConstant Hairpin
          Describe dynamic changes.
static FourByteConstant HarpPedal
          Display a symbol indicating how a harp's strings are to be tuned, ala a Salzedo diagram.
static FourByteConstant KeySignature
          Standard key signatures, including cancelations.
static FourByteConstant KeySignNonstandard
          Indicates the start of a nonstandard key signature.
static FourByteConstant Line
          Add a line to a score.
static FourByteConstant Lyric
          Display a lyrical text syllable on one of the established verse lines.
static FourByteConstant MeasureNumbering
          Used to set or change the measure numbering scheme anywhere in the score.
static FourByteConstant MidiDataStream
          Lengthy or complex MIDI information that cannot be represented with the simple MIDI Performance tag can be supplied with the MIDI Data Stream chunk.
static FourByteConstant NiffInfo
          The NIFF Information chunk is the first required chunk in the Setup Section.
static java.lang.Integer noDefinedChunkLength
           
static FourByteConstant Notehead
          Display a notehead, which is usually interpreted as a note to be played.
static FourByteConstant OctaveSign
          Cue to play one or two octaves higher or lower.
private  java.util.List order
           
static FourByteConstant Ornament
          Decorations such as trills, turns and mordents.
static FourByteConstant PageHeader
          Describes a physical page of the score.
static FourByteConstant Parenthesis
          Left or Right or Both parenthesis/es, brace/s or bracket/s.
static FourByteConstant Part
          Part Description Chunk, part of the Parts list which is a required part of the Setup Section.
static FourByteConstant PedalOrgan
          Represents equivalent of "fingering" on a chromatic, foot-operated keyboard.
static FourByteConstant PedalPiano
          Depressing a Pedal which alters timbre or other property of instrument.
static FourByteConstant Portamento
          Used to describe a line that functions as a portamento, a rapid swoop from a lower to a higher note smoothly over all intervening frequencies.
static FourByteConstant PsType1Font
          Part of the Custom Graphics list which is an optional table in the Setup Section which contains fonts and graphics.
static FourByteConstant PsType3Font
          Part of the Custom Graphics list which is an optional table in the Setup Section which contains fonts and graphics.
static FourByteConstant RehearsalMark
          The rehearsal letters or numbers placed above a staff.
static FourByteConstant RepeatSign
          Logical and graphical components of a repeat sign.
static FourByteConstant Rest
          Display a logical silence, which otherwise has the semantics of a note.
static FourByteConstant Slur
          A musical slur between two notes of different pitch.
static FourByteConstant StaffGrouping
          Staff Grouping chunks, part of the Staff Groupings list, an optional part of the Setup Section or Data Section.
static FourByteConstant StaffHeader
          Describes a logical Staff.
static FourByteConstant Stem
          Display a stem for creating of chords at the same time-stamp.
static FourByteConstant StringTable
          The String Table is a chunk containing all strings referred to elsewhere in the file.
static FourByteConstant SystemHeader
          Container for staffs.
static FourByteConstant SystemSeparation
          Used in ensemble scores to vertically separate systems.
private  java.util.Map table
           
static FourByteConstant TagActivate
          This chunk can be stored at the start of a series of chunks to indicate that each of its tags are to be applied to all of the chunks appearing between it and a matching Tag Inactivate chunk.
static FourByteConstant TagInactivate
          This chunk is used to end the application of tags started with a Tag Activate chunk.
static FourByteConstant TempoMarking
          A standard tempo marking either in the form [note] = [metronome setting], or text tempo instructions.
static FourByteConstant TempoMarkNonstandard
          Indicates the start of a tempo marking.
static FourByteConstant Text
          A text string.
static FourByteConstant Tie
          Tie two noteheads into a composite note.
static FourByteConstant TimeSignature
          Represent a simple time signature.
static FourByteConstant TimeSigNonstandard
          Indicates the start of a nonstandard time signature.
static FourByteConstant TimeSlice
          Indicate Logical Start Time of various anchored tags.
static FourByteConstant Tremolo
          Display a tremolo marking.
static FourByteConstant Tuplet
          Tuplet.
static FourByteConstant UserDefined
          Provide for a user defined chunk for vendor-specific expansion.
 
Constructor Summary
ChunkLengthTable()
           
 
Method Summary
(package private) static void ()
           
 int get(FourByteConstant fcc)
           
 java.lang.Integer getNumber(FourByteConstant fcc)
           
 java.util.Iterator iterator()
           
static ChunkLengthTable makeDefaultEntries()
          Fill a chunk length table with "canned" entries.
 void put(FourByteConstant fcc)
           
 void put(FourByteConstant fcc, int length)
           
 void put(FourByteConstant fcc, java.lang.Integer length)
           
 int size()
          Return the number of entries in a chunk length table.
 java.lang.String verifyDefaults()
          Make sure our canned CLT entries jive with a given chunk length table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

ChnkLenTable

public static final FourByteConstant ChnkLenTable
The Chunk Length Table allows for future changes in the fixed length part of the chunk structures, without disturbing existing programs.

The purpose of the chunk length table is to give programs a tool for adapting to changes in the fixed length part of the NIFF chunk structures. The chunk length table is a series of 8 byte Chunk Length Table Entries, each table entry composed of a chunk name and the offset of the first tag field for chunks of that type. There must be a table entry for each chunk type present in the file. Chunks appear in the table in alphabetical order.

This chunk is a required part of the Setup Section.

It is a series of 8 byte table entries, each one composed of a 4 byte chunk name followed by a 4 byte pointer to the first tag field to be found in chunks of that type. The pointer value is always the same as the length of the chunk's required structure. If the required structure for the chunk type is the EMPTY data type, the pointer value is zero. If no tags are allowed in that chunk, the pointer value is -1. There must be a table entry for each chunk type present in the file, including user-defined chunks. Table entries appear in alphabetical order.
NameTypeContainerContentsTags
Chunk Length TableSetup ChunkSetup Section LISTN/AN/A
NameTypeDescription
ChunkLengthTableEntries(FOURCC,LONG)[]
Field NameTypeDescription
chunk nameFOURCCNIFF Chunk Name
offset of first tagLONG A 4 byte pointer to the first tag field to be found in chunks of this type. The pointer value is always the same as the length of the required part of the chunk. If the chunk has no required structure, the pointer value is zero. If no tags are allowed in the chunk, the pointer value is -1.


DefaultValues

public static final FourByteConstant DefaultValues
Default Renderings.

The Defaults chunk specifies default fonts for various text categories, vertical offsets of chord symbols, guitar grids, and rehearsal marks, and a default tuplet appearance description.

The fields are "music font", "part name font", "lyric font", "chord symbol font", "measure number font", "rehearsal mark font", all of type "FONTIDX", a 2-byte pointer to a Font Description chunk in the Font Descriptions list. Next comes an pair of unsigned bytes which are interpreted as the "tuplet grouping symbol" and the "tuplet number style".
NameTypeContainerContentsTags
Default ValuesSetup ChunkSetup Section LISTN/AN/A
NameTypeDescription
music fontFONTIDX
part name fontFONTIDX Used as the default font for part name and abbreviation. See StaffHeader and Part.
lyric fontFONTIDX
chord symbol fontFONTIDX
measure number fontFONTIDX
rehearsal mark fontFONTIDX
tuplet grouping symbolBYTE (Copied from Tag.tupletDesc )

0 = default
1 = number only
2 = number with broken slur
3 = number outside slur
4 = number inside slur
5 = number with broken bracket
6 = number outside bracket
7 = number inside bracket
8 = bracket only
9 = slur only
10 = no symbol

tuplet number styleBYTE (Copied from Tag.numberStyle )

numstyleDefault = 0,
numstyleFirstNumOnly = 1,
numstyle2NumsWithColon = 2,
numstyleNumString = 3,
numstyleNoNumber = 4


EpsGraphic

public static final FourByteConstant EpsGraphic
Part of the Custom Graphics list which is an optional table in the Setup Section which contains fonts and graphics.

EPS graphics in the Custom Graphics list table are referred to by means of the Custom Graphic Symbol chunk, which represents a symbol with no musical function, or the Custom Graphic tag, which is applied to a music symbol chunk to override the default appearance of the symbol.

NameTypeContainerContentsTags
EPS GraphicSetup ChunkCustom Graphics LISTN/AN/A
NameTypeDescription
encapsulated PostScriptBYTE[] A PostScript description of a graphic, in EPS (encapsulated PostScript) format.

See Also:
CustomGraphicChk, Tag.customGraphicTag

FontDescription

public static final FourByteConstant FontDescription
Font Description chunks define a particular combination of font name, font size, and font style.

The Font Descriptions list is an optional table in the Setup Section that is composed of a series of Font Description chunks. Font Description chunks in the Font Descriptions list are referred to elsewhere in the file by means of the FONTIDX data type.

The FONTIDX data type is used in the optional Default Values chunk in the Setup Section for specifying default fonts for music symbols, lyrics, figured bass and chord symbols. FONTIDX is also used in the Font ID tag, which is applied to any music symbol or text-type chunk to specify that the same character(s) but a different font, size or style is to be used. Finally, FONTIDX is used in the Custom Font Character tag, which allows a non-default font and character to be used on a music symbol chunk.

Each Font Description chunk gives the font name, size (in both twips and absolute units), style (plain, bold, italic, underscored, or a combination), and the location where the font itself can be found, if it is stored in the file. The location is given as a pointer to the PostScript font in the Custom Graphics list, a separate Setup Section structure.

The size of text fonts is given in twips. (One twip = 1/20 of a point, or 1/1440 of an inch.) This allows for scaling of fonts between point sizes, for those who can use this feature (e.g. a 210 twip font = a 10 1/2 point font).

The size of music fonts is described in two different ways: font size (in twips) and space height (in absolute units). Since there is no agreement on the meaning of font size between different music fonts, the space height is intended to provide a clue about the intended size of the symbols on a standardized scale. It is equal to the vertical distance in absolute units between two adjacent staff lines of a staff on which the music font symbols would appear of normal size.

NameTypeContainerContentsTags
Font DescriptionSetup ChunkFont Descriptions LISTN/AN/A
NameTypeDescription
font nameSTROFFSETOffset into the string table of the font name.
sizeSHORT Font size, in twips (20ths of a point)
space heightSHORT Used only for music fonts. Font size, given as the vertical distance, in absolute units, between two adjacent staff lines of a staff on which the music font symbols would normally appear.
whereSHORT Where this font can be found.

-1 = This font or a substitute is assumed to be known and available to the reading program.
0-32767. The index into the Custom Graphic list where the actual PostScript font can be found. This must point to a fnt1 or fnt3 chunk.

styleBYTE The following values are additive, in the sense of a bitmap: 0 = plain
1 = bold
2 = italic
4 = underscored


NiffInfo

public static final FourByteConstant NiffInfo
The NIFF Information chunk is the first required chunk in the Setup Section.

This includes the following information: NIFF version, writing program type, measurement units and MIDI ticks per quarter. Of these fields, all but the NIFF version can have a value of -1 to indicate "no value".

NIFF uses two different measurement systems - absolute units and staff steps.

Absolute units are the writing program's own choice of units, declared in the Setup Section NIFF Information chunk. The unit choice is expressed in two field values: the standard unit (inches, centimeters, or points), and the number of absolute units per standard unit. For example, if the resolution used by the writing program were 4000 dots per inch, the writing program would choose a standard unit of "inches" and the number of absolute units per standard unit would be 4000.

For performance playback, both start time and duration are measured in MIDI ticks, which denote some fixed amount of time using an integer. MIDI ticks are well suited to performance information because of their high resolution. The relationship between the performance and logical values is described by the field MIDI ticks per quarter note, stored in the NIFF Information chunk in the Setup Section.
NameTypeContainerContentsTags
NIFF InformationSetup ChunkSetup Section LISTN/AN/A
NameTypeDescription
NIF VersionBYTE[8] NUL-padded ASCII string. 6a or 6b for Tag.numberStyle.
writing program typeSIGNEDBYTE -1 = no value/other
1 = engraving program
2 = scanning program
3 = MIDI interpreter
4 = sequencer
5 = research program
6 = educational program
standard unitsSIGNEDBYTE -1 = no absolute measurements in file
1 = inches
2 = centimeters
3 = points
absolute unitsSHORT Number of absolute units per standard unit.

-1 = no absolute measurements in file

MIDI ticks per quarterSHORT MIDI ticks per quarter note, to be used in interpreting MIDI time values. Must be a positive number if MIDI time values are present in file. -1 indicates no MIDI timing information is present.

See Also:
Tag.spacingByPart

Part

public static final FourByteConstant Part
Part Description Chunk, part of the Parts list which is a required part of the Setup Section.

Each Part Description Chunk defines the Part ID, part name and part abbreviation, maximum number of staves in that part, MIDI channel and cable numbers, and the number of steps to transpose this part on playback. All fields except Part ID can be set to null values. Part ID's should be assigned sequentially starting with zero. The vertical offset of such optional items as lyrics, guitar grid symbols, and figured bass can optionally be specified by appending tags to the Part Description chunk.

The maximum number of staves field in each Part Description must have a nonzero value. This information is used in interpreting staff number values in the Setup Section StaffGrouping list.

The Part Description chunk has fields for part name and part abbreviation. These can be used by the reading program as the names to be placed to the left of the system identifying the parts. This would be easiest in simple scores, where there is a clear correspondence between parts and staves and each Staff Header chunk has a Part ID tag to identify it. The part name font in the Default Values chunk can be used by the reading program for these simple part names and abbreviations.
NameTypeContainerContentsTags
Part DescriptionSetup ChunkParts LISTN/ATag.chordSymbolsOffset
Tag.figBassOffset
Tag.guitarGridOffset
Tag.lyricVerseOffset (one for each lyric line)
Tag.rehearsalOffset
NameTypeDescription
part IDSHORT The Part ID, referred to on Data Section chunks associated with this part. Should be assigned sequentially starting with zero.
nameSTROFFSET Name to be associated with the staff or staves displaying this part on the first page of the score. See General Discussion of Part and Staff Names for details about its use.
abbreviationSTROFFSET Name to be associated with the staff or staves displaying this part on all pages after the first page of the score. See General Discussion of Part and Staff Names for details about its use.
number of stavesBYTE Maximum number of simultaneous staves for this part. Used to calculate staff ID's referred to in the Setup Section Staff Groupings list. A value of zero is allowed only if the Staff Groupings list is omitted from the Setup Section.
MIDI channelSIGNEDBYTE Use -1 to specify none.
MIDI cableSIGNEDBYTE Use -1 to specify none.
transposeSIGNEDBYTE Number of halfsteps to transpose this part during playback.

See Also:
Tag.staffName

PsType1Font

public static final FourByteConstant PsType1Font
Part of the Custom Graphics list which is an optional table in the Setup Section which contains fonts and graphics.

Fonts are stored as PostScript Type 1 or Type 3 font.
NameTypeContainerContentsTags
PostScript Type 1 FontSetup ChunkCustom Graphics LISTN/AN/A
NameTypeDescription
Postscript dataBYTE[] Contains a complete PostScript type 1 font.


PsType3Font

public static final FourByteConstant PsType3Font
Part of the Custom Graphics list which is an optional table in the Setup Section which contains fonts and graphics.

Fonts are stored as PostScript Type 1 or Type 3 font.
NameTypeContainerContentsTags
PostScript Type 3 FontSetup ChunkCustom Graphics LISTN/AN/A
NameTypeDescription
Postscript dataBYTE[] Contains a complete PostScript type 3 font.


StaffGrouping

public static final FourByteConstant StaffGrouping
Staff Grouping chunks, part of the Staff Groupings list, an optional part of the Setup Section or Data Section.

Indicates some type of connection at the left end of a series of sequential staves in the score, such as vertical lines, braces or brackets. Staff groupings can be nested. When the same staff is included in more than one grouping, the grouping symbols are stored in the file in the order they are to be applied to the staff, from right to left, starting at the staff origin.

Each Staff Grouping chunk describes some type of grouping symbol at the left end of a series of sequential staves in the score, such as an initial vertical line, a brace or a bracket.

A default list of Staff Grouping chunks can optionally be supplied in the Setup Section.

In the Data Section, Staff Groupings lists can be supplied in some System lists as overrides to the default Staff Grouping. Alternatively, the Setup Section Staff Grouping list can be eliminated entirely, with Staff Groupings supplied only in Data Section System lists. Storing a default Staff Groupings list in the Setup Section makes the most sense when there is little variety among the score's staff groupings.

N.B.: In a Data Section override Staff Grouping chunk, use the Staff ID's of the staves in the system to which the grouping applies, starting with zero for the first staff and increasing sequentially. In the Setup Section default Staff Groupings, Staff ID's of the default system are assigned as follows:

A Staff ID is assigned to every staff of every part, using the maximum number of staves for each part. The ID numbers are assigned in increasing order starting with Part 0, Staff 0. Here is an example:
Part 0 has maximum number of staves = 3
Part 1 has maximum number of staves = 3
Part 2 has maximum number of staves = 1
Default System Staff IDDescription
0 Part 0, Staff 0
1 Part 0, Staff 1
2 Part 0, Staff 2
3 Part 1, Staff 0
4 Part 1, Staff 1
5 Part 1, Staff 2
6 Part 2, Staff 0

NameTypeContainerContentsTags
Staff GroupingSetup/Data ChunkStaff Groupings LISTN/AN/A
NameTypeDescription
grouping typeBYTE (1-3) 1 = vertical line at start of system
2 = curly brace at start of system
3 = bracket at start of system
first staffSHORT 0-32767. Staff ID of first staff in grouping. See note above.
last staffSHORT 0-32767. System Staff ID of last staff in grouping. See note above.


StringTable

public static final FourByteConstant StringTable
The String Table is a chunk containing all strings referred to elsewhere in the file. It is a series of null terminated ASCII strings (known in RIFF terminology as ZSTRs). In any NIFF chunk where a string value is needed, the data type STROFFSET is used. This contains the offset of the string in the String Table.

By "offset", we have verified the NIFF authors mean a 0-based index into the array of characters of the pre-defined strings, and not the index of the strings. This may allow for compression schemes to be devised.
NameTypeContainerContentsTags
String TableSetup ChunkSetup Section LISTN/AN/A
NameTypeDescription
string entriesBYTE[] Contains one or more character strings in RIFF ZSTR format. Each ZSTR is composed of a series of ASCII characters followed by a one byte NULL (0x00) terminator. The character strings are referenced throughout the file by STROFFSET values which represent the offset into the table. 0 offset points to the first character after the chunk length.


PageHeader

public static final FourByteConstant PageHeader
Describes a physical page of the score.

Page Coordinate System.

The size of a page is given as its height and width in absolute units. The origin of the page's coordinate system is the top left corner of the page (as in the lower right quadrant of a Cartesian coordinate system). Measurements are increasingly positive to the right and towards the bottom of the page.

The origin of a staff is the left end of its top line. The origin of a system is the staff origin of its top staff.

Simulated Part Ordering

For a file with simulated part ordering, use values of zero for Width and Height. See DataSection for more information on Simulated Part Ordering.

NameTypeDefault AnchorReferenceTags
Page HeaderHeader ChunkN/APage Origin: Top left corner of pageTag.height
Tag.width
NameTypeDescription
EMPTY


StaffHeader

public static final FourByteConstant StaffHeader
Describes a logical Staff.

The staff size is described by the Height tag, which contains the vertical distance between the top and bottom staff lines. The default number of staff lines is 5. If only one part is present on this staff, the Part ID tag should be appended here, so it won't have to be appended individually to each symbol in the Staff list.

For a staff name, a Text chunk with the Staff Name tag should be stored following a Staff Header chunk. Its placement, if specified, would be given relative to the staff's origin. For a grouping name, a Text chunk with the Staff Name tag should be stored following a Staff Grouping chunk in a Staff Groupings list (in either the Setup Section or the Data Section). Its placement, if specified, would then be given relative to the staff origin of the top staff of the grouping.

Guitar Tablature.

Guitar Tablature is encoded as a separate Staff list within a System list in the Data Section. It is normally the second staff of a part with two staves, and should be counted in the maximum number of staves in the Setup Section Part Description chunk. The Guitar Tablature tag, the Number of Staff Lines tag (with a value of 6), and the Part ID tag are added to the Staff Header chunk.

The standard Clef chunk is used, with its value indicating TAB. Guitar TAB Number chunks are used to place the numbers on the string lines, and standard Barline chunks are used for barlines.The tablature symbols are stored with time-slice chunks that correspond to those of the music symbols displayed on the standard notated staff above.

Ossias

An ossia is to be stored as one or more additional Staff chunks within a System list, each labelled with an Ossia tag applied to the Staff Header chunk. The presence of the Ossia tag indicates that this is an alternate performance of the symbols in one or more other staves. The part and voice of the ossia staves' symbols must be marked (individually, or by a shorthand method), to indicate which parts and voices it represents an alternative to.

NameTypeDefault AnchorReferenceTags
Staff HeaderHeader ChunkSystem OriginStaff Origin: Top line of staffTag.height
Tag.width
Tag.partID
Tag.numStaffLines
Tag.silent (for ossias)
placement tags
NameTypeDescription
EMPTY

See Also:
Tag.ossia, Tag.guitarTabTag

SystemHeader

public static final FourByteConstant SystemHeader
Container for staffs.
NameTypeDefault AnchorReferenceTags
System HeaderHeader ChunkPage OriginSystem Origin: Staff origin of first staffTag.height
Tag.width
placement tags
NameTypeDescription
EMPTY

TimeSlice

public static final FourByteConstant TimeSlice
Indicate Logical Start Time of various anchored tags.

An explicit start time is required because simultaneous events are not always vertically aligned - for example, a chord with seconds. Ambiguity can result for a variety of other reasons as well.

The start time of a note or rest is stored on the event Time-slice chunk associated with (most recently preceding) the note or rest symbol. The start time is represented by a fraction which is the sum of the durations of all events that have occurred within the voice since the previous measure-start time-slice.

Here is an example, showing the start times and durations for 4 quarter notes in the first measure of a score in 4/4 time.

Time-slice, type=event, start-time=0/4
    Stem
        Notehead, duration=1/4
Time-slice, type=event, start-time=1/4
    Stem
        Notehead, duration=1/4
Time-slice, type=event, start-time=2/4
    Stem
        Notehead, duration=1/4
Time-slice, type=event, start-time=3/4
    Stem
        Notehead, duration=1/4

The start time of a measure is stored on a measure-start Time-slice chunk. It is given as the cumulative duration of all events since the start of the piece. The effective start time of each event in a measure is therefore the sum of the measure start time (from the measure-start Time-slice chunk) and the event start time (from the event Time-slice chunk). In the example above, the start time on the measure-start Time-slices of the first and second measures, respectively, would be 0/4 and 4/4.

The reference back to the start of the piece permits the correspondence between events in different parts to be determined even when the parts are in different meters.

Note concerning pickup bars: NIFF has no standard "correct" way to represent such (incomplete preliminary) bars. In particular, scanning programs may not have the intelligence to distinguish a genuinely incomplete bar from a pickup measure. Therefore the writing program has the choice of representing the pickup either as simply a "normal" incomplete bar, or else of representing it "correctly" (in musical terms) as the final portion of a preceding bar. As long as the barline time slice and the following measure time slice contain the same time, it should make little difference on which beats the two pickups are placed. Implementations should be prepared to deal with either of these possible representations of time in a pickup measure.

An additional reason start time is required is that voices are not always logically complete from start to finish. If a voice were logically complete, the start time of each event within the voice would always be the exact time that the previous event in that voice finished. Logical incompleteness (gaps) can occur, however, for various reasons:

  1. Piano music often allows temporary voices to appear and disappear with no rests to fill the time gaps.
  2. A non-metrical cadenza-like section can appear in one voice or part, leaving all other voices or parts with a logical gap during that time.
  3. Scanning programs can easily miss one or more notes in the middle of a sequence.
  4. Inactive parts might be hidden for large sections of a score.

Logical gaps can be filled in with invisible rests and placeholding measure-start time-slices. Or, logical gaps can be handled by adding extra value to the start time of the event following the gap to compensate for the missing time. Either technique ensures that the event following a logical gap in one voice will not occur until its proper time among the events in all other voices and parts.

Advanced feature: using time-slice start time as a placement clue.

There are some cases when the start times on an event time-slice might be used as a clue to the proper positioning of symbols. This is an advanced feature that is not required in either reading or writing programs for successful implementation of NIFF.

There are situations in music where the proportional placement of symbols is meaningful: for example, a crescendo hairpin ending somewhere between the start and end of a whole note. When the spacing of symbols is later adjusted, the hairpin should expand or shrink proportionally to its surroundings.

When the writing program has used either logical or default placement of symbols rather than absolute, the proportion cannot be described in graphical terms. An event time-slice could be used as an anchor for the hairpin end, to precisely indicate the implied temporal relationship between it and the whole note's start and end. The program should calculate for the anchor time-slice's start time a value with the proper proportion to the start and end times of the whole note. The reading program could then use the temporal proportion of the hairpin end relative to the start and end times of the whole note to calculate the symbols' proportional placement.

In mathematical terms:

P0 = position of previous timeslice
T0 = time of previous timeslice
P1 = position of next timeslice
T1 = time of next timeslice
P = position of hairpin end
T = start time on anchor time-slice of hairpin end

P = P0 + (T - T0) * (P1 - P0) / (T1 - T0).

NameTypeDefault AnchorReferenceTags
Time-SliceHeader ChunkPrevious measure-start time-slice, or staff origin for first time-slice in a staff.Bottom staff line at its intersection with the time-slice.???
NameTypeDescription
time slice typeBYTE 1 = measure-start
2 = event
start-timeRATIONAL depends on time-slice type

type 1: measure start time, relative to start of score
type 2: event start time, relative to previous measure-start time-slice


Accidental

public static final FourByteConstant Accidental
Represents an accidental symbol attached to a Notehead.

(Note: for triple sharps or triple flats, or for the combinations natural+sharp and natural+flat, simply use two accidental chunks.)
NameTypeDefault AnchorReferenceTags
AccidentalSymbol ChunkNoteheadHot-spot of symbolTag.smallSize
NameTypeDescription
shapeBYTE (1-9) 1 = double flat
2 = flat
3 = natural
4 = sharp
5 = double sharp
6 = quarter tone flat
7 = three quarter tones flat
8 = quarter tone sharp
9 = three quarter tones sharp

See Also:
Parenthesis

AltEndingGraphic

public static final FourByteConstant AltEndingGraphic
Graphical symbols used on alternate endings. Used together with the Repeat Sign chunk and Alternate Ending tag. See General Discussion on Repeats and Alternate Endings for example.
NameTypeDefault AnchorReferenceTags
Alternate Ending GraphicSymbol ChunkTimeSliceN/Amulti-node symbol tags
NameTypeDescription
bracket shapeBYTE (0-3) 0 = no down-jog
1 = down-jog at beginning
2 = down-jog at end
3 = down-jog at beginning and end
text stringSTROFFSET Number to appear at start of bracket. Normally "1." or "2." but any text string is allowed.

Arpeggio

public static final FourByteConstant Arpeggio
The symbol in front of a chord indicating that the notes of the chord are to be played successively from lowest to highest pitch, rather than simultaneously. This is a multi-node symbol, with node chunks anchored to the first and last Notehead chunks of the chord. It has both a logical and graphical function.
NameTypeDefault AnchorReferenceTags
ArpeggioSymbol ChunkNoteheadendpoints of the wavy line???
NameTypeDescription
shapeBYTE (1-2) 1 = wavy line
2 = vertical slur mark

Articulation

public static final FourByteConstant Articulation
Attached to a stem are various articulation symbols.

For some symbols, such as the strong accent and fermata, the shape depends on the context of the symbol - a strong wedge with the point at the top is used above up-stem notes, while the point is at the bottom when it is below down-stem notes. The non-default version of the symbol can be specified with the Articulation Direction tag.
NameTypeDefault AnchorReferenceTags
ArticulationSymbol ChunkStemCenter of the SymbolTag.articDirection
NameTypeDescription
shapeSHORT (1-15) 1 = strong accent (vertical wedge)
2 = medium accent (>)
3 = light accent ( tenuto)
4 = staccato
5 = down bow
6 = up bow
7 = harmonic (small circle)
8 = fermata
9 = arsis sign (unstressed)
10 = thesis sign (stressed)
11= plus sign
12 = vertical filled wedge (staccatissimo)
13 = double tonguing (two dots)
14 = triple tonguing (3 dots)
15 = "snap" pizzicato


AugDot

public static final FourByteConstant AugDot
Graphic indication of lengthening of a note.

For more than one dot, store additional Augmentation Dot chunks.

When the dot is on a note or rest on a staff line, the vertical component of the Logical Placement tag can be used as follows:

1= above staff line
2 = below staff line
For the reference point when the anchor is a rest symbol, see table (Diagram XX from Read pg. 96)
NameTypeDefault AnchorReferenceTags
Augmentation DotSymbol ChunkNoteheadCenter of the DotTag.logicalPlacement
NameTypeDescription
EMPTY

Barline

public static final FourByteConstant Barline
Mark the end of a measure.

Any number of these chunks can appear together (normally following a measure-start time-slice), with their order of appearance in the file indicating their graphical placement from left to right. The Barline chunk has only graphical significance. Use the Barline chunk together with the Repeat Sign chunk for repeat barlines. The Repeat Sign chunk would be stored by itself in all but the first staff of the barline's number of staves.

The Barline chunk should be stored only in the topmost staff of each part. It represents a graphic line extending from the current staff to the part's bottom staff. The Width tag can be used with either value of the type field to specify line width. However, for writing programs not concerned with exact measurements, the type field should be used to to distinguish between thick and thin barlines.

The Line Quality tag can be used to indicate a dotted or dashed line.

A barline signals the end of a measure rather than the start of a measure. On the last measure of a system it is necessary to store the Barline chunk before the measure-start time-slice, which belongs in a new Staff list and a new System list. So, for consistency and logical rigor, the Barline graphical symbol chunk is to be stored between the last event in the measure and the measure-start time-slice of the next measure. A special event time-slice chunk should be stored for this purpose, to uniquely identify the sequential position of the barline. Its start time can be the same, in essence, as the start time of the next measure-start time-slice, except given in relation to the start of its measure rather than the start of the score. The only time non-unique time-slices are allowed within a Staff list are when an event time-slice duplicates a measure-start time-slice in this way.
NameTypeDefault AnchorReferenceTags
BarlineSymbol ChunkTimeSliceH: center of barline, V: staff originTag.lineQuality
Tag.thickness
Tag.width
NameTypeDescription
typeBYTE (1-2) 1 = thin line
2 = thick line
extends toBYTE (1-3) 1 = to bottom line of bottom staff indicated by number of staves.
2 = currently unused. (This option is a holdover from a previous version of NIFF, where the barline chunk wording was quite different. The numbering is being retained so as not to conflict with the NIFF SDK or header file.)
3 = only in spaces between staves (not through staves)
number of stavesSHORT


Beam

public static final FourByteConstant Beam
Link note stems into a metrical unit.

Normally a multi-node symbol. See Discussion Section, Multi-node Symbols for more details.
NameTypeDefault AnchorReferenceTags
BeamSymbol ChunkStemReference point of anchormulti-node symbol tags
NameTypeDescription
beam parts to leftBYTE
beam parts to rightBYTE


ChordSymbol

public static final FourByteConstant ChordSymbol
The chord symbols placed above a staff. The chord symbol offset value in the Setup Section Part Description, if any, applies to this Chord Symbol. These chunks are interspersed with the music symbols of the part in the Staff list.

Guitar slashes.

There are two types of guitar slashes. Those with rhythm indicators such as stems, flags and beams are encoded using standard Stem and Notehead chunks, with a special slash notehead shape. For a guitar slash indicating a simple repetition of a chord symbol, the Repeat Sign chunk should be used, most likely with a Chord Symbol chunk.
NameTypeDefault AnchorReferenceTags
Chord SymbolSymbol ChunkStemThe (lowest) baseline of the chord symbol text.Tag.fontID
NameTypeDescription
text descriptionSTROFFSETA case-sensitive ASCII text string that represents the chord symbol to be printed. Special characters and their meanings are as follows:
What to typeDescription
@a flat sign
#a sharp sign
-a minor sign
*a diminished symbol
%a half-diminished symbol
&a major 7 triangle
6/9the 6/9 chord suffix
/A diagonal slash for a hybrid chord, inversion or altered bass
\escape character. the next character typed appears "as is" in the chord symbol, instead of being interpreted as a functional operator (for example, type "\&" to place an ampersand in the chord symbol
_a horizontal slash for a poly chord
enclose suffixes in parenthesesstacked suffixes within braces
enclose suffixes in square bracketsstacked suffixes within brackets
enclose suffixes in angle bracketsstacked suffixes with no braces or brackets
any other textany other text

See Also:
Part

Clef

public static final FourByteConstant Clef
Indicates that the following musical symbols are to be interpreted in the specified clef. When two clefs are active on the same staff, one or more Voice ID tags can be applied to the Clef chunk to associate it with a subset of the following symbols. It is active until the end of the Staff list, unless terminated by a new Clef (perhaps with an Invisible tag), which applies to the same voice or voices.

Barlines are stored with a event time-slice chunk indicating the end of the current measure.

Chunks representing changes in clef, key signature and time-signature, when present at a measure boundary, should be stored in the same way, following the Barline chunk. Horizontal placement can be supplied to identify the individual placement of each symbol within this special time-slice, though most reading programs would have spacing algorithms to handle them adequately without it. When changes in clef, key signature or time signature occur in the middle of a measure, they should be stored with the time-slice which represents the following event. The horizontal placement of a symbol chunk in this situation, if specified, should have a negative value.

Chunks representing the clefs, key signatures and time signatures that appear at the start of the staff do not need to be preceded by an event-time-slice. They are stored immediately after the new measure-start time-slice. In the case where the new system starts in the middle of a measure, these chunks should be stored with the time-slice which represents the following event. The horizontal placement of a symbol chunk in this situation, if specified, should have a negative value.
NameTypeDefault AnchorReferenceTags
ClefSymbol ChunkTimeSliceH: Left of symbol, but center of symbol when anchor, V: clef hot spotplacement tags, Tag.voiceID
NameTypeDescription
shapeBYTE (1-6) 1 = G clef
2 = F clef
3 = C clef
4 = percussion
5 = Double G clef
6 = TAB for guitar tablature
staff stepSIGNEDBYTE Staff step of clef sign hot spot.
treble clef:
shape = G clef, staff step = 2
bass clef:
shape = F clef, staff step = 6
alto clef:
shape = C clef, staff step = 4
tenor clef:
shape = C clef, staff step = 6
guitar tablature:
shape = TAB, staff step = 8 (on a 6 line staff).
octave numberBYTE (1-4) Used to modify the shape by attaching a little "8" above or below the clef symbol. The presence of the 8 above or below transposes the staff an octave up or down.

0 = no number
1 = 8 above
2 = 8 below
3 = 15 above
4 = 15 below

See Also:
Barline

CustomGraphicChk

public static final FourByteConstant CustomGraphicChk
Used when a custom graphic is to be placed on the page, with no musical function or sound.

EPS graphics in the Custom Graphics list table are referred to by means of the Custom Graphic Symbol chunk, which represents a symbol with no musical function.
NameTypeDefault AnchorReferenceTags
Custom Graphic SymbolSymbol ChunkSystem or Page origin, depending on contextUndefinedUndefined
NameTypeDescription
valueSHORT The index into the Custom Graphic list of an EPS Graphic chunk containing a description of the graphic symbol. Used only within a page or system context. This chunk has no musical sound or function.

See Also:
Tag.customGraphicTag, CustomGraphicsList

Dynamic

public static final FourByteConstant Dynamic
Affects dynamics (velocity) of playback.

When a change in dynamic is to occur over a range (such as with values 16 - 19), the Dynamic chunk can be a multi-node symbol, indicating the start and end of the range. The Line Quality tag can be included on the start node, normally with a value of dashes.

Note:NIFF represents only the most common subset of music words and symbols with special chunks and tags. Words and symbols not in the NIFF standard - like for example "fffff" - should be represented as generic text or graphics chunks. Note that single words implying simultaneous change in both dynamics and tempo (calando, slentando, incalzando, morendo, smorzando) can be encoded as text with attached midi.
NameTypeDefault AnchorReferenceTags
DynamicSymbol ChunkPart or TimeSlice, depending on contextBottom left of text stringmulti-node symbol tags, Tag.lineQuality
NameTypeDescription
codeSHORT (1-19) 1 = pppp
2 = ppp
3 = pp
4 = p
5 = mp
6 = mf
7 = f
8 = ff
9 = fff
10 = ffff
11 = sp
12 = sf
13 = sfz
14 = fz
15 = fp
16 = cresc.
17 = crescendo
18 = dim.
19 = diminuendo


FiguredBass

public static final FourByteConstant FiguredBass
Used to describe the numerals and accidentals of a basso continuo. These chunks are interspersed with the other music symbols of the staff to which it belongs (such as in a harspichord part).
NameTypeDefault AnchorReferenceTags
Figured BassSymbol ChunkStembottom left of first symbol???
NameTypeDescription
text descriptionSTROFFSETEach chunk is composed of an ASCII character string with the following interpretation:
What to typeDescription
0-9The numerals themselves
@a flat sign
#a sharp sign
-a natural sign
\the previous numeral is altered with a slash (for chromatic alteration)
/the following characters appear at the next stacking level below

Fingering

public static final FourByteConstant Fingering
Describe which finger is used to play.
NameTypeDefault AnchorReferenceTags
FingeringSymbol ChunkNoteheadBottom left of text character???
NameTypeDescription
shapeBYTE (0-5) 0 = finger 0
1 = finger 1
2 = finger 2
3 = finger 3
4 = finger 4
5 = finger 5

Glissando

public static final FourByteConstant Glissando
Used to describe a line that functions as a glissando, a rapid swoop from a lower to a higher note passing all half-steps in between. Normally a multi-node symbol anchored to two Notehead chunks. Use the Line Quality tag to specify anything other than a wavy line.
NameTypeDefault AnchorReferenceTags
GlissandoSymbol ChunkNoteheadEndpoint of lineTag.lineQuality
Tag.thickness
NameTypeDescription
EMPTY

GuitarGrid

public static final FourByteConstant GuitarGrid
Display a fret diagram for a stringed intrument.
NameTypeDefault AnchorReferenceTags
Guitar GridSymbol ChunkTimeSliceBottom left of the grid symbol???
NameTypeDescription
number of fretsBYTE The number of frets of the guitar fingerboard represented by the grid.
number of stringsBYTE 6, for guitar. Could be another value, such as 4, for ukele. The length of the text description is the same as the number of strings (i.e., for guitar, the text description is 6 digits, ABCDEF).
text descriptionSTROFFSET A number represented as an ASCII character string ABCD..., where A refers to the lowest string, B the next, and so on. The numbers in the text description indicate on which fret the dot is to be placed. The number 9 will create an open circle above the grid indicating a higher fret. The number 0 represents an open string.

GuitarTabNum

public static final FourByteConstant GuitarTabNum
Used to indicate numbers to be placed on a guitar tablature staff.
NameTypeDefault AnchorReferenceTags
Guitar TAB NumberSymbol ChunkNoteheadCenter of bounding box of the numberTag.voiceIDTD>
NameTypeDescription
numberBYTE The ASCII representation for the number, normally 0-6.
staff step SIGNEDBYTE Indicates the string line on which the number is to be placed, specified in staff steps. For traditional guitar tablature notation, even numbers should always be used.
See Also:
StaffHeader

Hairpin

public static final FourByteConstant Hairpin
Describe dynamic changes.
NameTypeDefault AnchorReferenceTags
HairpinSymbol ChunkTimeSlice???Tag.thickness
Tag.height
NameTypeDescription
directionBYTE (0-2) 1 = open to left
2 = open to right

Normally a hairpin would be a multi-node symbol. The direction field should have a value of 0 for all nodes but the first. The Height tag can be used to specify the vertical distance between the end points on the open node.


HarpPedal

public static final FourByteConstant HarpPedal
Display a symbol indicating how a harp's strings are to be tuned, ala a Salzedo diagram.
NameTypeDefault AnchorReferenceTags
Harp Pedal SymbolSymbol ChunkTimeSliceH: left side, V: centerTag.thickness
Tag.height
NameTypeDescription
pedal positionsSTROFFSET A 7 digit ASCII character string ABCDEFG representing a Salzedo diagram, where each letter represents one of the seven harp pedals, A, B, and C on the left, and D, E, F and G on the right. Each digit can have a valueof 1, 2, or 3, depending on whether the pedal is in the bottom (sharp) position, the middle (natural) position, or the top (flat) position.

KeySignature

public static final FourByteConstant KeySignature
Standard key signatures, including cancelations.

Explicit cancellation of the previous key signature is indicated with a Key Signature chunk containing a negative value, preceding the new Key Signature chunk. The key signature affects the pitch of the notes for MIDI playback.

Barlines are stored with a event time-slice chunk indicating the end of the current measure.

Chunks representing changes in clef, key signature and time-signature, when present at a measure boundary, should be stored in the same way, following the Barline chunk. Horizontal placement can be supplied to identify the individual placement of each symbol within this special time-slice, though most reading programs would have spacing algorithms to handle them adequately without it. When changes in clef, key signature or time signature occur in the middle of a measure, they should be stored with the time-slice which represents the following event. The horizontal placement of a symbol chunk in this situation, if specified, should have a negative value.

Chunks representing the clefs, key signatures and time signatures that appear at the start of the staff do not need to be preceded by an event-time-slice. They are stored immediately after the new measure-start time-slice. In the case where the new system starts in the middle of a measure, these chunks should be stored with the time-slice which represents the following event. The horizontal placement of a symbol chunk in this situation, if specified, should have a negative value.
NameTypeDefault AnchorReferenceTags
Key SignatureSymbol ChunkTimeSliceH: left of leftmost symbol, V: staff origin???
NameTypeDescription
standard codeSIGNEDBYTE (-14-14) 0 = no sharps or flats
1-7 = 1-7 sharps
8-14 = 1-7 flats
-1 - -7 = 1-7 naturals in the sharp positions
-8 - -14 = 1-7 naturals in the flat positions

See Also:
Barline

KeySignNonstandard

public static final FourByteConstant KeySignNonstandard
Indicates the start of a nonstandard key signature.

This chunk is followed by a series of graphical chunks such as NIFF Font Symbol chunks, Custom Graphic Symbol chunks, or Text chunks, each one representing a character to be printed. The number of chunks following this one is given in the number of chunks field. The referenced chunks are to be considered only in the context of the key signature, and are otherwise devoid of function. Each referenced chunk contains its own placement information. If placement information is absent, the symbols are to be placed from left to right. The Width tag indicates the width of the entire key signature, from the left of the leftmost symbol to the right of the rightmost one.

Example: To place a sharp sign on the top line, store this chunk with a number of chunks of 1. Following it, store an Accidental chunk with a shape of sharp sign and a Staff Step tag of 8.

NameTypeDefault AnchorReferenceTags
Key Signature - NonstandardSymbol ChunkTimeSliceH: left of leftmost symbol's bounding box, V: staff origin???
NameTypeDescription
number of chunksBYTE


Line

public static final FourByteConstant Line
Add a line to a score. Normally a multi-node symbol. The Line Quality tag is used to indicate such features as dashed, dotted or wavy. For glissando or portamento functions, use Glissando or Portamento chunks.
NameTypeDefault AnchorReferenceTags
LineSymbol ChunkTimeSliceEndpoint of line at each nodeTag.anchorOverride
Tag.lineQuality
Tag.thickness
multi-node symbol tags
NameTypeDescription
shapeBYTE (0-3) Used on each node, to describe the characteristics of the line at that node.

0 = no unusual feature
1 = arrowhead at node
2 = down-jog at node
3 = up-jog at node


Lyric

public static final FourByteConstant Lyric
Display a lyrical text syllable on one of the established verse lines.

When a lyric is to be left justified rather than centered, the Reference Point Override tag can be used.

An Anchor Override to Stem can be used to relate a lyric to a chord.

NameTypeDefault AnchorReferenceTags
LyricSymbol ChunkNoteheadCenter of text stringTag.anchorOverride
Tag.refPtOverride
Tag.fontID
Tag.lineQuality
NameTypeDescription
textSTROFFSET A text string representing a word or syllable. For a lyric which extends beyond one time-slice, a multi-node lyric should be constructed. On each node but the first, the text pointer should be given the value -1. The Line Quality tag should be used on the first node, to indicate the graphical technique used to extend the word. If the word is split into two syllables, each in a separate time-slice, the text of the first syllable can be followed by a backslash "\" and then a hyphen. This indicates that a hyphen is to be horizontally centered between the two syllables.
lyric verse IDBYTE Associates this Lyric chunk with a particular Lyric Verse Offset tag on the Setup Section Part Description. If there is more than one Lyric within a Time-Slice, the Lyric Verse ID must be different on each.


MeasureNumbering

public static final FourByteConstant MeasureNumbering
Used to set or change the measure numbering scheme anywhere in the score. Stored after a measure-start Time-Slice chunk in the first Staff list of a System list. The instructions given in this chunk are in effect until the end of the score, or until the next Measure Numbering chunk, whichever comes first.

The numbering of alternate endings is left to the default of the reading program, unless explicitly indicated by the writing program with Measure Numbering chunks.

Only logical placement options can be specified for this chunk. If precise placement of numbers is desired, use the Rehearsal Mark chunk instead.

The Measure Numbering chunk is used to assign a measure numbering scheme. It allows for choice of the numbering frequency, starting number, and logical placement of the measure numbers. The measure numbering scheme can be changed at the start of any measure in the score, by storing this chunk after the appropriate measure-start Time-Slice chunk in the first Staff list of a System list.

For precise placement of individual numbers, or to use letters instead of numbers, use the Rehearsal Mark chunk instead.
NameTypeDefault AnchorReferenceTags
Measure NumberingSymbol ChunkNoteheadCenter of text stringTag.anchorOverride
Tag.refPtOverride
Tag.fontID
Tag.lineQuality
NameTypeDescription
number which measuresBYTE (0-3) 0 = no measure numbering
1 = use number frequency field
2 = number start of each system
3 = number start of each page
number frequencyBYTE (1+) How frequently measure numbers are to appear. 1 means every measure, 2 means every other measure, etc.
starting numberSHORT The number to be used for the measure starting with the current measure-start Time-Slice.
font IDFONTIDX The font, size and style to be used for measure numbers.
above or belowBYTE (0-1) 0 = above top staff of system
1 = below bottom staff of system
horizontal centeringBYTE (0-3) 0 = centered at barline
1 = to left of barline
2 = to right of barline
3 = to left of start of system (number which measures = 2 or 3 only)
enclosureBYTE (0-2) 0 = none
1 = box
2 = circle

See Also:
RehearsalMark

MidiDataStream

public static final FourByteConstant MidiDataStream
Lengthy or complex MIDI information that cannot be represented with the simple MIDI Performance tag can be supplied with the MIDI Data Stream chunk.

This chunk is used to record a free-form stream of MIDI events. When its sound is associated with more than one notational symbol, it is a multi-node symbol, with each node anchored to a symbol chunk. In this case, its first node contains the full MIDI data stream in the value field, and all other nodes contain a null value field. Otherwise it contains only one node. It replaces any explicit or implied MIDI Performance of the chunks to which it is anchored. If anchored to a Time-Slice, it is independent of any notational element.

A complete MIDI file can be integrated into a NIFF file.

In the Setup Section, each part can globally be assigned a MIDI channel number and cable number in the Part Description chunk. The part can be given a new set of channel and cable numbers at any point during the score by applying the Part Description Override tag. This might be used to switch to a new instrument sound, such as in a part for oboe and English horn.

In the Data Section, the MIDI Data Stream chunk and MIDI Performance tag are used. There are four possible relationships between the notation symbols and MIDI data:

  1. One to one correlation - notes. In the case of the pairing of a Notehead chunk and a Note On message, the MIDI Performance tag is appended to the Notehead chunk. The MIDI Performance tag includes the pitch and velocity of a MIDI Note On message, plus the performance start time and duration in MIDI ticks. The start time is given as an offset from the current time-slice.
  2. One symbol, one or more MIDI messages. For example, a dynamic associated with a control change message, a hairpin associated with a controller 7 sweep or a turn or a trill symbol associated with a series of Note On and Note Off messages. This is represented by a MIDI Data Stream chunk anchored to a music symbol chunk. The MIDI Data Stream chunk indicates the start time of the beginning of the stream, in MIDI ticks, as an offset from the current time-slice. It includes any number of MIDI events, stored as in a MIDI file, starting at time zero.
  3. Many to many correlation, where the number of symbol chunks is different from the number of MIDI messages. For example, a pitch bend might be associated with portamento notation composed of two Notehead chunks and the diagonal line Portamento chunk between them. In this case, the MIDI Data Stream is made into a multi-node symbol, with each node corresponding to one of the notation symbols. Only the first node contains the actual series of MIDI Pitch Bend Change messages.
  4. No correlation. Either the notation has no clear MIDI meaning (for example a text string like "espressivo"), or the MIDI data has no standard notational equivalent (like panning information). The latter case is represented by a MIDI Data Stream chunk anchored to a Time-Slice. It may or may not be associated with a particular part.
NameTypeDefault AnchorReferenceTags
MIDI Data StreamSymbol ChunkPreceeding ChunkN/Amulti-node symbol tags
NameTypeDescription
start timeBYTE Start time of the stream, given in MIDI ticks, as an offset from the logical start time of its anchor.
valueBYTE[] The MIDI SMF data stream. Its length is equal to the chunk size minus 1.
See Also:
Tag.midiPerformance

FontSymbol

public static final FourByteConstant FontSymbol
A standard music font character that is to be placed on page or system outside of a staff, without its normal sound or function. Any of the music symbols normally indicated with a music symbol chunk can be represented this way. This chunk can be used within a Page list or a System list but not in a Staff list. One example of its use is withiin the list of characters following a Tempo Marking Nonstandard chunk.

For notes and stems, use the normal syntax of a stem followed by one or more notes, with the Height tag optionally added to the stem to indicate its precise length. The same tags can be added to the NIFF Font Symbol chunk as to the ordinary music symbol chunks, such as Number of Flags, and Small Size.

The NIFF Font Symbol chunk is a font-independent method of indicating the appearance of a music symbol without its musical function.

An alternative to the Custom Graphic Symbol chunk, it can be used to indicate that an ornament or clef sign, for example, is to appear in a particular place on a page such as a footnote, without specifying any particular font.

The generic "NIFF Font" is composed of the four character code for the music symbol chunk normally used to display the symbol, and the shape, if any, for the desired symbol in that chunk's definition.
NameTypeDefault AnchorReferenceTags
NIFF Font SymbolSymbol ChunkSystem or Page originMiddle of symbol's bounding box???
NameTypeDescription
chunk typeFOURCC The four character chunk type of the music symbol, such as STEM, NOTE, ORNM, or ARTC.
space heightSHORT The size of the character, given as the height in absolute units of a space on a staff on which the character would appear of normal size.
shapeBYTE The value of the shape field in the chunk of type chunk type. For example, for a filled notehead, the value of shape would be 4. If there is no shape field on the referenced music symbol, leave shape 0 on this chunk.


Notehead

public static final FourByteConstant Notehead
Display a notehead, which is usually interpreted as a note to be played.

The Notehead and Stem chunks and associated chunks and tags contain graphical features such as notehead shape, number of dots and number of flags that in printed music describe a note's duration. However, the reading program need not concern itself with the timing implications of these details. The duration field stored on the Notehead chunk should be used for the timing value, regardless of the graphical features. For example, a note with duration of 3/16 could appear visually as a dotted eighth note with either a flag or a beam. In practice, any combination of a note's graphical features, or even an invisible note on a zero length stem, could be used to represent any time value.

The performance playback values may be affected by other chunks and tags associated with the Notehead or Stem chunks, however. For example, an Accidental chunk will affect the pitch, an Articulation chunk or Silent tag might affect the performance duration, and a Grace Note tag would likely affect the start time.

An event's start time and duration are always present (each composed of a numerator and denominator component); the performance start time and duration are optional values that can be supplied on the MIDI Performance tag. If not present, it is assumed that the performance values are equivalent to the logical values.

Guitar slashes.

There are two types of guitar slashes. Those with rhythm indicators such as stems, flags and beams are encoded using standard Stem and Notehead chunks, with a special slash notehead shape. For a guitar slash indicating a simple repetition of a chord symbol, the Repeat Sign chunk should be used, most likely with a Chord Symbol chunk.

Reference points on Noteheads and Stems.

As stated earlier, the Notehead and Stem chunks both use the Time-slice as their anchor in terms of symbol placement. This means that the offsets of the Notehead and Stem chunks are both given in relation to the time-slice.

The default reference point of a Notehead is its center. A horizontal offset of zero on a note chunk thus means it is horizontally centered over the time-slice. This would also be the default position, on an individual note or on a chord without seconds. When a chord contains a second, the notes on the "correct" side of the stem are by default to be centered over the time-slice. This allows for the correct alignment of simultaneous up-stem and down-stem chords which both contain seconds.

When both a normal size notehead and a small size notehead are both present on the same stem, it is the normal size notehead that is centered over the time-slice.

Diagram D
The time-slice is centered under the two notes to the left of the up-stem, and the two notes to the right of the down-stem.

NameTypeDefault AnchorReferenceTags
NoteheadSymbol ChunkTimeSliceMiddle of symbol's bounding boxTag.partID
Tag.voiceID
Tag.midiPerformance
Tag.smallSize
Tag.largeSize
Tag.splitStem
Tag.graceNote
Tag.silent
Tag.invisible
placement tags
NameTypeDescription
shapeBYTE (1-14) 1 = breve (double whole) 2 = whole 3 = half (open) 4 = filled (solid) 5 = open diamond 6 = solid diamond 7 = x notehead 8 = open x notehead 9 = filled guitar slash 10 = open guitar slash 11 = filled square 12 = open square 13 = filled triangle 14 = open triangle
staff stepSIGNEDBYTE
durationRATIONAL


OctaveSign

public static final FourByteConstant OctaveSign
Cue to play one or two octaves higher or lower.

Normally a multi-node symbol indicating that all symbols in the Staff list between the first and last nodes are to be performed one or two octaves higher or lower than as written, or, in the case of coll' ottava, are to be doubled at the octave above or below. Only a starting and ending node are required, unless the octave marking extends beyond a system boundary (see multi-node symbols). One or more Voice ID or Part ID tags can be appended to the first node, indicating that only the specified voices or parts are affected. The function is active until its final node is encountered in the file. On all nodes but the first, the meaning of the fields can be ignored, and should be stored as null. Placement tags are used to indicate where the symbol appears in relation to the staff. The Line Quality tag should be used if anything besides a dashed line is desired.
NameTypeDefault AnchorReferenceTags
Octave SignSymbol ChunkMulti-node symbolMiddle of symbol's bounding boxTag.lineQuality
NameTypeDescription
number of octavesBYTE Normally 1 or 2.
above or belowBYTE (1-2) To be performed above or below the notated symbols.

1 = above
2 = below

typeBYTE 1 = notated symbols to be transposed one or more octaves
2 = notated symbols to be doubled (coll' ottava)
text stringSTROFFSET The text string appearing at its start, such as "8va" or 8 or "8a alta"


Ornament

public static final FourByteConstant Ornament
Decorations such as trills, turns and mordents.

Accidental chunks may be anchored to an ornament, with placement tags indicating above or below, usually with a Small Size tag. The long trill symbols (shapes 10, 11, 12) are multi-node, anchored to the start and end anchors of the trill.

NameTypeDefault AnchorReferenceTags
OrnamentSymbol Chunk Stem or Multi-node symbolMiddle of symbol's bounding box???
NameTypeDescription
shapeSHORT (1-12) 1 = mordent
2 = inverted mordent
3 = double "long" mordent
4 = inverted double "long" mordent
5 = turn
6 = inverted turn
7 = trill (spelled "tr")
8 = trill (short symbol - 2 bumps)
9 = trill (short symbol - 3 bumps)
10 = trill (long wavy line)
11 = long trill with up-hook at start
12 = long trill with down-hook at start


Parenthesis

public static final FourByteConstant Parenthesis
Left or Right or Both parenthesis/es, brace/s or bracket/s.

The default size of the symbol(s) is the reading program's default for the given context. By default symbols 1, 3 and 5 should be placed to the left of the anchor, and symbols 2, 4, and 6 to the right of the anchor.

A Parenthesis can be a multi-node symbol, for instance when parentheses surround a series of staccatos over a series of notes. This would allow the sequence of staccatos to be understood as logically grouped by the parentheses.

NameTypeDefault AnchorReferenceTags
ParenthesisSymbol Chunk Preceding Symbol Chunk or Multi-node symbolBottom left of text characterMulti-node symbol tags
NameTypeDescription
shapeBYTE 1 = left parenthesis '('
2 = right parenthesis ')'
3 = left curly brace '{'
4 = right curly brace '}'
5 = left bracket '['
6 = right bracket ']'
7 = left and right parentheses surround anchor
8 = left and right braces surround anchor
9 = left and right bracket surround anchor


PedalPiano

public static final FourByteConstant PedalPiano
Depressing a Pedal which alters timbre or other property of instrument.

Normally a multi-node symbol with two nodes, the starting node indicating where to depress the pedal, and the ending node indicating where to release it. Each node should use the appropriate shape byte. For half-pedal markings, a node should be stored at each time-slice where the line has a notch.
NameTypeDefault AnchorReferenceTags
Pedal (Piano)Symbol ChunkMulti-node symbolUndefinedMulti-node symbol tags
NameTypeDescription
shapeBYTE (0-11) 0 = no graphic (for last node, when no graphical symbol appears there)
1 = "Ped." (graphic)
2 = Asterisk (*) indicating end of damper pedal
3 = alternate end of damper pedal symbol (circle with cross-hairs)
4 = horizontal line with up-jog at this node
5 = horizontal line with down-jog at this node
6 = upslanted line with up-jog at this node
7 = upslanted line with down-jog at this node
8 = notch in line at this node
9 = "una corda" text
10 = "tre corde" text
11 = "S.P. " text (sostenuto pedal)


PedalOrgan

public static final FourByteConstant PedalOrgan
Represents equivalent of "fingering" on a chromatic, foot-operated keyboard.

This chunk is interspersed with the music symbols on the organ pedal staff. The Logical Placement tag is used to place these symbols above or below the staff, to indicate right foot or left foot. The line or slur sometimes connecting two organ pedal symbols is represented by multi-node Line or Slur chunks anchored to the organ Pedal chunks.
NameTypeDefault AnchorReferenceTags
Pedal (Organ)Symbol ChunkStemCenterTag.logicalPlacement
NameTypeDescription
shapeBYTE (1-4) 1 = heel (u shape) 2 = heel (o shape) 3 = toe ( up-pointed wedge) 4 = toe (down-pointed wedge)


Portamento

public static final FourByteConstant Portamento
Used to describe a line that functions as a portamento, a rapid swoop from a lower to a higher note smoothly over all intervening frequencies. Normally a multi-node symbol anchored to two Notehead chunks. Use the Line Quality tag to specify anything other than a straight line.
NameTypeDefault AnchorReferenceTags
PortamentoSymbol ChunkNotehead (Multi-node)Endpoint of lineTag.lineQuality
Tag.thickness
NameTypeDescription
EMPTY

RehearsalMark

public static final FourByteConstant RehearsalMark
The rehearsal letters or numbers placed above a staff. The rehearsal mark offset in the Setup Section Part Description, if any, specifies the default vertical placement for this rehearsal mark. Rehearsal Mark chunks are interspersed with the music symbols of the part in the Data Section Staff list.
NameTypeDefault AnchorReferenceTags
Rehearsal MarkSymbol ChunkTimeSliceTop-left of bounding boxTag.fontID
placement tags
NameTypeDescription
text stringSTROFFSET The letter(s) or number(s).
enclosureBYTE (0-2) 0 = none 1 = box 2 = circle

RepeatSign

public static final FourByteConstant RepeatSign
Logical and graphical components of a repeat sign. Indicates the start or end of a section to be repeated, or the repetition of a previous beat, measure or measures.

A text chunk should be anchored to this chunk if a number over a slash repeat sign is to appear here.

For "bis" surrounded by brackets, logical codes 1 and 2 should be used at the start and end of the section, respectively, with graphical code zero. The graphical elements (brackets and the word "bis") should be constructed with Line and Text chunks.

A repeated section of a score appears in the NIFF file only once. A Repeat Sign symbol contains information about both the graphical repeat sign and its function. It follows a Time-slice chunk (either measure-start or event type) at either the beginning or the end of the section to be repeated. The Repeat Sign chunk can be used for many kinds of repetition. It can indicate the appearance of symbols, printed words, or abbreviations, and the repetition of a beat, measure or whole section.

Alternate endings introduce an apparent timing inconsistency: the start times in the measures of later endings duplicate the start times of measures in the first ending. To allow the reading program to make sense of this inconsistency, each measure-start Time-slice chunk of each ending is to have an Alternate Ending tag attached. When calculating the start time of the time-slice following a series of alternate endings, only the longest of the alternate endings should be considered.

There would normally also be an Alternate Ending Graphic chunk which indicates the appearance of the alternate ending, at least on the topmost staff. But it is the Alternate Ending tag which definitively resolves the timing conflict.
NameTypeDefault AnchorReferenceTags
Rehearsal MarkSymbol ChunkTimeSliceTop-center of symbol???
NameTypeDescription
graphical codeSHORT (0-18) 0 = no graphical symbol - this is only a logical chunk
1 = Segno symbol :S:
2 = Coda symbol (circle with crosshairs)
3 = one slash (such as with logical code 3 or 7)
4 = 2 slashes (such as with logical code 3)
5 = 3 slashes (such as with logical code 3)
6 = 2 slashes with dot on either side (such as with logical code 3)
7 = 1 slash with dot on either side (such as with logical code 4)
8 = 1 slash with dot on either side, and barline through it (such
as with logical code 5)
9 = 2 slashes with dot on either side, and barline through it
(such as with logical code 5)
10 = Repeat dots - use Barline chunk(s) with this
11 = "D.C."
12 = "D.C. al Fine"
13 = "D.C. al Segno"
14 = "D.C. al Segno e poi la Coda"
15 = "D.S."
16 = "D.S. al Fine"
17 = "Fine"
18 = "Coda"
logical codeBYTE (0-7) 0 = no repeat function - this is only a graphical chunk
1 = beginning of section to be repeated
2 = end of section to be repeated
3 = repeat the previous beat
4 = repeat the previous measure
5 = repeat the previous two measures
6 = function as described by words (graphical codes 11 - 18)
7 = repeat chord indicated by associated Chord Symbol for one beat

See Also:
Tag.altEnding, AltEndingGraphic

Rest

public static final FourByteConstant Rest
Display a logical silence, which otherwise has the semantics of a note.
NameTypeDefault AnchorReferenceTags
RestSymbol ChunkTimeSliceHot-spot of rest???
NameTypeDescription
shapeBYTE (1-15) 1 = breve (double whole)
2 = whole
3 = half
4 = quarter
5 = eighth
6 = sixteenth
7 = 32nd
8 = 64th
9 = 128th
10 = 256th
11 = multiple rest symbol - 4 measures
12 = multiple-measure rest - thick horizontal bar (normally used with dependent text chunk containing a number, and possibly with Width and Thickness tags)
13 = multiple-measure rest - thick slanted bar (same options as shape 12)
14 = vocal breath mark (comma)
15 = vocal breath mark (2 small slashes)
staff stepSIGNEDBYTE
durationRATIONAL

Slur

public static final FourByteConstant Slur
A musical slur between two notes of different pitch.

A simple slur is a multi-node symbol with start and end nodes. The Tie Direction tag can be used on the first node of the slur to indicate whether the slur is bowed up or down. The standard placement tags when used on each slur node, indicate the placement of the slur endpoint relative to its anchor. Bezier Incoming and Bezier Outgoing tags can be used to specify Bezier control points for each node. A complex slur can be built by storing any number of slur nodes, each with its own Bezier Incoming and Outgoing control points.

Note: If a dependent symbol is centered relative to a 2 node slur, the slur's horizontal reference is the center, and the vertical reference is the lowest or highest point of the arc, for slurs bowed downward or upward, respectively. Centering of dependent symbol is undefined for cross-system slurs (which have more than two nodes).

NameTypeDefault AnchorReferenceTags
SlurSymbol ChunkStemThe slur's end point. (See Notes above.)Tag.tieDirection
Tag.bezierIncoming
Tag.bezierOutgoing
multi-node symbol tags
NameTypeDescription
EMPTY


Stem

public static final FourByteConstant Stem
Display a stem for creating of chords at the same time-stamp.

Multi-staff chords.

When a stem contains notes on more than one staff, the stem is represented by a multi-node symbol. Each staff on which a portion of the stem appears has its own Stem node chunk. The first node contains the tags which affect all the nodes, such as Number of Flags.

Because the ID tag is unique within the chunk type for the entire score, the ID tag is sufficient to identify the related stem nodes in the different staves.

Here is an example:

Diagram C

Example:

(Staff 1) Time-slice. type=event, start-time=0/8     Rest, duration=1/8 Time-slice. type=event, start-time=1/8     Rest, duration=1/8 Time-slice. type=event, start-time=2/8     Stem, ID=1, Number of nodes=2         Notehead, staff step=2, duration=1/4         Notehead, staff step=-1, duration=1/4

(staff 2) Time-slice. type=event, start-time=0/8     Stem         Notehead, staff step=6, duration=1/8 Time-slice. type=event, start-time=1/8     Stem         Notehead, staff step=6, duration=1/8 Time-slice. type=event, start-time=2/8     Stem, ID=1         Notehead, staff step=7, duration=1/4

NameTypeDefault AnchorReferenceTags
StemSymbol ChunkTimeSliceEnd point of stem (where the flag or beam would be attached).Tag.partID
Tag.voiceID
Tag.height
Tag.smallSize
Tag.largeSize
Tag.graceNote
Tag.silent
placement tags
multi-node symbol tags
NameTypeDescription
EMPTY

SystemSeparation

public static final FourByteConstant SystemSeparation
Used in ensemble scores to vertically separate systems. Should be stored immediately following the System Header chunk.
NameTypeDefault AnchorReferenceTags
System Separation MarkSymbol ChunkSystem originCenter of symbol's bounding box???
NameTypeDescription
whereBYTE (1-2) 1 = placed at left margin
2 = placed at right margin

Corrected from NIFF 6a where this field was called margin.


TagActivate

public static final FourByteConstant TagActivate
This chunk can be stored at the start of a series of chunks to indicate that each of its tags are to be applied to all of the chunks appearing between it and a matching Tag Inactivate chunk. If a Part ID or Voice ID tag appears on it, this restricts its scope to chunks of that part or voice.

When one or more tags is to be applied to a sequence of symbols in a Staff list, the Tag Activate chunk can be used to identify the start of the sequence, and the Tag Inactivate chunk to identify the end of the sequence. Each tag is activated independently of the others, but they can be grouped together on the Tag Activate/Inactivate chunks. For example, the Tag Activate may include the Font ID, Small Size and Grace Note tags, while one Tag Inactivate chunk ends the Grace Note tag long before the other two tags are ended with another Tag Inactivate chunk.

A tag on a Tag Activate chunk remains in effect until a Tag Inactivate chunk appears with the same tag, or the end of the current Staff list is found, whichever occurs first. Tag Activate chunks can also be nested.

The Tag Activate chunk is useful for saving space, but another purpose is to allow for additive applications of a particular tag - such as when a very small grace note is present within a cadenza-like passage of small notes. This example is shown below:

Time-Slice, type=event
    Stem
        Notehead (a)
Tag Activate, Small Size
Time-Slice, type=event
    Stem
        Notehead
Time-Slice, type=event
    Stem, Grace Note, Small Size
        Notehead (b)
    Stem
        Notehead (c)
Time-Slice, type=event
    Stem
        Notehead
Tag Inactivate, Small Size
Time-Slice, type=event
    Stem
        Notehead (d)

Notehead (a) before the Tag Activate chunk and Notehead (d) after the Tag Inactivate chunk are normal sized. Notehead (c) is a small note, affected by the Small Size tag on the Tag Activate chunk. Notehead (b) is a very small note, affected cumulatively by the Small Size tag on its Stem and by the Small Size tag on the Tag Activate chunk.

Tag Activate restricted by Part ID, Voice ID

Part ID and Voice ID have a special meaning on the Tag Activate chunk. When Part ID and/or Voice ID appear on the Tag Activate chunk, their purpose is to restrict the action of the Tag Activate to the subset of the intervening chunks which have matching Part ID and/or Voice ID's. If any intervening chunks have a different Part ID or Voice ID from that specified on the Tag Activate chunk, those chunks are not affected by the Tag Activate.

The following example shows use of the Voice ID to restrict the mode to one voice only:

Tag Activate, Voice ID=2, Small Size
Time-slice
    Stem, Voice ID = 1
        Notehead (a)
    Stem, Voice ID = 2
        Notehead (b)
Tag Inactivate, Voice ID=2, Small Size

Only Notehead (b) is affected by the Small Size tag on the Tag Activate chunk.

N.B. For some chunks within the Tag Activate scope, the tags would be meaningless and should be ignored by the reading program. An example is the Small Size tag as applied to a Time-Slice chunk.
NameTypeDefault AnchorReferenceTags
Tag ActivateSymbol ChunkN/AN/A???
NameTypeDescription
EMPTY


TagInactivate

public static final FourByteConstant TagInactivate
This chunk is used to end the application of tags started with a Tag Activate chunk. Each tag can be ended independently of the others with its own Tag Inactivate chunk, or they can be grouped together.
NameTypeDefault AnchorReferenceTags
Tag InactivateSymbol ChunkN/AN/A???
NameTypeDescription
EMPTY
See Also:
TagActivate

TempoMarking

public static final FourByteConstant TempoMarking
A standard tempo marking either in the form [note] = [metronome setting], or text tempo instructions.

Example: [dotted quarter] = 72

text string: -1
note value: 3/8
beats per minute: 72
NameTypeDefault AnchorReferenceTags
Tempo MarkingSymbol ChunkTimeSliceBottom left of bounding boxTag.fontID
NameTypeDescription
text stringSTROFFSET Used for text instructions such as "Allegretto". If ia special font or italics are required, append the Font ID tag.
note valueRATIONAL The note value representing one beat. See discussion of Timing Representation for values. If only text is desired, leave this 0/0.
beats per minuteSHORT The metronome setting, where one beat is equal to a note with duration of note value. If only text is desired, leave this 0.

TempoMarkNonstandard

public static final FourByteConstant TempoMarkNonstandard
Indicates the start of a tempo marking. This chunk is followed by a series of graphical chunks such as NIFF Font Symbol chunks or Text chunks, each one representing a symbol or word to be printed. The number of chunks following this one is given in the number of chunks field. The referenced chunks are to be considered in the context of the tempo marking, and are otherwise devoid of function. Each referenced chunk contains its own placement information. If placement information is absent, the symbols are to be placed from left to right. The Width tag indicates the width of the entire tempo marking, from the left of the leftmost symbol to the right of the rightmost one.

Example: Allegro moderato (M.M. [dotted eighth note] = 72)

Tempo Marking Nonstandard, number of chunks = 5
    Text, string="Allegro moderato (M.M."
    NIFF Font [Stem]
    NIFF Font [Notehead, shape=4], number of flags=1
    NIFF Font [Augmentation Dot]
    Text, string = "= 72)"
NameTypeDefault AnchorReferenceTags
Tempo Marking - NonstandardSymbol ChunkTimeSliceBottom left of bounding boxTag.width
placement tags
NameTypeDescription
number of chunksBYTE

Text

public static final FourByteConstant Text
A text string. By default, the bottom left of the text string is placed at the anchor's reference point. The Font ID tag can be used to specify the font. Text can be centered or justified by use of the Reference Point Override tag.
NameTypeDefault AnchorReferenceTags
TextSymbol ChunkTimeSliceBottom left of bounding boxTag.fontID
placement tags
NameTypeDescription
valueSTROFFSET

Tie

public static final FourByteConstant Tie
Tie two noteheads into a composite note.

Note: If a dependent symbol is horizontally centered relative to a tie, the tie's horizontal reference is the center, and the vertical reference is the lowest or highest point of the arc, for slurs bowed downward or upward, respectively.

NameTypeDefault AnchorReferenceTags
TieSymbol ChunkNoteheadThe tie's end point. (See Notes above.)Tag.tieDirection
Tag.bezierIncoming
Tag.bezierOutgoing
multi-node symbol tags
NameTypeDescription
EMPTY


TimeSignature

public static final FourByteConstant TimeSignature
Represent a simple time signature. Time Signatures are not fractions. They do have a top number and bottom number, however. The common non-numeric time signatures are represented as follows:
"common time" symbol: top number = -1, bottom number = -1
"cut time" symbol: top number = -2, bottom number = -1

For a single number time-signature, use the top number, and set the bottom number to -1. To place an ordinary time-signature above the staff, use the Logical Placement tag, vertical component = above. To place it between the staves, use the Logical Placement tag, vertical component = below, and omit the Time Signature chunk in the lower staff.

NIFF does not require logical adherence to time signatures.

Barlines are stored with a event time-slice chunk indicating the end of the current measure.

Chunks representing changes in clef, key signature and time-signature, when present at a measure boundary, should be stored in the same way, following the Barline chunk. Horizontal placement can be supplied to identify the individual placement of each symbol within this special time-slice, though most reading programs would have spacing algorithms to handle them adequately without it. When changes in clef, key signature or time signature occur in the middle of a measure, they should be stored with the time-slice which represents the following event. The horizontal placement of a symbol chunk in this situation, if specified, should have a negative value.

Chunks representing the clefs, key signatures and time signatures that appear at the start of the staff do not need to be preceded by an event-time-slice. They are stored immediately after the new measure-start time-slice. In the case where the new system starts in the middle of a measure, these chunks should be stored with the time-slice which represents the following event. The horizontal placement of a symbol chunk in this situation, if specified, should have a negative value.
NameTypeDefault AnchorReferenceTags
Time SignatureSymbol ChunkTimeSliceH: center of bounding box, V: staff originTag.smallSize
Tag.largeSize
placement tags
NameTypeDescription
top numberSIGNEDBYTE
bottom numberSIGNEDBYTE

See Also:
Barline

TimeSigNonstandard

public static final FourByteConstant TimeSigNonstandard
Indicates the start of a nonstandard time signature. This chunk is followed by a series of graphical chunks such as NIFF Font Symbol chunks, Custom Graphic Symbol chunks, or Text chunks, each one representing a character to be printed. The number of chunks following this one is given in the number of chunks field. The referenced chunks are to be considered only in the context of the time signature, and are otherwise devoid of function. Each referenced chunk contains its own placement information. If placement information is absent, the symbols are to be placed from left to right. The Width tag indicates the width of the entire key signature, from the left of the leftmost symbol to the right of the rightmost one.

A special case of the Time-Signature - Nonstandard chunk is when it has a single text chunk starting with the backslash character "\". In this case, the ASCII string following the backslash is a string of numbers and '+', '/' and ' ', interpreted as follows:

'+'
represents the literal plus sign
'/'
means place the previous number(s) above the following number(s)
' '
means leave space between the previous and following number(s).
NameTypeDefault AnchorReferenceTags
Time Signature - NonstandardSymbol ChunkTimeSliceH: Left or leftmost symbol's bounding box, V: staff origin???
NameTypeDescription
number of chunksBYTE

Tremolo

public static final FourByteConstant Tremolo
Display a tremolo marking.

Normally multi-node with two nodes. For a single stem tremolo with slashes through the stem, there will be a single node, with attached beam parts containing the number of slashes, and unattached beam parts zero. For whole note tremolos, set attached beam parts to zero, and use unattached beam parts. The presence of a Tremolo chunk affects the playback of the related Notehead chunk. The duration on each Notehead should be assigned such that the total duration of all Noteheads belonging to the tremolo equals the total duration of the notes on playback.

See Tag.slashedStem Tag for other types of slashes.
NameTypeDefault AnchorReferenceTags
TremoloSymbol ChunkStem or multi-nodeReference point of anchormulti-node symbol tags
NameTypeDescription
attached beam partsBYTE The number of beams attached to the stem (primary beams).
unattached beam partsBYTE The number of beams not attached to the stem (secondary beams).


Tuplet

public static final FourByteConstant Tuplet
Tuplet. A tuplet node chunk is placed with each stem or rest belonging to the tuplet. Normally a multi-node symbol. TheTuplet Description tag is required on the first node.

A tuplet is normally a multi-node symbol, represented by a series of Tuplet node chunks, each one associated with one Stem chunk. All notes on a tupletized stem must contain the same duration.

Nested tuplets are represented by an additional tuplet associated with a subset of notes already included in a tuplet. The transformation ratios are applied cumulatively to each affected note.

More than one voice or part can be included in a tuplet. For example, when all horns shown on the same staff are playing in rhythmic unison, a whole collection of chords may be tupletized. However, within each voice (or part, if there is one voice per part), the sum of the durations of the notes must equal a b-type notes.

NameTypeDefault AnchorReferenceTags
TremoloSymbol ChunkStem or multi-nodeUndefinedTag.tupletDesc
multi-node symbol tags
NameTypeDescription
EMPTY

See Also:
Tag.tupletDesc

UserDefined

public static final FourByteConstant UserDefined
Provide for a user defined chunk for vendor-specific expansion.

NIFF users such as commercial software vendors and academic researchers can define their own NIFF chunks, to provide for features of their software that are not present in the NIFF specification. NIFF users who want to define their own chunks must formally register a unique two byte NIFF User ID, using a protocol yet to be developed.

User-defined chunks are identified by the four character code "user". The two byte NIFF User ID is stored in the first two bytes of the chunkData field. The user defines the structure and value of the remainder of the data portion of the chunk tag. The presence of the size field allows reading programs to ignore unrecognized user-defined chunks.

The Chunk Length Table in the Setup Section must include an entry for each user-defined chunk type as well as for each standard NIFF chunk type used in the file.

NIFF users should clearly document the structure and function of each user-defined chunk. The details of administering a documentation library have yet to be determined.
NameTypeDefault AnchorReferenceTags
User DefinedNIFF ChunkVariesUndefinedNot allowed.
NameTypeDescription
NIFF User IDSHORTAssigned by the NIFF authority.


defaultTable

private static java.util.Map defaultTable

defaultOrder

private static java.util.List defaultOrder

noDefinedChunkLength

public static final java.lang.Integer noDefinedChunkLength

table

private java.util.Map table

order

private java.util.List order
Constructor Detail

ChunkLengthTable

public ChunkLengthTable()
Method Detail

static void ()

put

public void put(FourByteConstant fcc,
                int length)

put

public void put(FourByteConstant fcc,
                java.lang.Integer length)

put

public void put(FourByteConstant fcc)

getNumber

public java.lang.Integer getNumber(FourByteConstant fcc)

get

public int get(FourByteConstant fcc)

iterator

public java.util.Iterator iterator()

size

public int size()
Return the number of entries in a chunk length table.

verifyDefaults

public java.lang.String verifyDefaults()
Make sure our canned CLT entries jive with a given chunk length table.

makeDefaultEntries

public static ChunkLengthTable makeDefaultEntries()
Fill a chunk length table with "canned" entries. Fills an existing chunk length table with a complete set of chunk length entries for each chunk in the NIFF specification.

DixShtix