From d4f904da669b003c91394799bc5521ebd745122b Mon Sep 17 00:00:00 2001
From: julian laplace <julescarbon@gmail.com>
Date: Tue, 9 May 2023 16:38:32 +0200
Subject: render relabi wave to canvas

---
 src/index.jsx | 49 +++++--------------------------------------------
 1 file changed, 5 insertions(+), 44 deletions(-)

(limited to 'src/index.jsx')

diff --git a/src/index.jsx b/src/index.jsx
index 8c07739..b41c7da 100644
--- a/src/index.jsx
+++ b/src/index.jsx
@@ -1,55 +1,16 @@
 import * as React from "react";
 import { createRoot } from "react-dom/client";
 import { requestAudioContext, randrange } from "./lib/util";
-import Relabi from "./relabi";
-import { Kalimba, Drums } from "./lib/instruments";
+
+import App from "./ui/App.jsx";
 
 document.body.style.backgroundColor = "#111";
 document.body.style.color = "#fff";
+document.body.style.margin = 0;
+document.body.style.padding = 0;
 
 requestAudioContext(() => {
   document.body.innerHTML = '<div id="app"></div>';
-
-  const relabi = new Relabi({
-    waves: [
-      { type: "sine", frequency: 0.75 },
-      { type: "sine", frequency: 1.0 },
-      { type: "sine", frequency: 1.617 },
-      { type: "sine", frequency: 3.141 },
-    ],
-    bounds: [
-      {
-        level: -0.5,
-        sounds: [
-          { instrument: Drums, index: 0 },
-          { instrument: Drums, index: 1 },
-        ],
-      },
-      {
-        level: 0.5,
-        sounds: [
-          { instrument: Drums, index: 2 },
-          { instrument: Drums, index: 3 },
-        ],
-      },
-      {
-        level: -0.25,
-        sounds: [
-          { instrument: Kalimba, frequency: 440 },
-          { instrument: Kalimba, frequency: (440 * 3) / 2 },
-        ],
-      },
-      {
-        level: 0.25,
-        sounds: [
-          { instrument: Kalimba, frequency: (440 * 6) / 5 },
-          { instrument: Kalimba, frequency: (440 * 6) / 7 },
-        ],
-      },
-    ],
-  });
-  relabi.start();
-
   const root = createRoot(document.getElementById("app"));
-  root.render(<h1>Relabi generator</h1>);
+  root.render(<App />);
 });
-- 
cgit v1.2.3-70-g09d2

