Re: Transpose a complete MIDI file and save it to a new MIDI file (in batch mode)

From: Alexandre Ratchov <alex_at_caoua.org>
Date: Wed Jul 30 2008 - 00:06:21 CEST
On Tue, Jul 29, 2008 at 05:38:11PM +0200, éléandar wrote:
> Hy,
> 
> I am a newbie in MIDI events.
> 
> I see a transpose proc in midish manual. I would like to transpose a
> complete MIDI song (every notes) one or more halftone down or up and save it
> to a new MIDI file.
> 
> Please, could you give me some advice on realizing this task with midish ?
> 

hey!

assuming the midi file doesn't use drum kits, the following will
transpose the song by 4 halftones:

import "myfile.mid"
sel 10000
for trk in [tlist] { ct $trk; ttransp 4; }
export "myfile2.mid"

drums can't be transposed. on the other hand midi files don't
contain information to distinguish drums from chromatic
instruments. But luckily most songs use channel 9 for drums, so you
can just skip it, ie transpose channels 0..8 and 10..15 only:

import "myfile.mid"
sel 10000
ev {any {0 0..8}}
for trk in [tlist] { ct $trk; ttransp 4; }
ev {any {0 10..15}}
for trk in [tlist] { ct $trk; ttransp 4; }
export "myfile2.mid"

(assuming you're using latest snapshot; older versions work
differently).

-- Alexandre
Received on Wed, 30 Jul 2008 00:06:21 +0200

This archive was generated by hypermail 2.1.8 : Wed Nov 08 2017 - 16:32:20 CET