-
Notifications
You must be signed in to change notification settings - Fork 123
STK Doc Improvements #338
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
Open
tdug
wants to merge
7
commits into
supercollider:main
Choose a base branch
from
tdug:topic/stk-doc-improvements
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
STK Doc Improvements #338
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ba941d7
Comment out StkBowed gate logging messages.
tdug 42770cb
Add directory method to StkShakers
tdug 535dcf7
StkInst Docs: rawwaves filepath fix
tdug 6d803cb
Some StkUGens documentation
tdug 7aee5e5
Stk summary lines added. StkClarinet and StkSaxofony docs added
tdug 213ba16
StkShakers directory fixed
tdug ef416c3
StkPluck Help refinement
tdug File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
TITLE:: StkClarinet | ||
summary:: Synthesis Toolkit Clarinet | ||
categories:: UGens>PhysicalModels>StkUGens | ||
related:: Classes/Stk, Classes/StkInst | ||
|
||
CLASSMETHODS:: | ||
|
||
METHOD:: ar | ||
ARGUMENT:: freq | ||
ARGUMENT:: reedstiffness | ||
ARGUMENT:: noisegain | ||
ARGUMENT:: vibfreq | ||
ARGUMENT:: vibgain | ||
ARGUMENT:: breathpressure | ||
ARGUMENT:: trig | ||
ARGUMENT:: mul | ||
ARGUMENT:: add | ||
|
||
EXAMPLES:: | ||
|
||
code:: | ||
( // Add SynthDef | ||
SynthDef.ar(\helpStkClarinet, { | ||
arg freq=440, reedstiffness=64, noisegain=4, vibfreq=64, vibgain=11, breathpressure=64, gate=1, amp=1, out=0; | ||
|
||
var env = EnvGen.kr(Env.new(times: [0, 0.1]), gate: gate, doneAction: 2); | ||
var sig = StkClarinet.ar(freq, reedstiffness, noisegain, vibfreq, vibgain, breathpressure, trig: gate); | ||
|
||
sig = sig * env * amp; | ||
|
||
Out.ar(out, sig.dup); | ||
}).add; | ||
) | ||
|
||
( // Play SynthDef | ||
Pbind( | ||
\instrument, \helpStkClarinet, | ||
\degree, Pseq([0,2,4,7], 2) | ||
).play; | ||
) | ||
:: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
TITLE:: StkFlute | ||
summary:: Synthesis Toolkit Flute | ||
categories:: UGens>PhysicalModels>StkUGens | ||
related:: Classes/Stk, Classes/StkInst | ||
|
||
CLASSMETHODS:: | ||
|
||
METHOD:: ar | ||
ARGUMENT:: freq | ||
ARGUMENT:: jetDelay | ||
ARGUMENT:: noisegain | ||
ARGUMENT:: jetRatio | ||
ARGUMENT:: mul | ||
ARGUMENT:: add | ||
|
||
|
||
EXAMPLES:: | ||
code:: | ||
( // Add SynthDef | ||
SynthDef(\helpStkFlute, { | ||
arg freq=440, jetDelay=49, noisegain=0.15, jetRatio=0.32, amp=0.2, gate=1, out=1; | ||
|
||
var env = EnvGen.kr(Env.asr(0, 1, 0.1), gate, doneAction: 2); | ||
var sig = StkFlute.ar(freq, jetDelay: jetDelay, noisegain: noisegain, jetRatio: jetRatio); | ||
sig = sig * env * amp; | ||
|
||
Out.ar(0, sig.dup); | ||
}).add; | ||
) | ||
|
||
( // Play SynthDef | ||
Pbind( | ||
\instrument, \helpStkFlute, | ||
\degree, Pseq((0..7)), | ||
\octave, 6 | ||
).play; | ||
) | ||
:: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
TITLE:: StkPluck | ||
summary:: Synthesis Toolkit Pluck | ||
categories:: UGens>PhysicalModels>StkUGens | ||
related:: Classes/Stk, Classes/StkInst | ||
|
||
CLASSMETHODS:: | ||
|
||
METHOD:: ar | ||
ARGUMENT:: freq | ||
ARGUMENT:: decay | ||
ARGUMENT:: mul | ||
ARGUMENT:: add | ||
|
||
|
||
EXAMPLES:: | ||
code:: | ||
( // Add SynthDef. | ||
SynthDef(\helpStkPluck, { | ||
arg freq=440, decay=0.99, amp=0.2, gate=1, out=0; | ||
|
||
var env = EnvGen.kr(Env.asr(0,1,0.1), gate, doneAction:2); | ||
var sig = StkPluck.ar(freq, decay); | ||
sig = sig * env * amp; | ||
|
||
Out.ar(out, sig.dup); | ||
}).add; | ||
) | ||
|
||
( // Play SynthDef | ||
Pbind( | ||
\instrument, \helpStkPluck, | ||
\degree, Pseq([0,2,4,7], 1), | ||
\dur, 1 | ||
).play; | ||
) | ||
|
||
( // Guitar tuning. | ||
var midinotes=[40, 45, 50, 55, 59, 64]; | ||
Pbind( | ||
\instrument, \helpStkPluck, | ||
\midinote, Pseq(midinotes), | ||
\dur, 1 | ||
).play; | ||
) | ||
|
||
( // Guitar chords. | ||
var midinotes=[40, 45, 50, 55, 59, 64]; | ||
var fretsE=[ 0, 2, 2, 1, 0, 0]; | ||
var fretsA=[Rest(0), 0, 2, 2, 2, 0]; | ||
Pbind( | ||
\instrument, \helpStkPluck, | ||
\midinote, midinotes + Pseq([Pn(fretsE, 6), Pn(fretsA, 6)], 2), | ||
\strum, Pseq([1, -1], inf) * Pgauss(0.0125, 0.005), | ||
\dur, Pseq([1/2, 1/4, 1/2, 1/4, 1/4, 1/4], inf), | ||
\legato, 0.95 | ||
).play; | ||
) | ||
:: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
TITLE:: StkSaxofony | ||
summary:: Synthesis Toolkit Saxophony | ||
categories:: UGens>PhysicalModels>StkUGens | ||
related:: Classes/Stk, Classes/StkInst | ||
|
||
CLASSMETHODS:: | ||
|
||
METHOD:: ar | ||
|
||
ARGUMENT:: freq | ||
ARGUMENT:: reedstiffness | ||
ARGUMENT:: reedaperture | ||
ARGUMENT:: noisegain | ||
ARGUMENT:: blowposition | ||
ARGUMENT:: vibratofrequency | ||
ARGUMENT:: vibratogain | ||
ARGUMENT:: breathpressure | ||
ARGUMENT:: trig | ||
ARGUMENT:: mul | ||
ARGUMENT:: add | ||
|
||
|
||
EXAMPLES:: | ||
|
||
code:: | ||
( // Add SynthDef | ||
SynthDef(\helpStkSaxofony, { | ||
arg freq=220, reedstiffness=64, reeddeparture=64, noisegain=20, | ||
blowposition=26, vibratofrequency=20, vibratogain=20, breathpressure=128, gate=1, amp=1, out=0; | ||
|
||
var env = EnvGen.kr(Env.new(times: [0, 0.1]), gate: gate, doneAction: 2); | ||
var sig = StkSaxofony.ar(freq, reedstiffness, reeddeparture, noisegain, | ||
blowposition, vibratofrequency, vibratogain, breathpressure, trig: gate); | ||
|
||
sig = sig * env * amp; | ||
|
||
Out.ar(out, sig.dup); | ||
}).add; | ||
) | ||
|
||
( // Play SynthDef | ||
Pbind( | ||
\instrument, \helpStkSaxofony, | ||
\degree, Pseq([0,2,4,7], 2) | ||
).play; | ||
) | ||
:: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
TITLE:: StkShakers | ||
summary:: Synthesis Toolkit Shakers | ||
categories:: UGens>PhysicalModels>StkUGens | ||
related:: Classes/Stk, Classes/StkInst | ||
|
||
CLASSMETHODS:: | ||
|
||
METHOD:: ar | ||
|
||
ARGUMENT:: instr | ||
An integer between 0 and 21, inclusive. Instruments can be found with link::#-directory:: | ||
ARGUMENT:: energy | ||
ARGUMENT:: decay | ||
ARGUMENT:: objects | ||
ARGUMENT:: resfreq | ||
ARGUMENT:: mul | ||
ARGUMENT:: add | ||
|
||
METHOD:: directory | ||
Returns a dictionary of shaker instrument numbers. | ||
RETURNS:: A link::Classes/Dictionary:: | ||
code:: | ||
StkShakers.directory; | ||
:: | ||
|
||
EXAMPLES:: | ||
|
||
code:: | ||
( | ||
SynthDef(\helpStkShakers, { | ||
arg instr=0, energy=64, decay=64, objects=64, resfreq=64, amp=0.2, gate=1; | ||
|
||
var env = EnvGen.kr(Env.asr(0, 1, 0.1), gate: gate, doneAction: 2); | ||
var sig = StkShakers.ar(instr, energy, decay, objects, resfreq); | ||
sig = sig * env * amp; | ||
|
||
Out.ar(0, sig.dup); | ||
}).add; | ||
) | ||
|
||
( | ||
Pbind( | ||
\instrument, \helpStkShakers, | ||
\instr, 11, | ||
\dur, Pseq([2, Rest(2), 2, Rest(2), 2]), | ||
\amp, 0.5 | ||
).play; | ||
) | ||
:: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
There's probably a more pragmatic way to handle this.
Also, I think the folder got renamed at some point in the history of these plugins.
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.
the lines 35 and 36 as well as 37 and 37 seem to be the same?
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.
@telephon - They're extremely similar. The only difference is the case of
p
/P
.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've seen these paths declared in multiple ways and I'm wondering if the path has changed over time with the codebase. Is there a "correct" version of this filepath for the most updated version of SC?
Uh oh!
There was an error while loading. Please reload this page.
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'm not sure it's "correct", but previously I used the ".filenameSymbol" method to get the path of the class file, which allowed me to get a reference to where the class is installed, without any assumptions as to where the extension is installed.
Here we could do