Skip to content

Commit

Permalink
notes: ministeno : named bus links
Browse files Browse the repository at this point in the history
  • Loading branch information
iani committed Jul 13, 2015
1 parent 02d7fd8 commit 34a381a
Show file tree
Hide file tree
Showing 2 changed files with 146 additions and 87 deletions.
229 changes: 144 additions & 85 deletions Notes/TODOs.org
Expand Up @@ -48,56 +48,6 @@ Implementation notes for =new= method:

See MiniSteno.sc, MiniSteno class.

Thoughts for further refinement:

- use "astring".asteno for audio config and "astring".ksteno for control config
- Do not use { } @>.param \chuck, because of the problem of naming the created k-chucks. Stick with ksteno. Perhaps use: { } @> \kchuck @>.param \achuck or:
{ } @>.param_k \achuck where k is the name of the kchuck. The name of the chuck is _after_ the name of the parameter to enable one to use capital letters in the adverb to name kchucks whose name is a capital letter.
- At any moment there is only strictly one audio-rate MiniSteno and one control-rate MiniSteno tree active and stored in Library.
- For Audio: Strictly only the chucks contained in the latest compiled MiniSteno tree are audible. The other chucks are not removed or stopped, but moved to the head of the nullGroup, and their out bus parameter set to 0. Additionally, at the tail of the nullGroup, create a permanent synth that replaces out (ReplaceOut.kr()), with silence, sent to bus 0, for all channels of Server.default.options.numAudioOutputChannels. This masks the output of any chucks that are still running but are not contained in the currently active MiniSteno tree. Note: These inactive chucks could also be paused at the moment that they are entered in the nullGroup - but this should be optional, for example for the case of chucks that play audio buffers, when it is desired to keep advancing the playback position.
- In the MiniSteno tree, each chuck has only one input (=in=) and one output (=out=). However, one can create additional inputs and outputs that access the busses attached to inputs and outputs in other chucks, by using shortcut methods defined in the tiny-sc library that create In and Out ugens, by addressing the source or target chucks per name. For example:

Read from the default audio output of chuck =x=.
#+BEGIN_SRC sclang
\x.ain // or just: \x.a
#+END_SRC

Read from the audio output of chuck =x= named =out2=.
#+BEGIN_SRC sclang
\x.ain(\out2) // or just: \z.a(\out2)
#+END_SRC

Read from the default audio output of chuck =x= with an input of 2 channels.
#+BEGIN_SRC sclang
\x.ain(numChans: 2)
#+END_SRC

Read from the default audio output of chuck =x=, with =InFeedback.ar=:
#+BEGIN_SRC sclang
\x.fin // or just \x.af
#+END_SRC

etc.

Read from the default control output of (control rate) chuck =x=.
#+BEGIN_SRC sclang
\x.kin // or just: \x.k
#+END_SRC

etc.

Write to the default audio input of (audio rate) chuck =x=:

#+BEGIN_SRC sclang
\x.out(...)
#+END_SRC

Note that these shortcuts must be attached to the source chucks with notifications so that they change the numbers of their i/o channel when the source chuck's corresponding parameter changes bus index.

- Building the audio-rate mini-steno tree places the chucks in layered groups so that they stay in the correct order.
- While building the mini-steno tree, keep track of which chucks have been added to it. Use this to:
- Prevent that a chuck is added twice to the tree.
- Move chucks that are no longer part of the tree to the nullGroup.
*** MiniSteno extended
:PROPERTIES:
:DATE: <2015-07-04 Sat 22:58>
Expand All @@ -124,11 +74,94 @@ Note that these shortcuts must be attached to the source chucks with notificatio
//:
// "a.b.c".replace (".", "', '")
#+END_SRC
**** TODO Modify the MiniSteno tree at any moment
**** DONE Use : separator to enable multiple custom inputs in one chuck
:PROPERTIES:
:DATE: <2015-07-13 Mon 10:58>
:END:

#+BEGIN_SRC sclang
{ SinOsc.arp (300 * LFPulse.kr(1).range (4, 5)) } ++> \sine;
{ SinOsc.arp (400) } ++> \pulse;
{ Inp.ar (\in1) * Inp.ar (\in2) * 5 } ++> \ringmod;
#+END_SRC

#+BEGIN_SRC sclang
"(sine.ringmod:in1)(pulse.ringmod:in2)".addBranch
#+END_SRC
**** TODO Enable I/O to named busses for any branch
:PROPERTIES:
:DATE: <2015-07-13 Mon 11:03>
:END:
**** TODO implement addBefore, addAfter analogous to addBranch
:PROPERTIES:
:DATE: <2015-07-13 Mon 11:12>
:END:


