Introduction ``manx'' is a muscial notation program written in Forth. Inspired by a remark of Marcel Hendrix, the writer of the original ``manx'' package, I rethought what I wanted to do with that that package. What I want to do is, play the musical scores created -- mainly -- by Albert Nijhof using a reasonably portable Forth program on he tingle tangles. I dropped two of the main ideas behind my efforts of the last three years. I don't keep any of the functionality besides playing on the tingle tangles. I don't intend to be true to the original score language or the original design of the program. In particular any notation that is irrelevant to the tingle tangles can be dropped and a notation that allows for a simpler program will be adopted. For lack of a better name this is called minimanx. Project note. As a project minimanx has the goal to allow for the execution of all known musical scores originally intended for the tingle tangles, on both ciforth and gforth. Design notes General A musical piece consists of parts, most of the time. Here we will consider each part of a piece as separate and call it a score. (If we ever want to need to refer to the trio part of Beethovens 11th piano sonate, we will call it the third ``mouvement''.) What is played by one player we will call a ``part'' (Dutch ``partij''). (And note that this is different from the above notion of a part.) A part may very well be polyphonic and mostly it is. But it is one instrument, meaning that the tones sounds similar. We call this a ``voice''. (Note that if we program a midi box to have a strings ensemble and a harpsichord play in unison we will call this one voice. This is in defiance of midi, where it would be called two voices.) Each part is divided into measures called ``bars''. Measures contains ``notes''. These may be of a duration and pitch prescibed by the composer, or they may be percussion notes, where neither can be influenced. Non percussion notes we will call ``normal'' notes. The voice of a percussion note fully determines how it sounds (apart from sophisticated finesse.) Transposition applies to normal notes only, and makes no sense with percussion voices. Controlling an instrument We will control a musical instrument directly from a score. This naturally requires an interface some where between the controlling part and the instrument ( or ``driver'') part. The design of the interface plays a crucial role. It is there were the intentions of the composer are trimmed down to the basic acoustic elements of pitch, timing, loudness and voice. What can we learn from midi? Midi is an example of an interface between a controller and an instruments. A controller contains of one or more keyboards or drum pads. The instruments are is mostly an expander, but in our case it is a set of mechanical instruments. Midi is a serial protocol, consisting of events. It is real time, i.e. an events is a command to be executed here and now. It has controlling events, i.e. events that influence how coming events are to be interpreted. These we will ignore, because they have no relevance to the tingle tangles. What remains are the events to start and stop a notes of a certain pitch and those to play percussion notes. The tingle tangle As we all know the gold tingle tangle is a metallophone with 37 (3 octaves worth) of copper tubes. The silver tingle tangle is made of 37 aluminium tubes and has in addition some percussion instruments. It could be argued that the tingle tangle is itself a percussion instrument. The duration of the tone is not under control, and a command to stop the tone can't be executed. However, because it makes sense to transpose, it is proper to consider the tingle tangle a ``normal'' voice. Design of the interface With the above we come to a main design for minimanx. We adopt the following midi ideas. From the point of view of the generator of note events we have time, pitch, loadness and channel number. At the other end we have the instrument driver that maps the channel number to a voice, and interprets what to with time, pitch, and loudness. Any percussion voices are mapped on a fixed midi channel (9) and can be placed in any part. A part is mapped onto midi channels in sequence, skipping channel 5. Separate commands map midi channel to the gold or silver tingle. The midi channel can also be mapped elsewhere, such as a real expander or the internal loudspeaker. Therefore it makes sense to carefully handle the note off events, even if the tingles ignores them. Considered as a midi device the tingles are three channels, silver gold and percussion. Handling time. Normally in midi we want to hear a note the moment we press a key on the keyboard. In the interface towards the tingles the time where the event is to take place is fetched from a global variable, the midibeat. This allows to send the events to the driver out of order. So events for a multi-part can be generated on a bar by bar basis, and there is no need to collect notes to be played simultaneously into a chord. Musical aspects of the midibeat. The midibeat is counted in 576-th of a quaver. (A quaver is 1/4 of a whole note.) Divisions in 2's and 3's are musically most pleasing, and between pieces with a slow and fast beat, the variation in duration of quaver are much less than the variation in the beat. The zero point of the midibeat can be anywhere in real time. Likewise the duration of a midibeat tick is not fixed, and even can vary during a piece. Technical description of events. A midi interface is a byte stream. An event is 2 or 3 bytes where the first byte has its m.s.b. bit up. A note on event is 3 bytes $80+channel number, note number, loudness. It intends to start a note with pitch ``note number'' and ``loudness'' at the current midibeat time. A note off event is 3 bytes $90+channel number, note number, loudness. It stops the note. Note numbers are 0 for the 16 Hz C up to 120 for the 16 kHz C. (Assuming a well tempered scale with 12 notes per octave and no difference between e.g. Cis and Des.) Loudness is 0 for ppp to 127 for fff. From the drivers present in minimanx, only the speaker driver handles note off events. The gold and silver drivers ignore them. On the percussion channel a note number is a voice, and note off events are used to double the number of notes on the channel. Loudness is set to mp and ignored. (For mechanically good metallophones, loudness can make sense.) (Loudness sometimes is called velocity. This is because looking from the keyboard side of the interface it represents the force with whichis the key was struck.) Mappings. The gold tingle plays note 48 to 84. The silver tingle plays note 50 to 86. The percussion handles the note numbers that agree with high-tom low-tom and cymbals on the midi percussion channel. (Should the score ever be played on a normal midi expander, the results is more or less correct. For the same reason loudness is set to $37 mp.) Technical section The technical section contains the definition of Forth words. (If you miss the stack comments, they are left out for all words that do not affect the stack. Words that handle the stack are commented using the Stallman convention.) /1 set the whole note as the current note duration. (``cnd''). /2 ... /32 are similar. 3) divide the current note duration by 3. 5) is similar. C3 build a midi event with note 50 (and fixed loudness.) Fill in ``note on'' and the part number. Schedule it on the midi channel to which this part is mapped with the current midibeat. (Meaning to play at the time that agrees with the current midibeat.) Schedule a similar ``note off'' event taking into account the cnd and other settings (e.g. articulation legato/staccato.) Advance the midibeat by cnd. See also &~ HIGHER ^ C3 is build by the defining word note : 50 NOTE C3 rest Advance the midibeat by cnd. & "unrest" Set back the midibeat by cnd. &~ "arpeggio unrest" Set back the midibeat by cnd, but not quite. Make cnd temporarily a bit smaller. (This will not be implemented, because it is not needed for the tingles. ^ "tie" Tie the next note to the next note with the same pitch. In more detail: Suppress the scheduling of the ``note off'' of the next note. Remember that note, and suppress the scheduling of the ``note on'' event when the same note is played again. .~ "dot-flag" The next note gets a dot ( cnd + 1/2 cnd) and the note following an extra flag ( cnd * 1/2). ) A score file. A score file contains one musical piece. Any commands before SCORE are executed during the loading of the file. They have no lasting effect SCORE Build a structure "name" to fill in ``parts''. Its fields are accessable such that later words can add to it. DESCRIPTION. Execution : ``INSTRUMENT name'' plays the score on INSTRUMENTS. ``0 name'' plays it on the default instrument specified with the parts. PART Build one of the parts associated in order with the latest word defined by ``SCORE'' to be played by INSTRUMENT. Separate the following code in ``measures'' : pieces ending in a bar ('|') until a double bar ('||'). Compile each piece in a Forth word without a name and store their execution tokens in an array. L: This defining must occur at the start of a measure. It associates "name" with the measure. It is called a label. Exceptions and consistency requirements. Measures are counted from 0 (up beat, until the first bar). (So measure have a different number than the bar that ends them, but this is usance in musicology.) (Measure except for the upbeat, must have the total note lenght that follows from the MEASURE command.) Add a measure with the effect of the measure associated with LABEL. `` "label" REDO'' is counted as one measure. Add measures with the effect of the measure associated with effect of the LABEL through LABEL2 are substituted. `` "label1" "label2" BIS'' They are counted as as many measures. Play all notes SEMITONES higher if positive or lower if negative. HIGHER (This will of course not be part of minimanx. The equivalent of 12 HIGHER OCTAVO The equivalent of -12 HIGHER BASSO ) VOCABULARY'S Regular score files should compile with only the FORMULA wordlist in the search order. Specialist can do ``ALSO MANX'' ``ALSO EXTERNAL'' or even ``ALSO FORTH''