Repository navigation
Processing: 'Auto' transposes one-sample presets, chords are measured at their root note - #492
Open
douglas-carmichael wants to merge 2 commits into
Open
douglas-carmichael wants to merge 2 commits into
douglas-carmichael wants to merge 2 commits into
Conversation
The Transpose processing option set to 'Auto' needs at least three measured zones which agree, so a multi-sample of one or two zones - typically one recording stretched across the keyboard - never got a result. All 36 one-sample synth presets of Rephazer's 'Operator's Choise' for the Deluge stayed where they are, although 26 of them sound one or two octaves below their root keys: 'R921 KEY RHODES NOTE' maps its recording of the MIDI note 84 (1047 Hz) to the key 96 and plays an octave below the keys on the Deluge as well. Such a multi-sample has no majority which could outvote a misreading, so it is now only trusted if all of its zones are measured, they agree and they sound a whole number of octaves away from their root keys: a root key set in another octave than the recording is the common case, and moving it by octaves keeps the keys in tune, while a chord or an inharmonic sound can measure as any interval. Multi-samples of three or more zones are measured as before: the notes of 109 SoundFonts and 65 TAL-Sampler presets of Espen Kraft, 102 Tonverk presets and 25 OP-XY presets do not change. The note about a preset which plays its samples as recorded far away from the middle of the keyboard said that the Transpose processing option can move it, which suggested 'Auto' as well - but 'Auto' only moves root keys onto the pitch measured in their samples, not towards the middle. The note now names the setting which plays the samples as recorded closest to the middle, in whole octaves within the range of the option, and it is no longer logged for a multi-sample which the processing transposed, since that no longer plays as the source maps it. Analysing with 'Auto' selected reported no pitch at all: the note was left out because the transposition reports it, but analysing does not transpose.
The pitch of a sample is the highest fundamental whose harmonics hold most of its power, which is the pitch of a single note. The notes of a chord are harmonic series of their own, and the only fundamental which explains all of them lies below the lowest note and does not sound: a fifth was measured an octave and a major triad two octaves too low. 'Auto' therefore moved chord samples an octave too far - the dyads of Rephazer's 'Operator's Choise' for the Deluge, e.g. 'R919 DYAD LEGATO SYNTH 3' (F4 and C5), by two octaves instead of one, and the multi-sampled 'LOFI 5TH PAD1' of 'Toneworld Vol. 3' for the Tonverk, which sounds at its keys, by an octave. A chord is recognised by the harmonics of the common fundamental which belong to none of its notes: the fundamental itself and e.g. the harmonics 5 and 7 of a fifth stay empty, while a single note whose fundamental is weak or filtered away still has them. Two or three notes are recognised, each starting with at least 2% of the power, and every other harmonic up to the last audible one must be empty, otherwise the sound counts as a single note as before. The chord is measured at its note at the pitch class of the common fundamental - the root of a fifth, a fourth, a major third and a major triad in all of its inversions - and a chord without such a note is not measured. A chord of more notes, e.g. of a choir, is not recognised. Of the 597 presets of 10 libraries which were compared (Deluge, Tonverk, OP-XY, SoundFont, TAL-Sampler and 3rd Wave), 10 change: 5 chord samples are measured an octave higher - 2 dyads, 2 fifth pads and 'FADERS PATH' of 'Toneworld Vol. 3', a fifth; the zones of 'LOFI 5TH PAD1' now agree that it sounds at its keys and those of 'LOFI 5TH PAD3' no longer agree on a wrong octave; the top zone of 'Bass Drone' of Espen Kraft's TAL-Sampler collection Vol. 4 holds a fifth and now agrees with the other zones; and the result of 'CLOCKENSPIEL' of 'Toneworld Vol. 1' and 'Organ 2' of Vol. 4 stays the same with one zone more or less which agrees.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Transpose processing option set to 'Auto' (#477) needs at least three measured zones which agree, so a multi-sample of one or two zones - typically one recording stretched across the keyboard - never got a result. 36 of the 50 synth presets of Rephazer's 'Operator's Choise' for the Deluge are such presets, and 26 of them sound one or two octaves below their root keys: 'R921 KEY RHODES NOTE' maps its recording of the MIDI note 84 (
C6.wav, 1047 Hz) to the key 96 (transpose="-36"), so the Deluge plays it an octave below the keys as well. With 'Auto' selected none of them moved, and the note about presets which play their samples as recorded far from the middle of the keyboard (#288) still said that "the Transpose processing option can move it" - but set to 'Auto' it does not: 'Auto' moves root keys onto the measured pitch, not towards the middle of the keyboard.Measuring the one-sample presets brought up a second problem, which affects multi-samples as well: a chord is measured an octave or more too low. Its notes are harmonic series of their own, and the only fundamental which explains all of them lies below the lowest note and does not sound - an octave below a fifth, two octaves below a major triad. 'Auto' then moves the dyads and fifth pads an octave too far: 'R919 DYAD LEGATO SYNTH 3' (F4 and C5) by two octaves instead of one, and 'LOFI 5TH PAD1' of Rephazer's 'Toneworld Vol. 3' for the Tonverk, whose 12 zones sound at their keys, by an octave.
Changes
PitchDetector.detect: a multi-sample with fewer than three zones gets a result if all of its zones are measured, they agree and their offset rounds to a whole number of octaves (rounded like the transposition). A single recording has no other zones which could outvote a misreading; a root key set in another octave than the recording is the common case, and moving it by octaves keeps the keys in tune, while a chord or an inharmonic sound can measure as any interval. Multi-samples of three or more zones are measured as before.PitchDetector.findChordRoot: when the found fundamental does not sound (less than 3% of the power of its strongest harmonic), its harmonics up to the last audible one (at most 24) are checked. Every harmonic which belongs to none of the notes found so far must either be missing (below 0.1% of the harmonic power or 3% of its neighbours) or start the series of another note (at least 2%). Two or three notes with at least two missing harmonics besides the fundamental are a chord - a fifth leaves the harmonics 1, 5 and 7 empty, while a single note whose fundamental is weak or filtered away still has them; anything else stays a single note as before. The chord is measured at its note at the pitch class of the fundamental - the harmonic 2, 4 or 8, which is the root of a fifth, a fourth, a major third and a major triad in all of its inversions - and a chord without such a note is not measured. A reading therefore only moves up by whole octaves or disappears; its pitch class never changes.ConverterBackend.checkOffCenterMapping: the note names the setting of the Transpose option which plays the samples as recorded closest to the middle of the keyboard, in whole octaves within its range of ±24, and says what 'Auto' does - e.g. "The Transpose processing option set to +24 plays them as recorded at C4 (MIDI 72) - set to 'Auto' it only moves root keys onto the pitch measured in their samples." It is only logged when the processing left the middle of the keyboard as the source maps it: a multi-sample which was transposed, by a fixed number of semitones or by 'Auto', no longer gets it.ConverterBackend.checkSamplePitch: analysing with 'Auto' selected reported no pitch at all. The note was left out because the transposition reports it, but analysing does not transpose.Verification
-Ze -Zpa, with main 31b0f8a and with this branch: main moves 2 multi-sampled presets and logs 32 notes about the middle of the keyboard; the branch also moves 26 one-sample presets - 4 by 24 semitones and 22 by 12, among them the dyads 'R917' and 'R919' - leaves 'R926 LEAD 101 SAW' (-11.5) and the dyad 'R918' (-28.1) alone, and logs 9 notes. Only the QPAT files of the 26 presets differ, in the pitch column of the sample map and nowhere else except the length of the map of 'R931', whose pitch goes from 101 to 77; all samples are byte-identical.