mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-21 20:55:12 -04:00
Merge remote-tracking branch 'origin/main' into velocity-in-value
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
"@nanostores/react": "^0.7.1",
|
||||
"@strudel/codemirror": "workspace:*",
|
||||
"@strudel/core": "workspace:*",
|
||||
"@strudel/draw": "workspace:*",
|
||||
"@strudel/csound": "workspace:*",
|
||||
"@strudel/desktopbridge": "workspace:*",
|
||||
"@strudel/hydra": "workspace:*",
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { colorMap } from '@strudel/core/color.mjs';
|
||||
import React from 'react';
|
||||
import { colorMap } from '@strudel/draw';
|
||||
|
||||
const Colors = () => {
|
||||
return (
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useState, useRef, useCallback, useMemo, useEffect } from 'react';
|
||||
import { Icon } from './Icon';
|
||||
import { silence, getPunchcardPainter, noteToMidi, _mod } from '@strudel/core';
|
||||
import { silence, noteToMidi, _mod } from '@strudel/core';
|
||||
import { getPunchcardPainter } from '@strudel/draw';
|
||||
import { transpiler } from '@strudel/transpiler';
|
||||
import { getAudioContext, webaudioOutput, initAudioOnFirstClick } from '@strudel/webaudio';
|
||||
import { StrudelMirror } from '@strudel/codemirror';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createCanvas } from 'canvas';
|
||||
import { pianoroll } from '@strudel/core';
|
||||
import { pianoroll } from '@strudel/draw';
|
||||
import { evaluate } from '@strudel/transpiler';
|
||||
import '../../../../test/runtime.mjs';
|
||||
import * as tunes from '../../repl/tunes.mjs';
|
||||
|
||||
@@ -238,9 +238,9 @@ Let's break down all pitch envelope controls:
|
||||
|
||||
<JsDoc client:idle name="crush" h={0} />
|
||||
|
||||
## shape
|
||||
## distort
|
||||
|
||||
<JsDoc client:idle name="shape" h={0} />
|
||||
<JsDoc client:idle name="distort" h={0} />
|
||||
|
||||
# Global Effects
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createCanvas } from 'canvas';
|
||||
import { pianoroll } from '@strudel/core';
|
||||
import { pianoroll } from '@strudel/draw';
|
||||
import { evaluate } from '@strudel/transpiler';
|
||||
import '../../../../test/runtime.mjs';
|
||||
import { getMyPatterns } from '../../my_patterns';
|
||||
|
||||
@@ -4,7 +4,8 @@ Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/st
|
||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { code2hash, getDrawContext, logger, silence } from '@strudel/core';
|
||||
import { code2hash, logger, silence } from '@strudel/core';
|
||||
import { getDrawContext } from '@strudel/draw';
|
||||
import cx from '@src/cx.mjs';
|
||||
import { transpiler } from '@strudel/transpiler';
|
||||
import {
|
||||
@@ -17,6 +18,7 @@ import {
|
||||
import { defaultAudioDeviceName } from '../settings.mjs';
|
||||
import { getAudioDevices, setAudioDevice } from './util.mjs';
|
||||
import { StrudelMirror, defaultSettings } from '@strudel/codemirror';
|
||||
import { clearHydra } from '@strudel/hydra';
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { settingsMap, useSettings } from '../settings.mjs';
|
||||
import {
|
||||
@@ -75,6 +77,11 @@ export function Repl({ embedded = false }) {
|
||||
onUpdateState: (state) => {
|
||||
setReplState({ ...state });
|
||||
},
|
||||
onToggle: (playing) => {
|
||||
if (!playing) {
|
||||
clearHydra();
|
||||
}
|
||||
},
|
||||
afterEval: (all) => {
|
||||
const { code } = all;
|
||||
setLatestCode(code);
|
||||
@@ -165,6 +172,7 @@ export function Repl({ embedded = false }) {
|
||||
const resetEditor = async () => {
|
||||
resetGlobalEffects();
|
||||
clearCanvas();
|
||||
clearHydra();
|
||||
resetLoadedSounds();
|
||||
editorRef.current.repl.setCps(0.5);
|
||||
await prebake(); // declare default samples
|
||||
@@ -189,6 +197,7 @@ export function Repl({ embedded = false }) {
|
||||
setActivePattern(patternData.id);
|
||||
setViewingPatternData(patternData);
|
||||
clearCanvas();
|
||||
clearHydra();
|
||||
resetLoadedSounds();
|
||||
resetGlobalEffects();
|
||||
await prebake(); // declare default samples
|
||||
|
||||
@@ -24,7 +24,9 @@ angle(saw)
|
||||
`;
|
||||
|
||||
// https://strudel.cc/?C31_NrcMfZEO
|
||||
export const spiralflower = `const {innerWidth:ww,innerHeight:wh} = window;
|
||||
export const spiralflower = `let {innerWidth:ww,innerHeight:wh} = window;
|
||||
ww*=window.devicePixelRatio;
|
||||
wh*=window.devicePixelRatio;
|
||||
const ctx = getDrawContext()
|
||||
const piDiv180 = Math.PI / 180;
|
||||
function fromPolar(angle, radius, cx, cy) {
|
||||
|
||||
@@ -72,6 +72,7 @@ export async function getRandomTune() {
|
||||
export function loadModules() {
|
||||
let modules = [
|
||||
import('@strudel/core'),
|
||||
import('@strudel/draw'),
|
||||
import('@strudel/tonal'),
|
||||
import('@strudel/mini'),
|
||||
import('@strudel/xen'),
|
||||
|
||||
Reference in New Issue
Block a user