Skip to content

Chordmatrix

Pre-release
Pre-release
Compare
Choose a tag to compare
@dmgolubovsky dmgolubovsky released this 29 Apr 02:38
· 13 commits to master since this release

This is the first "usable" version of Chordemux with chords routing rules hardcoded in the program to cover the majority of frequently used chords.

The table below illustrates the mapping (hardcoded routing rules) of chords to channels, M is major, m is minor, number after exclamation is inversion number, no inversion number means root position.

Chord!inv
Chan
Chord!inv
Chan
Chord!inv
Chan
Chord!inv
Chan
M
1
M!1
2
M!2
3
dim
4
m
5
m!1
6
m!2
7
*1
8
M7
9
M7!1
10
M7!2
11
M7!3
12
m7
13
m7!1
14
m7!2
15
m7!3
16

The program opens an ALSA MIDI receiving port and expects chords (multiple notes arriving within a reasonably short time interval) to be received. A transmitting MIDI port is opened as well.

Chords coming from a sequencer program usually have microsecond intervals between notes in a chord (unless it is an arpeggio chord), while chords played live on a physical keyboard may have millisecond intervals (as approximately measured by myself, in the range of 2 - 9ms between the first and the second notes when playing accurately). The program measures a time interval between first two notes, and waits for 10 times that interval until the rest of notes arrive 2. After that, semitone intervals between notes in ascension are analyzed (e. g. [4, 3] corresponds to a major chord in root position). Once chord type and inversion are identified, all or some notes of the chord (with optional offset) are sent to the proper channel (see the table above) via the output port.3

Possible use of the program is to connect an individual arpeggiator/sequencer to each output channel to generate distinct accompaniment pattern for each chord played. The arpeggiator is expected to output a repeating (as long as the chord is played) sequence of notes as function of the input set of notes. QMidiArp serves as an example

A short piece (live improvisation) was recorded using Chordmatrix, QMidiArp as arpeggiator, ZynAddSubFX for all voices (lead, pad, arpeggio). Only 8 instances of QMidiArp were used, so an additional plugin remapped channels 8 - 16 to 1 - 8. Ardour was used for MIDI routing, plugins configuration, and audio recording. Lead and pad were played on a split (at C4) keyboard; arpeggio patterns were generated by Chordmatrix.

A pre-built binary executable (64-bit x86 Linux) is provided with this release. Its library dependencies are listed below:

	linux-vdso.so.1 =>  (0x00007ffd1d2b1000)
	libasound.so.2 => /usr/lib/x86_64-linux-gnu/libasound.so.2 (0x00007fa85dd64000)
	libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007fa85dae3000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa85d7da000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fa85d5d2000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa85d3cd000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa85d1b0000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fa85cf9a000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa85cbd0000)
	/lib64/ld-linux-x86-64.so.2 (0x00005585e6dc9000)

It was compiled with GHC 8.0.2 and is known to work on Ubuntu 16.04. For building instructions see the README file in the project repository. Please note that the executable name will be chordemux.


1 Any chord that is not listed.
2 This logic definitely deserves improvement.
3 Per the hardcoded chord routing rules, all chord's notes are sent without offset, although the data structure of the chord routing table and the program logic allow to specify selection of notes and optionally their offsets to be sent.