Let's say I am using DAW soft with MIDI keyboard.
When I start real time recording mode and press the key,
then the timing and velocity information is recorded to some file or memory.

Another example.
Let's say I am using DAW soft with microphone.
When I start recording and sing a song,
then the sound pressure is recorded to some file or memory.

So, my question is,

  1. How the MIDI device recognize the information of timing?
    Consider the phonograph record case.
    Information of "when" the needle moved
    is recorded precisely thanks to "constant" rotation of the disc.
    In MIDI device, what mechanism play a role of "turntable" ?

  2. Simlarly, how the sound device records the sound pressure ?

One thing I can think of is,
when MIDI recording is started, store the information of time (GMT time),
and set that the origin of time axis,
and when key is pressed, again refer the GMT time,
and set the MIDI event to appropriate position.

However, sound recording case, I think this method can't be used.

Thank you.

  • 1
    Have you read any data on the MIDI Spec on the internet? It's very interesting stuff. Maybe it will answer your questions about MIDI.
    – n00dles
    Commented Aug 3, 2016 at 3:45

1 Answer 1


When using a DAW, wether for midi sequencing or audio recording, the fundamental timing of the DAW is managed by a high frequency clock.

Depending on your DAW and audio interface, this clock source can be the internal clock of your PC, a clock on your audio interface, or an external clock provided by a third party hardware. But all pieces of the system must be locked on this common clock to work flawlessly.

When you setup a new project in a DAW, you usually have to setup the sampling frequency of the project (44.1 kHz, 48 kHz, ...). This will define the fundamental timing of your DAW session.

When recording MIDI data, each MIDI event is associated with a timestamp based on the reference clock (for example : this MIDI note-on event happened N clock ticks after the session start). Clock ticks can easily be converted into measures/bars or minutes/seconds).

When recording audio, the sound pressure is sampled at every clock tick, and the DAW stores all sampled data into a file. The DAW just need to also store the moment where the recording started relatively to the session start. (This audio file starts N ticks after the session start. Notice that therefore, moving audio data against the timeline is only changing this start time relatively to the session start, not the audio data itself).

  • 2
    @shu-s : if the answer actually answers your question, you should mark it as answered. If it doesn't, you can explain why in the comments.
    – audionuma
    Commented Aug 4, 2016 at 8:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.