Skip to content

Commit

Permalink
renaming analyze to scope and documenting
Browse files Browse the repository at this point in the history
  • Loading branch information
Bubobubobubobubo committed Nov 30, 2023
1 parent c192988 commit 5382198
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/classes/SoundEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export class SoundEvent extends AudibleEvent {
self.updateValue("release", 0.0);
return self;
},
analyze: function(self: SoundEvent) {
scope: function(self: SoundEvent) {
self.updateValue("analyze", true)
return self
},
Expand Down
29 changes: 20 additions & 9 deletions src/documentation/more/oscilloscope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,22 @@ export const oscilloscope = (application: Editor): string => {
const makeExample = makeExampleFactory(application);
return `# Oscilloscope
You can turn on the oscilloscope to generate interesting visuals or to inspect audio. Use the <ic>scope()</ic> function to turn it on and off. The oscilloscope is off by default.
You can turn on the oscilloscope to generate interesting visuals or to inspect audio. Use the <ic>scope()</ic> function to turn on/off the oscilloscope and to configure it. The oscilloscope is off by default.
You need to manually feed the scope with the sounds you want to inspect:
${makeExample(
"Feeding a sine to the oscilloscope",
`
beat(1)::sound('sine').freq(200).ad(0, .2).scope().out()
`, true
)}
Here is a layout of the scope configuration options:
${makeExample(
"Oscilloscope configuration",
`
"Oscilloscope configuration",
`
scope({
enabled: true, // off by default
color: "#fdba74", // any valid CSS color or "random"
Expand All @@ -23,12 +34,12 @@ scope({
refresh: 1 // refresh rate (in pulses)
})
`,
true,
)}
true,
)}
${makeExample(
"Demo with multiple scope mode",
`
"Demo with multiple scope mode",
`
rhythm(.5, [4,5].dur(4*3, 4*1), 8)::sound('fhardkick').out()
beat(0.25)::sound('square').freq([
[250, 250/2, 250/4].pick(),
Expand All @@ -44,8 +55,8 @@ scope({enabled: true, thickness: 8,
color: ['purple', 'green', 'random'].beat(),
size: 0.5, fftSize: 2048})
`,
true,
)}
true,
)}
Note that these values can be patterned as well! You can transform the oscilloscope into its own light show if you want. The picture is not stable anyway so you won't have much use of it for precision work :)
Expand Down

0 comments on commit 5382198

Please sign in to comment.