Skip to content

Commit 8b5f2dc

Browse files
authored
Add files via upload
1 parent 81ecebc commit 8b5f2dc

1 file changed

Lines changed: 146 additions & 0 deletions

File tree

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
#Example of OSC messages to / from Dicy2 server
2+
3+
This example corresponds to `tab 2` in tutorial `2_Chaining_Agents.maxpat` in [Dicy2 for Max](https://forum.ircam.fr/projects/detail/dicy2/)
4+
5+
## Launch server
6+
7+
Launch `dicy2_server.app` with OSC ports as arguments
8+
*NB: this applies of course to `dicy2_server.app` or to a server started from the Python code!*
9+
10+
FROM_SERVER: /server initialized
11+
FROM_SERVER: /server status bang *... (then looped)*
12+
13+
14+
## Create two agents
15+
16+
### Create first agent (labels=abstract musical gesture types, contents=sequences of vocal playing modes)
17+
18+
#### Create first agent "Agent_Form"
19+
20+
TO_SERVER: /server create_agent /Agent_Form listlabel
21+
22+
FROM_SERVER: /server info "Created new agent at '/Agent_Form'"
23+
FROM_SERVER: /server create_agent /Agent_Form
24+
FROM_SERVER: /Agent_Form initialized
25+
FROM_SERVER: /Agent_Form status bang *... (then looped)*
26+
27+
28+
#### Setting some parameters for first agent (in particular the max_continuity parameters)
29+
30+
TO_SERVER: /Agent_Form set_control_parameter generator::prospector::\_navigator::max_continuity 6
31+
TO_SERVER: /Agent_Form set_control_parameter generator::force_output 1
32+
TO_SERVER: /Agent_Form clear listlabel
33+
34+
FROM_SERVER: /Agent_Form clear ListLabel ... (+ list of default paramaters)
35+
36+
37+
#### Learning a sequence in first agent (labels=abstract musical gesture types, contents=sequences of vocal playing modes)
38+
39+
TO_SERVER: /Agent_Form learn_event listlabel Gesture_type_1 "Agilita Breath Ribatutto Silence Staccato Tenuto"
40+
TO_SERVER: /Agent_Form learn_event listlabel Gesture_type_2 "Staccato Staccato Staccato"
41+
(... send other couples {label} {content})
42+
43+
FROM_SERVER: /Agent_Form new_event_learned "Agilita Breath Ribatutto Silence Staccato Tenuto"
44+
FROM_SERVER: /Agent_Form info "Learned event 'Agilita Breath Ribatutto Silence Staccato Tenuto'"
45+
FROM_SERVER: /Agent_Form new_event_learned "Staccato Staccato Staccato"
46+
FROM_SERVER: /Agent_Form info "Learned event 'Staccato Staccato Staccato'"
47+
(... feedback other couples {label} {content})
48+
49+
### Create second agent (labels=vocal playing mode, contents=corresponding markers in an audio file)
50+
51+
#### Create second agent "Agent_Audio"
52+
53+
TO_SERVER: /server create_agent /Agent_Audio listlabel
54+
55+
FROM_SERVER: /server info "Created new agent at '/Agent_Audio'"
56+
FROM_SERVER: /server create_agent /Agent_Audio
57+
FROM_SERVER: /Agent_Audio initialized
58+
FROM_SERVER: /Agent_Audio status bang *... (then looped)*
59+
60+
#### Setting some parameters for second agent (in particular the max_continuity parameters)
61+
62+
TO_SERVER: /Agent_Audio set_control_parameter generator::prospector::\_navigator::max_continuity 6
63+
TO_SERVER: /Agent_Audio set_control_parameter generator::force_output 1
64+
65+
FROM_SERVER: /Agent_Audio clear ListLabel ... (+ list of default paramaters)
66+
67+
#### Learning a sequence in first agent (labels=vocal playing mode, contents=corresponding markers in an audio file)
68+
69+
TO_SERVER: /Agent_Audio clear listlabel
70+
TO_SERVER: /Agent_Audio learn_event listlabel Tenuto "0 1876"
71+
TO_SERVER: /Agent_Audio learn_event listlabel Agilita "1876 2398"
72+
(... send other couples {label} {content})
73+
74+
FROM_SERVER: /Agent_Audio new_event_learned "0 1876"
75+
FROM_SERVER: /Agent_Audio info "Learned event '0 1876'"
76+
FROM_SERVER: /Agent_Audio new_event_learned "1876 2398"
77+
FROM_SERVER: /Agent_Audio info "Learned event '1876 2398'"
78+
(... feedback other couples {label} {content})
79+
80+
81+
## Send queries to the agents
82+
83+
### First agent "/Agent_Form"
84+
85+
#### Send a "free" query to the first agent "/Agent_Form"
86+
87+
*A "free" query takes advantage of the model built on the sequence to generate a new sequence without any constraint than the `maxcontinuity` value defined earlier*
88+
89+
TO_SERVER: /Agent_Form query query0 0 relative 10
90+
91+
__Note the syntax of a "free" query :
92+
`{name_agent} query {name_query} {start_date} {relative or absolute} {number_of_events_to_generate}`__
93+
94+
#### Receiving and parsing the result of the query
95+
96+
FROM_SERVER: /Agent_Form server_received_query query0
97+
FROM_SERVER: /Agent_Form query_result_iterative query0 1 10 "Tenuto Silence None Staccato Tenuto"
98+
FROM_SERVER: /Agent_Form query_result_iterative query0 2 10 "Staccato None None None Staccato None None Staccato"
99+
(...)
100+
FROM_SERVER: /Agent_Form query_result_iterative query0 10 10 "Staccato None None None Staccato None None Staccato"
101+
102+
__Note that the output of the query is sent event by event with a counter indicating the potion of the event in the generated sequence__
103+
104+
### Second agent "/Agent_Audio"
105+
106+
In this example we chain "/Agent_Form" and "/Agent_Audio": the "content" alphabet of one corresponding to the "label" alphabet of the other, we can concatenate the output of the query to "/Agent_Form" to use it as a "scenario" for the query to "/Agent_Audio".
107+
108+
#### Send a "scenario" query to the first agent "/Agent_Audio"
109+
110+
*The run of a "scenario" query will output the best possible match for a given sequence of labels (see related research articles).*
111+
112+
TO_SERVER: /Agent_Audio query query0 0 relative None listlabel [ Tenuto Silence None Staccato Tenuto Staccato None None None Staccato None None Staccato Tenuto Silence None Staccato Tenuto Staccato None None None Staccato None None Staccato Tenuto Silence None Staccato Tenuto Staccato None None None Staccato None None Staccato Tenuto Silence None Staccato Tenuto Staccato None None None Staccato None None Staccato Tenuto Silence None Staccato Tenuto Staccato None None None Staccato None None Staccato ]
113+
114+
__Note the syntax of a "scenario" query :
115+
`{name_agent} query {name_query} {start_date} {relative or absolute} None {[ list_of_labels_to_match ] }`__
116+
117+
__The "None" keyword allows the generation to chose an optimal label.__
118+
119+
#### Receiving and parsing the result of the query
120+
121+
FROM_SERVER: /Agent_Audio server_received_query query0
122+
FROM_SERVER: /Agent_Audio query_result_iterative query0 1 65 "52458 54795"
123+
FROM_SERVER: /Agent_Audio query_result_iterative query0 2 65 "84360 85772"
124+
FROM_SERVER: /Agent_Audio query_result_iterative query0 3 65 "85772 86997"
125+
(...)
126+
FROM_SERVER: /Agent_Audio query_result_iterative query0 64 65 "19330 19538"
127+
FROM_SERVER: /Agent_Audio query_result_iterative query0 65 65 "19869 20169"
128+
129+
__Note that the output of the query is sent event by event with a counter indicating the potion of the event in the generated sequence__
130+
131+
132+
Finally, the result of the process is a sequence of markers that can be used to drive concatenative synthesis:
133+
- it matches a sequence of vocal playing modes in an optimal way thanks to the model learned in the 2nd agent
134+
- and this sequence of vocal playing modes has itself been generated by the system in the style of a higher level corpus associating categories of abstract musical gestures to sequences of vocal playing modes.
135+
136+
## Exit
137+
138+
TO_SERVER: /server exit
139+
140+
FROM_SERVER: /Agent_Audio terminated bang
141+
FROM_SERVER: /Agent_Form terminated bang
142+
FROM_SERVER: /server info "DICY2 server terminated"
143+
FROM_SERVER: /server terminated bang
144+
145+
146+

0 commit comments

Comments
 (0)