[obsidian] vault backup: 2023-11-22 16:15:03[
This commit is contained in:
parent
5c45dba816
commit
9d80efcf31
@ -85,14 +85,21 @@ Program as a Format - MPEG-Structured Audio(CSoundベースの音源配布フォ
|
|||||||
まだシンタックス(パーサー)が実装されてないので、Rust風の擬似ソースコード
|
まだシンタックス(パーサー)が実装されてないので、Rust風の擬似ソースコード
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
|
let sinewave =|freq,amp,phase|{
|
||||||
|
...
|
||||||
|
}
|
||||||
|
let apply_fadeinout = |start,dur,time_in,time_out,content|{
|
||||||
|
...
|
||||||
|
}
|
||||||
let FadeInOut = |time_in,time_out,origin|{
|
let FadeInOut = |time_in,time_out,origin|{
|
||||||
|
let time_in = Param("time_in",0.01,0.0..inf);
|
||||||
|
let time_out = Param("time_out",0.01,0.0..inf);
|
||||||
Region({
|
Region({
|
||||||
start: origin.start
|
start: origin.start
|
||||||
dur : origin.dur
|
dur : origin.dur
|
||||||
content: apply_fadeinout(start,dur,time_in,time_out,origin.content)
|
content: apply_fadeinout(start,dur,time_in,time_out,origin.content)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
let project = |sample_rate|{
|
let project = |sample_rate|{
|
||||||
let tracks = Track([
|
let tracks = Track([
|
||||||
FadeInOut(
|
FadeInOut(
|
||||||
@ -109,9 +116,7 @@ let project = |sample_rate|{
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
]);
|
]);
|
||||||
tracks.map(||
|
tracks.map(|t| t.render()).sum()
|
||||||
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
Loading…
Reference in New Issue
Block a user