keropi wrote:Please do not confuse hardware connection clock signals with software ones, that's not how things work.
Clock is required in hardware level in the midi protocol so devices sync.
I'm sorry, but this is just plain incorrect. As a warning, this is going to be a long post, but I hope it will be interesting to people into MIDI-based equipment in general. For background am very familiar with the MIDI standard, as I have tinkered extensively with MIDI synthesizers (i.e., the stand-alone type, not PC), including programming MIDI implementations for microcontrollers.
To clarify, let's start with the MIDI protocol specification from https://www.midi.org/specifications-old/item/ … 0-specification (which I have read several times over while implementing MIDI stuff). The clock is first introduced along with other realtime messages. Note that already the second passage here notes that they are "normally ignored by keyboard instruments and synthesizers".
The MIDI System Real Time messages are used to synchronize all of the MIDI clock-based equipment within a system, such as sequencers and drum machines. Most of the System Real Time messages are normally ignored by keyboard instruments and synthesizers.
The clock (or indeed most other real time messages) are, as noted in the specifications, used to synchronise clock-based equipment, of which sequencers and drum machines are given as examples. The drum machine here does not refer to a sound module that simply produces drum sounds, but to a drum machine which has its own patterns, thus requiring the clock to synchronise the tempo. The sequencer does require a clock, but in almost all MPU-based uses the PC is the only "sequencer" in the system, as it plays back the notes, such as from a game to a sound module. In this case it is the game which acts as the clock, and it would be incorrect to sync the clock to an incoming MIDI tempo, or to a "hardware clock" generated outside the game. In theory the game could ask the MPU to generate a hardware clock at a specific tempo and then sync itself to that clock, but even in this scenario it is not required to send out the clock anywhere, since the game is again the only "sequencer" or other clock-based thing in the system.
In particular, let's be clear here that devices like the MT-32 and SC-55 and any GM, GS and XG sound modules do not need a MIDI clock. This is trivially provable by observing the MIDI data transmitted and noting the absence of the real time clock is not an issue (e.g., connect any "plain" MIDI keyboard and play, or observe the data sent from a regular PC MIDI interface, or even take a signal which includes the clock and remove those – this is what I am currently doing in my patchbay for the MPU card; the MOTU MTP AV patchbay can do advanced filtering, routing and remapping on MIDI data).
Some fancier sound modules and synthesizers, as well as most drum machines, may also include a built-in sequencer or MIDI file player, in which case they may indeed offer the capability to send out the clock (I have several synthesizers and drum modules that do). Then, yes, there is the option to setup your device as either a master or a slave with regard to the clock. This is necessary because in the MIDI data stream the clock beat is simply the single constant byte (0xF8), and thus doesn't include any channel information to denote which device it is meant for. This means that if multiple devices send out a clock in the same system, and those clocks get merged inadvertently, any recipients of this multiplied clock will see the sum of the tempos (with strangely spaced beats, no less). So, yes, it is possible for a single device to be selectable between a clock master and slave. The setting has no other effect than to source the clock, and thus doesn't exist in "plain" synthesizers or sound modules (such as the MT-32 and most classic keyboard synths) – they are not "slaves", because the simply ignore the clock (as pointed out by the MIDI specification) altogether!
So, let's get back to the MPU card and its "hardware clock". The only time it matters is when you are syncing multiple sequencers/drum machines to the same clock and you want the MPU to be the clock master. If you are not syncing any other clock-based devices (such as when the PC containing the MPU is the only sequencer, as is always the case when playing game music), sending the clock out is unnecessary.
Now, if the PC containing the MPU card is the clock master and you wish to sync other devices (such as a drum machine) to it, yes, you want it to send out the clock but you must also sync to that clock yourself, i.e., either the sequencer/composer software you run on the PC must follow that exact same clock that is being sent out, or it must be able to disable the "hardware clock" and instead send out its own "software clock" (which is, on the MIDI protocol level, the same constant 0xF8 bytes, but the clock source is different). Likewise if you wish to sync a software sequencer or drum machine to an external device (such as a hardware sequencer which is what the musician is likely to actually be operating during a live performance), the MPU card must have the option to become slave to that external clock. Sure, you could simply receive an external clock beat on the MIDI IN, but then you would be sending the wrong clock out, unless it is possible to disable the hardware clock. (edit: And indeed the MPU specifically has a command to become a slave to an external clock, stopping the internal one, see the next post.)
Anyway, like said, I have solved this issue for my (admittedly complex) setup by simply setting up my patchbay to ignore all realtime messages (including the clock beat) from the MPU input, but merge others into the outputs going to the various sound modules. This allows me to keep a bunch of sources, including 4 different computers, connected all the time and sharing the same sound modules, without having to worry about powering on the MPU and inadvertently messing up the tempo sync in the (admittedly rare) case that I would have another clock master and clock-based slaves on the same patchbay. (One example of such a case would be to use the TR-8 drum machine with its nice tempo adjustment and start/stop buttons as the clock master through the patchbay while using Ableton Live and some of the vintage sound modules.) (edit: See next post for solutions.)