Quantcast
Channel: KVR Audio
Viewing all articles
Browse latest Browse all 5618

Bitwig • Bitwig's Harmonize Device: The Gory Details

$
0
0
I’ve spent several days exploring how Bitwig’s Harmonize device works. I think I understand how it works, though I’m still a bit befuddled about some aspects of why it works the way it does.

I noticed several older posts here (2017 and 2018) asking about the device (back when it was called Note Harmonizer).

Here, years later (sorry), is my answer.

This post has four parts:
  1. Preliminaries: Stuff to know before I dive into the details.
  2. The Process: Quite terse (sorry).
  3. Explanation: A slightly wordier attempt to explain the process, with examples.
  4. Notes about Parameters. Some thoughts about Incoming Note Key and Live Harmony Source.

Preliminaries

Disclaimer

I’ve tested dozens of scenarios and compared the output of my process to the output of Harmonize. In every scenario I’ve tested, my process produces exactly the same results as Harmonize.

That said, I am not claiming that the process that Harmonize actually follows is identical to the one I describe, or even similar to it.

And there may be scenarios I have not tested that would produce different results.

Goals of the Harmonize Device
  • Goal 1. Transpose each incoming note based on the lowest note in the Live Harmony Source. (Step 1 of the process.)
  • Goal 2. Snap the transposed notes to correspond to the harmony represented by the Live Harmony Source. (Steps 2 and 3 of the process.)
  • Goal 3. Keep the outgoing notes in the same octave as the corresponding incoming notes. (Step 4 of the process.)
Pitch Class

In the process I describe below, each step refers to the pitch classes of one or more notes.

In most cases I refer to pitch classes using integer notation. In this notation the pitch class of a note is its distance (in semitones) from the nearest C note that is no higher than the given note. The pitch class of any C is 0; the pitch class of any C♯ is 1; and so on up to B (pitch class 11).

When you add or subtract two pitch classes, use mod 12 arithmetic. If the result is 12 or higher, subtract 12. If the result is less than 0, add 12. The result will always be in the range 0 to 11.

In some cases I refer to a pitch class by its note name (C, C♯, D, D♯, …).



The Process

Whenever Harmonize receives one or more Note On messages at its input, it applies the following steps.

Step 1. Transpose

Transpose each new incoming note by adding the pitch class of the lowest note in the Live Harmony Source. By “new note,” I mean a note identified by one of the Note On messages that triggered this Harmonize process.

Step 2. Identify Snapping Targets

For each note in the Live Harmony Source, identify a Snapping Target (my term) by adding the pitch class of the note to the pitch class of the Incoming Note Key.

Step 3. Snap

Snap each transposed note by applying the following rules in order.

Rule 3.1. If the pitch class of the transposed note is a Snapping Target, skip to step 4.

Rule 3.2. If the pitch class of the note below the transposed note is a Snapping Target, move the transposed note down one semitone and skip to step 4.

Rule 3.3. If the pitch class of the note above the transposed note is a Snapping Target, move the transposed note up one semitone.

Step 4. Confine to Original Octave

If steps 2 and 3 moved an incoming note up to or across a note with the same pitch class as the Incoming Note Key, move the transposed note down one octave.



Explanation

Step 1. Transpose

This step transposes each input note based on the lowest note in the Live Harmony Source.

Specifically, it transposes each note upward by a number of semitones equal to the pitch class of the lowest note in the Live Harmony Source.

Example 1: The incoming note is G3 and the lowest note in the Live Harmony Source is C (pitch class 0). Step 1 transposes the G3 up by 0 semitones to G3.

Example 2: The incoming note is G3 and the lowest note in the Live Harmony Source is G (pitch class 7). Step 1 transposes the G3 up by 7 semitones to D4.

That’s all there is to this step. It does not analyze the harmony or the incoming notes more deeply than that. It’s just a simple transposition.

Step 2. Identify Snapping Targets

Step 2 in effect aligns the Live Harmony Source with the Incoming Note Key by transposing the harmony’s pitch classes up from their original key (C) to the key of the incoming notes (the Incoming Note Key).

Example 1: The Live Harmony Source has an active E4 note (pitch class 4), and the Incoming Note Key is D (pitch class 2). Step 2 will identify a Snapping Target with pitch class 6 (F♯). Just as the original harmony note (E4) was a major 3rd above its original tonic (C), the Snapping Target (F♯) is a major 3rd above the Incoming Note Key (D).

Example 2: The Live Harmony Source has an active G6 note (pitch class 7), and the Incoming Note Key is A (pitch class 9). Step 2 will identify a Snapping Target with pitch class 4 (E). Just as the original harmony note was a perfect 5th above its original tonic (C), the Snapping Target (E) is a perfect 5th above the Incoming Note Key (A).

Step 3. Snap

