-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation: Creating Examples #111
Conversation
Updating sawlfo.md to fit with latest documentation specs.
Removing old SawLFO example.
Updating index.md and adding example-0.py
Updated documentation and examples for sawlfo, sinelfo, squarelfo, and trianglelfo.
Running documentation generator on the changes to SawLFO, SineLFO, SquareLFO, and TriangleLFO.
Adding example files and updating the documentation for oscillators.
Adding an example for the Impulse oscillator, and making formatting consistent across documentation.
Updating the descriptions in square.h and square-lfo.h to be more concise and clear.
Automatically generating new documentation files reflecting earlier changes. Also removing unnecessary spaces in square.h and square-lfo.h.
Adding graph.wait() to oscillator examples which did not have it.
Created examples for: MouseDown() MouseX() MouseY() ASREnvelope() Line() Impulse() ClockDivider() Sequence() And fixing a typo in BufferPlayer().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice examples, and thanks for the improvements to the docs! I've added a few comments inline.
# Using a line to control the gain of an oscillator, emulating a sidechain ducking effect. | ||
#------------------------------------------------------------------------------- | ||
clock = Impulse(frequency=1.0) | ||
line = Line(0.0, 0.5, 1.0, 0, clock) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to use False
than 0
for the loop
parameter, to make it clear that it is a boolean.
Plus, slightly pedantic but this current formulation reproduces the exact behaviour of SawLFO
. Maybe you could reduce the time
variable to (say) 0.5s, so that it's doing something that can't be reproduced with other nodes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea re: False
-- should I update that in the documentation to match? Currently the example says loop=0
voice_a = oscillator_a * envelope_a | ||
voice_b = oscillator_b * envelope_b | ||
|
||
left = StereoPanner(voice_a, -1.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love this example!
To be slightly pedantic again - this formulation of "voice_a through left channel and voice_b through right channel" could (slightly more efficiently) be implemented using ChannelArray(voice_a, voice_b)
. But I like the use of StereoPanner
here, so maybe you could do StereoPanner(voice_a, -0.5)
and StereoPanner(voice_b, 0.5)
to do something that couldn't be achieved with a ChannelArray.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also missing a graph.wait()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch re: graph.wait()!
Good idea re: StereoPanner -- I'll change the pan values to -0.75 and 0.75 to give a bit more stereo separation, which should allow for easy distinction between the two voices whilst still doing something ChannelArray can't. Feel like with -0.5/0.5 the distinction is less clear and doesn't quite demonstrate the ClockDivider as effectively, if you get me?
# Creating a sequence using the MIDI note values of a C Major scale, starting on middle C. | ||
#------------------------------------------------------------------------------- | ||
clock = Impulse(2.0) | ||
sequence = Sequence([ 60, 62, 64, 65, 67, 69, 71, 72 ], clock) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another nice example!
@@ -6,7 +6,7 @@ description: RandomChoice: Pick a random value from the given array. If a clock | |||
# RandomChoice | |||
|
|||
```python | |||
RandomChoice(values=std::vector<float> ( ), clock=None, reset=None) | |||
RandomChoice(values=std : : vector <float >(), clock=None, reset=None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some auto-formatting is causing these colons to be broken up, which shouldn't happen. I remember seeing this before but can't remember the cause. Can you merge your branch with latest master
and see if it's still happening?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having trouble with merging my branch to latest master
-- might be worth going through this together on Friday.
Implementing feedback on examples for Line and ClockDivider
Fixing description for Saw LFO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
Created examples for:
MouseDown()
MouseX()
MouseY()
ASREnvelope()
Line()
Impulse()
ClockDivider()
Sequence()
And fixing a typo in BufferPlayer().