|
» codelab : http://codelab.fr/accueil » Forum : SuperCollider : http://codelab.fr/supercollider » problème d'assignation d'une valeur avec .set : http://codelab.fr/1176 Ceci est la version imprimable d'un sujet du forum, pour retourner à la version complète : problème d'assignation d'une valeur avec .set |
| oyster_twiter — 2009-05-22 19:18:28 |
Hello, (
for(0, 9, {arg i; ~or[i] = OSCresponder (nil, "/carte_0"+i.asString , { arg time, resp, msg;
forBy(1,~spatNb[i],3,{arg j; /////// boucle pour scanner les icrementations
if(msg[j] == 1,
{
~smp[i][(j-1)/3] = Synth.new("entite-sonore", [\spat, 0, \bank, i, \id, (j-1)/3]);
~sorN[i][(j-1)/3] = 0;
},
{
if(msg[j] == 'stop' && ~sorN[i][(j-1)/3] == 0,
{~smp[i][(j-1)/3].free;
~sorN[i][(j-1)/3] = 1;
});
});
if(~sorN[i][(j-1)/3] == 0, ///// si un synthe instancié par [(j-1)/3] est existant alors spat
{
~xS = msg[j+1].asFloat -0.5;
//~xS = msg[j+1] - 0.5;
~yS = msg[j+2].asFloat - 0.5;
//~yS = msg[j+2] - 0.5;
a = atan(~yS / ~xS);
if (((~xS < 0) && (~yS < 0)), { b = a; });
if (((~xS > 0) && (~yS < 0)), { b = pi + a; });
if (((~xS > 0) && (~yS > 0)), { b = pi + a; });
if (((~xS < 0) && (~yS > 0)), { b = 2pi + a; });
c = 2 - (b / pi);
~smp[i][(j-1)/3].set(\spat, c);
//msg[j+1].postln;
c.postln;
});
})}).add;});
)pour ceux que ça intéresse je fourni l'intégralité de mon code SC en pièce jointe. |
| oyster_twiter — 2009-05-22 20:38:17 |
autant pour moi , j'ai trouvé mon erreur, il s'agissait d'une conversion de valeur en entrée qui arrivainet entre 0 et 1024 alors qu'il me faut du 0 à 1 pour la spat... |