Same time transformation

The function same-time-transform captures a number of NoteOn messages in some given channels, all of which occur at the exact same time. They have most likely been played by hitting a single key, which is instructed to generated two or more notes. In the example below one key generates three "same-time notes".

We correct a couple of errors in channel 1, but it is - in general - a major work to redo the same corrections in channel 3 and 4 as well. The function same-time-transform helps. The lambda expression is called on every occurrence of the three "same-time notes", and the function returns the correction. In the example, channel 3 and 4 are instructed to follow channel 1.

The interesting places in all example files start with the first NoteOn message. Please scroll a bit!

Description Midl source file Resulting midi file
Original from keyboard - a scale of parallel notes i channel 1, 3 and 4. midl source file midi file
Two manual modifications have been made to channel 1. Problem: Channel 3 and 4 out of sync. midl source file midi file
Use of same-time-transform to force all three channels to be in sync midl source file midi file
Result of same-time-transform midl source file midi file

The midi files of the two last rows are identical, of course.