[PD] write tempo change with [midifile]?

Martin Peach chakekatzil at gmail.com
Sun Feb 11 06:21:12 CET 2018


On Sat, Feb 10, 2018 at 7:48 PM, Martin Peach <chakekatzil at gmail.com> wrote:

> On Sat, Feb 10, 2018 at 1:49 PM, tim vets <timvets at gmail.com> wrote:
>
>> I seem to be getting closer
>> [255 81 3 $1 $2 $3( seems to do the trick, (the 3 was necessary to
>> designate the 3 following bytes...)
>> still not sure why [255 81 3 7 161 32( does not result in 120bpm but
>> "120qpm" and 80bpm...
>>
>
> Probably because numbers greater than 127 must be formatted in
> 'variable-length quantity' form, where the number is broken up into 7-bit
> pieces and all the pieces except the last have the high bit set, so decimal
> 500000 in hex is 7A120, or in binary 1111010000100100000, becomes 10011110
> 11000010 00100000, or 158 194 32 (if I didn't make any mistakes along the
> way). Using calculator in programmer mode is useful here.
>

But for meta events, numbers are stored as is, in big-endian order, not as
variable-length,, so [ 255 81 3 7 161 32 ( should work properly.

Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20180211/70c90f99/attachment-0001.html>


More information about the Pd-list mailing list