react-synth
Components

Sample

Plays audio samples

<Sample>

Plays an audio sample file with optional effects. Samples are loaded from a built-in sample library.

PropTypeDefaultDescription
nameSampleNameRequired. Sample name (without file extension)
ampnumber1Amplitude/volume multiplier
cutoffnumber or Line20000Lowpass filter cutoff (MIDI note or Hz)
ratenumber1Playback rate multiplier
pannumber0Stereo pan position: -1 (left) to 1 (right)

Cutoff Values (MIDI note → Hz)

  • 60 → ~262 Hz (C4)
  • 80 → ~831 Hz
  • 100 → ~2637 Hz
  • 110 → ~4699 Hz
  • 130 → ~20kHz (no filtering)
{
  /* Basic kick drum */
}
<Sample name="bd_haus" />;

{
  /* Louder with filter */
}
<Sample name="bd_haus" amp={2} cutoff={100} />;

{
  /* Hi-hat with pitch shift and panning */
}
<Sample name="drum_cymbal_closed" rate={1.2} pan={0.3} />;

{
  /* Snare with lowpass filter */
}
<Sample name="drum_snare_soft" cutoff={80} amp={0.8} />;

On this page