Nodes/MKRShift_Nodes/Audio Tempo + Pitch
ComfyUI Node

Audio Tempo + Pitch

Speed up a clip without chipmunks, or shift pitch without changing speed

By criskb·Created 7 months ago·Updated 5 months ago· 0
Audio Tempo + Pitch
  • audio
  • audio
  • output_path
  • duration_sec
  • summary
tempo1.00
pitch_semitones0.0
output_formatauto
filename_prefixMKR_audio_tempo_pitch
subfolder
overwritefalse
filename_label

Two audio edits look like the same thing and aren't: changing speed (tempo) without changing pitch, and changing pitch without changing speed. Tape recorders could only do both at once - speed up and everything squeaks. MKRAudioTempoPitch gives you the two knobs independently, which is what you need for the two most common jobs: fitting a voice clip into a shorter slot (tempo, pitch preserved) or making a track "darker"/"brighter" without affecting its timing (pitch, tempo preserved).

It's an FX node in the MKRShift_Nodes audio set. The typical chain: tempo-fit a dialogue clip to picture, or pitch-shift a generated voice down a couple semitones for a character read, then run the result through the limiter before it hits the mix.

How it works

With ffmpeg present, this is a proper two-stage processing chain. Pitch shift uses the classic asetrate trick - it resamples the audio to a different rate (which shifts pitch) and then compensates the tempo back to 1.0 with an atempo filter, so pitch moves without the clock changing. Tempo uses an atempo chain (split into 2.0/0.5 chunks because a single atempo filter only handles a 0.5–2.0× range). Pitch and tempo compose cleanly: pitch-shift first, then tempo.

Here's the important catch, straight from the source: the fallback path is tape-style. If ffmpeg is unavailable, the node falls back to numpy linear interpolation - and that couples pitch and tempo, the way a tape machine does. The code even warns you about it in the summary: "ffmpeg unavailable: using tape-style fallback where pitch also changes tempo." So the independent control you bought depends on ffmpeg being installed. Install it.

Inputs that matter

  • audio - MKR_AUDIO payload, waveform tensor, or file path.
  • tempo - 0.25 to 4.0, default 1.0. 1.5 = 50% faster, 0.5 = half speed.
  • pitch_semitones - −24 to +24, default 0. −12 = one octave down, +12 = one octave up. (0.1 steps so you can land at any microtone.)
  • Standard save block: output_format, filename_prefix, subfolder, overwrite, optional filename_label.

Outputs: audio (MKR_AUDIO), output_path, duration_sec (tempo changes this; pitch alone doesn't), summary (includes the processing mode - ffmpeg vs the tape fallback).

Install

ComfyUI Manager (search "MKRShift Nodes"), or:

cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes

Restart - then install ffmpeg (macOS: brew install ffmpeg; Windows: winget install ffmpeg). Without it, this node quietly degrades into tape-style coupling, and the whole point of independent tempo/pitch disappears. No model downloads.

Common issues

The tape-fallback surprise is the big one (covered above). Second: at the extremes - tempo 4.0 or pitch ±24 - you'll hear artifacts even with ffmpeg; atempo is a time-stretch algorithm and it gets warbly beyond ~2×. For aggressive speed-ups, do them in small stages or accept the artifact. And watch your durations: tempo 0.5 doubles duration_sec, so if you're tempo-fitting to picture, compute the tempo from the target duration before you run, or use MKRAudioPadTrimDuration to finesse the last few frames.

CategoryMKRShift Nodes/Media/Audio/FX

Inputs (8)

NameTypeDefaultDescription
audio*
tempoFLOAT1.000.25–4
pitch_semitonesFLOAT0.0-24–24
output_formatCOMBOauto5 options: auto, wav, mp3, flac, ogg
filename_prefixSTRINGMKR_audio_tempo_pitch
subfolderSTRING
overwriteBOOLEANfalse
filename_labeloptSTRING

Outputs (4)

NameTypeDescription
audioMKR_AUDIO
output_pathSTRING
duration_secFLOAT
summarySTRING