Transporte: al cargar un track el loop arranca desde cero
Cargar un proyecto (pestaña Projects o anterior/siguiente de la barra) deja pendiente un reinicio que se aplica en la siguiente evaluacion: el tema nuevo empieza en el ciclo 0 aunque el reloj del scheduler siga corriendo. Editar y actualizar en vivo no reinicia nada. Funciona con Cyclist y NeoCyclist (ambos tienen setCycle). README-HACKLAB mas breve y con enlaces: upstream, TidalCycles, algorave, librerias de samples y video introductorio.
This commit is contained in:
parent
b6dbe97a62
commit
921647020c
4 changed files with 53 additions and 42 deletions
|
|
@ -35,6 +35,7 @@ import { audioEngineTargets } from '../settings.mjs';
|
|||
import { useStore } from '@nanostores/react';
|
||||
import { prebake } from './prebake.mjs';
|
||||
import { getRandomTune, initCode, loadModules, shareCode } from './util.mjs';
|
||||
import { $resetPending } from './components/panel/ProjectsTab.jsx';
|
||||
import './Repl.css';
|
||||
import { setInterval, clearInterval } from 'worker-timers';
|
||||
import { getMetadata } from '../metadata_parser';
|
||||
|
|
@ -104,6 +105,11 @@ export function useReplContext() {
|
|||
beforeEval: () => audioReady,
|
||||
afterEval: (all) => {
|
||||
const { code } = all;
|
||||
// track recien cargado desde Projects: el loop arranca desde cero
|
||||
if ($resetPending.get()) {
|
||||
$resetPending.set(false);
|
||||
editorRef.current?.repl?.scheduler?.setCycle?.(0);
|
||||
}
|
||||
//post to iframe parent (like Udels) if it exists...
|
||||
window.parent?.postMessage(code);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue