44 lines
No EOL
1.3 KiB
Text
44 lines
No EOL
1.3 KiB
Text
@startuml "Token.apply activity diagram"
|
|
title Token.apply
|
|
|
|
left footer
|
|
Les méthodes et champs de l'argument "context" et "self" ont été raccourcis pour gagner de la place.
|
|
"t" will be incremented by placing the length instruction in "slopes". Context.render will tick every slope variable at every frame.
|
|
endfooter
|
|
|
|
start
|
|
|
|
(C)
|
|
switch (T)
|
|
case (Silence)
|
|
:render(None);
|
|
case (Marser)
|
|
:result = [];
|
|
case (Note)
|
|
:render(n);
|
|
case (VariableChange)
|
|
:variables[name] = change.eval(variables);
|
|
case (Loop)
|
|
:old_context = context.clone();
|
|
:context.result = [];
|
|
:new_context = fold inner into current context with Token.apply;
|
|
:return new_context.replace(result, old_context.result + new_context.result * count);
|
|
case (Tuplet)
|
|
:current_length = current_length();
|
|
:calculate how many samples should fit in the current length;
|
|
:old_context = context.clone();
|
|
:context.result = [];
|
|
:new_context = fold inner into current context with Token.apply;
|
|
:new_context.variables[t] = old_context.variables[t];
|
|
:spray new_context.result with void until it fits the sample count;
|
|
:prepend old_context.result;
|
|
:return new context;
|
|
case (Slope)
|
|
:slopes += (each_frame.name, each_frame.change);
|
|
:context = fold inner into current context with Token.apply;
|
|
:slopes[each_frame.name].drop();
|
|
endswitch
|
|
|
|
stop
|
|
|
|
@enduml |