[CM] RE: [keykit] Synthesizing Midi

Tony dj.ton.e@gmx.de
Mon, 9 Aug 2004 16:02:04 +0200


Thanks Tim, this works great. 

Now I'm trying to find a way that allows me also to use chords in
melody.mid.

Another variation would be to use the velocities from melody.mid and not
from rhythm.mid.

Best greetings,
t


-----Original Message-----
From: Tim Thompson [mailto:tjt@nosuch.com] 
Sent: Monday, August 09, 2004 1:59 AM
To: 'Tony'; cmdist@ccrma.stanford.edu; keykit@nosuch.com
Subject: RE: [keykit] Synthesizing Midi

> I have two midi files. (e.g. both just one bar long, in 4/4 measure).
> 
> 1: rhythm.mid ( with the following note lengths)
> 1/4 1/4 1/4 1/8 1/8. (all C notes) 
> 
> 2: melody.mid (with the following notes)
> 1/4(Note C) 3/4(Note D) 
>  
> From these midi files I should get with Pd or Common Music or Key Kit
a
> combination:
>  
> 3: combi.mid
> 1/4(C) 1/4(D) 1/4(D) 1/8(D) 1/8(D)

In keykit, this would be:

	p1 = readmf("rhythm.mid")
	p2 = readmf("melody.mid")
	p3 = applynear(p1,p2,PITCH)
	writemf(p3,"combi.mid")

The source for the applynear function is in lib/basic1.k,
if you want to see how it works.  It takes each note in p1,
and applies the pitch of the nearest (in terms of time) 
note from p2.
 
   ...Tim...