First time here? Check out the FAQ!
x

Is the only way of assigning a value to an !EventValue to use an STGC?

0 votes
726 views

You can't assign to an !EventValue like this:

!MyEventValue <+ 23.

can you? So is the only way to set its value is using a SoundToGlobalController?

asked Dec 11, 2018 in Capytalk & Smalltalk by alan-jackson (Virtuoso) (15,840 points)

2 Answers

+1 vote
 
Best answer

EventValues (i.e., the names that start with exclamation points and turn red) are different from EventVariables (which can be defined in an individual parameter field).

An EventVariable, like most variables, is a location in memory that you can read from or write to. EventVariables are local to the parameter field in which they are defined. An EventVariable can be assigned a single number at any one time.

An EventValue is more like the end of a pipe that is connected to the outside world. Data is flowing into Kyma through that pipe. You can route that pipe to any destination in your Sound; anywhere the !EventValue appears in any parameter field gets hooked up to that external source and the data will pour into that point. So the !EventValues are global in the sense that every EventValue of the same name gets the same stream of values. And it is read-only (the data are flowing out of the pipe into the parameter field, never flowing back into the pipe). In a sense, an !EventValue is more like a signal (a stream) than it is a single number or data structure.

The SoundToGlobalController is a way to generate an internal stream of data and hook it up to an !EventValue pipe. To a Kyma Sound, it looks as if the stream of numbers is coming in from an external controller or software, even though it is being generated in Kyma by a parallel branch of the signal flow graph.

In many ways, EventValues and EventExpressions are more analogous to Sounds and signal flows than they are to the variables of programming languages that do not explicitly reference time.

How's that for a long answer to a simple question? ;)

answered Dec 13, 2018 by ssc (Savant) (128,200 points)
selected Dec 14, 2018 by alan-jackson
That is a fantastic answer, thanks so much! That really helps me build a better mental model. Looking at it that way it makes sense why you'd call it a "SoundToGlobalController".
I just realized that an EventValue is operationally identical to a *signal* in a Reactive programming environment, where establishing any new realtime observer/subscriber on the signal becomes as simple as typing its name: !EventValue.

In the parlance of Reactive systems, a SoundToGlobalController is precisely an event *sink*... a designated point for manually introducing values into a signal.

This expanded perspective is right on time, thanks!
Yes! (though perhaps the STGC is a source and the !EventValue is a sink)?
OK, I think I understand what you've been saying here now, after looking at an open STGC parameter panel:

By supplying a unique name with proper syntax to the GeneratedEvent field of a SoundToGlobalController, we establish a fresh new eventValue (i.e. the *sink*) that's monitoring an active input stream (i.e. the *source*).

So (only) within an STGC:
 
*sink*      ≅   the value of parameter 'GeneratedEvent' (e.g. !GenEvent)
*source*  ≅  the value of parameter 'Value'                   (e.g.      LFO     )

Elsewhere within that sound, any other reference to !GenEvent defines another place from which to monitor the changing values of the LFO source in realtime (i.e. *not-a-sink*).
+1 vote

Hi Alan,

TransformEventValue is another way to set an EventValue. You can enter a list of EventValues (the targets) along with a corresponding list of EventExpressions (the value generators). For your example, it would be:

!MyEventValue

as the EventValue and

23

as the expression.

This will "rewrite" every instance of that !EventValue that occurs to the left of the TransformEventValue (you can limit its scope with the SharedSounds parameter).

answered Dec 11, 2018 by ssc (Savant) (128,200 points)
TransformEventValue looks really useful thanks. I'm guessing there's no CapyTalk way of assigning to an EventValue though?
Yes, that's right.
...