Hello,

From: "Peter Billam" <p...@pjb.com.au>
Subject: [timidity-talk] timidity destroys initial silence :-(
Date: Fri, 8 Aug 2014 12:40 +1000

> I'm trying to split a .mid file t.mid into separate channels
> eg t_cha0.mid t_cha1.mid t_cha4.mid
> then convert each of those to wav t_cha0.wav t_cha1.wav t_cha4.wav
> so that I can treat them with effects eg using sox
> then mix them back together eg using ecasound.

First, you do not have to split a midi file into separate channels.
You can convert each of those to wave files using -Q option.

> BUT when I convert mid->wav using timidity, eg:
>   timidity -Ow -o t_cha1.wav t_cha1.mid
> the four seconds of initial silence in t_cha1.mid before the first
> note gets suppressed :-( thus destroying the co-ordination between
> my files and making mixdown impossible :-(
> 
> I've been through  man timidity  and  man timidity.cfg
> and there are hundreds of options, but I see nothing to
> disable the destruction of the initial silence.
> 
> I tried inserting a note_off event into t_cha1.mid just before
> the 4-second initial silence, but timidity is 'clever' enough to
> ingore it :-(
> 
> Does anyone know a timidity option to preserve initial silence ?

To avoid skipping initial silence, you can try to add a dummy track
which contains only one midi note on and off event at offset zero.

Here is the sample script.  In this case, the dummy track is assigned
to channel 32, which is not used.

----------------------------------------------------------------------
#!/bin/sh

# add a dummy track
mf2t -ntv kkr8p.mid kkr8p.txt
cp -p kkr8p.txt kkr8p_dummy.txt
sed -i '/^MFile/s/22/23/' kkr8p_dummy.txt
cat <<- "EOF" >> kkr8p_dummy.txt
        MTrk
        0:-1:0 Meta TrkName ""
        0:-1:0 Meta 0x21 01
        2:-1:-2 On ch=16 note=c5 vol=64
        2:0:-2 On ch=16 note=c5 vol=0
        TrkEnd
        EOF
t2mf kkr8p_dummy.txt kkr8p_dummy.mid

# make wav (melody)
timidity -idt -Q0,-1,-5,-11,-12,-17,-20 -Ow -o kkr8p1.wav kkr8p_dummy.mid
# make wav (harmony)
timidity -idt -Q1,5,9,10,11,12,17,20,32 -Ow -o kkr8p2.wav kkr8p_dummy.mid
# make wav (percussion)
timidity -idt -Q0,-9,-10,-32            -Ow -o kkr8p3.wav kkr8p_dummy.mid

# mix them
sox -m kkr8p1.wav kkr8p2.wav kkr8p3.wav kkr8p.wav
----------------------------------------------------------------------

Regards,
TAMUKI Shoichi

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Timidity-talk mailing list
Timidity-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/timidity-talk

Reply via email to