Difference between revisions of "Electronic music - sync"

From Helpful
Jump to: navigation, search
m (PPQN)
m (PPQN)
 
Line 68: Line 68:
  
 
If 1PPQN is a quarter note, then 2PPQN lets you talk eights (and do basic syncopation/offbeats), 4PPQN sixteenths (and basic swing).
 
If 1PPQN is a quarter note, then 2PPQN lets you talk eights (and do basic syncopation/offbeats), 4PPQN sixteenths (and basic swing).
And ''maybe'' 32th notes, but since those are already hard to use or hear, 8PPQN is a soft limit to basic beat sequencing needs.
 
  
If you want to do triplets, or clave-style rhythm, you want a factor 3 in there, as well as 2 or 4.
 
So yes, 6 or 12PPQN would also have worked.
 
  
If you want swing, you want extra steps in the entirely regular pulse whre you can place it, so you quickly want to place at sixteenth-note positions (4PPQN for 16 things per bar)
+
Yet if you want to do triplets, or clave-style rhythm, you want a factor 3 in there, as well as 2 or 4.
  
 +
If you want swing in an entirely regular pulse, you'ld like some extra steps where you can place it, so you quickly want to place at sixteenth-note positions (4PPQN for 16 things per bar)
 +
 +
So now we could argue for 6 or 12PPQN.
  
  
Line 82: Line 82:
  
 
The math says you need the lowest common multiple,
 
The math says you need the lowest common multiple,
and it turns out that 24PPQN covers all the just-mentioned cases.
+
and it turns out that 24PPQN covers all the just-mentioned cases (and pulls in includes 32ths, even though those are hard to hear or play for most of us).
 +
 
  
 
Remembering that 24PPQN means 24 input ticks move onto the next ''quarter'' note, this allows  
 
Remembering that 24PPQN means 24 input ticks move onto the next ''quarter'' note, this allows  
Line 99: Line 100:
 
:: sixtyfourth-note triplets (1 each)
 
:: sixtyfourth-note triplets (1 each)
  
