Live coding music with React
npm install @react-synth/synthThis is a fun little experiment showing that React API can be used outside of
browser environment to render... music instead of HTML.
Should you use it? I don't know, you are an adult.
See documentation page for more info
Init new repository and install react-synth and its dependencies:
``bash`
npm init
npm i @react-synth/synth react
npm i -D @types/react
Then create new .tsx file. React-synth requires created file to have default
export with ReactNode. For example, you can paste below code:
`tsx
// song.tsx
import React from "react";
import {
Chord,
Loop,
Note,
Sample,
Sequence,
Synth,
Track,
} from "@react-synth/synth";
export default function MySong() {
return (
{/ Melody arpeggio with prophet synth /}
{/ Chord progression /}
);
}
`
Then run it with:
`bash``
npx react-synth song.tsx
Now any change made to the code will cause hot reload without disruption.
- Sonic Pi - The original live coding synth
MIT