0.2.8 • Published 7 years ago

react-looper v0.2.8

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

alt text

npm version

Web Audio API based Looper component for React

    • Connect your own AudioContext (or use the default one 🤖)
    • Built-in tweakable oscillator as metronome (tick, tick, tick...💣)
    • Loop your audio file each X bars (just provide the arrayBuffer 👍)

Installation and usage

yarn add react-looper

Metronome

import Looper from "react-looper"

<Looper playing />

99 BPM

<Looper bpm={99} playing />

Play each 4 bars

<Looper bpm={99} playEach={4} playing />

Props

NameTypeDefaultDescription
audioContextAudioContextnew AudioContext()AudioContext object
bpmnumber120sets the tempo of your loop
loopingbooleanfalsestarts or stops your loop
sourceArrayBufferundefinedaudio file to play each iteration
onIterationfunction() => {}function to invoke each iteration
playEachnumberundefinedplay sound each number of iterations

Additional props

oscillator

This object can be provided in order to configure Looper's oscillator and its duration (ms).

NameTypeDefaultDescription
detunenumber0OscillatorNode.detune
durationnumber0duration of the tone in milliseconds
frequencynumberfalseOscillatorNode.frequency
typestring"sine"OscillatorNode.type
const oscillatorConfig = {
	duration: 0.05,
	detune: 1,
	frequency: 555,
	type: "square",
}

<Looper playing oscillator={oscillatorConfig} />

License

MIT Licensed. Copyright (c) Peter Sherhsov 2018.

0.2.8

7 years ago

0.2.7

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago