mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-11 13:48:34 +00:00
import tone always from @strudel/tone
This commit is contained in:
parent
edba815b0b
commit
65deb7df1d
@ -14,7 +14,7 @@ import * as drawHelpers from '@strudel/tone/draw.mjs';
|
||||
import gist from '@strudel/core/gist.js';
|
||||
import shapeshifter from './shapeshifter.mjs';
|
||||
import { mini } from '../mini/mini.mjs';
|
||||
import * as Tone from 'tone';
|
||||
import { Tone } from '@strudel/tone';
|
||||
import * as toneHelpers from '../tone/tone.mjs';
|
||||
import * as voicingHelpers from '../tonal/voicings.mjs';
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import * as Tone from 'tone';
|
||||
import { Tone } from '@strudel/tone';
|
||||
import { State, TimeSpan } from '@strudel/core';
|
||||
|
||||
/* export declare interface UseCycleProps {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { isNote } from 'tone';
|
||||
import _WebMidi from 'webmidi';
|
||||
import { Pattern as _Pattern } from '@strudel/core/strudel.mjs';
|
||||
import * as Tone from 'tone';
|
||||
import { Tone } from '@strudel/tone';
|
||||
|
||||
// if you use WebMidi from outside of this package, make sure to import that instance:
|
||||
export const WebMidi = _WebMidi;
|
||||
@ -67,7 +67,7 @@ Pattern.prototype.midi = function (output, channel = 1) {
|
||||
// console.log('midi', value, output);
|
||||
const timingOffset = WebMidi.time - Tone.getContext().currentTime * 1000;
|
||||
time = time * 1000 + timingOffset;
|
||||
// const inMs = '+' + (time - Tone.context.currentTime) * 1000;
|
||||
// const inMs = '+' + (time - Tone.getContext().currentTime) * 1000;
|
||||
// await enableWebMidi()
|
||||
device.playNote(note, channel, {
|
||||
time,
|
||||
|
||||
@ -4,4 +4,5 @@ TBD
|
||||
|
||||
## Dev Notes
|
||||
|
||||
`@tonejs/piano` has peer dependency on `webmidi@^2.5.1`! A newer version of webmidi will break.
|
||||
- `@tonejs/piano` has peer dependency on `webmidi@^2.5.1`! A newer version of webmidi will break.
|
||||
- If you use Tone in another package, make sure to `import { Tone } from '@strudel/tone`, to ensure you get the same AudioContext.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import * as Tone from 'tone';
|
||||
import { Tone } from '@strudel/tone';
|
||||
import { Pattern } from '@strudel/core';
|
||||
|
||||
export const getDrawContext = (id = 'test-canvas') => {
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
import { Pattern as _Pattern } from '@strudel/core';
|
||||
import * as Tone from 'tone';
|
||||
import * as _Tone from 'tone';
|
||||
|
||||
// import Tone from here, to make sure to get the same AudioContext
|
||||
export const Tone = _Tone;
|
||||
|
||||
const {
|
||||
AutoFilter,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import * as Tone from 'tone';
|
||||
import { Tone } from '@strudel/tone';
|
||||
|
||||
export const hideHeader = () => {
|
||||
document.getElementById('header').style = 'display:none';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import * as Tone from 'tone';
|
||||
import { Tone } from '@strudel/tone';
|
||||
import { State, TimeSpan } from '@strudel/core';
|
||||
import { getPlayableNoteValue } from '@strudel/core/util.mjs';
|
||||
import { evaluate } from '@strudel/eval';
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React, { useCallback, useMemo, useState } from 'react';
|
||||
import * as Tone from 'tone';
|
||||
import { Tone } from '@strudel/tone';
|
||||
import useRepl from '@strudel/hooks/useRepl.mjs';
|
||||
import CodeMirror, { markEvent } from '../CodeMirror';
|
||||
import cx from '../cx';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user