prekern was written to assist with the translation of the scores into
**kern files. Actually it's a preprocessor for **kern. It adds some context-dependency to the symbols. prekern takes
a file with a single spine in context-dependent notation as input and
outputs a file with the spine in **kern format.
prekern translates line after line into **kern format. The
information that is not explicitly entered is "inherited" from the
The following rules are applied:
- A line with "**prekern" will be translated into a line with "**kern".
- A line starting with '!', '*' or '=' will just be copied.
- A line starting with '%' will be copied without the leading '%'. Thus you can escape from the converting mechanism.
- If the pitch is preceded by a '@', the nomal **kern
interpretation is used to determine the octave. This should be used for
the first note in the spine.
- If for a certain note the duration is not provided, the duration of the preceding note is used.
- If for a certain note the octave information is not provided, the
note is chosen that is nearest to the previous note (i.e. within a
- If a note is a fifth or more from the previous note, either '@'
followed by the normal **kern representation or one of the signs '>' (take an octave higher)
and '<' (take an octave lower) should be used.
- The canonical order of **kern signifiers must be used.
An example to make things clear:
|input: example.pk||output: example.krn|
f @G @b-
e a c
4FF 4G 4b-
4EE 4A 4cc
- C++ code: prekern.cc
- Header file: prekern.h
- Linux Binary: prekern (built on a GNU/Linux Mandrake 9.2 system)
- Windows Binary: prekern.exe (built under cygwin with 'g++ -mno-cygwin -o prekern -s prekern.cc' so no cygwin dll is needed.)
To compile, put prekern.cc and prekern.h in the same directory and enter something like:
g++ -o prekern prekern.ccon the command line, if you're using the GNU Compiler Collection. With other compilers, you're on your own.
I provide this because it is helpful for me and it might be helpful
for others. It is not under active development. Prekern is released
under the GPL.