mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-11 21:58:37 +00:00
hidden 100s button
This commit is contained in:
parent
733994f9b5
commit
679f30abe3
@ -1,5 +1,6 @@
|
||||
import React, { useCallback, useLayoutEffect, useRef, useState } from 'react';
|
||||
import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
||||
import * as Tone from 'tone';
|
||||
import { State, TimeSpan } from '../../strudel.mjs';
|
||||
import CodeMirror, { markEvent, markParens } from './CodeMirror';
|
||||
import cx from './cx';
|
||||
import { evaluate } from './evaluate';
|
||||
@ -94,6 +95,18 @@ function App() {
|
||||
<h1 className="text-2xl">Strudel REPL</h1>
|
||||
</div>
|
||||
<div className="flex space-x-4">
|
||||
{/* <button
|
||||
onClick={() => {
|
||||
console.log('log..');
|
||||
const start = performance.now();
|
||||
const events = pattern?.query(new State(new TimeSpan(0, 100)));
|
||||
const took = performance.now() - start;
|
||||
console.log('took', took / 1000);
|
||||
console.log('events', events);
|
||||
}}
|
||||
>
|
||||
log 100s
|
||||
</button> */}
|
||||
<button onClick={() => togglePlay()}>
|
||||
{!pending ? (
|
||||
<span className="flex items-center w-16">
|
||||
|
||||
4
repl/src/types.d.ts
vendored
4
repl/src/types.d.ts
vendored
@ -1,3 +1,5 @@
|
||||
import type { State } from '../../strudel.mjs';
|
||||
|
||||
export declare interface Fraction {
|
||||
(v: number): Fraction;
|
||||
d: number;
|
||||
@ -19,6 +21,6 @@ export declare interface Hap<T = any> {
|
||||
show: () => string;
|
||||
}
|
||||
export declare interface Pattern<T = any> {
|
||||
query: (span: TimeSpan) => Hap<T>[];
|
||||
query: (span: State) => Hap<T>[];
|
||||
fmap: (v: T) => T;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user