mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-27 13:38:40 +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 * as Tone from 'tone';
|
||||||
|
import { State, TimeSpan } from '../../strudel.mjs';
|
||||||
import CodeMirror, { markEvent, markParens } from './CodeMirror';
|
import CodeMirror, { markEvent, markParens } from './CodeMirror';
|
||||||
import cx from './cx';
|
import cx from './cx';
|
||||||
import { evaluate } from './evaluate';
|
import { evaluate } from './evaluate';
|
||||||
@ -94,6 +95,18 @@ function App() {
|
|||||||
<h1 className="text-2xl">Strudel REPL</h1>
|
<h1 className="text-2xl">Strudel REPL</h1>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex space-x-4">
|
<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()}>
|
<button onClick={() => togglePlay()}>
|
||||||
{!pending ? (
|
{!pending ? (
|
||||||
<span className="flex items-center w-16">
|
<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 {
|
export declare interface Fraction {
|
||||||
(v: number): Fraction;
|
(v: number): Fraction;
|
||||||
d: number;
|
d: number;
|
||||||
@ -19,6 +21,6 @@ export declare interface Hap<T = any> {
|
|||||||
show: () => string;
|
show: () => string;
|
||||||
}
|
}
|
||||||
export declare interface Pattern<T = any> {
|
export declare interface Pattern<T = any> {
|
||||||
query: (span: TimeSpan) => Hap<T>[];
|
query: (span: State) => Hap<T>[];
|
||||||
fmap: (v: T) => T;
|
fmap: (v: T) => T;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user