Note that while 24PPQN (e.g. in MIDI) was probably aiming for 32nd notes and triplets, the way the [https://en.wikipedia.org/wiki/Least_common_multiple least common multiple] of 3 and 4 interact means it technically ''allows'' 64th-note triplets, but a lot of 24PPQN don't expose this, because you don't really perceive this.
+
Note that while 24PPQN (e.g. in MIDI) was probably aiming for 32nd notes and triplets, the way the [https://en.wikipedia.org/wiki/Least_common_multiple least common multiple] of 3 and 4 interact means it technically ''allows'' 64th-note triplets, but a lot of 24PPQN devices don't expose this, because you don't really perceive this.
  
  
 
<!--
 
<!--
 +
  
 
'''Are there other reasons for higher PPQN?'''
 
'''Are there other reasons for higher PPQN?'''
Line 117: Line 119:
 
That's not a coherent rhythm anymore. This relates to the way our brain resolves rhythm and tone - the two are different mechanisms, and there's a dead zone where it's not really perceived as either.  Events at &gt;~10Hz (&gt;600bpm) beat can't be described as coherent rhythm for people (and depending on the waveform it triggers, that'll produce a low note).  
 
That's not a coherent rhythm anymore. This relates to the way our brain resolves rhythm and tone - the two are different mechanisms, and there's a dead zone where it's not really perceived as either.  Events at &gt;~10Hz (&gt;600bpm) beat can't be described as coherent rhythm for people (and depending on the waveform it triggers, that'll produce a low note).  
  
So 24PPQN is basically beyond the requirements for rhythmic coherency, in regularly triggering sounds.
+
So 24PPQN is basically beyond the requirements for rhythmic coherency of regularly triggered sounds.
  
  
  
 +
But that's not the only need.
  
'''If you were to record notes, more precision on where the land is great'''
+
'''The above assumes you want strict regularity. If you like things like swing, you don't want it to snap to the beat'''.
  
In that it tends to snap the notes to where you intended them.
 
  
Yet for this, you rarely need more than 16th, ''maybe'' 32nds, so 24PPQN is also already more than you need.
 
 
 
 
'''Another is strict regularity versus not'''
 
 
All of the above assumes you want strict regularity.
 
 
Yet it turns out that at regular music's ~100bpm pace, we can half-consciously tell if it is entirely regular or not.
 
  
 +
It turns out that at regular music's ~100bpm pace, we can half-consciously tell if it is ''entirely'' regular or ''not quite''.
 
While this is hard to fully separate from musical styles/genres (techno is always regular, jazz never is), there are plenty of examples (e.g. rock) where strict regularity will sound a bit artificial to us, even if we can't directly say why.
 
While this is hard to fully separate from musical styles/genres (techno is always regular, jazz never is), there are plenty of examples (e.g. rock) where strict regularity will sound a bit artificial to us, even if we can't directly say why.
  
Line 143: Line 137:
 
Similar for drums, more so in slower beats{{verify}} because this is more easily perceived as tension, sluggishness, laziness.
 
Similar for drums, more so in slower beats{{verify}} because this is more easily perceived as tension, sluggishness, laziness.
  
Consider e.g. J Dilla, known for his interesting irreglar beats. He used an early MPC - but unlike most other people, he turned quantize off. {{comment|(...which actually still quantized to 96PPQN because that was the internal rate of early MPCs)}}
+
You can get DAWs to generate random little offsets to notes, to get a similar effect.
  
DAWs may allow or even generate random little offsets to notes, to get a similar effect.
+
Consider e.g. J Dilla, known for his interesting irreglar beats. He used an early MPC - but unlike most other people, he turned quantize off.
 +
 
 +
 
 +
If your device happens to work in a strictly regular pattern,  
 +
then if it just happens to run a few times faster,
 +
that gives you a ''lot'' more ability to add a swing-like feel.
 +
 
 +
Yet for this, you rarely need more than 16th, ''maybe'' 32nds, so 24PPQN is also already more than you need.
 +
 
 +
And 96PPQN gives you better-than-128th-note intervals.  
  
  
Line 170: Line 173:
 
You can argue for 96PPQN well enough; 96PPQN at 120BPM means 5ms.
 
You can argue for 96PPQN well enough; 96PPQN at 120BPM means 5ms.
  
 
+
And remember that J Dilla example? It turns out turning quantize meant it went to 96PPQN, because that was the internal rate of early MPCs.
Maybe a few hundred PPQN to be safe, tops, for the most extreme of uses,
+
assuming we need to hit that 2ms or a little better.
+
 
+
  
  
  
Then the gearheads enter, arguing e.g. that you must have millisecond accuracy throughout the range so more more more!
+
Maybe a few hundred PPQN to be safe, tops, for the most extreme of uses, assuming we need to hit that 2ms or a little better.
...never mind that at 30BPM -- one beat ''every two seconds''' -- you are just ''not'' going to perceive millisecond accuracy. ''At all''.
+
  
  
  
 +
...and then the gearheads enter, arguing e.g. that you must have millisecond accuracy throughout the range so more more more!
 +
...never mind that at 30BPM -- which is one beat ''every two seconds''' -- you are just ''not'' going to perceive millisecond accuracy.
 +
''At all''.
  
DAWs with PPQN figures like 4096 or 9600 is purely a marketing thing.
+
...and then DAWs figure that higher numbers means a few more customers, so now we have 4096 or 9600.
It seems the only reason reason they don't go higher is that's down to a single audio sample (at 0.06ms)
+
It seems the ''only'' reason reason they don't go higher is that someone will call them out of the fact that that'd be shorter than a single audio sample.
  
 
-->
 
-->

Latest revision as of 17:54, 21 May 2022

The physical and human spects dealing with audio, video, and images

Vision and color perception: objectively describing color · the eyes and the brain · physics, numbers, and (non)linearity · color spaces · references, links, and unsorted stuff

Image: file formats · noise reduction · halftoning, dithering · illuminant correction · Image descriptors · Reverse image search · image feature and contour detection · OCR · Image - unsorted

Video: format notes · encoding notes · On display speed


Audio physics and physiology: Basic sound physics · Human hearing, psychoacoustics · Descriptions used for sound and music

Digital sound and processing: capture, storage, reproduction · programming and codescs · some glossary · Audio and signal processing - unsorted stuff


Electronic music: Some history, ways of making noises · Gaming synth · on APIs (and latency) ··· microphones · studio and stage notes · Effects · sync ·

Music electronics: device voltage and impedance, audio and otherwise · amps and speakers · basic audio hacks · Simple ADCs and DACs · digital audio · multichannel and surround ·

Noise stuff: Stray signals and noise · sound-related noise names · electronic non-coupled noise names · electronic coupled noise · ground loop · strategies to avoid coupled noise · Sampling, reproduction, and transmission distortions · (tape) noise reduction


Unsorted: Visuals DIY · Signal analysis, modeling, processing (some audio, some more generic) · Music fingerprinting and identification

For more, see Category:Audio, video, images

Sync in general

Devices can keep pretty damn regular rhythm with an internal clock, much better than people can ever hear.

However small the imprecision (could be order of .01%), multiple devices with their own time would eventually still go out of sync - or be so unless you start both at precisely the same time.




We could instead do what modular synths do: not actually synchronize up, they just make a sound in direct response when they see an event on their input. But that basically means one thing must be in control of everything, and only one thing can keep time.




What we end up wanting instead of either of those is devices regularly matching up, so that each device can do its own thing to a shared beat that will never go off.


Electrically, sync is typically a square impulse, because that is best defined electrically, and easy to produce and consume.


Functionally, sync just tells another device when to move on to the next step in a sequence.

This means there is only one clock, and everything else will keep synchronized to it. Each device will do the same thing, no matter how (ir)regular that one clock is.


But this raises some questions.

Say, you can tell another device to progress on every tick, then you can only share four-to-the-floor sort of beat.

You couldn't have one thing play faster (e.g. an eighth-note melody over a fourth-note rhythm, a slow kickdrum and faster hihats), things like syncopation, off-beats, swing, triplets, slugghishly late beats, polyrhythm.

Assuming the ticks are entirely regular, then doing those things comes down to how a device consumes them.

The eighth-note melody on top of quarter note beat would be served by having one device progress only every second tick.

That kickdrum-and-hihat example by making the kickdrum only react every fourth or eighth tick.

PPQN

PPQN (a.k.a. PPQ and TPQN) is fairly literal: the amount of electronic-level pulses (/ticks) before a listening device moves on to the next quarter note.


Defining this with a quarter notes at the center seems purely because it's music theory's default. It needn't actually be a quarter note - you can play things faster or slower - but when combining more than one device, that tends to become the common denominator.

(note that this pulse is electronic/signal sense[1] of a rapid transient that returns to its baseline, not that of musical pulse. The below uses ticks to maybe lessen confusion)


PPQN is often seen in the form 24PPQN, e.g. in MIDI beat clock (and the earlier DIN sync).


Why 24? Why not fewer? Why not more?

More exists. Fewer exists. 24PPQN just became a convention.


Consider our needs.

If 1PPQN is a quarter note, then 2PPQN lets you talk eights (and do basic syncopation/offbeats), 4PPQN sixteenths (and basic swing).


Yet if you want to do triplets, or clave-style rhythm, you want a factor 3 in there, as well as 2 or 4.

If you want swing in an entirely regular pulse, you'ld like some extra steps where you can place it, so you quickly want to place at sixteenth-note positions (4PPQN for 16 things per bar)

So now we could argue for 6 or 12PPQN.


If you want polymeter, you can use the same musical pulse but have one thing loop earlier. This doesn't really change anything (and was simple to do even in early electronic music).


The math says you need the lowest common multiple, and it turns out that 24PPQN covers all the just-mentioned cases (and pulls in includes 32ths, even though those are hard to hear or play for most of us).


Remembering that 24PPQN means 24 input ticks move onto the next quarter note, this allows

typical ones:
whole note (96 counts each)
half note (48 counts each)
quarter notes (24 counts each)
eight notes (12 counts each),
sixteenth notes (6 counts each)
32nd notes (3 counts each)
and triplets
quarter note triplets (16 each) (note this aligns only every second beat, at 48 ticks, 2*24 and 3*16)
eight-note triplets (8 each; more common for musically practical reasons)
sixteenth-note triplets (4 each),
thirtysecondth-note triplets (2 each),
sixtyfourth-note triplets (1 each)

Note that while 24PPQN (e.g. in MIDI) was probably aiming for 32nd notes and triplets, the way the least common multiple of 3 and 4 interact means it technically allows 64th-note triplets, but a lot of 24PPQN devices don't expose this, because you don't really perceive this.



Some practical details

One practical limitation is that such a pulse alone can't communicate when a measure should start over, so it's not very hard to get two devices playing at the same speed, but start/restart their measures at different times.

One workaround is to, if possible, prime each listening device at the start, and only then start the sync pulses.

Sync in the real world

MIDI beat clock, a.k.a. MIDI timing clock, MIDI clock, is using regular MIDI connection to transmit a (single-byte) message at 24PPQN.

see also MIDI#Beat_clock


MIDI Timecode, a.k.a. MTC, is a variant of SMPTE

Which isn't really a beat, so it turns out to be somewhere between finicky and useless to use for rhythm.
It's useful to mention, to point out that this is not the same as beat clock.
see also MIDI#MTC


DIN sync pinout
DIN Sync[2] is a PPQN style pulse on a dedicated pin of a DIN socket. (A second pin set whether the drum machine should be running or paused. There are a few pinout variations.)

DIN sync is typically 24PPQN, and also known as Sync24.


Some old drum machines (e.g. some from Linn, Korg) used 48PPQN, many others 24PPQN (e.g. Roland). If DIN-synced between those, they'd go at twice/half speed. Which some people used intentionally, others has a converter box for.



Modular synth sync - there's usually just one thing keeping time, and all other things make a sound as soon as they see an event (trigger or gate), and don't run their own timer at all.

Even deriving varied clock signals using modules tend not to use what you'd classically call sync.
As such, it's usually only the clock generator you use that needs to know about rhythm, everything else just needs to react.