From 8bd1863da06fe619fd373460de291e4dbc96edab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=BE=E6=B5=A6=20=E7=9F=A5=E4=B9=9F=20Matsuura=20Tomoy?= =?UTF-8?q?a?= Date: Thu, 28 Aug 2025 21:21:11 +0900 Subject: [PATCH] [obsidian] vault backup: 2025-08-28 21:21:11[ --- content/otopoiesis.md | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/content/otopoiesis.md b/content/otopoiesis.md index 5cbdc793..8d74d32d 100644 --- a/content/otopoiesis.md +++ b/content/otopoiesis.md @@ -154,24 +154,43 @@ fn sinosc(freq,amp){ // --ここから上はstage 1 value //track_1はstage0として参照する -let track1 = Track(|| phasor(1.0)|> scale(_,0.0,1.0,100,4000)) +let track1:`()->float = Track(|| phasor(1.0)|> scale(_,0.0,1.0,100,4000)) //track1をfrequencyとして参照することにする let r1 = { start: 100ms, dur: 1000ms, - content: || sinosc(track1(), 1.0) + content: || sinosc($track1(), 1.0) +} + +let regions = [r1,r2,...]//regionの列はstage0のvalue + +let track3 = track_regions(regions) + +``` + +```rust + +fn track_regions(regions:[{start:float,dur:float,generator:()->float}]){ + Track() } ``` ## トラックのランタイム構造 -``` -fn Track() +```rust +fn Track(content:()->float)->`()->float{ + let thunk = bind_to_runtime(content)//ここでprobeも行うことで、波形とメーター表示をする + thunk +} +fn master(tracks:[`()->float])->`()->float{ + `{ || map(tracks,|t| $t() ) |> sum} +} +let dsp = Track!($master([t1,t2,t3,...])) ```