Previous | Up | Home | Next

The Setup Section

The only required items in the Setup Section are the NIFF Information chunk, the Chunk Length Table, and the Parts list. Optional items in the Setup Section are the standard RIFF INFO list, the String Table, the Staff Groupings list, the Default Values chunk, the Font Descriptions list, and the Custom Graphics list. The required and optional components of each list must appear when present in the order described in Chapter 3, unless "in any order" is specified in the list's definition.

The NIFF Information chunk. 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".

The Chunk Length Table. The purpose of this is to allow for future changes in the fixed length part of the chunk structures, without disturbing existing programs. 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.

The Parts list. This list is composed of a series of Part Description chunks, each of which 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 Staff Groupings list.

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.

The Staff Groupings list is a series of Staff Grouping chunks, each of which 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 Staff Groupings list 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.

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.

Fonts and Custom Graphics.

This section discusses the Font Descriptions list, the Custom Graphics list, and the related structures that allow the writing program to store and use special fonts and graphics in a NIFF file.

The Font Descriptions list is an optional table in the Setup Section that is composed of a series of Font Description chunks, each of which defines a particular combination of font name, font size, and font style. Font Description chunks in the Font Descriptions list are referred to elsewhere in the file by means of the FONTPTR data type.

The FONTPTR 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. FONTPTR 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, FONTPTR 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 Custom Graphics list is an optional table in the Setup Section that is used to store fonts and custom graphics. Fonts are stored as PostScript Type 1 or Type 3 font, and graphics are stored in EPS (encapsulated PostScript) format. 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.

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.


Previous | Up | Home | Next