This commit is contained in:
2023-09-26 20:02:03 +03:00
3 changed files with 80 additions and 62 deletions

View File

@ -33,6 +33,7 @@ export async function loadSamples() {
registerZZFXSounds(), registerZZFXSounds(),
samples("github:Bubobubobubobubo/Dough-Samples/main"), samples("github:Bubobubobubobubo/Dough-Samples/main"),
samples("github:Bubobubobubobubo/Dough-Amiga/main"), samples("github:Bubobubobubobubo/Dough-Amiga/main"),
samples("github:Bubobubobubobubo/Dough-Amen/main"),
samples("github:Bubobubobubobubo/Dough-Waveforms/main"), samples("github:Bubobubobubobubo/Dough-Waveforms/main"),
]); ]);
} }

View File

@ -300,6 +300,13 @@ export class SoundEvent extends AudibleEvent {
public size = (value: number) => this.updateValue("size", value); public size = (value: number) => this.updateValue("size", value);
public sz = this.size; public sz = this.size;
// Unit
public stretch = (beat: number) => {
this.updateValue("unit", "c");
this.updateValue("speed", 2 / beat)
return this;
}
// ================================================================================ // ================================================================================
// AbstactEvent overrides // AbstactEvent overrides
// ================================================================================ // ================================================================================

View File

@ -188,6 +188,7 @@ There are some basic controls over the playback of each sample. This allows you
| loopBegin | | Beginning of the loop section (between <ic>0</ic> and <ic>1</ic>) | | loopBegin | | Beginning of the loop section (between <ic>0</ic> and <ic>1</ic>) |
| loopEnd | | End of the loop section (between <ic>0</ic> and <ic>1</ic>) | | loopEnd | | End of the loop section (between <ic>0</ic> and <ic>1</ic>) |
| loop | | Whether to loop or not the audio sample | | loop | | Whether to loop or not the audio sample |
| stretch | | Stretches the audio playback rate of a sample over <ic>n</ic> beats |
| speed | | Playback speed (<ic>2</ic> = twice as fast) | | speed | | Playback speed (<ic>2</ic> = twice as fast) |
| cut | | Set with <ic>0</ic> or <ic>1</ic>. Will cut the sample as soon as another sample is played on the same bus | | cut | | Set with <ic>0</ic> or <ic>1</ic>. Will cut the sample as soon as another sample is played on the same bus |
| clip | | Multiply the duration of the sample with the given number | | clip | | Multiply the duration of the sample with the given number |
@ -207,6 +208,15 @@ beat(.5)::snd('pad').begin(0.2)
true true
)}; )};
${makeExample(
"Playing an amen break",
`
// Note that stretch has the same value as beat
beat(4) :: sound('breaks165').stretch(4).out()
beat(0.25) :: sound('hh').out()
beat(1, 4, 8) :: sound('bd').out()`,
true,
)};
## Filters ## Filters