The goal for step 3 is to shift the transposed input notes to nearby harmony notes to better conform to the harmony. This is a somewhat weak goal. Step 3 will never move a note more than one semitone, and so may leave some notes several semitones away from the nearest harmony note.

The decision of whether to snap, and in which direction to snap, depends entirely on the pitch classes of the notes involved.

Example 1 (Rule 3.1): The transposed note is C4, and the snapping targets include 0 (C), 1 (C♯), and 11 (B). Because the pitch class of the transposed note (C4, pitch class 0) is a snapping target, Rule 3.1 will skip to Step 4 without moving the note. It does not matter that the pitch classes of both neighboring notes are also snapping targets, because Rule 3.1 takes precedence over Rules 3.2 and 3.3.

Example 1 shows that if the pitch class of a transposed note is itself a snapping target, then note already conforms to the harmony. It doesn’t need to be snapped.

Example 2 (Rule 3.2): The transposed note is C4, and the snapping targets include 1 (C♯) and 11 (B) but not 0 (C). Rule 3.1 does not apply, because the pitch class of the transposed note (C4, pitch class 0) is not a snapping target, so Rule 3.1 does not apply. The note below (B3, pitch class 11) is a snapping target. This satisfies rule 3.2, which snaps the note down to B3. It does not matter that the note above the transposed note (C♯4, pitch class 1) is also a snapping target, because Rule 3.2 takes precedence over Rule 3.3.

Example 2 shows that if a transposed note is sandwiched between two snapping targets (one a semitone above and one a semitone below), Step 3 prefers to move the note down instead of up.

Example 3 (Rule 3.3): The transposed note is C4, and the snapping targets include 1 (C♯) but not 0 (C) or 11 (B). Rule 3.1 does not apply, because the pitch class of the transposed note (C4, pitch class 0) is not a snapping target. Rule 3.2 does not apply, because the pitch class of the note below (B3, pitch class 11) is not a snapping target. But the pitch class of the note above (C♯4, pitch class 1) is a snapping target. So Rule 3.3 snaps the note up to C♯4.

Example 4 (no snapping rules apply): The transposed note is C4, and the only snapping target is 2 (D). Neither the transposed note (C4, pitch class 0), nor the note above (C♯4, pitch class 1), nor the note below (B3, pitch class 11) is a snapping target. So none of the rules apply, and Step 3 leaves the note where it is, at C4.

Example 4 shows that if a transposed input note is more than one semitone away from the nearest snapping target, Step 3 leaves the note unchanged.

Step 4. Confine to Original Octave

A final Harmonize goal (after transposing and snapping the incoming notes) is for each outgoing note in be the same octave as the corresponding incoming note.

For this step, Harmonize reckons each octave starting from the Incoming Note Key.

For example, if the Incoming Note Key is F, the octaves are F-2 to E-1, F1 to E0, F0 to E1, and so on.

Steps 1 and 3 might transpose an incoming note from one octave into the next. If that happens, Step 4 moves the outgoing note down to the same octave as the incoming note.



Notes about Parameters

The Live Harmony Source Parameter

The live help for Live Harmony Source says:
All active notes from this source are analyzed for rough key structure, which notes arriving at this device are then conformed to fit.
In my view, “analyzed for rough key structure” is a wild overstatement, even with “rough” as a hedge.

As far as I can tell, Harmonize analyzes the notes from the source only in these two ways:
  • Identify the pitch class of the lowest active note in the Live Harmony Source. Step 1 uses this pitch class to transpose the incoming notes.
  • Identify the pitch class of each note in the Live Harmony Source. Steps 2 and 3 use these pitch classes to identify snapping targets for the transposed notes.
That’s it. The device does no analysis beyond that. It does not identify the type of scale. The scale could be major, minor, locrian, whole tone, chromatic, or any other imaginable scale based on a 12 note octave. Harmonize does not care about the type of scale. It cares only about the lowest note and the pitch classes of the notes.

Think of the Live Harmony Source as a template for creating the harmony, written in some arbitrary scale with C as its tonic.

The Incoming Note Key Parameter

The live help for Incoming Note Key says:
Set this parameter to match the key of the incoming notes, which helps improve the harmonic reshaping.
The Incoming Note Key identifies the tonic of the scale of the incoming notes. The type of scale (major, minor, locrian, whole tone, …) does not matter. This parameter is used only as an offset.

As far as I can tell, Harmonize uses the Incoming Note Key only as an offset, and only in these two ways:
  • Identify the bottom note of each octave. Step 4 uses this to determine the octave of each incoming and outgoing note.
  • Transpose the harmony notes upward (from C to the Incoming Note Key) to create snapping targets.

Statistics: Posted by dhemery — Thu Oct 10, 2024 9:12 pm — Replies 0 — Views 187



Viewing all articles
Browse latest Browse all 5618

Trending Articles