**** TODO implement output copy links in ChuckLink
:PROPERTIES:
:DATE: <2015-07-13 Mon 11:13>
:END:

**** Syntax drafts for named busses and output-copy-links
:PROPERTIES:
:DATE: <2015-07-13 Mon 11:31>
:END:

***** Try 2

Use Par only for grouping one or more chucks that need named input or output

[inbus@chuck1.chuck2>outbus]

With optional input name specification for chucks chuck1:in1.chuck2:in1 etc.

For output-copy links use %:

[inbus@chuck1.chuck2%outbus]

***** REJECTED Try 1
1. for single chucks:

inbus@input:chuck>outbus

2. For whole MiniStenos

()

[]


**** STARTED Direct creation of link in synth-function code { \sourcechuck.a ... } ++> \fxchuck
:PROPERTIES:
:DATE: <2015-07-05 Sun 19:55>
:END:

Implementation requires storing the link request in a class var and then executing the link request after compiling the function to a SynthDef but before adding the resulting synthdef to the server via SynthDefLoader.

#+BEGIN_SRC sclang
{ \sourcechuck.a ... } ++> \fxchuck
#+END_SRC

Add \fxchuck serially after \sourcechuck.

: { \sourcechuck.a ... } ++> \fxchuck;

is a shortcut for:

#+BEGIN_SRC sclang
{ Inp.ar ... } ++> \fxchuck;
\sourcechuck &> \fxchuck;
#+END_SRC

Possible second shortcut =.ap= for =&>>=

*** OBSOLETE Modify the MiniSteno tree at any moment
:PROPERTIES:
:DATE: <2015-07-04 Sat 23:45>
:END:
***** TODO Create named steno branches
See above ...
**** STARTED Create named steno branches
:PROPERTIES:
:DATE: <2015-07-06 Mon 12:05>
:END:
Expand All @@ -137,7 +170,7 @@ Note that these shortcuts must be attached to the source chucks with notificatio
- \branchname.remove; :: ...?
- "stenostring" &> \root :: the root branch is the entire active tree.

***** Link two chucks on-the-fly
**** Link two chucks on-the-fly
:PROPERTIES:
:DATE: <2015-07-06 Mon 12:05>
:END:
Expand All @@ -155,7 +188,7 @@ Two basic operators/operations only:
4. both reader and writer are already in the global ministeno tree. In that case, do not change the tree, but issue a warning that the tree must be edited with an explicit ministeno specification.
2. \a <&> \b :: compose a and b in parallel. The rules are analogous to 1 above.

****** earlier draft:
***** earlier draft:
:PROPERTIES:
:DATE: <2015-07-09 Thu 15:15>
:END:
Expand All @@ -168,55 +201,31 @@ We may want to introduce also <& and <<& for adding siblings to the head of the

Adding \w &> \r to the following trees, results:

******* case 1
****** case 1
before: x.y

after: x.y(w.r)

******* case 2
****** case 2
before: x.w

after x(w.r)

******* case 3
****** case 3

before:

after:

Shortcuts:
***** STARTED Direct creation of link in synth-function code { \sourcechuck.a ... } ++> \fxchuck
:PROPERTIES:
:DATE: <2015-07-05 Sun 19:55>
:END:

Implementation requires storing the link request in a class var and then executing the link request after compiling the function to a SynthDef but before adding the resulting synthdef to the server via SynthDefLoader.

#+BEGIN_SRC sclang
{ \sourcechuck.a ... } ++> \fxchuck
#+END_SRC

Add \fxchuck serially after \sourcechuck.

: { \sourcechuck.a ... } ++> \fxchuck;

is a shortcut for:

#+BEGIN_SRC sclang
{ Inp.ar ... } ++> \fxchuck;
\sourcechuck &> \fxchuck;
#+END_SRC

Possible second shortcut =.ap= for =&>>=

***** TODO prevent duplicate chucks in the steno tree
**** TODO prevent duplicate chucks in the steno tree
:PROPERTIES:
:DATE: <2015-07-07 Tue 12:16>
:END:

See notes in: Symbol.asSteno.

