Fix stretch function and sound examples

This commit is contained in:
2023-10-05 11:03:41 +02:00
parent f1525a45a3
commit 959c8a99c2
2 changed files with 6 additions and 5 deletions

View File

@ -303,7 +303,8 @@ export class SoundEvent extends AudibleEvent {
// Unit // Unit
public stretch = (beat: number) => { public stretch = (beat: number) => {
this.updateValue("unit", "c"); this.updateValue("unit", "c");
this.updateValue("speed", 2 / beat) this.updateValue("speed", 1 / beat)
this.updateValue("cut", beat)
return this; return this;
} }

View File

@ -201,7 +201,7 @@ ${makeExample(
// Using some of the modifiers described above :) // Using some of the modifiers described above :)
beat(.5)::snd('pad').begin(0.2) beat(.5)::snd('pad').begin(0.2)
.speed([1, 0.9, 0.8].beat(4)) .speed([1, 0.9, 0.8].beat(4))
.n([0, 0, 2, 4].beat(4)).pan(usine(.5)) .n(2).pan(usine(.5))
.end(rand(0.3,0.8)) .end(rand(0.3,0.8))
.room(0.8).size(0.5) .room(0.8).size(0.5)
.clip(1).out() .clip(1).out()
@ -213,12 +213,12 @@ ${makeExample(
"Playing an amen break", "Playing an amen break",
` `
// Note that stretch has the same value as beat // Note that stretch has the same value as beat
beat(4) :: sound('breaks165').stretch(4).out() beat(4) :: sound('amen1').n(11).stretch(4).out()
beat(0.25) :: sound('hh').out() beat(1) :: sound('kick').shape(0.35).out()`,
beat(1, 4, 8) :: sound('bd').out()`,
true, true,
)}; )};
## Filters ## Filters
There are three basic filters: a _lowpass_, _highpass_ and _bandpass_ filters with rather soft slope. Each of them can take up to two arguments. You can also use only the _cutoff_ frequency and the resonance will stay to its default nominal value. There are three basic filters: a _lowpass_, _highpass_ and _bandpass_ filters with rather soft slope. Each of them can take up to two arguments. You can also use only the _cutoff_ frequency and the resonance will stay to its default nominal value.