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.

play envelope sound

Problem it solves

You want to design a custom synthesizer sound effect with fine control over attack, decay, sustain, and release phases.

What this block does

Synthesizes and plays a custom audio wave with configurable start and end pitch and envelope timing.

The block

Block ID: retro_envelope_sound

play envelope sound start pitch $startPitch end pitch $endPitch||attack $attack decay $decay sustain $sustain release $release block

Parameters

NameTypeDefaultMeaning
startPitchnumber600The starting audio frequency in Hertz.
endPitchnumber400The ending audio frequency in Hertz.
attacknumber50Time in milliseconds for volume to rise.
decaynumber50Time in milliseconds for volume to drop to sustain level.
sustainnumber180The volume level held during sustain.
releasenumber100Time in milliseconds for sound to fade out.

Example

Retro.envelopeSound(800, 300, 30, 40, 150, 80)

Add the extension

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