tempo track

40 views
Skip to first unread message

unhan...@gmail.com

unread,
May 22, 2019, 11:27:09 AM5/22/19
to KeyKit
Hi Tim,

Maybe I've missed it, but I can't find any instructions for adding a tempo track.  In fact I don't even see any tool for adding tempo messages.

Andrew Dabrowski

unread,
May 23, 2019, 12:42:37 PM5/23/19
to KeyKit
I think I could copy wgroup's notifydrawnote method to enter tempo events as text notes.  But I don't see how to create a note like

'"Tempo=XXX"'

where XXX is specified at runtime.

Andrew Dabrowski

unread,
May 23, 2019, 12:45:51 PM5/23/19
to KeyKit

Andrew Dabrowski

unread,
May 24, 2019, 11:58:10 AM5/24/19
to KeyKit
I've added notifydrawtempo to wgroup.k, and it seems to work - I can click at point in time and add an arbitrary tempo. 

Except that the midi message isn't read during playback. I know tempo messages work in other midi files, and I can't see the difference in the phrases.

Here's an excerpt from the dump of wgroup in the kp file.  You see part of the list of phrases.

3=',l231436',4='"Tempo=166666":1t57832,l231436',5=

Isn't that how a tempo message is supposed to look?  And yet it is not read during playback.

Here's an excerpt from another file in which the Tempo message is read.

do4d48v33t3840 a- c+o5,"Timesig=1/4,24,8" "Tempo=375000","Timesig=2/4,24,8"t3984,fo4d96v96t4224,bo1d16v49,do2d15t4337,go5d16t4368,ed15t4385,a-o2d48v96t4800

I don't see any important difference in the Tempo messages.

Andrew Dabrowski

unread,
May 24, 2019, 3:25:55 PM5/24/19
to KeyKit
Here's something weird.  I tried using midibytes instead of a text note.  I used

midibytes(0xff,0x51,0x03,x,y,z)

But when I look at the resulting kp file it has turned into

5='xf95103087a23:1t-1206'

i.e. 0xff turned into 0xf9.  The same thing shows up in the .mid file.

00000b60: 0d00 f706 f951 0308 7a23 00ff 2f00 4d54  .....Q..z#../.MT

Is it possible there's a bug somewhere that corrupts meta events?

Tim Thompson

unread,
May 24, 2019, 4:45:44 PM5/24/19
to Andrew Dabrowski, KeyKit
Hi!   Thanks for the investigation and details!   If I do this:

a='"Tempo=300000",a,b,c,"Tempo=100000",d,e,f'
realtime(a)

it plays back with the tempo changes, and if I do:

Snarf = a

and then bring up a Group tool and File->Read->Snarf and right-click the mouse (to play it), it seems to play back with the tempo changes.  How are you playing it back?

To construct a Tempo message dynamically, the first way I can thing of is:

newtempo=99999
eval "ph='a,b,\"Tempo="+string(newtempo)+"\"'"
print ph

(I think I got the quotes right - I can't cut/paste from the KeyKit window - that's lame)

which should print 'a,b,"Tempo=99999"'

I'm thinking/hoping the meta event thing you identified is unrelated, but I haven't looked at that.

     ...Tim...



--
You received this message because you are subscribed to the Google Groups "KeyKit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keykit+un...@googlegroups.com.
To post to this group, send email to key...@googlegroups.com.
Visit this group at https://groups.google.com/group/keykit.
To view this discussion on the web visit https://groups.google.com/d/msgid/keykit/82cc733d-6e89-4c7d-965d-3438d9340923%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrew Dabrowski

unread,
May 24, 2019, 6:31:40 PM5/24/19
to KeyKit
I tried your example and it seemed to work.  But when I changed the channel of the track the tempo messages were no longer read!  Changing the channel back to the original one caused them to be read again!

The problem is probably at my end.  I've been tweaking everything for the last 11 years and god knows how many bugs I've created.

Tim Thompson

unread,
May 24, 2019, 7:54:00 PM5/24/19
to Andrew Dabrowski, KeyKit
No, the problem isn't you.  Changing the channel of the phrase is indeed what triggers the problem, i.e.:

      a='"Tempo=100000"'
      print a
      a.chan=2
      print a    # bad value

The .chan operation shouldn't be trying to change the channel on sysex messages (ones starting with 0xf0).  It's a bit surprising that that hasn't been revealed before, good find!  Thank you!  I should have a fix shortly.

     ...Tim...

On Fri, May 24, 2019 at 3:31 PM Andrew Dabrowski <unhan...@gmail.com> wrote:
I tried your example and it seemed to work.  But when I changed the channel of the track the tempo messages were no longer read!  Changing the channel back to the original one caused them to be read again!

The problem is probably at my end.  I've been tweaking everything for the last 11 years and god knows how many bugs I've created.

--
You received this message because you are subscribed to the Google Groups "KeyKit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keykit+un...@googlegroups.com.
To post to this group, send email to key...@googlegroups.com.
Visit this group at https://groups.google.com/group/keykit.

Andrew Dabrowski

unread,
May 24, 2019, 8:27:53 PM5/24/19
to KeyKit
Hmm, I wonder if that's where that "9" in "xf9" came from, I might have used channel 9.
Reply all
Reply to author
Forward
0 new messages