This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@strudel.cycles/react

0.9.0 • Public • Published

@strudel.cycles/react

This package contains react hooks and components for strudel. It is used internally by the Strudel REPL.

Install

npm i @strudel.cycles/react

Usage

Here is a minimal example of how to set up a MiniRepl:

import * as React from 'react';
import '@strudel.cycles/react/dist/style.css';
import { MiniRepl } from '@strudel.cycles/react';
import { evalScope, controls } from '@strudel.cycles/core';
import { samples, initAudioOnFirstClick } from '@strudel.cycles/webaudio';

async function prebake() {
  await samples(
    'https://strudel.tidalcycles.org/tidal-drum-machines.json',
    'github:ritchse/tidal-drum-machines/main/machines/'
  );
  await samples(
    'https://strudel.tidalcycles.org/EmuSP12.json',
    'https://strudel.tidalcycles.org/EmuSP12/'
  );
}

async function init() {
  await evalScope(
    controls,
    import('@strudel.cycles/core'),
    import('@strudel.cycles/mini'),
    import('@strudel.cycles/webaudio'),
    import('@strudel.cycles/tonal')
  );
  await prebake();
  initAudioOnFirstClick();
}

if (typeof window !== 'undefined') {
  init();
}

export default function App() {
  return <MiniRepl tune={`s("bd sd,hh*4")`} />;
}

Package Sidebar

Install

npm i @strudel.cycles/react

Weekly Downloads

0

Version

0.9.0

License

AGPL-3.0-or-later

Unpacked Size

586 kB

Total Files

33

Last publish

Collaborators

  • felixroos
  • yaxupaxo