# Rumor

## 1 Rumor — Really Unintelligent Music transcriptOR

This documentation was generated for Rumor 1.0.5 at 15 June 2014.

Rumor is a realtime monophonic (with chords) MIDI keyboard to Lilypond converter. It receives MIDI events, quantizes them according to its metronome on the fly and outputs handwritten-like corresponding Lilypond notation. Tempo, meter, key and other parameters can be set via command-line options (see Invocation).

This program is Copyright © 2003 Vaclav Smilauer and is covered by GNU General Public License (see the file `COPYING` in the source distribution).

## 2 Features

Rumor’s only purpose is to help out with music transcriptions (even of polyphonic music with separated voices); typical usage is to write Lilypond file skeleton by hand and then paste Rumor output into it (see Examples).

It does not want to be a full-blown quantization program; fancy features like tuplets, polyphony and tempo tracking were ommited deliberately.

- Rumor mimics handwritten Lilypond source:
  - it uses relative notation and omits note length if it has not changed (both can be switched off though)
  - it writes rhythms intelligently, in relation to bar position (tied single notes, over barlines if necessary)
  - it resolves enharmonic ambiguities (e.g. `gis`/`as`) given the `--key=NOTE` option (see Invocation)
- It is scriptable, with support for user-defined rhythm notations, keyboard layout and pitch names (dutch and italian being built-in). See Scripting.
- It supports chords (simlutaneous notes), using the <c e>8 syntax.
- It can talk to MIDI I/O via ALSA or OSS.
- It can emulate MIDI keyboard using ordinary (computer) keyboard, key layout being scriptable.

Rumor is written in `c++` and developped under Linux; windows port is conceivable but not planned.

## 3 Examples

For real-life examples, Links.

### 3.1 Minimal sample

A minimalistic rumor session follows (play keyboard, then press ^-C).

    vaclav@frigo:~/ujf/quant/rumor$ ./rumor -m68 -kb -g32
    b'8 ~ b32 a g fis g16 e cis8 ~ cis16 g' fis8 |
    e d b4 ais8 r |
    ais b32 a g fis g16 e' g, fis32 e fis16 cis' e, cis' |
    e, d32 cis d16 b' ~ b ais ~ ais32 cis b ais b16 d ~ d cis ~|
    cis32 e d cis d16 fis ~ fis e ~ e32 g fis e fis16 b ~ b ais |
    b32 a gis fis gis16 b eis, fis ~ fis32 fis eis dis eis16 gis ais, b ~|
    b32 b ais gis ais16 cis eis, fis d'8 cis
    vaclav@frigo:~/ujf/quant/rumor$

`-m68` (or equivalently, `--meter=6/8`) sets six-eights bar, `-kb` (`--key=b`) indicates b-based scale, `-g32` (`--grain=32`) sets resolution to 32nd notes.

If run with –full option, Rumor outputs complete Lilypond file; the tune of the precceding session would look thusly (beginning of J.S. Bach’s Prelude in b-minor):

### 3.2 More complicated example

Suppose you don not like the tied 16th notes in bar 4 and 5 (indeed, in original sheet, they are printed as eights). I this case, you can override default rhythms by a guile script, loaded with the `--script` option (see Invocation). The syntax is very simple (see Scripting); put the following into file `rhythm68.scm`:

    (rumor-rhythms 32 6 8  '(#(8) 18 6))

Run rumor and play the two bars on the keyboard:

    vaclav@frigo:~/ujf/quant/rumor$ ./rumor -m68 --script=rhythm68.scm -t80 -kb -a2 -f -g5 > hmoll_prael1.ly

This will lead to

## 4 Invocation

Default start-up values are `--alsa=64:0,65:0 --tempo=100 --meter=44 --grain=16 --key=c`.

`-g,--grain=NUM`

  Set minimum time resolution to the NUMth note. Only powers of two are valid, from 1 up to 128.

`-l,--legato`

  Ignore any rests between notes. Every note terminates upon the start of the next one.

`-D,--no-dots`

  Do not use dotted notes (dotted rests are always disallowed).

`-m,--meter=P[/]Q`

  Set time signature. Bar will have P beats of duration of the Qth note. Metronome will sound every beat. (thus e.g. 4/4 and 8/8 will give the same output, only metronome behavior will change).

  Q must be a power of two. Slash may be omited if P and Q are both smaller than 10.

`-t,--tempo=BPM`

  Metronome speed will be BPM beats per minute. Note that what is considered a beat is determined by `--meter`.

`-w,--wait=BEAT`

  Start metronome upon arrival of the first MIDI note, at the beginning of bar (BEAT=1) unless overridden.

`--flat`

  Output only pitches as you play, no lengths. Metronome will not be started.

`--no-chords`

  Disables chords (groups of notes pressed and released “simultaneously”, with regard to quantization). Enabled by default.

`--explicit-durations`

  Output duration indication after every note, even if it remains the same as preceedingly.

`--absolute-pitches`

  Do not use Lilypond relative notation. Instead, all pitches have their octave indicated by (possibly zero) tics or commas.

`--lang=LANG`

  LANG can be one of `ne` (default: `ces`, `c`, `cis`, …), `en`, `en-short`, `de`, `no`, `sv`, `it`, `ca`, `es`. Languages match those used by Lilypond (not necessarily the version you have installed, though). Note that pitch names can be always overridden by `rumor-pitches` (see Scripting).

`-k,--key=KEY`

  Set base note of current scale, used to resolve enharmonic ambiguities (i.e. `fis` vs. `ges`). Valid value for KEY is any pitch having less than two accidentals, in current language (`--lang`; this option must precede `--key` in order to have effect).

  Run `--sample-sheet` and look at scales to see its impact and possible values for KEY.

`--sample-sheet`

  Produce complete Lilypond file showing all possible rhythm notations and chromatic scale in all possible keys (see `--key`). It is influenced by `--meter`, `--grain` and also user-defined notations (see `--script`).

`-s,--strip`

  Strip leading and trailing rests from output. First and last bars may thus be incomplete.

`-f,--full`

  Output can be fed directly into Lilypond. It will be one–line staff in violin clef and key signature as determined by `--accidentals`.

`-a,--accidentals=NUM`

  Set number of sharps or flats (if NUM is positive or negative, respectively) for full Lilypond output. No effect without `--full`.

`--script=FILE`

  Run guile script FILE before beginning. See Scripting.

`--alsa=[[IC:IP,]OC:OP]`

  Use ALSA interface. If argument is specified, connect input to client IC on port IP and output to OC:OP. By default, Rumor will try to use `64:0,65:0`. If connection fails, you can use `aconnect` to do this manually.

  If you specify only one pair `C:P`, it will be the output port. This is useful with `--kbd`.

`--oss[=DEV]`

  Use OSS interface. Device number 0 on `/dev/sequencer` will be used, unless overridden by DEV.

`--kbd`

  Emulate MIDI keyboard using ordinary keyboard. An ordinary MIDI interface (ALSA or OSS) is still needed for metronome and echoing. Standard input must be a terminal. There is a usable keyboard layout builtin; however, key bindings are configurable via `(rumor-kbd ...)` (see Scripting).

`-v,--verbose`

  Be verbose. This option may be used more times and every time will increase verbosity level by 1. If it is greater than 3 and Rumor was compiled with debuggins support, debugging and tracing messages will be printed. If verbosity is zero (default), Rumor will only report errors.

`-?,--help`
`--usage`
`-V,--version`

## 5 Scripting

### 5.1 rumor-rhythms

You can change default notations knowing TU at which the note starts, via guile command `rumor-rhythms`. Rumor will always look at user-defined notations, if it fails (meaning: there is no notation shorter than or equal to at the position of the note requested), it will use its built-in algorithm. Syntax of the aforementioned command is

    (rumor-rhythms grain P Q notation-def …)

- First three arguments are self-explanatory. If grain is grater (smaller) than its current value (see `--grain`), rhythm will be divided (multiplied) accordingly. Meters like 3/4 and 6/8 are equal.
- notation-def has two parts. First we define which is the desired notation. Then we put all TUs at which this rhythm will start.

  Notation is vector of basic rhythms (single notes). Basic rhythm is expressed in scheme as numeric duration for undotted notes (like in Lilypond) or as a pair `'(DUR . DOTS)` for notes with DOTS dots (`DUR` is eqivalent to `'(DUR . 0)`).

#### 5.1.1 Example

This example can be found as `doc/rhythm68.scm` in Rumor source distribution.

    (rumor-rhythms 32 6 8

We have 6/8 bar with 32th notes. This gives 32*6/8=24 TU/bar, one beat corresponding to 4TU.

      '( #(8) 18 6)

First item in the list is vector (denoted `#(...)`) of basic rhythms. Eight note `#(8)`; it may appear at positions given after in TU.

      '( #((4 . 1)) 0 12)

Dotted quarter note (`4.` in Lilypond) may be in either half of bar.

      '( #(8 8) 8)

6/8 bar is like two subbars, whence we do not want a quarter note to go over the middle: override it with two tied eights (this is where Rumor simple algorithm goes “wrong” as it treats 3/4 bar as shortened 4/4).

     '( #(2) 0 8)

Half note would not normally (i.e. 4/4) begin at the third 1/8 beat, right after first 1/4; however, it is perfectly OK in 6/8.

    )

### 5.2 rumor-pitches

Rumor normally uses notations corresponding to `nederlands.ly` in standard Lilypond distribution. This command makes it possible to define arbitrary names for different tones.

    (rumor-pitches '(tone double-flat flat natural sharp double-sharp) …)

tone is a number from 0 ("c") to 6 ("b"), next five parameters are strings for respective pitches relative to tone.

#### 5.2.1 Example

If you wish to use german (defined in `deutsch.ly`) notation, you can do it like this:

    (rumor-pitches
      '(5 "asas" "as" "a" "ais" "aisis" )
      '(6 "heses" "b" "h" "his" "hisis")
    )

Please note that a better solution is to use `--lang=de` to achieve this. This option is now partially obsolete but possibly useful for something fancy.

### 5.3 rumor-kbd

If you use `--kbd` options (see Invocation), you may want to change the builtin keyboard layout (for example, if not using a QWERTY keyboard).

    (rumor-kbd reset transposition '(char . pitch) …)

- reset can be either `#t` (true), in which case all established bindings will be deleted before adding the new ones. If it is `#f` (false), new bindings will be appended (and may overwrite the old ones).
- transposition, given in semitones, will be added to all subsequent pitches.
- char is a guile character (notation `#\c` for small “c”, for example; there are special characters as `#\space`, see guile documentation for these).
- pitch+transposition is MIDI pitch (semitone) generated when char is received from keyboard. The lowest MIDI “c” has zero; as this note practically never used, it generates a rest (note-off).

If keyboard emulation is not used, this command returns error.

#### 5.3.1 Example

This example can be found as `doc/kbd.scm` in Rumor source distribution.

    (rumor-kbd #t 0 '(#\space . 0))

Assign rest to spacebar, first resetting all previous bindings.

    (rumor-kbd #f 60

Append new settings, transposing all following pitches by 60 (that is, 5 octaves up).

                        '(#\g . 6)'(#\h . 8)'(#\j . 10)
                   '(#\v . 5)'(#\b . 7)'(#\n . 9)'(#\m . 11)

           '(#\s . 1)'(#\d . 3)
      '(#\z . 0)'(#\x . 2)'(#\c . 4)

The source is deliberately laid out as on keyboard. “z” is assigned 0+60 and so forth, up to “m” (11+60), which completes the octave.

Now we assign the next octave to the same keys, but capitalized:

    (rumor-kbd #f 72
                       '(#\G . 6)'(#\H . 8)'(#\J . 10)
                   '(#\V . 5)'(#\B . 7)'(#\N . 9)'(#\M . 11)

           '(#\E . 1)'(#\D . 3)
      '(#\Z . 0)'(#\X . 2)'(#\C . 4)'
    )

### 5.4 rumor-beats

This command changes default beat sounds.

    (rumor-beats channel first-beat-specification other-beats-specification)

channel is MIDI channel we use for beats (note that keyboard input’s channel is used also for tone output but not for beat output) and should be 1–16. beat-specification is specific to the first beat and then to all other beats. It is a list of the following form:

    '(patch pitch velocity duration)

instrument is number of the MIDI instrument or patch (should be 1–128). pitch is self-explanatory and should be 0–127 (semitone count from the lower (base) c). velocity corresponds to volume and should be in 0–127. duration is a floating-point number given in seconds. The beat sound will be released after this duration.

#### 5.4.1 Example

If your setup has a functioning MIDI drum channel, you can use it like this:

    (rumor-beats
      10 ; this is the MIDI drum (percussion) channel
         ; with the drum channel, pitches are not pitches,
         ; they represent different percussions
      '(15 15 127 0 05) ; 1st beat
      '(20 20 95  0.05) ; all other beats
    )

This example can be found as `doc/drums.scm` in Rumor source disribution.

## 6 Links

For further information, consult source documentation and `README` in particular. Try also here:

- homepage: http://beta.arcig.cz/~eudoxos/rumor/
- sources: http://www.launchpad.net/rumor
- contact: mailto:VÃ¡clav Å milauer <eu@doxos.eu>

Real-life pieces typeset using Rumor (please report if there are more!)

- BWV538: http://www.mutopiaproject.org/cgibin/piece-info.cgi?id=307
- BWV544: http://www.mutopiaproject.org/cgibin/piece-info.cgi?id=308
- BWV565: http://www.mutopiaproject.org/cgibin/piece-info.cgi?id=381
- BWV1079: http://www.mutopiaproject.org/cgibin/piece-info.cgi?id=340
- BWV542: http://www.mutopiaproject.org/cgibin/piece-info.cgi?id=382

Related sites:

- Nicolas Sceaux’s Lilypond quick insert mode uses Rumor as its backend: http://nicolas.sceaux.free.fr/lilypond/lyqi.html
- Lilypond: http://www.lilypond.org
- Mutopia: http://www.mutopiaproject.org
- ALSA: http://www.alsa-project.org
- OSS: http://www.4fronttech.com
- Guile: http://www.gnu.org/software/guile/