MakeCode Games!

A fan-made community library of MakeCode Arcade games. Visit MakeCode Arcade to make a game!

← Back to extensions

Retro FX

Add juicy 8-bit sound synthesizers, screen shakes, particle explosions, camera effects, and retro text displays to your games.

jitter pitch

Problem it solves

You want synthesized chiptune tones to have slight pitch fluctuations so sound effects do not sound static or robotic.

What this block does

Adds a random offset within a positive and negative range to a base pitch value.

The block

Block ID: retro_jitter_pitch

jitter pitch $pitch amount $amount block

Parameters

NameTypeDefaultMeaning
pitchnumber600Base pitch frequency in Hertz.
amountnumber15Maximum random deviation added or subtracted.

Returns

number — The jittered pitch frequency.

Example

let newPitch = Retro.jitterPitch(440, 20)
console.log(newPitch)

Add the extension

Add github:CrzLe0723/RetroFx to your project, or open: Import RetroFx.