***** TODO silence chucks removed from the steno tree
**** TODO silence chucks removed from the steno tree
:PROPERTIES:
:DATE: <2015-07-07 Tue 12:16>
:END:
Expand All @@ -227,12 +236,12 @@ The following needs to be run for the branch that is modified (branches above or
2. Modify or rebuild (substitute) the branch and store it in var n.
3. For each chuck c in l: If c is not in n, then move c to null-group. Note: The null group must have a tail synth that silences all outputs.

***** TODO Note: Only the tree being modified needs to be re-rendered for groups and busses
**** TODO Note: Only the tree being modified needs to be re-rendered for groups and busses
:PROPERTIES:
:DATE: <2015-07-07 Tue 13:18>
:END:

***** TODO How many different insertion methods need to be implemented?
**** TODO How many different insertion methods need to be implemented?
:PROPERTIES:
:DATE: <2015-07-09 Thu 13:49>
:END:
Expand All @@ -243,6 +252,56 @@ What is the minimum number of methods needed to insert any chuck or subtree anyw
| new in tree | new in tree | add (writer.reader) to root tree |
| already writer | of reader | issue message, do not change |
| | | |
*** Thoughts for further refinement

- use "astring".asteno for audio config and "astring".ksteno for control config
- Do not use { } @>.param \chuck, because of the problem of naming the created k-chucks. Stick with ksteno. Perhaps use: { } @> \kchuck @>.param \achuck or:
{ } @>.param_k \achuck where k is the name of the kchuck. The name of the chuck is _after_ the name of the parameter to enable one to use capital letters in the adverb to name kchucks whose name is a capital letter.
- At any moment there is only strictly one audio-rate MiniSteno and one control-rate MiniSteno tree active and stored in Library.
- For Audio: Strictly only the chucks contained in the latest compiled MiniSteno tree are audible. The other chucks are not removed or stopped, but moved to the head of the nullGroup, and their out bus parameter set to 0. Additionally, at the tail of the nullGroup, create a permanent synth that replaces out (ReplaceOut.kr()), with silence, sent to bus 0, for all channels of Server.default.options.numAudioOutputChannels. This masks the output of any chucks that are still running but are not contained in the currently active MiniSteno tree. Note: These inactive chucks could also be paused at the moment that they are entered in the nullGroup - but this should be optional, for example for the case of chucks that play audio buffers, when it is desired to keep advancing the playback position.
- In the MiniSteno tree, each chuck has only one input (=in=) and one output (=out=). However, one can create additional inputs and outputs that access the busses attached to inputs and outputs in other chucks, by using shortcut methods defined in the tiny-sc library that create In and Out ugens, by addressing the source or target chucks per name. For example:

Read from the default audio output of chuck =x=.
#+BEGIN_SRC sclang
\x.ain // or just: \x.a
#+END_SRC

Read from the audio output of chuck =x= named =out2=.
#+BEGIN_SRC sclang
\x.ain(\out2) // or just: \z.a(\out2)
#+END_SRC

Read from the default audio output of chuck =x= with an input of 2 channels.
#+BEGIN_SRC sclang
\x.ain(numChans: 2)
#+END_SRC

Read from the default audio output of chuck =x=, with =InFeedback.ar=:
#+BEGIN_SRC sclang
\x.fin // or just \x.af
#+END_SRC

etc.

Read from the default control output of (control rate) chuck =x=.
#+BEGIN_SRC sclang
\x.kin // or just: \x.k
#+END_SRC

etc.

Write to the default audio input of (audio rate) chuck =x=:

#+BEGIN_SRC sclang
\x.out(...)
#+END_SRC

Note that these shortcuts must be attached to the source chucks with notifications so that they change the numbers of their i/o channel when the source chuck's corresponding parameter changes bus index.

- Building the audio-rate mini-steno tree places the chucks in layered groups so that they stay in the correct order.
- While building the mini-steno tree, keep track of which chucks have been added to it. Use this to:
- Prevent that a chuck is added twice to the tree.
- Move chucks that are no longer part of the tree to the nullGroup.



Expand Down
4 changes: 2 additions & 2 deletions README.org
Expand Up @@ -474,13 +474,13 @@ Create source and effect synths, and listen to the 2 source synths separately:
Link the output of the first source to =in1= and the output of the second source to =in2=:

#+BEGIN_SRC sclang
"(sine.ringmod:in1)(pulse.ringmod:in2)".arlink
"(sine.ringmod:in1)(pulse.ringmod:in2)".addBranch;
#+END_SRC

** Multiple voice example
:PROPERTIES:
:ID: CDEFFE5C-E976-4D0C-9983-A5E27467AB0F
:eval-id: 362
:eval-id: 377
:END:

Just a demo with 8 Chuck instances playing on 8 different TaskPlayers.
Expand Down

0 comments on commit 34a381a

Please sign in to comment.