[sdiy] MIDI Clock sync advice
Spiros Makris
spirosmakris92 at gmail.com
Fri Mar 15 09:29:21 CET 2024
Roman Sowa wrote:
> And it's pretty easy to do, as MIDI clock message has no dependencies at
> all, it can even go between bytes of single note message. Just look for
> F8 in UART register and bam!
>
> I'm a bit surprised that such powerfull processors as used in arduinos
> can't handle increased traffic, while everything needed to be done in
> any MIDI receiver can be easily handled within one byte transmission,
> that is 0.3ms. OTOH I don't use arduinos or libraries so what do I know.
While I'm a big supporter of frameworks like arduino, many libraries tend
to be extremely inefficient. MIDI implementations are a prime example; most
I've found floating around work with polling rather than interrupts. Teensy
tends to be much better, but even that doesn't offer a receive interrupt
out of the box. (I remember digging into the library files and hacking the
interrupt into the USB-MIDI code of Paul; I did share it somewhere, I think
it was this list). Despite its shortcomings, Arduino helps you set up
prototypes incredibly fast, which is great for hobbyists and lowers costs
for professionals (in my previous job we would crank out functional
robotics proofs of concept in mere days!). "Serious" designers (ie product
designers) can then go deeper and change/fix the inefficient libraries.
Even if you must rewrite a library completely, you still avoid writing tons
of boilerplate.
Nobody is stopping us from utilising all the hardware in a chip, this is
what sets apart an experienced designer from your average hobbyist after
all. I often get students asking for advice for getting into
microcontrollers and device programming, and the most common thing I have
to explain to them is that good uC design usually means code that
orchestrates the operation of hardware peripherals and glues their
functionality, rather than code that "does the thing".
I've been following this discussion and you have wetted my appetite for a
clock upscaler. I've got a teensy 4 lying around, I'll give it a go soon
and share the results here.
On Wed, 13 Mar 2024 at 16:16, Neil Johnson via Synth-diy <
synth-diy at synth-diy.org> wrote:
> Roman Sowa wrote:
> > And it's pretty easy to do, as MIDI clock message has no dependencies at
> > all, it can even go between bytes of single note message. Just look for
> > F8 in UART register and bam!
> >
> > I'm a bit surprised that such powerfull processors as used in arduinos
> > can't handle increased traffic, while everything needed to be done in
> > any MIDI receiver can be easily handled within one byte transmission,
> > that is 0.3ms. OTOH I don't use arduinos or libraries so what do I know.
>
> Yes, I do find it rather sad that people don't put the effort into
> learning how to write small, fast code for small processors. When I
> look back and see 8-bit processors like the 6502 and Z80 in home
> computers doing _ALL_ the work with relatively few registers (the 6502
> has 3, the Z80 has 8) running at 1-4 MHz, and then I look at something
> like the Atmega8 with its 32 registers at 16 MHz and more integrated
> peripherals than you can shake a stick at...... *sigh*....
>
> And MIDI was designed at the time of these 8-bit machines so it really
> is quite easy to process with very little state (i.e., memory) needed.
>
> Neil
> ________________________________________________________
> This is the Synth-diy mailing list
> Submit email to: Synth-diy at synth-diy.org
> View archive at: https://synth-diy.org/pipermail/synth-diy/
> Check your settings at: https://synth-diy.org/mailman/listinfo/synth-diy
> Selling or trading? Use marketplace at synth-diy.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://synth-diy.org/pipermail/synth-diy/attachments/20240315/252b592f/attachment.htm>
More information about the Synth-diy
mailing list