EEG.pdf


Aperçu du fichier PDF eeg.pdf - page 2/31

Page 1 23431



Aperçu texte


4. TOOLS

Example with 2 settings :
• Query : “/osc/widget 0”, reply from Kyma :
“/osc/widget 0 JSON0” (first widget) ;

4.1. Kyma

• Query : “/osc/widget 1”, reply from Kyma :
“/osc/widget 1 JSON1” (second widget) ;
• Query : “/osc/widget 2”, reply from Kyma :
“/osc/widget 2” (widget non-existent).
It can be used to detect the end of the enumeration
of the currents settings (we will send the “/osc/widget i” message while the “/osc/widget i” response is
not empty).
4.1.2. JSON structure
The JSON structures, containing the widgets attributes,
are represented as follows :
Figure 1: Kyma

JSON Code
{
" c r e a t i o n C l a s s " : " VCSEventSourceComponent " ,
" layout " : {
" c r e a t i o n C l a s s " : " LayoutFrame " ,
" leftOffset " : 0,
" topOffset " : 0 ,
" rightOffset " : 0,
" bottomOffset " : 0 ,
" l e f t F ra c t i o n " : 0.0 ,
" topFraction " : 0.0 ,
" r i g h t F r a c t i o n " : 0.125 ,
" bottomFraction " : 1.0 ,
}
" l a b e l " : "Amp" ,
" lookOrNil " : null ,
" displayType " : " Fader " ,
" c o n c r e t e E v e n t I d " : 3145730 ,
" minimum " : 0 ,
" maximum " : 0 ,
" grid " : 0 ,
" taper " : " linear " ,
" showNumber " : t r u e ,
" isGenerated " : false ,
" reflectMarker " : null ,
" tickMarksOrNil " : null

Kyma is a powerful graphic software for sound design. In a first step, only a few possibilities, offered by
this software, have been exploited namely the communication with the software in order to determine and modify
the sound settings.
4.1.1. Communication
The communication is established through OSC
messages and proceeds as follows :
Legend :
Messages to Kyma (queries)
Messages from Kyma (replies)
1. /osc/respond_to i
Where “/osc/respond_to” is the OSC pattern and “i”
is an integer corresponding to the port where Kyma
has to send its OSC messages.
2. /osc/response_from i
Where “i” is an integer corresponding to the port
used (by our computer) to send the first message.
3. /osc/widget i
Where “i” is an integer corresponding to the widget
for which we want to know the attributes.
4. /osc/widget i JSON
Where “i” is an integer corresponding to the widget query and “JSON” is a JSON 3 structure which
contains the widget attributes.
5. /osc/widget i
If we send a widget query to kyma with a widget
that doesn’t exist (wrong number), kyma will respond with an “empty JSON”.

3 . JavaScript Object Notation

}

For this application, only a few of these attributes are
relevant :
• creationClass : informs about the type of the widget. For this application, only the “VCSEventSourceComponent” is used ;
• label : widget name (“Amplitude”, “Distorsion”,
...);
• concreteEventID : widget identification (ID). It’s
probably the most important information needed. It’s
with that ID that it’s possible to modify the settings
value ;
• minimum : minimum value for the widget ;
• maximum : maximum value for the widget.
To get back these information, the structure needs to be
parsed. To do this, the SimpleJSON library 4 , written in
4 . https ://github.com/MJPA/SimpleJSON (accessed February 2012)