diff options
-rw-r--r-- | msd.h | 617 | ||||
-rw-r--r-- | msd/01_msdtest.pd | 56 | ||||
-rw-r--r-- | msd/02_imsdtest.pd | 12 | ||||
-rw-r--r-- | msd/03_msdwave.pd | 133 | ||||
-rw-r--r-- | msd/filet.pd | 48 | ||||
-rw-r--r-- | msd/help-msd.pd | 596 | ||||
-rw-r--r-- | msd2D/01_msd2Dtest.pd | 56 | ||||
-rw-r--r-- | msd2D/02_msd2Dadd.pd | 272 | ||||
-rw-r--r-- | msd2D/03_imsd2Dtest.pd | 38 | ||||
-rw-r--r-- | msd2D/04_msd2Dperf.pd | 363 | ||||
-rw-r--r-- | msd2D/05_msd2DDataStruct.pd | 120 | ||||
-rw-r--r-- | msd2D/06_msd2Dgravit.pd | 412 | ||||
-rw-r--r-- | msd2D/help-msd2D.pd | 756 | ||||
-rw-r--r-- | msd3D/01_msd3Dtest.pd | 140 | ||||
-rw-r--r-- | msd3D/02_msd3Dperf.pd | 290 | ||||
-rw-r--r-- | msd3D/03_msd3Dmemb.pd | 68 | ||||
-rw-r--r-- | msd3D/04_msd3Dfilet.pd | 34 | ||||
-rw-r--r-- | msd3D/05_msd3Dvline.pd | 203 | ||||
-rw-r--r-- | msd3D/06_msd3Dcylindre.pd | 201 | ||||
-rw-r--r-- | msd3D/filet.pd | 50 | ||||
-rw-r--r-- | msd3D/help-msd3D.pd | 758 |
21 files changed, 3679 insertions, 1544 deletions
@@ -29,7 +29,7 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Version 0.05 -- 28.04.2005 + Version 0.07 -- 17.05.2005 */ // include flext header @@ -40,8 +40,8 @@ #include <vector> // define constants -#define MSD_VERSION 0.05 - +#define MSD_VERSION 0.07 +#define PI 3.1415926535 // check for appropriate flext version #if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 500) @@ -69,7 +69,7 @@ class LinkList public: void insert(Link<N> *l) { - for(typename LinkList::iterator it = begin(); it != end(); ++it) + for(typename LinkList<N>::iterator it = this->begin(); it != this->end(); ++it) if(*it == l) return; // not found -> add push_back(l); @@ -77,7 +77,7 @@ public: void erase(Link<N> *l) { - for(typename LinkList::iterator it = begin(); it != end(); ++it) + for(typename LinkList<N>::iterator it = this->begin(); it != this->end(); ++it) if(*it == l) { // found std::vector<Link<N> *>::erase(it); @@ -165,15 +165,64 @@ public: t_float K1, D1, D2; t_float longueur, long_min, long_max; t_float distance_old; + t_float puissance; + t_int oriented; //0 : no, 1 : tangential, 2 : normal + t_float tdirection1[3], tdirection2[3]; - Link(t_int n,const t_symbol *id,Mass<N> *m1,Mass<N> *m2,t_float k1,t_float d1,t_float d2,t_float lmin,t_float lmax) + Link(t_int n,const t_symbol *id,Mass<N> *m1,Mass<N> *m2,t_float k1,t_float d1, t_int o=0, t_float xa=0, t_float ya=0, t_float za=0,t_float pow=1, t_float lmin = 0,t_float lmax = 1e10) : nbr(n),Id(id) , mass1(m1),mass2(m2) - , K1(k1),D1(d1),D2(d2) + , K1(k1),D1(d1),D2(0),oriented(o),puissance(pow) , long_min(lmin),long_max(lmax) { - distance_old = longueur = Mass<N>::dist(*mass1,*mass2); // L[n-1] - + for (int i=0; i<3; i++) { + tdirection1[i] = 0; + tdirection2[i] = 0; + } + if (oriented == 0) + distance_old = longueur = Mass<N>::dist(*mass1,*mass2); // L[n-1] + else if (oriented == 1) { // TANGENTIAL LINK + const t_float norme = sqrt(sqr(xa)+sqr(ya)+sqr(za)); + tdirection1[0] = xa/norme; + tdirection1[1] = ya/norme; + tdirection1[2] = za/norme; + distance_old = 0; + for(int i = 0; i < N; ++i) + distance_old += sqr((m1->pos[i]-m2->pos[i])*tdirection1[i]); + distance_old = sqrt(distance_old); + longueur = distance_old; + } + else if (oriented == 2) { // NORMAL LINK 2D + if (N >= 2) { + const t_float norme = sqrt(sqr(xa)+sqr(ya)); + tdirection1[0]=ya/norme; + tdirection1[1]=xa/norme; + distance_old = 0; + for(int i = 0; i < N; ++i) + distance_old += sqr((m1->pos[i]-m2->pos[i])*tdirection1[i]); + if (N == 3) { // NORMAL LINK 3D + if (xa == 0 && ya==0 && za!= 0) { // Special case + tdirection1[0]=1; + tdirection1[1]=0; + tdirection1[2]=0; + tdirection2[0]=0; + tdirection2[1]=1; + tdirection2[2]=0; + } + else { // Normal case + const t_float norme2 = sqrt(sqr(xa*ya +za*xa)+sqr(xa*ya+za*ya)+sqr(sqr(xa)+sqr(ya))); + tdirection2[0] = (xa*za+xa*ya)/norme2; + tdirection2[1] = (xa*ya+za*ya)/norme2; + tdirection2[2] = (sqr(xa)+sqr(ya))/norme2; + } + distance_old = 0; + for(int i = 0; i < N; ++i) + distance_old += sqr((m1->pos[i]-m2->pos[i])*(tdirection1[i]+tdirection2[i])); + } + distance_old = sqrt(distance_old); + longueur = distance_old; + } + } mass1->links.insert(this); mass2->links.insert(this); } @@ -187,21 +236,52 @@ public: // compute link forces inline void compute() { + t_float distance=0; + t_float F; Mass<N> *m1 = mass1,*m2 = mass2; // cache locally - t_float distance = Mass<N>::dist(*m1,*m2); + if (oriented == 0) + distance = Mass<N>::dist(*m1,*m2); + else if (oriented == 1) { + for(int i = 0; i < N; ++i) + distance += sqr((m1->pos[i]-m2->pos[i])*tdirection1[i]); + distance = sqrt(distance); + } + else if (oriented == 2) { + for(int i = 0; i < N; ++i) + distance += sqr((m1->pos[i]-m2->pos[i])*(tdirection1[i] +tdirection2[i])); + distance = sqrt(distance); + } + if (distance < long_min || distance > long_max || distance == 0) { - for(int i = 0; i < N; ++i) { - m1->force[i] -= D2 * m1->speed[i]; // Fx1[n] = -Fx, Fx1[n] = Fx1[n] - D2 * vx1[n-1] - m2->force[i] += D2 * m2->speed[i]; // Fx2[n] = Fx, Fx2[n] = Fx2[n] - D2 * vx2[n-1] - } +// for(int i = 0; i < N; ++i) { + // m1->force[i] -= D2 * m1->speed[i]; // Fx1[n] = -Fx, Fx1[n] = Fx1[n] - D2 * vx1[n-1] + // m2->force[i] += D2 * m2->speed[i]; // Fx2[n] = Fx, Fx2[n] = Fx2[n] - D2 * vx2[n-1] + // } } - else { // Lmin < L < Lmax - const t_float F = (K1 * (distance - longueur) + D1 * (distance - distance_old))/distance ; // F[n] = k1 (L[n] - L[0])/L[n] + D1 (L[n] - L[n-1])/L[n] - for(int i = 0; i < N; ++i) { - const t_float Fn = F * (m1->pos[i] - m2->pos[i]); // Fx = F * Lx[n]/L[n] - m1->force[i] -= Fn + D2 * m1->speed[i]; // Fx1[n] = -Fx, Fx1[n] = Fx1[n] - D2 * vx1[n-1] - m2->force[i] += Fn - D2 * m2->speed[i]; // Fx2[n] = Fx, Fx2[n] = Fx2[n] - D2 * vx2[n-1] - } + else { // Lmin < L < Lmax + // F[n] = k1 (L[n] - L[0])/L[n] + D1 (L[n] - L[n-1])/L[n] + if ((distance - longueur)>0) + F = (K1 * pow(distance - longueur,puissance) + D1 * (distance - distance_old))/distance ; + else + F = (-K1 * pow(longueur - distance,puissance) + D1 * (distance - distance_old))/distance ; + if (oriented == 0) + for(int i = 0; i < N; ++i) { + const t_float Fn = F * (m1->pos[i] - m2->pos[i]); // Fx = F * Lx[n]/L[n] + m1->force[i] -= Fn + D2 * m1->speed[i]; // Fx1[n] = -Fx, Fx1[n] = Fx1[n] - D2 * vx1[n-1] + m2->force[i] += Fn - D2 * m2->speed[i]; // Fx2[n] = Fx, Fx2[n] = Fx2[n] - D2 * vx2[n-1] + } + else if (oriented == 1 || (oriented == 2 && N == 2)) + for(int i = 0; i < N; ++i) { + const t_float Fn = F * (m1->pos[i] - m2->pos[i])*tdirection1[i]; // Fx = F * Lx[n]/L[n] + m1->force[i] -= Fn + D2 * m1->speed[i]; // Fx1[n] = -Fx, Fx1[n] = Fx1[n] - D2 * vx1[n-1] + m2->force[i] += Fn - D2 * m2->speed[i]; // Fx2[n] = Fx, Fx2[n] = Fx2[n] - D2 * vx2[n-1] + } + else if (oriented == 2 && N == 3) + for(int i = 0; i < N; ++i) { + const t_float Fn = F * (m1->pos[i] - m2->pos[i])*(tdirection1[i] +tdirection2[i]); // Fx = F * Lx[n]/L[n] + m1->force[i] -= Fn + D2 * m1->speed[i]; // Fx1[n] = -Fx, Fx1[n] = Fx1[n] - D2 * vx1[n-1] + m2->force[i] += Fn - D2 * m2->speed[i]; // Fx2[n] = Fx, Fx2[n] = Fx2[n] - D2 * vx2[n-1] + } } distance_old = distance; // L[n-1] = L[n] @@ -449,16 +529,26 @@ protected: void m_set_mobile(int argc,t_atom *argv,bool mob = true) { if (argc != 1) { - error("%s - %s Syntax : Idmass",thisName(),GetString(thisTag())); + error("%s - %s Syntax : Id/Nomass",thisName(),GetString(thisTag())); return; } - - t_mass *m = mass.find(GetAInt(argv[0])); - if(m) - if(mob) m->setMobile(); - else m->setFixed(); - else - error("%s - %s : Index not found",thisName(),GetString(thisTag())); + if(IsSymbol(argv[0])) { + typename IDMap<t_mass *>::iterator it; + if(mob) + for(it = massids.find(GetSymbol(argv[0])); it; ++it) + it.data()->setMobile(); + else + for(it = massids.find(GetSymbol(argv[0])); it; ++it) + it.data()->setFixed(); + } + else { + t_mass *m = mass.find(GetAInt(argv[0])); + if(m) + if(mob) m->setMobile(); + else m->setFixed(); + else + error("%s - %s : Index not found",thisName(),GetString(thisTag())); + } } // set mass No to fixed @@ -530,12 +620,10 @@ protected: nearest_mass = mit.data()->nbr; } } - - } // Set fixed if mobile - mobil = mass.find(nearest_mass)->M; + mobil = mass.find(nearest_mass)->invM; SetInt(aux2[0],nearest_mass); if (mobil != 0) m_set_fixe(1,aux2); @@ -565,41 +653,107 @@ protected: // Id, *mass1, *mass2, K1, D1, D2, (Lmin,Lmax) void m_link(int argc,t_atom *argv) { - if (argc < 6 || argc > 8) { - error("%s - %s Syntax : Id Nomass1 Nomass2 K D1 D2 (Lmin Lmax)",thisName(),GetString(thisTag())); + if (argc < 5 || argc > 8) { + error("%s - %s Syntax : Id No/Idmass1 No/Idmass2 K D1 (pow Lmin Lmax)",thisName(),GetString(thisTag())); return; } - - t_mass *mass1 = mass.find(GetAInt(argv[1])); - t_mass *mass2 = mass.find(GetAInt(argv[2])); - - if(!mass1 || !mass2) { - error("%s - %s : Index not found",thisName(),GetString(thisTag())); - return; + if (IsSymbol(argv[1]) && IsSymbol(argv[2])) { // ID & ID + typename IDMap<t_mass *>::iterator it1,it2,it; + it1 = massids.find(GetSymbol(argv[1])); + it2 = massids.find(GetSymbol(argv[2])); + for(; it1; ++it1) { + for(it = it2; it; ++it) { + t_link *l = new t_link( + id_link, + GetSymbol(argv[0]), // ID + it1.data(),it.data(), // pointer to mass1, mass2 + GetAFloat(argv[3]), // K1 + GetAFloat(argv[4]), // D1 + 0,0,0,0, + argc >= 6?GetFloat(argv[5]):1, // power + argc >= 7?GetFloat(argv[6]):0, + argc >= 8?GetFloat(argv[7]):1e10 + ); + linkids.insert(l); + link.insert(id_link++,l); + outlink(S_iLink,l); + } + } + } + else if (IsSymbol(argv[1])==0 && IsSymbol(argv[2])) { // No & ID + typename IDMap<t_mass *>::iterator it2,it; + t_mass *mass1 = mass.find(GetAInt(argv[1])); + it2 = massids.find(GetSymbol(argv[2])); + for(it = it2; it; ++it) { + t_link *l = new t_link( + id_link, + GetSymbol(argv[0]), // ID + mass1,it.data(), // pointer to mass1, mass2 + GetAFloat(argv[3]), // K1 + GetAFloat(argv[4]), // D1 + 0,0,0,0, + argc >= 6?GetFloat(argv[5]):1, // power + argc >= 7?GetFloat(argv[6]):0, + argc >= 8?GetFloat(argv[7]):1e10 + ); + linkids.insert(l); + link.insert(id_link++,l); + outlink(S_iLink,l); + } + } + else if (IsSymbol(argv[1]) && IsSymbol(argv[2])==0) { // ID & No + typename IDMap<t_mass *>::iterator it1,it; + it1 = massids.find(GetSymbol(argv[1])); + t_mass *mass2 = mass.find(GetAInt(argv[2])); + for(it = it1; it; ++it) { + t_link *l = new t_link( + id_link, + GetSymbol(argv[0]), // ID + it.data(),mass2, // pointer to mass1, mass2 + GetAFloat(argv[3]), // K1 + GetAFloat(argv[4]), // D1 + 0,0,0,0, + argc >= 6?GetFloat(argv[5]):1, // power + argc >= 7?GetFloat(argv[6]):0, + argc >= 8?GetFloat(argv[7]):1e10 + ); + linkids.insert(l); + link.insert(id_link++,l); + outlink(S_iLink,l); + } + } + else { // No & No + t_mass *mass1 = mass.find(GetAInt(argv[1])); + t_mass *mass2 = mass.find(GetAInt(argv[2])); + + if(!mass1 || !mass2) { + error("%s - %s : Index not found",thisName(),GetString(thisTag())); + return; + } + + t_link *l = new t_link( + id_link, + GetSymbol(argv[0]), // ID + mass1,mass2, // pointer to mass1, mass2 + GetAFloat(argv[3]), // K1 + GetAFloat(argv[4]), // D1 + 0,0,0,0, + argc >= 6?GetFloat(argv[5]):1, // power + argc >= 7?GetFloat(argv[6]):0, // Lmin + argc >= 8?GetFloat(argv[7]):1e10// Lmax + ); + + linkids.insert(l); + link.insert(id_link++,l); + outlink(S_Link,l); } - - t_link *l = new t_link( - id_link, - GetSymbol(argv[0]), // ID - mass1,mass2, // pointer to mass1, mass2 - GetAFloat(argv[3]), // K1 - GetAFloat(argv[4]), // D1 - GetAFloat(argv[5]), // D2 - argc >= 7?GetFloat(argv[6]):0, - argc >= 8?GetFloat(argv[7]):32768 - ); - - linkids.insert(l); - link.insert(id_link++,l); - outlink(S_Link,l); } - // add interactor link // Id, Id masses1, Id masses2, K1, D1, D2, (Lmin, Lmax) void m_ilink(int argc,t_atom *argv) { if (argc < 6 || argc > 8) { - error("%s - %s Syntax : Id Idmass1 Idmass2 K D1 D2 (Lmin Lmax)",thisName(),GetString(thisTag())); + error("%s - %s Syntax : Id Idmass1 Idmass2 K D1 (pow Lmin Lmax)",thisName(),GetString(thisTag())); return; } @@ -615,44 +769,305 @@ protected: it1.data(),it.data(), // pointer to mass1, mass2 GetAFloat(argv[3]), // K1 GetAFloat(argv[4]), // D1 - GetAFloat(argv[5]), // D2 + 0,0,0,0, + argc >= 6?GetFloat(argv[5]):1, // power argc >= 7?GetFloat(argv[6]):0, - argc >= 8?GetFloat(argv[7]):32768 + argc >= 8?GetFloat(argv[7]):1e10 ); linkids.insert(l); link.insert(id_link++,l); - outlink(S_Link,l); + outlink(S_iLink,l); } } } - // set rigidity of link(s) named Id + // add a tangential link + // Id, *mass1, *mass2, K1, D1, D2, (Lmin,Lmax) + void m_tlink(int argc,t_atom *argv) + { + if (argc < 5+N || argc > 8+N) { + error("%s - %s Syntax : Id Nomass1 Nomass2 K D1 xa%s%s (pow Lmin Lmax)",thisName(),GetString(thisTag()),N >= 2?" ya":"",N >= 3?" za":""); + return; + } + + if (IsSymbol(argv[1]) && IsSymbol(argv[2])) { // ID & ID + typename IDMap<t_mass *>::iterator it1,it2,it; + it1 = massids.find(GetSymbol(argv[1])); + it2 = massids.find(GetSymbol(argv[2])); + for(; it1; ++it1) { + for(it = it2; it; ++it) { + t_link *l = new t_link( + id_link, + GetSymbol(argv[0]), // ID + it1.data(),it.data(), // pointer to mass1, mass2 + GetAFloat(argv[3]), // K1 + GetAFloat(argv[4]), // D1 + 1, // tangential + GetAFloat(argv[5]),N >= 2?GetAFloat(argv[6]):0,N >= 3?GetAFloat(argv[7]):0, // vector + (N==1 && argc >= 7)?GetFloat(argv[6]):((N==2 && argc >= 8)?GetFloat(argv[7]):((N==3 && argc >= 9)?GetFloat(argv[8]):1)), // power + (N==1 && argc >= 8)?GetFloat(argv[7]):((N==2 && argc >= 9)?GetFloat(argv[8]):((N==3 && argc >= 10)?GetFloat(argv[9]):0)), // Lmin + (N==1 && argc >= 9)?GetFloat(argv[8]):((N==2 && argc >= 10)?GetFloat(argv[9]):((N==3 && argc >= 11)?GetFloat(argv[10]):1e10))// Lmax + + ); + linkids.insert(l); + link.insert(id_link++,l); + outlink(S_iLink,l); + } + } + } + else if (IsSymbol(argv[1])==0 && IsSymbol(argv[2])) { // No & ID + typename IDMap<t_mass *>::iterator it2,it; + t_mass *mass1 = mass.find(GetAInt(argv[1])); + it2 = massids.find(GetSymbol(argv[2])); + for(it = it2; it; ++it) { + t_link *l = new t_link( + id_link, + GetSymbol(argv[0]), // ID + mass1,it.data(), // pointer to mass1, mass2 + GetAFloat(argv[3]), // K1 + GetAFloat(argv[4]), // D1 + 1, // tangential + GetAFloat(argv[5]),N >= 2?GetAFloat(argv[6]):0,N >= 3?GetAFloat(argv[7]):0, // vector + (N==1 && argc >= 7)?GetFloat(argv[6]):((N==2 && argc >= 8)?GetFloat(argv[7]):((N==3 && argc >= 9)?GetFloat(argv[8]):1)), // power + (N==1 && argc >= 8)?GetFloat(argv[7]):((N==2 && argc >= 9)?GetFloat(argv[8]):((N==3 && argc >= 10)?GetFloat(argv[9]):0)), // Lmin + (N==1 && argc >= 9)?GetFloat(argv[8]):((N==2 && argc >= 10)?GetFloat(argv[9]):((N==3 && argc >= 11)?GetFloat(argv[10]):1e10))// Lmax + ); + linkids.insert(l); + link.insert(id_link++,l); + outlink(S_iLink,l); + } + } + else if (IsSymbol(argv[1]) && IsSymbol(argv[2])==0) { // ID & No + typename IDMap<t_mass *>::iterator it1,it; + it1 = massids.find(GetSymbol(argv[1])); + t_mass *mass2 = mass.find(GetAInt(argv[2])); + for(it = it1; it; ++it) { + t_link *l = new t_link( + id_link, + GetSymbol(argv[0]), // ID + it.data(),mass2, // pointer to mass1, mass2 + GetAFloat(argv[3]), // K1 + GetAFloat(argv[4]), // D1 + 1, // tangential + GetAFloat(argv[5]),N >= 2?GetAFloat(argv[6]):0,N >= 3?GetAFloat(argv[7]):0, // vector + (N==1 && argc >= 7)?GetFloat(argv[6]):((N==2 && argc >= 8)?GetFloat(argv[7]):((N==3 && argc >= 9)?GetFloat(argv[8]):1)), // power + (N==1 && argc >= 8)?GetFloat(argv[7]):((N==2 && argc >= 9)?GetFloat(argv[8]):((N==3 && argc >= 10)?GetFloat(argv[9]):0)), // Lmin + (N==1 && argc >= 9)?GetFloat(argv[8]):((N==2 && argc >= 10)?GetFloat(argv[9]):((N==3 && argc >= 11)?GetFloat(argv[10]):1e10))// Lmax + ); + linkids.insert(l); + link.insert(id_link++,l); + outlink(S_iLink,l); + } + } + else { // No & No + t_mass *mass1 = mass.find(GetAInt(argv[1])); + t_mass *mass2 = mass.find(GetAInt(argv[2])); + + if(!mass1 || !mass2) { + error("%s - %s : Index not found",thisName(),GetString(thisTag())); + return; + } + t_link *l = new t_link( + id_link, + GetSymbol(argv[0]), // ID + mass1,mass2, // pointer to mass1, mass2 + GetAFloat(argv[3]), // K1 + GetAFloat(argv[4]), // D1 + 1, // tangential + GetAFloat(argv[5]),N >= 2?GetAFloat(argv[6]):0,N >= 3?GetAFloat(argv[7]):0, // vector + (N==1 && argc >= 7)?GetFloat(argv[6]):((N==2 && argc >= 8)?GetFloat(argv[7]):((N==3 && argc >= 9)?GetFloat(argv[8]):1)), // power + (N==1 && argc >= 8)?GetFloat(argv[7]):((N==2 && argc >= 9)?GetFloat(argv[8]):((N==3 && argc >= 10)?GetFloat(argv[9]):0)), // Lmin + (N==1 && argc >= 9)?GetFloat(argv[8]):((N==2 && argc >= 10)?GetFloat(argv[9]):((N==3 && argc >= 11)?GetFloat(argv[10]):1e10))// Lmax + ); + linkids.insert(l); + link.insert(id_link++,l); + outlink(S_tLink,l); + } + } + + // add a normal link + // Id, *mass1, *mass2, K1, D1, D2, (Lmin,Lmax) + void m_nlink(int argc,t_atom *argv) + { + if (argc < 5+N || argc > 8+N) { + error("%s - %s Syntax : Id No/Idmass1 No/Idmass2 K D1 xa%s%s (pow Lmin Lmax)",thisName(),GetString(thisTag()),N >= 2?" ya":"",N >= 3?" za":""); + return; + } + + if (N==1) { + error("%s - %s : No normal Link in 1D",thisName(),GetString(thisTag())); + return; + } + if (IsSymbol(argv[1]) && IsSymbol(argv[2])) { // ID & ID + typename IDMap<t_mass *>::iterator it1,it2,it; + it1 = massids.find(GetSymbol(argv[1])); + it2 = massids.find(GetSymbol(argv[2])); + for(; it1; ++it1) { + for(it = it2; it; ++it) { + t_link *l = new t_link( + id_link, + GetSymbol(argv[0]), // ID + it1.data(),it.data(), // pointer to mass1, mass2 + GetAFloat(argv[3]), // K1 + GetAFloat(argv[4]), // D1 + 2, // normal + GetAFloat(argv[5]),GetAFloat(argv[6]),N >= 3?GetAFloat(argv[7]):0, // vector + (N==2 && argc >= 8)?GetFloat(argv[7]):((N==3 && argc >= 9)?GetFloat(argv[8]):1), // pow + (N==2 && argc >= 9)?GetFloat(argv[8]):((N==3 && argc >= 10)?GetFloat(argv[9]):0), // Lmin + (N==2 && argc >= 10)?GetFloat(argv[9]):((N==3 && argc >= 11)?GetFloat(argv[10]):1e10)// Lmax + ); + linkids.insert(l); + link.insert(id_link++,l); + outlink(S_nLink,l); + } + } + } + else if (IsSymbol(argv[1])==0 && IsSymbol(argv[2])) { // No & ID + typename IDMap<t_mass *>::iterator it2,it; + t_mass *mass1 = mass.find(GetAInt(argv[1])); + it2 = massids.find(GetSymbol(argv[2])); + for(it = it2; it; ++it) { + t_link *l = new t_link( + id_link, + GetSymbol(argv[0]), // ID + mass1,it.data(), // pointer to mass1, mass2 + GetAFloat(argv[3]), // K1 + GetAFloat(argv[4]), // D1 + 2, // normal + GetAFloat(argv[5]),GetAFloat(argv[6]),N >= 3?GetAFloat(argv[7]):0, // vector + (N==2 && argc >= 8)?GetFloat(argv[7]):((N==3 && argc >= 9)?GetFloat(argv[8]):1), // pow + (N==2 && argc >= 9)?GetFloat(argv[8]):((N==3 && argc >= 10)?GetFloat(argv[9]):0), // Lmin + (N==2 && argc >= 10)?GetFloat(argv[9]):((N==3 && argc >= 11)?GetFloat(argv[10]):1e10)// Lmax + ); + linkids.insert(l); + link.insert(id_link++,l); + outlink(S_nLink,l); + } + } + else if (IsSymbol(argv[1]) && IsSymbol(argv[2])==0) { // ID & No + typename IDMap<t_mass *>::iterator it1,it; + it1 = massids.find(GetSymbol(argv[1])); + t_mass *mass2 = mass.find(GetAInt(argv[2])); + for(it = it1; it; ++it) { + t_link *l = new t_link( + id_link, + GetSymbol(argv[0]), // ID + it.data(),mass2, // pointer to mass1, mass2 + GetAFloat(argv[3]), // K1 + GetAFloat(argv[4]), // D1 + 2, // normal + GetAFloat(argv[5]),GetAFloat(argv[6]),N >= 3?GetAFloat(argv[7]):0, // vector + (N==2 && argc >= 8)?GetFloat(argv[7]):((N==3 && argc >= 9)?GetFloat(argv[8]):1), // pow + (N==2 && argc >= 9)?GetFloat(argv[8]):((N==3 && argc >= 10)?GetFloat(argv[9]):0), // Lmin + (N==2 && argc >= 10)?GetFloat(argv[9]):((N==3 && argc >= 11)?GetFloat(argv[10]):1e10)// Lmax + ); + linkids.insert(l); + link.insert(id_link++,l); + outlink(S_nLink,l); + } + } + else { // No & No + t_mass *mass1 = mass.find(GetAInt(argv[1])); + t_mass *mass2 = mass.find(GetAInt(argv[2])); + + if(!mass1 || !mass2) { + error("%s - %s : Index not found",thisName(),GetString(thisTag())); + return; + } + + t_link *l = new t_link( + id_link, + GetSymbol(argv[0]), // ID + mass1,mass2, // pointer to mass1, mass2 + GetAFloat(argv[3]), // K1 + GetAFloat(argv[4]), // D1 + 2, // normal + GetAFloat(argv[5]),GetAFloat(argv[6]),N >= 3?GetAFloat(argv[7]):0, // vector + (N==2 && argc >= 8)?GetFloat(argv[7]):((N==3 && argc >= 9)?GetFloat(argv[8]):1), // pow + (N==2 && argc >= 9)?GetFloat(argv[8]):((N==3 && argc >= 10)?GetFloat(argv[9]):0), // Lmin + (N==2 && argc >= 10)?GetFloat(argv[9]):((N==3 && argc >= 11)?GetFloat(argv[10]):1e10)// Lmax + ); + linkids.insert(l); + link.insert(id_link++,l); + outlink(S_nLink,l); + } + } + + // set rigidity of link(s) named Id or number No void m_setK(int argc,t_atom *argv) { if (argc != 2) { - error("%s - %s Syntax : IdLink Value",thisName(),GetString(thisTag())); + error("%s - %s Syntax : Id/NoLink Value",thisName(),GetString(thisTag())); return; } - t_float k1 = GetAFloat(argv[1]); - typename IDMap<t_link *>::iterator it; - for(it = linkids.find(GetSymbol(argv[0])); it; ++it) - it.data()->K1 = k1; + const t_float k1 = GetAFloat(argv[1]); + + if(IsSymbol(argv[0])) { + typename IDMap<t_link *>::iterator it; + for(it = linkids.find(GetSymbol(argv[0])); it; ++it) + it.data()->K1 = k1; + } + else { + t_link *l = link.find(GetAInt(argv[0])); + if(l) + l->K1 = k1; + else + error("%s - %s : Index not found",thisName(),GetString(thisTag())); + } } - // set damping of link(s) named Id + // set damping of link(s) named Id or number No void m_setD(int argc,t_atom *argv) { if (argc != 2) { - error("%s - %s Syntax : IdLink Value",thisName(),GetString(thisTag())); + error("%s - %s Syntax : Id/NoLink Value",thisName(),GetString(thisTag())); return; } - t_float d1 = GetAFloat(argv[1]); - typename IDMap<t_link *>::iterator it; - for(it = linkids.find(GetSymbol(argv[0])); it; ++it) - it.data()->D1 = d1; + const t_float d1 = GetAFloat(argv[1]); + + if(IsSymbol(argv[0])) { + typename IDMap<t_link *>::iterator it; + for(it = linkids.find(GetSymbol(argv[0])); it; ++it) + it.data()->D1 = d1; + } + else { + t_link *l = link.find(GetAInt(argv[0])); + if(l) + l->D1 = d1; + else + error("%s - %s : Index not found",thisName(),GetString(thisTag())); + } + } + + // set initial lenght of link(s) named Id or number No + void m_setL(int argc,t_atom *argv) + { + if (argc != 2) { + error("%s - %s Syntax : Id/NoLink Value",thisName(),GetString(thisTag())); + return; + } + + const t_float lon = GetAFloat(argv[1]); + + if(IsSymbol(argv[0])) { + typename IDMap<t_link *>::iterator it; + for(it = linkids.find(GetSymbol(argv[0])); it; ++it) { + it.data()->longueur = lon; + it.data()->distance_old = lon; + } + } + else { + t_link *l = link.find(GetAInt(argv[0])); + if(l) { + l->longueur = lon; + l->distance_old = lon; + } + else + error("%s - %s : Index not found",thisName(),GetString(thisTag())); + } } // set damping of link(s) named Id @@ -673,7 +1088,7 @@ protected: void m_delete_link(int argc,t_atom *argv) { if (argc != 1) { - error("%s - %s Syntax : NoLink",thisName(),GetString(thisTag())); + error("%s - %s Syntax : NtLink",thisName(),GetString(thisTag())); return; } @@ -941,7 +1356,7 @@ private: massids.reset(); mass.reset(); - + // Reset state variables id_mass = id_link = mouse_grab = mass_deleted = link_deleted = 0; } @@ -966,15 +1381,49 @@ private: void outlink(const t_symbol *s,const t_link *l) { - t_atom sortie[7]; + t_atom sortie[15]; + int size=6; SetInt((sortie[0]),l->nbr); SetSymbol((sortie[1]),l->Id); SetInt((sortie[2]),l->mass1->nbr); SetInt((sortie[3]),l->mass2->nbr); SetFloat((sortie[4]),l->K1); SetFloat((sortie[5]),l->D1); - SetFloat((sortie[6]),l->D2); - ToOutAnything(1,s,7,sortie); + + if (l->oriented == 1 ||(l->oriented == 2 && N ==2)) { + for (int i=0; i<N; i++) + SetFloat((sortie[6+i]),l->tdirection1[i]); +// ToOutAnything(1,s,6+N,sortie); + size = 6+N; + } + else if (l->oriented == 2 && N==3) { + for (int i=0; i<N; i++) { + SetFloat((sortie[6+i]),l->tdirection1[i]); + SetFloat((sortie[6+i+N]),l->tdirection2[i]); + } +// ToOutAnything(1,s,6+2*N,sortie); + size = 6+2*N; + } + + if(l->long_max != 1e10) { + SetFloat((sortie[size]),l->puissance); + size++; + SetFloat((sortie[size]),l->long_min); + size++; + SetFloat((sortie[size]),l->long_max); + size++; + } + else if(l->long_min != 0) { + SetFloat((sortie[size]),l->puissance); + size++; + SetFloat((sortie[size]),l->long_min); + size++; + } + else if(l->puissance != 1) { + SetFloat((sortie[size]),l->puissance); + size++; + } + ToOutAnything(1,s,size,sortie); } @@ -983,6 +1432,8 @@ private: const static t_symbol *S_Mass; const static t_symbol *S_Link; const static t_symbol *S_iLink; + const static t_symbol *S_tLink; + const static t_symbol *S_nLink; const static t_symbol *S_Mass_deleted; const static t_symbol *S_Link_deleted; const static t_symbol *S_massesPos; @@ -1009,6 +1460,8 @@ private: S_Mass = MakeSymbol("Mass"); S_Link = MakeSymbol("Link"); S_iLink = MakeSymbol("iLink"); + S_tLink = MakeSymbol("tLink"); + S_nLink = MakeSymbol("nLink"); S_Mass_deleted = MakeSymbol("Mass deleted"); S_Link_deleted = MakeSymbol("Link deleted"); S_massesPos = MakeSymbol("massesPos"); @@ -1065,10 +1518,13 @@ private: FLEXT_CADDMETHOD_(c,0,"setFixed",m_set_fixe); FLEXT_CADDMETHOD_(c,0,"setK",m_setK); FLEXT_CADDMETHOD_(c,0,"setD",m_setD); + FLEXT_CADDMETHOD_(c,0,"setL",m_setL); FLEXT_CADDMETHOD_(c,0,"setD2",m_setD2); FLEXT_CADDMETHOD_(c,0,"mass",m_mass); FLEXT_CADDMETHOD_(c,0,"link",m_link); FLEXT_CADDMETHOD_(c,0,"iLink",m_ilink); + FLEXT_CADDMETHOD_(c,0,"tLink",m_tlink); + FLEXT_CADDMETHOD_(c,0,"nLink",m_nlink); FLEXT_CADDMETHOD_(c,0,"get",m_get); FLEXT_CADDMETHOD_(c,0,"deleteLink",m_delete_link); FLEXT_CADDMETHOD_(c,0,"deleteMass",m_delete_mass); @@ -1090,6 +1546,8 @@ private: FLEXT_CALLBACK_V(m_mass) FLEXT_CALLBACK_V(m_link) FLEXT_CALLBACK_V(m_ilink) + FLEXT_CALLBACK_V(m_tlink) + FLEXT_CALLBACK_V(m_nlink) FLEXT_CALLBACK_V(m_Xmax) FLEXT_CALLBACK_V(m_Xmin) FLEXT_CALLBACK_V(m_forceX) @@ -1104,6 +1562,7 @@ private: FLEXT_CALLBACK_V(m_posZ) FLEXT_CALLBACK_V(m_setK) FLEXT_CALLBACK_V(m_setD) + FLEXT_CALLBACK_V(m_setL) FLEXT_CALLBACK_V(m_setD2) FLEXT_CALLBACK_V(m_get) FLEXT_CALLBACK_V(m_delete_link) @@ -1116,7 +1575,7 @@ private: #define MSD(NAME,CLASS,N) \ const t_symbol \ *msdN<N>::S_Reset,*msdN<N>::S_Mass, \ - *msdN<N>::S_Link,*msdN<N>::S_iLink, \ + *msdN<N>::S_Link,*msdN<N>::S_iLink,*msdN<N>::S_tLink,*msdN<N>::S_nLink, \ *msdN<N>::S_Mass_deleted,*msdN<N>::S_Link_deleted, \ *msdN<N>::S_massesPos,*msdN<N>::S_massesPosNo,*msdN<N>::S_massesPosId, \ *msdN<N>::S_linksPos,*msdN<N>::S_linksPosNo,*msdN<N>::S_linksPosId, \ diff --git a/msd/01_msdtest.pd b/msd/01_msdtest.pd index 9f13180..9921dbe 100644 --- a/msd/01_msdtest.pd +++ b/msd/01_msdtest.pd @@ -32,19 +32,18 @@ #X obj 45 576 cnv 15 300 200 empty empty empty 20 12 0 14 -261689 -66577 0; #X obj 88 590 vsl 15 128 0 100 0 0 empty empty empty 0 -8 0 8 -261689 --1 -1 8396 1; +-1 -1 8489 1; #X obj 111 590 vsl 15 128 0 100 0 0 empty empty empty 0 -8 0 8 -261689 --1 -1 6393 1; +-1 -1 6790 1; #X obj 66 590 vsl 15 128 0 100 0 0 empty empty empty 0 -8 0 8 -261689 -1 -1 10160 1; #X msg 52 736 posX fix \$1; #X obj 156 590 vsl 15 128 0 100 0 0 empty empty empty 0 -8 0 8 -261689 --1 -1 2427 1; +-1 -1 3216 1; #X obj 134 590 vsl 15 128 0 100 0 0 empty empty empty 0 -8 0 8 -261689 --1 -1 4369 1; +-1 -1 5039 1; #X text 199 638 MOVE FIRST SLIDER; #X text 182 662 TO MOVE THE FIXED MASS; -#X msg 184 248 link souple \$1 \$2 10 0.5 0.5; #X msg 184 226 0 1 \, 1 2 \, 2 3 \, 3 4; #X msg 66 438 forceX mob 300; #X msg 180 438 forceX mob -300; @@ -53,13 +52,14 @@ #X obj 52 545 unpack f f f f f; #X obj 52 523 route massesPosL; #X msg 52 335 bang \, massesPosL; -#X connect 0 0 38 0; -#X connect 2 0 41 0; +#X msg 184 248 link souple \$1 \$2 10 10; +#X connect 0 0 37 0; +#X connect 2 0 40 0; #X connect 2 1 1 0; #X connect 3 0 6 0; -#X connect 6 0 42 0; +#X connect 6 0 41 0; #X connect 9 0 2 0; -#X connect 10 0 38 0; +#X connect 10 0 37 0; #X connect 11 0 9 0; #X connect 12 0 9 0; #X connect 13 0 9 0; @@ -72,23 +72,23 @@ #X connect 24 0 3 0; #X connect 28 0 29 0; #X connect 29 0 2 0; -#X connect 34 0 9 0; -#X connect 35 0 34 0; +#X connect 34 0 42 0; +#X connect 35 0 2 0; #X connect 36 0 2 0; -#X connect 37 0 2 0; -#X connect 38 0 36 0; -#X connect 38 0 3 0; -#X connect 38 1 35 0; -#X connect 38 1 24 0; -#X connect 38 2 13 0; -#X connect 38 3 15 0; -#X connect 38 4 14 0; -#X connect 38 5 11 0; -#X connect 40 0 28 0; -#X connect 40 1 26 0; -#X connect 40 2 27 0; -#X connect 40 3 31 0; -#X connect 40 4 30 0; -#X connect 41 0 40 0; -#X connect 41 1 1 0; -#X connect 42 0 2 0; +#X connect 37 0 35 0; +#X connect 37 0 3 0; +#X connect 37 1 34 0; +#X connect 37 1 24 0; +#X connect 37 2 13 0; +#X connect 37 3 15 0; +#X connect 37 4 14 0; +#X connect 37 5 11 0; +#X connect 39 0 28 0; +#X connect 39 1 26 0; +#X connect 39 2 27 0; +#X connect 39 3 31 0; +#X connect 39 4 30 0; +#X connect 40 0 39 0; +#X connect 40 1 1 0; +#X connect 41 0 2 0; +#X connect 42 0 9 0; diff --git a/msd/02_imsdtest.pd b/msd/02_imsdtest.pd index 901b7a2..6cb98e0 100644 --- a/msd/02_imsdtest.pd +++ b/msd/02_imsdtest.pd @@ -27,16 +27,16 @@ #X obj 45 576 cnv 15 300 200 empty empty empty 20 12 0 14 -261689 -66577 0; #X obj 88 590 vsl 15 128 0 100 0 0 empty empty empty 0 -8 0 8 -261689 --1 -1 12166 1; +-1 -1 6955 1; #X obj 111 590 vsl 15 128 0 100 0 0 empty empty empty 0 -8 0 8 -261689 --1 -1 7166 1; +-1 -1 5050 1; #X obj 66 590 vsl 15 128 0 100 0 0 empty empty empty 0 -8 0 8 -261689 --1 -1 9960 1; +-1 -1 8860 1; #X msg 52 736 posX fix \$1; #X obj 156 590 vsl 15 128 0 100 0 0 empty empty empty 0 -8 0 8 -261689 --1 -1 2370 1; +-1 -1 1240 1; #X obj 134 590 vsl 15 128 0 100 0 0 empty empty empty 0 -8 0 8 -261689 --1 -1 12700 1; +-1 -1 3145 1; #X text 199 638 MOVE FIRST SLIDER; #X text 182 662 TO MOVE THE FIXED MASS; #X msg 66 438 forceX mob 300; @@ -51,7 +51,7 @@ #X msg 66 406 setK inter 2; #X msg 176 385 setD inter 0.01; #X msg 176 407 setD inter 1; -#X msg 184 223 iLink inter fix mob 10 2.5 0.5 5; +#X msg 184 223 link inter fix mob 10 10; #X connect 0 0 31 0; #X connect 2 0 33 0; #X connect 2 1 1 0; diff --git a/msd/03_msdwave.pd b/msd/03_msdwave.pd index 4ac3ab6..987b6de 100644 --- a/msd/03_msdwave.pd +++ b/msd/03_msdwave.pd @@ -28,53 +28,33 @@ #X connect 5 1 1 2; #X connect 5 2 6 3; #X connect 7 0 3 1; -#X restore 265 625 pd massrender; +#X restore 274 531 pd massrender; #X msg 203 83 symbol reset; #X text 793 205 Select view; #X obj 145 38 t b b b b; #X text 418 114 Filet abstraction : x0 y0 stepx stepy ny nx; -#X obj 454 464 msd -------------; -#X obj 33 497 msd2D --------------------------------; +#X obj 63 403 msd -------------; +#X obj 425 423 msd2D --------------------------------; #X obj 305 254 route mass; #X msg 305 275 mass msd1 \$1 \$2 \$5; #X obj 145 253 route mass; #X msg 145 274 mass msd2 \$1 \$2 \$3 \$4; -#X obj 33 517 route massesPos; +#X obj 425 443 route massesPos; #X msg 33 343 bang \, get massesPos; #X obj 33 321 t b b; -#X obj 265 600 pack f f f; -#N canvas 0 0 450 300 getmasses 0; -#X obj 84 33 inlet; -#X obj 91 71 t b b b; -#X obj 120 139 f 0; -#X obj 120 166 + 1; -#X obj 223 34 inlet; -#X obj 224 64 select reset; -#X msg 224 98 0; -#X obj 193 228 outlet; -#X obj 120 191 % 800; -#X connect 0 0 1 0; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 2 0 7 0; -#X connect 3 0 8 0; -#X connect 4 0 5 0; -#X connect 5 0 6 0; -#X connect 6 0 2 1; -#X connect 8 0 2 1; -#X restore 72 657 pd getmasses; -#X obj 454 488 route massesPosNo; -#X msg 63 718 get massesPos \$1; +#X obj 274 506 pack f f f; +#X obj 63 427 route massesPosNo; +#X msg 421 523 get massesPos \$1; #X obj 602 334 rotateXYZ; -#X obj 651 450 vsl 15 128 0 4 0 0 empty empty empty 0 -8 0 8 -262131 --1 -1 1400 1; -#X obj 670 450 vsl 15 128 0 4 0 0 empty empty empty 0 -8 0 8 -262131 +#X obj 56 547 vsl 15 128 0 4 0 0 empty empty empty 0 -8 0 8 -262131 +-1 -1 500 1; +#X obj 75 547 vsl 15 128 0 4 0 0 empty empty empty 0 -8 0 8 -262131 -1 -1 0 1; -#X obj 689 450 vsl 15 128 0 4 0 0 empty empty empty 0 -8 0 8 -262131 +#X obj 94 547 vsl 15 128 0 4 0 0 empty empty empty 0 -8 0 8 -262131 -1 -1 0 1; -#X obj 707 450 vsl 15 128 0 4 0 0 empty empty empty 0 -8 0 8 -262131 +#X obj 112 547 vsl 15 128 0 4 0 0 empty empty empty 0 -8 0 8 -262131 -1 -1 0 1; -#X msg 651 585 posX 0 \$1; +#X msg 56 682 posX 0 \$1; #X msg 621 311 45; #X msg 603 223 view 4 0 0.5 0 0 0 0 0 1; #X msg 603 185 view 0 0.5 6 0 0 0 0 1 0; @@ -88,11 +68,11 @@ #X msg 164 140 setFixed 0 \, setFixed 39 \, setFixed 760 \, setFixed 799; #X msg 603 204 view 0 5 0 0 0 0 0 0 1; -#X msg 670 605 posX 39 \$1; -#X msg 689 625 posX 799 \$1; -#X msg 707 645 posX 760 \$1; -#X text 734 508 Move corners to send a wave!; -#X text 194 703 Each time a mass2D position is send \, the corresponding +#X msg 75 702 posX 39 \$1; +#X msg 94 722 posX 799 \$1; +#X msg 112 742 posX 760 \$1; +#X text 28 514 Move corners to send a wave!; +#X text 330 559 Each time a mass2D position is send \, the corresponding z is asked to the 1D model.; #X text 389 35 X-Y : 2D model; #X text 389 49 Z : 1D model; @@ -100,29 +80,28 @@ z is asked to the 1D model.; ; #X text 178 14 Reset; #X text 304 228 800 masses / 1540 links for each model; -#X text 31 455 The 2D model is just here to help display masses and +#X text 423 381 The 2D model is just here to help display masses and test synchronization between msd objects; -#X obj 33 537 unpack f f f; -#X obj 443 546 unpack f f; -#X obj 173 597 f; -#X obj 33 574 t b f; +#X obj 425 463 unpack f f f; +#X obj 91 462 unpack f f; +#X obj 481 502 f; +#X obj 425 485 t b f; #X connect 0 0 12 0; #X connect 2 0 1 0; -#X connect 3 0 27 0; +#X connect 3 0 26 0; #X connect 5 0 16 0; #X connect 5 0 18 0; #X connect 6 0 12 0; #X connect 7 0 5 0; #X connect 8 0 22 0; -#X connect 10 0 24 1; -#X connect 10 0 41 1; +#X connect 10 0 40 1; +#X connect 12 0 37 0; #X connect 12 0 38 0; -#X connect 12 0 39 0; -#X connect 12 1 42 0; -#X connect 12 2 41 0; +#X connect 12 1 41 0; +#X connect 12 2 40 0; #X connect 12 3 7 0; #X connect 12 3 10 0; -#X connect 14 0 25 0; +#X connect 14 0 24 0; #X connect 15 0 20 0; #X connect 16 0 17 0; #X connect 16 1 14 0; @@ -130,40 +109,40 @@ test synchronization between msd objects; #X connect 18 0 19 0; #X connect 18 1 15 0; #X connect 19 0 15 0; -#X connect 20 0 55 0; +#X connect 20 0 54 0; #X connect 21 0 15 0; #X connect 22 0 21 0; #X connect 22 1 14 0; #X connect 23 0 9 0; -#X connect 25 0 56 0; -#X connect 26 0 14 0; -#X connect 27 0 4 0; -#X connect 28 0 32 0; +#X connect 24 0 55 0; +#X connect 25 0 14 0; +#X connect 26 0 4 0; +#X connect 27 0 31 0; +#X connect 28 0 43 0; #X connect 29 0 44 0; #X connect 30 0 45 0; -#X connect 31 0 46 0; -#X connect 32 0 14 0; -#X connect 33 0 27 1; +#X connect 31 0 14 0; +#X connect 32 0 26 1; +#X connect 33 0 1 0; #X connect 34 0 1 0; -#X connect 35 0 1 0; -#X connect 36 0 27 2; -#X connect 37 0 1 0; -#X connect 37 0 40 0; -#X connect 38 0 15 0; -#X connect 39 0 14 0; -#X connect 40 0 35 0; -#X connect 40 0 36 0; -#X connect 40 0 33 0; +#X connect 35 0 26 2; +#X connect 36 0 1 0; +#X connect 36 0 39 0; +#X connect 37 0 15 0; +#X connect 38 0 14 0; +#X connect 39 0 34 0; +#X connect 39 0 35 0; +#X connect 39 0 32 0; +#X connect 40 0 5 0; #X connect 41 0 5 0; -#X connect 42 0 5 0; -#X connect 43 0 1 0; +#X connect 42 0 1 0; +#X connect 43 0 14 0; #X connect 44 0 14 0; #X connect 45 0 14 0; -#X connect 46 0 14 0; -#X connect 55 0 58 0; -#X connect 55 1 57 1; -#X connect 55 2 23 1; -#X connect 56 1 23 2; -#X connect 57 0 23 0; -#X connect 58 0 57 0; -#X connect 58 1 26 0; +#X connect 54 0 57 0; +#X connect 54 1 56 1; +#X connect 54 2 23 1; +#X connect 55 1 23 2; +#X connect 56 0 23 0; +#X connect 57 0 56 0; +#X connect 57 1 25 0; diff --git a/msd/filet.pd b/msd/filet.pd index ccc5fc5..6e6edb7 100644 --- a/msd/filet.pd +++ b/msd/filet.pd @@ -33,7 +33,6 @@ #X obj 344 59 t b b; #X obj 375 370 t b; #X obj 334 391 f; -#X msg 335 468 link fil \$1 \$2 10 2.5 0.5; #X obj 330 253 t f f f f; #X obj 494 339 moses; #X obj 443 431 pack f f; @@ -44,8 +43,9 @@ #X msg 54 359 mass filet 1 80 \$1 \$2 0; #X obj 46 257 * \$3; #X obj 176 256 * \$4; +#X msg 335 468 link fil \$1 \$2 10 10; #X connect 1 0 5 0; -#X connect 1 0 41 0; +#X connect 1 0 40 0; #X connect 2 0 5 1; #X connect 2 0 26 0; #X connect 3 0 6 0; @@ -62,7 +62,7 @@ #X connect 9 0 17 1; #X connect 10 0 23 0; #X connect 10 1 24 0; -#X connect 11 0 42 0; +#X connect 11 0 41 0; #X connect 12 0 15 0; #X connect 13 0 9 0; #X connect 13 0 31 0; @@ -72,35 +72,35 @@ #X connect 16 0 17 0; #X connect 17 0 18 0; #X connect 18 0 17 1; -#X connect 18 0 35 0; +#X connect 18 0 34 0; #X connect 19 0 16 1; #X connect 20 0 32 0; #X connect 21 0 11 0; #X connect 22 0 11 1; -#X connect 23 0 43 0; -#X connect 24 0 44 0; +#X connect 23 0 42 0; +#X connect 24 0 43 0; #X connect 26 0 20 1; #X connect 27 0 20 0; -#X connect 28 0 36 0; +#X connect 28 0 35 0; #X connect 29 0 30 1; -#X connect 30 0 34 0; +#X connect 30 0 44 0; #X connect 31 0 1 0; #X connect 31 1 2 0; #X connect 32 0 33 0; #X connect 33 0 30 0; -#X connect 34 0 0 0; -#X connect 35 0 27 0; -#X connect 35 1 29 0; -#X connect 35 1 33 1; -#X connect 35 2 28 0; -#X connect 35 3 40 0; -#X connect 35 3 39 1; -#X connect 36 0 38 0; -#X connect 37 0 34 0; -#X connect 38 0 39 0; -#X connect 39 0 37 0; -#X connect 40 0 37 1; -#X connect 41 0 36 1; -#X connect 42 0 0 0; -#X connect 43 0 21 0; -#X connect 44 0 22 0; +#X connect 34 0 27 0; +#X connect 34 1 29 0; +#X connect 34 1 33 1; +#X connect 34 2 28 0; +#X connect 34 3 39 0; +#X connect 34 3 38 1; +#X connect 35 0 37 0; +#X connect 36 0 44 0; +#X connect 37 0 38 0; +#X connect 38 0 36 0; +#X connect 39 0 36 1; +#X connect 40 0 35 1; +#X connect 41 0 0 0; +#X connect 42 0 21 0; +#X connect 43 0 22 0; +#X connect 44 0 0 0; diff --git a/msd/help-msd.pd b/msd/help-msd.pd index b113a1f..d3ef5e4 100644 --- a/msd/help-msd.pd +++ b/msd/help-msd.pd @@ -1,176 +1,426 @@ -#N canvas 367 274 570 449 10; -#N canvas 271 52 742 843 masses 0; -#X obj 33 821 msd; -#X obj 62 154 cnv 15 610 180 empty empty CREATION 20 12 0 14 -262131 --66577 0; -#X msg 79 183 reset; -#X text 249 214 Add a mass; -#X text 335 215 \$1 : Id (symbol); -#X text 334 235 \$2 : fixed or mobile (0/1); -#X text 334 253 \$3 : mass; -#X text 251 184 Delete all masses and links; -#X obj 62 338 cnv 15 610 60 empty empty COMPUTATION 20 12 0 14 -261689 --66577 0; -#X msg 82 367 bang; -#X text 235 367 Compute new masses positions; -#X obj 61 403 cnv 15 610 210 empty empty DYNAMIC_SETTING 20 12 0 14 --262131 -66577 0; -#X text 350 467 \$2 : New value; -#X text 348 521 \$2 : New value; -#X msg 87 429 posX \$1 \$2; -#X text 350 431 Set position of mass(es); -#X text 347 486 Add force on mass(es); -#X msg 85 485 forceX \$1 \$2; -#X obj 61 617 cnv 15 610 198 empty empty GET_ATTRIBUTES 20 12 0 14 --261689 -66577 0; -#X text 248 644 output all masses positions in a list on outlet No -1; -#X text 247 673 output all masses forces in a list on outlet No 1; -#X msg 146 710 get \$1 \$2; -#X text 249 711 Get specific attribute; -#X text 249 736 \$1 : Attribute type ( massesPos / massesSpeeds / massesForces -/ linksPos ); -#X text 249 773 \$2 : Id (symbol or creations numbers); -#X msg 79 214 mass \$1 \$2 \$3 \$4; -#X msg 79 290 deleteMass \$1; -#X text 248 292 Delete a mass and associated links; -#X text 338 309 \$1 : Creation No of mass; -#X msg 144 793 infosL; -#X text 247 793 Get infos on all masses and links on outlet No 2; -#X msg 84 535 Xmin \$1 \, Xmax \$1; -#X text 347 538 Set minimimum and maximum X of masses; -#X text 347 555 \$1 : Value; -#X text 73 22 MASSES :; -#X text 66 69 They got only one physical parameter \, the value of -their; -#X text 67 83 mass. They can be mobile or fixed \, in this case forces -; -#X text 66 54 The msd masses are the principals objects of the model. -; -#X text 66 97 applied on them automatically \, by links \, or manually -\, by; -#X text 67 112 messages \, don't do anything.; -#X msg 81 574 setMobile \$1 \, setFixed \$1; -#X text 345 578 Change mobile parameter; -#X text 345 594 \$1 : Creation No of mass; -#X text 334 271 \$4 : initial position; -#X text 350 449 \$1 : Id (symbol) or No; -#X text 348 503 \$1 : Id (symbol) or No; -#X msg 147 644 massesPosL; -#X msg 147 672 massesForcesL; -#X text 66 128 Be careful : if masses are deleted \, lists messages +#N canvas 479 25 563 818 10; +#X obj 4 369 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 5 779 cnv 15 550 30 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 8 6 cnv 15 550 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 14 389 cnv 15 75 15 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 14 584 cnv 15 75 15 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 4 527 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 4 562 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 7 76 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 5 729 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 5 749 cnv 15 550 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#N canvas 76 31 777 741 More_Info 0; +#X text 94 17 MSD : mass - spring - damper model; +#X text 26 46 MSD is the 1D object of the msd objects collection.; +#X text 25 160 Be careful : if masses are deleted \, lists messages won't work; -#X connect 2 0 0 0; -#X connect 9 0 0 0; -#X connect 14 0 0 0; -#X connect 17 0 0 0; -#X connect 21 0 0 0; -#X connect 25 0 0 0; -#X connect 26 0 0 0; -#X connect 29 0 0 0; -#X connect 31 0 0 0; -#X connect 40 0 0 0; -#X connect 46 0 0 0; -#X connect 47 0 0 0; -#X restore 282 323 pd masses; -#N canvas 222 83 808 841 links 0; -#X obj 33 821 msd; -#X obj 62 192 cnv 15 610 360 empty empty CREATION 20 12 0 14 -262131 --66577 0; -#X msg 79 221 reset; -#X text 402 247 \$1 : Id (symbol); -#X text 314 247 Add a link; -#X text 401 267 \$2 : creation No of mass1; -#X text 401 285 \$3 : creation No of mass2; -#X text 400 303 \$4 : rigidity; -#X text 251 222 Delete all masses and links; -#X text 400 321 \$5 : viscosity; -#X text 400 338 \$6 : damping; -#X obj 61 561 cnv 15 610 82 empty empty DYNAMIC_SETTING 20 12 0 14 --262131 -66577 0; -#X msg 172 583 setD \$1 \$2; -#X text 354 601 \$1 : Id (symbol); -#X text 354 619 \$2 : New value; -#X msg 87 583 setK \$1 \$2; -#X msg 255 583 setD2 \$1 \$2; -#X text 354 583 Set rigidity \, viscosity or damping of link(s); -#X obj 60 650 cnv 15 610 140 empty empty GET_ATTRIBUTES 20 12 0 14 --261689 -66577 0; -#X msg 75 679 get \$1 \$2; -#X text 237 680 Get specific attribute; -#X text 237 705 \$1 : Attribute type ( massesPos / massesSpeeds / massesForces -/ linksPos ); -#X text 237 742 \$2 : Id (symbol or creations numbers); -#X msg 74 533 deleteLink \$1; -#X text 239 535 Delete a link; -#X text 340 535 \$1 : Creation No of link; -#X msg 73 762 infosL; -#X text 236 762 Get infos on all masses and links on outlet No 2; -#X text 402 247 \$1 : Id (symbol); -#X text 314 247 Add a link; -#X text 401 267 \$2 : creation No of mass1; -#X text 401 285 \$3 : creation No of mass2; -#X text 400 303 \$4 : rigidity; -#X text 400 321 \$5 : viscosity; -#X text 400 338 \$6 : damping; -#X text 463 392 \$1 : Id (symbol); -#X text 462 448 \$4 : rigidity; -#X text 462 466 \$5 : viscosity; -#X text 462 483 \$6 : damping; -#X text 463 392 \$1 : Id (symbol); -#X text 462 448 \$4 : rigidity; -#X text 462 466 \$5 : viscosity; -#X text 462 483 \$6 : damping; -#X text 301 393 Add an interactor link; -#X text 94 52 LINKS :; -#X text 71 91 parameters : length \, rigidity \, viscosity and damping. -; -#X text 72 78 Links connect masses two by two. They got 4 physicals +#X text 25 65 It is designed to implement particules physical model +in PD.The model is based on two elements type : mass and link. The +msd masses are the principals objects of the model. They got only one +physical parameter \, the value of their mass. They can be mobile or +fixed \, in this case forces applied on them automatically \, by links +\, or manually \, by messages \, don't do anything.; +#X text 25 262 Links can be created between mutiples masses \, instead +of creation number \, the masses linked are defined with their Id. ; -#X text 70 134 the two masses at the creation.; -#X text 71 120 message. The lenght is initialised to the distance between +#X obj 449 23 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 449 277 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#N canvas 0 0 450 300 graph1 0; +#X array rigidity1 4 float 1; +#A 0 -1 0 1 2; +#X array zero 4 float 1; +#A 0 0 0 0 0; +#X coords 0 3 3 -3 200 150 1; +#X restore 117 339 graph; +#X text 175 496 L0; +#N canvas 163 176 956 727 figure 0; +#X obj 182 108 loadbang; +#X msg 191 180 \; rigidity1 resize 1 \; rigidity1 resize 4 \; rigidity1 +bounds 0 3 3 -3 \; rigidity1 0 -1 0 1 2 \; rigidity1 ylabel -0.5 \; +rigidity1 xlabel -3.5 \; rigidity1 xticks 0 1 1 \; rigidity1 yticks +0 0.1 5; +#X obj 399 574 sqrt; +#X obj 316 651 tabwrite rigidity3; +#X obj 343 464 - 20; +#X obj 316 609 f; +#X obj 316 579 t b f; +#X obj 343 494 moses 0; +#X obj 343 517 * -1; +#X obj 343 538 sqrt; +#X obj 343 559 * -1; +#X obj 375 429 counter 0 50; +#X obj 481 479 - 20; +#X obj 453 662 f; +#X obj 453 632 t b f; +#X obj 481 509 moses 0; +#X obj 481 532 * -1; +#X obj 480 612 * -1; +#X obj 536 627 *; +#X obj 480 591 *; +#X obj 533 595 t f f; +#X obj 480 564 t f f; +#X obj 453 704 tabwrite rigidity4; +#X msg 55 419 \; rigidity3 resize 51 \; rigidity3 xticks 0 1 5 \; rigidity3 +yticks 0 1 5 \; rigidity4 resize 51 \; rigidity4 xticks 0 1 5 \; rigidity4 +yticks 0 100 5; +#X obj 255 350 t b b; +#X obj 374 404 until; +#X msg 404 183 \; rigidity2 resize 1 \; rigidity2 resize 23 \; rigidity2 +bounds 0 3 22 -3 \; rigidity2 0 0 0 -2.5 -2.34 -2.167 -2 -1.833 -1.667 +-1.5 0 0 0 0 0 1.5 1.667 1.833 2 2.167 2.34 2.5 0 0 0 \; rigidity2 +ylabel -0.5 \; rigidity2 xlabel -3.5 \; rigidity2 xticks 1 1 5 \; rigidity2 +yticks 0 0.2 5; +#X connect 0 0 1 0; +#X connect 0 0 26 0; +#X connect 0 0 24 0; +#X connect 2 0 5 1; +#X connect 4 0 7 0; +#X connect 5 0 3 0; +#X connect 6 0 5 0; +#X connect 6 1 3 1; +#X connect 7 0 8 0; +#X connect 7 1 2 0; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X connect 10 0 5 1; +#X connect 11 0 4 0; +#X connect 11 0 6 0; +#X connect 11 0 12 0; +#X connect 11 0 14 0; +#X connect 11 1 25 1; +#X connect 12 0 15 0; +#X connect 13 0 22 0; +#X connect 14 0 13 0; +#X connect 14 1 22 1; +#X connect 15 0 16 0; +#X connect 15 1 20 0; +#X connect 16 0 21 0; +#X connect 17 0 13 1; +#X connect 18 0 13 1; +#X connect 19 0 17 0; +#X connect 20 0 18 0; +#X connect 20 1 18 1; +#X connect 21 0 19 0; +#X connect 21 1 19 1; +#X connect 24 0 25 0; +#X connect 24 1 23 0; +#X connect 25 0 11 0; +#X restore 430 703 pd figure; +#X text 121 318 Rigidity; +#N canvas 0 0 450 300 graph1 0; +#X array rigidity2 23 float 1; +#A 0 0 0 -2.5 -2.34 -2.167 -2 -1.833 -1.667 -1.5 0 0 0 0 0 1.5 1.667 +1.833 2 2.167 2.34 2.5 0 0; +#X array zero 23 float 1; +#A 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; +#X coords 0 3 22 -3 200 150 1; +#X restore 112 555 graph; +#X text 204 710 L0; +#X text 117 532 Rigidity with Lmin and Lmax; +#X text 220 710 Lmin; +#X text 282 711 Lmax; +#N canvas 0 0 450 300 graph1 0; +#X array rigidity3 51 float 1; +#A 0 -4.47214 -4.3589 -4.24264 -4.12311 -4 -3.87298 -3.74166 -3.60555 +-3.4641 -3.31662 -3.16228 -3 -2.82843 -2.64575 -2.44949 -2.23607 -2 +-1.73205 -1.41421 -1 0 1 1.41421 1.73205 2 2.23607 2.44949 2.64575 +2.82843 3 3.16228 3.31662 3.4641 3.60555 3.74166 3.87298 4 4.12311 +4.24264 4.3589 4.47214 4.58258 4.69042 4.79583 4.89898 5 5.09902 5.19615 +5.2915 5.38516 5.47723; +#X array zero 51 float 1; +#A 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; +#X coords 0 6 50 -6 200 150 1; +#X restore 557 346 graph; +#X text 630 499 L0; +#X text 562 325 Rigidity with power = 1/2; +#N canvas 0 0 450 300 graph1 0; +#X array rigidity4 51 float 1; +#A 0 -400 -361 -324 -289 -256 -225 -196 -169 -144 -121 -100 -81 -64 +-49 -36 -25 -16 -9 -4 -1 0 1 4 9 16 25 36 49 64 81 100 121 144 169 +196 225 256 289 324 361 400 441 484 529 576 625 676 729 784 841 900 ; -#X text 71 107 Rigidity \, viscosity and damping are defined by the -creation; -#X text 70 148 Interactor links are links between mutiples masses \, -instead; -#X text 70 161 of creation number \, the masses linked are defined -with; -#X text 69 175 their Id.; -#X text 397 356 ($7) : minimum lenght of link; -#X text 397 373 ($8) : maximum lenght of link; -#X msg 78 247 link \$1 \$2 \$3 \$4 \$5 \$6 ($7 \$8); -#X text 462 412 \$2 : Id (symbol) of masses 1; -#X text 462 430 \$3 : Id (symbol) of masses 2; -#X msg 73 393 iLink \$1 \$2 \$3 \$4 \$5 \$6 ($7 \$8); -#X text 458 500 ($7) : minimum lenght of links; -#X text 458 517 ($8) : maximum lenght of links; -#X connect 2 0 0 0; -#X connect 15 0 0 0; -#X connect 19 0 0 0; -#X connect 23 0 0 0; -#X connect 26 0 0 0; -#X connect 55 0 0 0; -#X connect 58 0 0 0; -#X restore 284 353 pd links; -#X text 135 323 HELP on masses --->; -#X text 134 354 HELP on links --->; -#X text 154 34 MSD : mass - spring - damper model; -#X text 75 79 MSD is the 1D object of the msd objects collection.; -#X text 73 128 There are 4 types of messages for msd :; -#X text 74 92 It is designed to implement particules physical model -in PD.The model is based on two elements type : mass and link.; -#X obj 73 143 cnv 15 420 30 empty empty empty 20 12 0 14 -262131 -66577 -0; -#X obj 73 176 cnv 15 420 30 empty empty empty 20 12 0 14 -261689 -66577 -0; -#X obj 73 209 cnv 15 420 30 empty empty empty 20 12 0 14 -262131 -66577 -0; -#X obj 73 242 cnv 15 420 30 empty empty empty 20 12 0 14 -261689 -66577 -0; -#X text 76 150 CREATION : To create the model masses and links.; -#X text 76 215 DYNAMIC SETTING : To set the model parameters dynamically. -; -#X text 76 248 ATTRIBUTES : To get the model parameters.; -#X text 76 177 COMPUTATION : To compute the new model state based on -previous instant.; +#X array zero 51 float 1; +#A 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; +#X coords 0 1000 50 -1000 200 150 1; +#X restore 554 561 graph; +#X text 627 715 L0; +#X text 557 539 Rigidity with power = 2; +#X text 548 21 The equations are :; +#X text 474 45 if Lmin<|L[n]-L[0]|<Lmax; +#X text 473 84 else; +#X text 473 104 F[n] = D(L[n]-L[n-1]); +#X text 473 63 F[n] = K(L[n] - L[0])^P + D(L[n] - L[n-1]); +#X text 25 192 Links connect masses two by two. They got 4 physicals +parameters : length \, rigidity \, damping and power.; +#X text 25 221 Rigidity \, damping and power are defined by the creation +message. The lenght is initialised to the distance between the two +masses at the creation.; +#X connect 5 0 6 0; +#X restore 16 785 pd More_Info; +#X text 12 76 Examples:; +#X text 9 369 Inlets:; +#X text 19 388 - Left:; +#X text 10 526 Arguments:; +#X text 11 562 Outlets:; +#X text 19 729 See Also:; +#X text 74 48 Full Name:; +#N canvas 58 22 262 70 Related_Objects 0; +#X obj 3 10 cnv 15 250 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 3 30 cnv 15 250 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 5 10 Externals and libraries; +#X obj 44 37 msd2D; +#X obj 140 37 msd3D; +#X restore 122 785 pd Related_Objects; +#X text 12 8 HELP: msd; +#X obj 157 48 msd; +#X text 12 18 DESCRIPTION: Mass spring damper physical modeling in +1D.; +#X obj 18 296 msd; +#N canvas 541 387 524 302 init 0; +#X msg 89 187 Xmax 127 \, Xmin 0; +#X obj 89 215 t a; +#X obj 89 33 loadbang; +#X msg 143 100 mass fix 0 10 0; +#X obj 89 241 s \$0-in; +#X obj 89 59 t b b b b b; +#X msg 161 80 reset; +#X obj 44 13 inlet; +#X msg 125 120 mass mob 1 10 0 \, mass mob 1 10 0 \, mass mob 1 10 +0; +#X msg 107 143 link souple 1 0 1 0.5 \, link souple 1 2 1 0.5 \, link +souple 3 2 1 0.5; +#X connect 0 0 1 0; +#X connect 1 0 4 0; +#X connect 2 0 5 0; +#X connect 3 0 1 0; +#X connect 5 0 0 0; +#X connect 5 1 9 0; +#X connect 5 2 8 0; +#X connect 5 3 3 0; +#X connect 5 4 6 0; +#X connect 6 0 1 0; +#X connect 7 0 5 0; +#X connect 8 0 1 0; +#X connect 9 0 1 0; +#X restore 17 156 pd init; +#X obj 18 321 s \$0-out; +#X obj 18 272 r \$0-in; +#X obj 261 184 vsl 15 127 0 127 0 0 empty empty Drag-----> -70 60 1 +10 -262144 -1 -1 0 1; +#X obj 292 184 vsl 15 127 0 127 0 0 empty empty empty 0 -8 0 8 -262144 +-1 -1 0 1; +#X obj 261 345 s \$0-in; +#X msg 261 322 posX fix \$1; +#N canvas 565 515 355 193 compute 0; +#X obj 159 37 inlet; +#X obj 159 74 metro 20; +#X obj 159 135 s \$0-in; +#X msg 159 104 bang \, massesPosL; +#X connect 0 0 1 0; +#X connect 1 0 3 0; +#X connect 3 0 2 0; +#X restore 17 208 pd compute; +#X obj 17 181 tgl 20 0 empty empty ON/OFF 25 10 1 10 -262144 -1 -1 +0 1; +#X obj 261 107 r \$0-out; +#X obj 17 126 bng 20 250 50 0 empty empty Reset 25 10 1 10 -262144 +-1 -1; +#X obj 261 131 route massesPosL; +#X obj 311 184 vsl 15 127 0 127 0 0 empty empty empty 0 -8 0 8 -262144 +-1 -1 0 1; +#X obj 330 184 vsl 15 127 0 127 0 0 empty empty empty 0 -8 0 8 -262144 +-1 -1 0 1; +#X obj 261 152 unpack f f f f; +#X text 101 388 Bang - A bang at the left inlet compute the new model +state based on previous instant.; +#X text 158 478 To set the model parameters after creation.; +#X text 158 456 To create the model masses and links.; +#X text 158 501 To get the model parameters; +#N canvas 33 254 559 560 creation________ 0; +#X obj 11 95 cnv 15 100 35 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 5 75 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 5 3 cnv 15 550 15 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 7 2 CREATION Messages; +#X obj 10 156 cnv 15 150 140 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 4 137 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 10 332 cnv 15 240 220 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 3 308 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X msg 32 104 reset; +#X text 202 167 Add a mass; +#X text 288 168 \$1 : Id (symbol); +#X text 287 188 \$2 : fixed or mobile (0/1); +#X text 287 206 \$3 : mass; +#X msg 32 167 mass \$1 \$2 \$3 \$4; +#X msg 32 243 deleteMass \$1; +#X text 201 245 Delete a mass and associated links; +#X text 285 262 \$1 : Creation No of mass; +#X text 287 224 \$4 : initial position; +#X text 7 137 Masses :; +#X text 7 74 Reset :; +#X text 129 105 Delete all masses \, links and internal variables; +#X text 6 308 Links :; +#X text 271 360 \$1 : Id (symbol); +#X text 271 413 \$4 : rigidity; +#X msg 30 505 deleteLink \$1; +#X text 264 507 Delete a link; +#X text 268 525 \$1 : Creation No of link; +#X text 271 360 \$1 : Id (symbol); +#X text 271 413 \$4 : rigidity; +#X text 271 378 \$2 : creation No/Id of mass1; +#X text 271 396 \$3 : creation No/Id of mass2; +#X text 266 341 Add link(s); +#X text 268 468 ($6) : minimum lenght of link; +#X text 268 485 ($7) : maximum lenght of link; +#X text 271 431 \$5 : damping; +#X text 10 28 Creation messages are used to define the structure of +the model. Messages create links and masses or destroy them.; +#X msg 30 341 link \$1 \$2 \$3 \$4 \$5 ($6 \$7 \$8); +#X text 271 449 \$6 : Power of the rigidity distance; +#X restore 12 457 pd creation________; +#X text 103 542 None; +#X text 18 583 - Left:; +#X text 101 584 Outputs the model parameters asked with the attributes +messages.; +#X obj 13 629 cnv 15 75 15 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 17 628 - Right:; +#X text 100 629 Outputs information on model when creation messages +are send or with the special message [infosL( which dump the complete +state of the model.; +#X text 101 420 Messages - Different messages are used to control the +msd object. They are of three types :; +#X text 9 751 CATEGORY: control; +#N canvas 475 181 557 516 dynamic 0; +#X obj 5 3 cnv 15 550 15 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 10 85 cnv 15 130 210 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 4 62 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 10 330 cnv 15 130 180 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 3 306 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X text 7 62 Masses :; +#X text 6 306 Links :; +#X text 7 2 DYNAMIC SETTINGS Messages; +#X msg 31 96 posX \$1 \$2; +#X text 190 144 Add force on mass(es); +#X msg 30 152 forceX \$1 \$2; +#X text 192 212 \$1 : Value; +#X text 193 107 \$1 : Id (symbol) or No; +#X text 193 161 \$1 : Id (symbol) or No; +#X msg 30 195 Xmin \$1; +#X msg 30 217 Xmax \$1; +#X msg 29 244 setMobile \$1; +#X msg 29 265 setFixed \$1; +#X text 193 89 Set position of fixed mass(es); +#X text 193 125 \$2 : Value; +#X text 193 179 \$2 : Value; +#X text 189 196 Set minimimum and maximum position of all masses; +#X text 188 244 Set mass to mobile or fixed; +#X msg 29 394 setD \$1 \$2; +#X text 184 380 \$2 : New value; +#X msg 29 343 setK \$1 \$2; +#X text 184 436 \$2 : New value; +#X text 184 489 \$2 : New value; +#X text 178 344 Set rigidity of link(s); +#X text 178 400 Set damping of link(s); +#X msg 29 449 setL \$1 \$2; +#X text 178 453 Set initial lenght of link(s); +#X text 184 362 \$1 : Id (symbol) or No; +#X text 184 418 \$1 : Id (symbol) or No; +#X text 184 471 \$1 : Id (symbol) or No; +#X text 191 261 \$1 : Id (symbol) or No; +#X text 10 25 Dynamic settings messages allows the user to redefine +internal parameters of links and masses.; +#X restore 12 478 pd dynamic settings; +#N canvas 382 95 598 603 attributes______ 0; +#X obj 11 95 cnv 15 100 35 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 5 75 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 5 3 cnv 15 590 15 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 10 158 cnv 15 150 75 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 4 137 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 10 264 cnv 15 110 330 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 4 240 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X text 7 74 General :; +#X text 7 2 ATTRIBUTES Messages; +#X text 7 137 Lists :; +#X msg 33 104 infosL; +#X text 136 104 Get infos on all masses and links on right outlet; +#X msg 32 170 massesPosL; +#X msg 32 198 massesForcesL; +#X text 170 170 Output all masses positions in a list on outlet No +1; +#X text 140 305 \$1 : Attribute type ( massesPos / massesSpeeds / massesForces +/ linksPos ); +#X text 140 280 Get specific attribute on specific element; +#X msg 20 278 get \$1 ($2); +#X text 7 240 Specific :; +#X text 140 375 The get message return the asked attribute preceded +by an identifier and the creation No of the element. The identifier +is made of the asked parameter and the way you asked for it.; +#X text 141 451 message; +#X text 381 451 response; +#X text 140 432 Examples with 3 masses numbered 0 \, 1 and 2 and named +mas:; +#X text 146 541 [get massesPos mas( -----> [massesPosId 0 x0(; +#X text 335 556 [massesPosId 2 x2(; +#X text 335 571 [massesPosId 1 x1(; +#X text 174 470 [get massesPos( -----> [massesPos 0 x0(; +#X text 335 484 [massesPos 2 x2(; +#X text 335 498 [massesPos 1 x1(; +#X text 160 520 [get massesPos 1( -----> [massesPosNo 1 x1(; +#X text 15 30 The attributes messages ask the object to output some +of his internal parameters. They can be output by lists for positions +and forces of masses.; +#X text 170 199 Output all forces applied on masses in a list on outlet +No 1; +#X text 140 342 ($2) : - If not defined all the attributes are send +for all the elements. - Ids or/and creations No; +#X restore 12 499 pd attributes______; +#X text 9 761 KEYWORDS: physical model mass spring damper link; +#X text 267 786 - Nicolas Montgermont \, May 12 \, 2005; +#X text 111 729 01_msdtest.pd; +#X connect 22 0 24 0; +#X connect 25 0 22 0; +#X connect 26 0 29 0; +#X connect 29 0 28 0; +#X connect 31 0 30 0; +#X connect 32 0 34 0; +#X connect 33 0 23 0; +#X connect 34 0 37 0; +#X connect 37 0 26 0; +#X connect 37 1 27 0; +#X connect 37 2 35 0; +#X connect 37 3 36 0; diff --git a/msd2D/01_msd2Dtest.pd b/msd2D/01_msd2Dtest.pd index 7b20575..9134b53 100644 --- a/msd2D/01_msd2Dtest.pd +++ b/msd2D/01_msd2Dtest.pd @@ -25,10 +25,8 @@ #X msg 207 71 reset; #X text 173 21 reset; #X obj 135 42 t b b b b b; -#X msg 135 226 link souple \$1 \$2 \$3 \$4 \$5; #X msg 153 181 Xmax 100 \, Xmin 0 \, Ymax 100 \, Ymin 0; #X text 413 87 CREATION : 3 MASSES \, 2 LINKS; -#X msg 135 205 0 1 10 2.5 0.5 \, 1 2 5 0.5 0.9; #X obj 53 300 gemhead; #X obj 53 323 t b; #X msg 53 345 bang \, get massesPos \, get linksPos; @@ -144,42 +142,44 @@ #X msg 153 160 50 50; #X msg 189 91 mass fix 0 100 50 50; #X msg 85 383 setD souple 0; +#X msg 135 226 link souple \$1 \$2 \$3 \$4; +#X msg 135 205 0 1 10 10 \, 1 2 10 10; #X connect 0 0 20 0; #X connect 3 0 2 0; #X connect 4 0 5 0; #X connect 6 0 2 0; -#X connect 7 0 37 0; +#X connect 7 0 35 0; #X connect 7 1 1 0; #X connect 16 0 7 0; #X connect 17 0 20 0; #X connect 18 0 16 0; -#X connect 20 0 24 0; -#X connect 20 1 47 0; -#X connect 20 1 22 0; -#X connect 20 2 45 0; -#X connect 20 3 48 0; +#X connect 20 0 49 0; +#X connect 20 1 45 0; +#X connect 20 1 21 0; +#X connect 20 2 43 0; +#X connect 20 3 46 0; #X connect 20 4 18 0; #X connect 21 0 16 0; -#X connect 22 0 16 0; -#X connect 24 0 21 0; -#X connect 25 0 26 0; -#X connect 26 0 27 0; +#X connect 23 0 24 0; +#X connect 24 0 25 0; +#X connect 25 0 7 0; #X connect 27 0 7 0; +#X connect 28 0 7 0; #X connect 29 0 7 0; -#X connect 30 0 7 0; -#X connect 31 0 7 0; -#X connect 34 0 7 0; -#X connect 35 0 7 0; -#X connect 37 0 46 0; -#X connect 37 1 36 0; -#X connect 37 2 1 0; -#X connect 39 0 41 0; -#X connect 39 0 42 0; -#X connect 40 0 39 0; -#X connect 41 0 7 0; -#X connect 42 0 7 0; -#X connect 44 0 16 0; -#X connect 45 0 44 0; -#X connect 47 0 39 1; +#X connect 32 0 7 0; +#X connect 33 0 7 0; +#X connect 35 0 44 0; +#X connect 35 1 34 0; +#X connect 35 2 1 0; +#X connect 37 0 39 0; +#X connect 37 0 40 0; +#X connect 38 0 37 0; +#X connect 39 0 7 0; +#X connect 40 0 7 0; +#X connect 42 0 16 0; +#X connect 43 0 42 0; +#X connect 45 0 37 1; +#X connect 46 0 16 0; +#X connect 47 0 7 0; #X connect 48 0 16 0; -#X connect 49 0 7 0; +#X connect 49 0 48 0; diff --git a/msd2D/02_msd2Dadd.pd b/msd2D/02_msd2Dadd.pd index 0f498f7..66f550e 100644 --- a/msd2D/02_msd2Dadd.pd +++ b/msd2D/02_msd2Dadd.pd @@ -1,15 +1,14 @@ #N canvas 534 65 716 776 10; -#X obj 129 376 t a; +#X obj 137 211 t a; #X obj 137 39 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; -#X msg 209 84 reset; +#X msg 195 86 reset; #X obj 52 15 loadbang; -#X obj 137 62 t b b b b b; -#X obj 313 605 print msd; -#X obj 52 583 msd2D --------------------------------; -#X msg 511 526 0 \, destroy; -#X obj 481 320 gemhead; -#X obj 481 343 world_light; +#X obj 313 571 print msd; +#X obj 52 549 msd2D --------------------------------; +#X msg 448 219 0 \, destroy; +#X obj 539 576 gemhead; +#X obj 539 599 world_light; #N canvas 177 95 946 729 synthese 0; #X obj 267 9 inlet; #X msg -35 224 \$1 50; @@ -218,49 +217,46 @@ #X connect 91 0 53 0; #X connect 92 0 61 0; #X connect 93 0 64 0; -#X restore 230 679 pd synthese; -#X obj 10 698 gemhead; -#X msg 155 258 Xmax 100 \, Xmin 0 \, Ymax 100 \, Ymin 0; -#X msg 511 503 reset \, create \, lighting 1 \, 1; +#X restore 230 645 pd synthese; +#X obj 374 461 gemhead; +#X msg 156 145 Xmax 100 \, Xmin 0 \, Ymax 100 \, Ymin 0; +#X msg 448 196 reset \, create \, lighting 1 \, 1; #X obj 52 399 t b; -#N canvas 643 123 605 590 massrender 1; +#N canvas 643 123 605 590 massrender 0; #X obj 127 22 inlet; #X obj 62 267 translateXYZ; -#X obj 141 87 / 12.5; -#X obj 141 110 - 4; -#X obj 206 88 / 12.5; -#X obj 206 111 - 4; +#X obj 166 123 / 12.5; +#X obj 166 146 - 4; +#X obj 231 124 / 12.5; +#X obj 231 147 - 4; #X obj 78 115 gemhead; #X obj 62 241 separator; #X obj 62 181 any; #X obj 127 57 unpack f f f; -#X obj 212 182 f; -#X msg 212 241 \$1; -#X obj 141 137 t b b f; +#X msg 128 194 \$1; #X obj 62 314 sphere 0.1; #X obj 62 219 colorRGB 1 1 1; -#X obj 212 221 / 29; +#X obj 128 174 / 29; +#X obj 127 85 t b f; #X connect 0 0 9 0; -#X connect 1 0 13 0; +#X connect 1 0 11 0; #X connect 2 0 3 0; -#X connect 3 0 12 0; +#X connect 3 0 1 1; #X connect 4 0 5 0; #X connect 5 0 1 2; #X connect 6 0 8 1; #X connect 7 0 1 0; -#X connect 8 0 14 0; -#X connect 9 0 10 1; +#X connect 8 0 12 0; +#X connect 9 0 14 0; #X connect 9 1 2 0; #X connect 9 2 4 0; -#X connect 10 0 15 0; -#X connect 11 0 14 2; -#X connect 11 0 14 3; -#X connect 12 1 8 0; -#X connect 12 1 10 0; -#X connect 12 2 1 1; -#X connect 14 0 7 0; -#X connect 15 0 11 0; -#X restore 141 657 pd massrender; +#X connect 10 0 12 2; +#X connect 10 0 12 3; +#X connect 12 0 7 0; +#X connect 13 0 10 0; +#X connect 14 0 8 0; +#X connect 14 1 13 0; +#X restore 141 623 pd massrender; #N canvas 284 227 587 558 linkrender 0; #X obj 93 25 inlet; #X obj 93 117 / 12.5; @@ -305,33 +301,15 @@ #X connect 18 3 10 0; #X connect 18 4 12 0; #X connect 19 0 9 0; -#X restore 52 678 pd linkrender; -#X msg 221 231 mass mob 1 \$1 \$2 \$3; -#X obj 393 181 random 100; -#X msg 393 161 seed 1; -#X obj 318 181 random 100; -#X obj 241 163 random 100; -#X msg 318 160 seed 2; -#X msg 241 143 seed 3; -#X obj 241 183 + 100; -#X obj 221 210 pack f f f; -#X obj 79 208 t b; -#X obj 79 252 + 1; -#X obj 121 290 f; -#X obj 121 270 + 1; -#X obj 79 273 t f b; -#X msg 112 229 -1; -#X obj 79 229 f -1; -#X obj 70 317 pack f f; -#X obj 173 148 t b b b; -#X obj 52 358 gemhead; -#X obj 511 547 gemwin; +#X restore 52 644 pd linkrender; +#X obj 52 359 gemhead; +#X obj 448 240 gemwin; #X text 175 41 Reset; -#X text 484 171 Random positions and masses; -#X text 367 502 1 Create window -->; -#X text 225 498 Add force; -#X msg 522 585 \; pd dsp 1; -#X text 396 591 2 SET DSP ON -->; +#X text 281 106 Random positions and masses; +#X text 304 195 1 Create window -->; +#X text 225 464 Add force; +#X msg 446 268 \; pd dsp 1; +#X text 320 274 2 SET DSP ON -->; #N canvas 311 224 409 530 gemmouse2 0; #X obj 114 29 gemmouse; #X obj 96 266 outlet; @@ -354,71 +332,117 @@ #X connect 7 0 6 0; #X connect 8 0 9 0; #X connect 9 0 1 0; -#X restore 10 720 pd gemmouse2; -#X msg 10 762 grabMass \$1 \$2 \$3; -#X obj 173 126 repeat 30; -#X obj 79 187 repeat 29; -#X msg 129 348 link souple \$1 \$2 10 0.5 0.5; -#X text 130 713 Move red masses for bass and white ones for high tones... -!Index errors; -#X obj 52 628 route linksPos massesPos massesSpeedsNo; +#X restore 374 483 pd gemmouse2; +#X msg 374 506 grabMass \$1 \$2 \$3; +#X obj 52 594 route linksPos massesPos massesSpeedsNo; #X msg 52 420 bang \, get massesPos \, get linksPos \, get massesSpeeds 1 5 9 13 17 21 25 29; -#X obj 334 684 print; -#X msg 95 518 forceX mob -1000; -#X msg 94 492 forceX mob 1000; -#X connect 0 0 6 0; -#X connect 1 0 4 0; -#X connect 2 0 0 0; +#X obj 334 650 print; +#X msg 95 484 forceX mob -1000; +#X msg 94 458 forceX mob 1000; +#X text 130 679 Move red masses for bass and white ones for high tones... +; +#N canvas 557 309 487 357 masses 0; +#X msg 245 215 mass mob 1 \$1 \$2 \$3; +#X obj 417 165 random 100; +#X msg 417 145 seed 1; +#X obj 342 165 random 100; +#X obj 239 146 random 100; +#X msg 342 144 seed 2; +#X msg 239 126 seed 3; +#X obj 239 166 + 100; +#X obj 245 194 pack f f f; +#X obj 42 14 inlet; +#X obj 246 283 outlet; +#X obj 268 47 loadbang; +#X text 284 101 M; +#X text 356 106 X; +#X text 437 106 Y; +#X obj 223 68 t b b; +#X obj 42 45 until; +#X obj 42 78 f; +#X obj 72 78 + 1; +#X obj 72 100 mod 30; +#X obj 90 45 sel 0; +#X connect 0 0 10 0; +#X connect 1 0 8 2; +#X connect 2 0 1 0; +#X connect 3 0 8 1; +#X connect 4 0 7 0; +#X connect 5 0 3 0; +#X connect 6 0 4 0; +#X connect 7 0 8 0; +#X connect 8 0 0 0; +#X connect 9 0 16 0; +#X connect 11 0 6 0; +#X connect 11 0 5 0; +#X connect 11 0 2 0; +#X connect 15 0 4 0; +#X connect 15 1 3 0; +#X connect 15 1 1 0; +#X connect 16 0 17 0; +#X connect 17 0 18 0; +#X connect 17 0 15 0; +#X connect 18 0 19 0; +#X connect 19 0 17 1; +#X connect 19 0 20 0; +#X connect 20 0 16 1; +#X restore 175 113 pd masses; +#N canvas 0 0 450 300 links 0; +#X obj 136 72 t b; +#X obj 136 116 + 1; +#X obj 130 191 f; +#X obj 92 171 t f b; +#X obj 91 211 pack f f; +#X msg 91 233 link souple \$1 \$2 10 0.5; +#X obj 136 23 inlet; +#X obj 91 260 outlet; +#X obj 136 48 until; +#X obj 202 112 sel 0; +#X obj 184 154 mod 29; +#X obj 136 93 f 0; +#X connect 0 0 11 0; +#X connect 1 0 10 0; +#X connect 1 0 2 1; +#X connect 2 0 4 1; #X connect 3 0 4 0; -#X connect 4 0 46 0; -#X connect 4 1 12 0; -#X connect 4 2 45 0; -#X connect 4 4 2 0; -#X connect 4 4 31 0; -#X connect 4 4 23 0; -#X connect 4 4 19 0; -#X connect 4 4 22 0; -#X connect 6 0 49 0; -#X connect 6 1 5 0; -#X connect 7 0 36 0; -#X connect 8 0 9 0; -#X connect 11 0 43 0; -#X connect 12 0 0 0; -#X connect 13 0 36 0; -#X connect 14 0 50 0; -#X connect 17 0 0 0; -#X connect 18 0 25 2; -#X connect 19 0 18 0; -#X connect 20 0 25 1; -#X connect 21 0 24 0; -#X connect 22 0 20 0; -#X connect 23 0 21 0; +#X connect 3 1 2 0; +#X connect 4 0 5 0; +#X connect 5 0 7 0; +#X connect 6 0 8 0; +#X connect 8 0 0 0; +#X connect 9 0 8 1; +#X connect 10 0 9 0; +#X connect 10 0 11 1; +#X connect 11 0 1 0; +#X connect 11 0 3 0; +#X restore 137 176 pd links; +#X obj 137 62 t b b b b; +#X text 491 431 Get a few masses speeds; +#X connect 0 0 5 0; +#X connect 1 0 34 0; +#X connect 2 0 0 0; +#X connect 3 0 34 0; +#X connect 5 0 26 0; +#X connect 5 1 4 0; +#X connect 6 0 17 0; +#X connect 7 0 8 0; +#X connect 10 0 24 0; +#X connect 11 0 0 0; +#X connect 12 0 17 0; +#X connect 13 0 27 0; +#X connect 16 0 13 0; #X connect 24 0 25 0; -#X connect 25 0 17 0; -#X connect 26 0 32 0; -#X connect 27 0 29 0; -#X connect 27 0 30 0; -#X connect 27 0 32 1; -#X connect 28 0 33 1; -#X connect 29 0 28 1; -#X connect 30 0 33 0; -#X connect 30 1 28 0; -#X connect 31 0 32 1; -#X connect 32 0 27 0; -#X connect 33 0 47 0; -#X connect 34 0 21 0; -#X connect 34 1 20 0; -#X connect 34 2 18 0; -#X connect 35 0 14 0; -#X connect 43 0 44 0; -#X connect 44 0 6 0; -#X connect 45 0 34 0; -#X connect 46 0 26 0; -#X connect 47 0 0 0; -#X connect 49 0 16 0; -#X connect 49 1 15 0; -#X connect 49 2 10 0; -#X connect 50 0 6 0; -#X connect 52 0 6 0; -#X connect 53 0 6 0; +#X connect 25 0 5 0; +#X connect 26 0 15 0; +#X connect 26 1 14 0; +#X connect 26 2 9 0; +#X connect 27 0 5 0; +#X connect 29 0 5 0; +#X connect 30 0 5 0; +#X connect 32 0 0 0; +#X connect 33 0 0 0; +#X connect 34 0 33 0; +#X connect 34 1 11 0; +#X connect 34 2 32 0; +#X connect 34 3 2 0; diff --git a/msd2D/03_imsd2Dtest.pd b/msd2D/03_imsd2Dtest.pd index a7da835..31dee78 100644 --- a/msd2D/03_imsd2Dtest.pd +++ b/msd2D/03_imsd2Dtest.pd @@ -103,31 +103,30 @@ #X connect 11 0 10 0; #X restore 104 657 pd gemmouse; #X obj 104 636 gemhead; -#X msg 84 681 posX fix \$1; -#X msg 76 706 posY fix \$2; +#X msg 105 677 posX fix \$1; +#X msg 106 698 posY fix \$2; #X text 204 677 SET FIXED MASS TO MOUSE POSITION; #X msg 186 150 mass mob 1 100 \$1 \$2; #X obj 135 42 t b b b b b b; -#X msg 135 234 iLink inter mob mob 1 2.5 0.5; #X msg 186 116 20 50 \, 23 61 \, 29 71 \, 39 77 \, 50 80 \, 61 77 \, 71 71 \, 77 61 \, 80 50 \, 77 39 \, 71 29 \, 61 23 \, 50 20 \, 39 23 \, 29 29 \, 23 39; -#X text 413 87 CREATION : 17 MASSES \, 2 iLINKS; -#X msg 152 215 iLink intf fix mob 10 2.5 0.5; #X msg 625 711 0.9 0.9 0.9; #X obj 62 563 route linksPos; #X msg 53 345 bang \, get linksPos; #X text 292 313 COMPUTE AND GET ALL LINKS POSITIONS; #X text 260 572 DISPLAY LINKS WITH GEM; #X msg 85 383 setD inter 0; -#X msg 84 403 setD2 inter 0; #X msg 216 384 setK inter 1; #X msg 216 404 setK inter 2; +#X msg 144 211 link intf mob 0 10 2.5; +#X msg 135 234 link inter mob mob 1 2.5; +#X text 290 43 CREATION : 17 MASSES \, 2 interactor LINKS; #X connect 0 0 35 0; #X connect 3 0 2 0; #X connect 4 0 5 0; #X connect 6 0 2 0; -#X connect 7 0 41 0; +#X connect 7 0 38 0; #X connect 7 1 1 0; #X connect 9 0 7 0; #X connect 10 0 35 0; @@ -136,7 +135,7 @@ #X connect 14 0 9 0; #X connect 15 0 9 0; #X connect 17 0 18 0; -#X connect 18 0 42 0; +#X connect 18 0 39 0; #X connect 20 0 7 0; #X connect 21 0 7 0; #X connect 29 0 31 0; @@ -145,20 +144,19 @@ #X connect 31 0 7 0; #X connect 32 0 7 0; #X connect 34 0 9 0; -#X connect 35 0 36 0; -#X connect 35 1 39 0; +#X connect 35 0 46 0; +#X connect 35 1 45 0; #X connect 35 2 13 0; #X connect 35 2 15 0; -#X connect 35 3 37 0; +#X connect 35 3 36 0; #X connect 35 4 14 0; #X connect 35 5 11 0; -#X connect 36 0 9 0; -#X connect 37 0 34 0; -#X connect 39 0 9 0; -#X connect 40 0 5 1; -#X connect 41 0 25 0; +#X connect 36 0 34 0; +#X connect 37 0 5 1; +#X connect 38 0 25 0; +#X connect 39 0 7 0; #X connect 42 0 7 0; -#X connect 45 0 7 0; -#X connect 46 0 7 0; -#X connect 47 0 7 0; -#X connect 48 0 7 0; +#X connect 43 0 7 0; +#X connect 44 0 7 0; +#X connect 45 0 9 0; +#X connect 46 0 9 0; diff --git a/msd2D/04_msd2Dperf.pd b/msd2D/04_msd2Dperf.pd index 42322d3..735ca6c 100644 --- a/msd2D/04_msd2Dperf.pd +++ b/msd2D/04_msd2Dperf.pd @@ -1,5 +1,5 @@ -#N canvas 291 84 843 799 10; -#X obj 167 310 t a; +#N canvas 346 91 843 799 10; +#X obj 167 221 t a; #X obj 167 33 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 239 84 reset; @@ -11,124 +11,46 @@ #X msg 460 409 0 \, destroy; #X obj 481 320 gemhead; #X obj 481 343 world_light; -#X msg 221 104 mass fix 0 100 50 50; -#N canvas 311 224 450 300 gemmouse 0; -#X obj 31 26 gemmouse; -#X obj 31 133 pack f f; -#X obj 31 167 spigot; -#X obj 31 193 outlet; -#X obj 31 80 - 0; -#X obj 82 94 + 100; -#X obj 31 57 / 5; -#X obj 82 71 / -5; -#X connect 0 0 6 0; -#X connect 0 1 7 0; -#X connect 0 2 2 1; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 4 0 1 0; -#X connect 5 0 1 1; -#X connect 6 0 4 0; -#X connect 7 0 5 0; -#X restore 393 540 pd gemmouse; -#X obj 360 524 gemhead; -#X obj 360 575 l; -#X obj 360 552 t b; -#X msg 360 602 posX fix \$1; -#X msg 360 623 posY fix \$2; -#X msg 185 192 50 50; -#X msg 167 261 Xmax 100 \, Xmin 0 \, Ymax 100 \, Ymin 0; #X msg 460 386 reset \, create \, lighting 1 \, 1; #X obj 52 301 t b; -#N canvas 643 123 605 590 massrender 0; -#X obj 127 22 inlet; -#X obj 48 203 translateXYZ; -#X obj 48 229 sphere 0.1; -#X obj 127 86 / 12.5; -#X obj 127 109 - 4; -#X obj 192 87 / 12.5; -#X obj 192 110 - 4; -#X obj 64 114 gemhead; -#X obj 48 177 separator; -#X obj 48 153 any; -#X obj 125 136 t b f; -#X obj 127 57 unpack f f f; -#X connect 0 0 11 0; -#X connect 1 0 2 0; -#X connect 3 0 4 0; -#X connect 4 0 10 0; +#N canvas 643 123 303 300 massrender 0; +#X obj 24 196 translateXYZ; +#X obj 24 222 sphere 0.1; +#X obj 24 170 separator; +#X obj 24 146 any; +#X obj 40 107 gemhead 45; +#X obj 103 17 inlet; +#X obj 103 55 unpack f f f; +#X obj 101 129 t b f; +#X connect 0 0 1 0; +#X connect 2 0 0 0; +#X connect 3 0 2 0; +#X connect 4 0 3 1; #X connect 5 0 6 0; -#X connect 6 0 1 2; -#X connect 7 0 9 1; -#X connect 8 0 1 0; -#X connect 9 0 8 0; -#X connect 10 0 9 0; -#X connect 10 1 1 1; -#X connect 11 1 3 0; -#X connect 11 2 5 0; +#X connect 6 1 7 0; +#X connect 6 2 0 2; +#X connect 7 0 3 0; +#X connect 7 1 0 1; #X restore 133 635 pd massrender; -#N canvas 284 227 587 558 linkrender 0; -#X obj 93 25 inlet; -#X obj 93 117 / 12.5; -#X obj 93 140 - 4; -#X obj 147 118 / 12.5; -#X obj 147 141 - 4; -#X obj 35 134 gemhead; -#X obj 44 222 separator; -#X obj 44 192 any; -#X obj 93 164 t b f; -#X obj 207 121 / 12.5; -#X obj 207 144 - 4; -#X obj 261 122 / 12.5; -#X obj 261 145 - 4; -#X obj 123 194 pack f f; -#X msg 123 217 \$1 \$2 0; -#X obj 207 193 pack f f; -#X msg 207 216 \$1 \$2 0; -#X obj 44 265 curve 2; -#X obj 94 70 unpack f f f f f; -#X connect 0 0 18 0; -#X connect 1 0 2 0; -#X connect 2 0 8 0; -#X connect 3 0 4 0; -#X connect 4 0 13 1; -#X connect 5 0 7 1; -#X connect 6 0 17 0; -#X connect 7 0 6 0; -#X connect 8 0 7 0; -#X connect 8 1 13 0; -#X connect 9 0 10 0; -#X connect 10 0 15 0; -#X connect 11 0 12 0; -#X connect 12 0 15 1; -#X connect 13 0 14 0; -#X connect 14 0 17 1; -#X connect 15 0 16 0; -#X connect 16 0 17 2; -#X connect 18 1 1 0; -#X connect 18 2 3 0; -#X connect 18 3 9 0; -#X connect 18 4 11 0; +#N canvas 284 227 386 261 linkrender 0; +#X obj 121 20 inlet; +#X obj 57 175 separator; +#X obj 57 151 any; +#X obj 57 220 curve 2; +#X obj 73 112 gemhead 45; +#X msg 213 69 \$4 \$5 0; +#X msg 141 65 \$2 \$3 0; +#X obj 115 139 t b a; +#X connect 0 0 5 0; +#X connect 0 0 6 0; +#X connect 1 0 3 0; +#X connect 2 0 1 0; +#X connect 4 0 2 1; +#X connect 5 0 3 2; +#X connect 6 0 7 0; +#X connect 7 0 2 0; +#X connect 7 1 3 1; #X restore 52 656 pd linkrender; -#X msg 211 170 mass mob 1 \$1 \$2 \$3; -#X obj 379 180 random 100; -#X msg 380 158 seed 1; -#X obj 379 221 random 100; -#X obj 470 179 random 100; -#X msg 379 200 seed 2; -#X msg 470 157 seed 3; -#X obj 470 201 + 100; -#X obj 219 140 pack f f f; -#X obj 591 127 t b; -#X obj 591 171 + 1; -#X obj 627 221 f; -#X obj 628 196 + 1; -#X obj 568 204 t f b; -#X msg 622 148 -1; -#X obj 591 148 f -1; -#X obj 582 248 pack f f; -#X obj 380 134 t b b b; -#X msg 167 284 link souple \$1 \$2 100 0.5 0.5; #X obj 52 278 gemhead; #X obj 460 458 gemwin; #X msg 52 335 bang \, get massesPos \, get linksPos; @@ -136,8 +58,6 @@ #X msg 460 433 view 0 0 4 0 0 0 0 1 0; #X msg 300 425 forceX mob -100; #X obj 441 55 f; -#X obj 380 109 repeat 100; -#X obj 592 105 repeat 100; #X obj 91 421 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X obj 91 442 metro 10; @@ -145,73 +65,160 @@ #X text 501 28 change number of mass to test performance; #X text 501 41 (and reset afterwards); #X obj 441 34 nbx 5 14 1 20000 1 1 empty empty empty 0 -6 0 10 -262144 --1 -1 500 256; -#X text 90 393 instead of GEM doing the timing; +-1 -1 381.385 256; +#X text 76 390 instead of GEM doing the timing; +#X msg 221 104 mass fix 0 100 0 0; +#N canvas 731 296 450 300 gemmouse 0; +#X obj 189 77 gemmouse; +#X obj 189 184 pack f f; +#X obj 189 218 spigot; +#X obj 109 243 outlet; +#X obj 109 36 inlet; +#X obj 109 98 t b; +#X obj 238 131 + 4; +#X obj 109 125 l 0 0; +#X msg 57 182 posX fix \$1; +#X msg 57 203 posY fix \$2; +#X obj 189 108 / 62.5; +#X obj 237 107 / -62.5; +#X obj 189 131 - 4; +#X connect 0 0 10 0; +#X connect 0 1 11 0; +#X connect 0 2 2 1; +#X connect 1 0 2 0; +#X connect 2 0 7 1; +#X connect 4 0 5 0; +#X connect 5 0 7 0; +#X connect 6 0 1 1; +#X connect 7 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 3 0; +#X connect 9 0 3 0; +#X connect 10 0 12 0; +#X connect 11 0 6 0; +#X connect 12 0 1 0; +#X restore 372 536 pd gemmouse; +#X obj 372 515 gemhead; +#N canvas 0 0 450 300 links 0; +#X obj 136 72 t b; +#X obj 136 116 + 1; +#X obj 130 191 f; +#X obj 92 171 t f b; +#X obj 91 211 pack f f; +#X msg 91 233 link souple \$1 \$2 10 0.5; +#X obj 136 23 inlet; +#X obj 91 260 outlet; +#X obj 136 48 until; +#X obj 202 112 sel 0; +#X obj 184 154 mod 29; +#X obj 136 93 f 0; +#X obj 311 32 inlet; +#X connect 0 0 11 0; +#X connect 1 0 10 0; +#X connect 1 0 2 1; +#X connect 2 0 4 1; +#X connect 3 0 4 0; +#X connect 3 1 2 0; +#X connect 4 0 5 0; +#X connect 5 0 7 0; +#X connect 6 0 8 0; +#X connect 8 0 0 0; +#X connect 9 0 8 1; +#X connect 10 0 9 0; +#X connect 10 0 11 1; +#X connect 11 0 1 0; +#X connect 11 0 3 0; +#X connect 12 0 10 1; +#X restore 167 194 pd links; +#N canvas 557 309 487 357 masses 0; +#X msg 211 239 mass mob 1 \$1 \$2 \$3; +#X msg 417 145 seed 1; +#X msg 342 144 seed 2; +#X msg 239 126 seed 3; +#X obj 211 218 pack f f f; +#X obj 42 14 inlet; +#X obj 212 307 outlet; +#X obj 268 47 loadbang; +#X text 284 101 M; +#X text 356 106 X; +#X text 437 106 Y; +#X obj 223 68 t b b; +#X obj 42 45 until; +#X obj 42 78 f; +#X obj 72 78 + 1; +#X obj 72 100 mod 30; +#X obj 90 45 sel 0; +#X obj 164 15 inlet; +#X obj 342 165 random 800; +#X obj 418 165 random 800; +#X obj 239 146 random 800; +#X obj 342 186 / 100; +#X obj 339 206 - 4; +#X obj 407 193 / 100; +#X obj 404 213 - 4; +#X obj 239 166 + 800; +#X obj 235 186 / 8; +#X connect 0 0 6 0; +#X connect 1 0 19 0; +#X connect 2 0 18 0; +#X connect 3 0 20 0; +#X connect 4 0 0 0; +#X connect 5 0 12 0; +#X connect 7 0 3 0; +#X connect 7 0 2 0; +#X connect 7 0 1 0; +#X connect 11 0 20 0; +#X connect 11 1 18 0; +#X connect 11 1 19 0; +#X connect 12 0 13 0; +#X connect 13 0 14 0; +#X connect 13 0 11 0; +#X connect 14 0 15 0; +#X connect 15 0 13 1; +#X connect 15 0 16 0; +#X connect 16 0 12 1; +#X connect 17 0 15 1; +#X connect 18 0 21 0; +#X connect 19 0 23 0; +#X connect 20 0 25 0; +#X connect 21 0 22 0; +#X connect 22 0 4 1; +#X connect 23 0 24 0; +#X connect 24 0 4 2; +#X connect 25 0 26 0; +#X connect 26 0 4 0; +#X restore 203 129 pd masses; +#X msg 185 155 Xmax 4 \, Xmin -4 \, Ymax 4 \, Ymin -4; #X connect 0 0 7 0; #X connect 1 0 6 0; #X connect 2 0 0 0; #X connect 3 0 6 0; #X connect 5 0 7 0; -#X connect 6 0 51 0; -#X connect 6 1 18 0; -#X connect 6 1 19 0; -#X connect 6 2 50 0; -#X connect 6 3 11 0; +#X connect 6 0 32 0; +#X connect 6 1 34 0; +#X connect 6 2 33 0; +#X connect 6 3 29 0; #X connect 6 4 2 0; -#X connect 6 4 38 0; -#X connect 6 4 30 0; -#X connect 6 4 26 0; -#X connect 6 4 29 0; -#X connect 7 0 46 0; -#X connect 8 0 44 0; +#X connect 7 0 18 0; +#X connect 8 0 16 0; #X connect 9 0 10 0; -#X connect 11 0 0 0; -#X connect 12 0 14 1; -#X connect 13 0 15 0; -#X connect 14 0 16 0; -#X connect 14 0 17 0; -#X connect 15 0 14 0; -#X connect 16 0 7 0; +#X connect 11 0 16 0; +#X connect 12 0 17 0; +#X connect 15 0 12 0; #X connect 17 0 7 0; #X connect 18 0 14 0; -#X connect 19 0 0 0; -#X connect 20 0 44 0; -#X connect 21 0 45 0; -#X connect 24 0 0 0; -#X connect 25 0 32 2; -#X connect 26 0 25 0; -#X connect 27 0 32 1; -#X connect 28 0 31 0; -#X connect 29 0 27 0; -#X connect 30 0 28 0; -#X connect 31 0 32 0; -#X connect 32 0 24 0; -#X connect 33 0 39 0; -#X connect 34 0 36 0; -#X connect 34 0 37 0; -#X connect 34 0 39 1; -#X connect 35 0 40 1; -#X connect 36 0 35 1; -#X connect 37 0 40 0; -#X connect 37 1 35 0; -#X connect 38 0 39 1; -#X connect 39 0 34 0; -#X connect 40 0 42 0; -#X connect 41 0 28 0; -#X connect 41 1 27 0; -#X connect 41 2 25 0; -#X connect 42 0 0 0; -#X connect 43 0 21 0; -#X connect 45 0 7 0; -#X connect 46 0 23 0; -#X connect 46 1 22 0; -#X connect 47 0 44 0; -#X connect 48 0 7 0; -#X connect 49 0 50 1; -#X connect 49 0 51 1; -#X connect 50 0 41 0; -#X connect 51 0 33 0; -#X connect 52 0 53 0; -#X connect 53 0 7 0; -#X connect 54 0 53 1; -#X connect 57 0 49 0; +#X connect 18 1 13 0; +#X connect 19 0 16 0; +#X connect 20 0 7 0; +#X connect 21 0 32 1; +#X connect 21 0 33 1; +#X connect 22 0 23 0; +#X connect 23 0 7 0; +#X connect 24 0 23 1; +#X connect 27 0 21 0; +#X connect 29 0 0 0; +#X connect 30 0 7 0; +#X connect 31 0 30 0; +#X connect 32 0 0 0; +#X connect 33 0 0 0; +#X connect 34 0 0 0; diff --git a/msd2D/05_msd2DDataStruct.pd b/msd2D/05_msd2DDataStruct.pd index ce67eae..8bc35e8 100644 --- a/msd2D/05_msd2DDataStruct.pd +++ b/msd2D/05_msd2DDataStruct.pd @@ -17,59 +17,50 @@ mid2 float lid; #X msg 153 181 Xmax 300 \, Xmin 0 \, Ymax 300 \, Ymin 0; #X msg 171 146 mass mob 1 100 \$1 \$2; #X msg 186 317 forceY mob 8; -#X msg 135 252 link souple \$1 \$2 10 2.5 1.5; #X msg 171 113 100 300 \, 150 300 \, 100 230 \, 150 230 \, 100 180 \, 150 180 \, 50 180 \, 200 180 \, 115 180 \, 135 180 \, 110 150 \, 140 150; #X msg 135 205 0 5 \, 1 2 \, 1 4 \, 2 3 \, 3 0 \, 0 2 \, 1 3 \, 2 4 \, 4 5 \, 5 3 \, 3 4 \, 2 5 \, 4 6 \, 5 7 \, 6 5 \, 4 7 \, 4 8 \, 5 9 \, 8 9 \, 8 10 \, 10 11 \, 11 9 \, 9 10 \, 8 11; -#X msg 211 443 forceY mob -500; -#X msg 211 466 forceY mob 500; -#X msg 86 441 forceX mob 500; -#X msg 86 464 forceX mob -500; #X obj 53 217 metro 10; -#X msg 52 571 forceY 6 -500 \, forceY 7 -500; -#X msg 52 540 forceX 0 -500 \, forceX 1 500; -#X msg 52 609 forceY 0 -500 \, forceY 1 -500 \, forceX 0 -500 \, forceX -1 500; #N canvas 0 0 307 306 1000-anim 0; -#X scalar liaison 181.293 300 243.137 187.054 0 0 0 \;; -#X scalar liaison 252.758 300 192.826 235.497 0 0 0 \;; -#X scalar liaison 252.758 300 190.913 187.054 0 0 0 \;; -#X scalar liaison 192.826 235.497 241.225 235.497 0 0 0 \;; -#X scalar liaison 241.225 235.497 181.293 300 0 0 0 \;; -#X scalar liaison 181.293 300 192.826 235.497 0 0 0 \;; -#X scalar liaison 252.758 300 241.225 235.497 0 0 0 \;; -#X scalar liaison 192.826 235.497 190.913 187.054 0 0 0 \;; -#X scalar liaison 190.913 187.054 243.137 187.054 0 0 0 \;; -#X scalar liaison 243.137 187.054 241.225 235.497 0 0 0 \;; -#X scalar liaison 241.225 235.497 190.913 187.054 0 0 0 \;; -#X scalar liaison 192.826 235.497 243.137 187.054 0 0 0 \;; -#X scalar liaison 190.913 187.054 150.806 220.479 0 0 0 \;; -#X scalar liaison 243.137 187.054 283.244 220.479 0 0 0 \;; -#X scalar liaison 150.806 220.479 243.137 187.054 0 0 0 \;; -#X scalar liaison 190.913 187.054 283.244 220.479 0 0 0 \;; -#X scalar liaison 190.913 187.054 205.914 196.864 0 0 0 \;; -#X scalar liaison 243.137 187.054 228.137 196.864 0 0 0 \;; -#X scalar liaison 205.914 196.864 228.137 196.864 0 0 0 \;; -#X scalar liaison 205.914 196.864 202.014 167.631 0 0 0 \;; -#X scalar liaison 202.014 167.631 232.035 167.63 0 0 0 \;; -#X scalar liaison 232.035 167.63 228.137 196.864 0 0 0 \;; -#X scalar liaison 228.137 196.864 202.014 167.631 0 0 0 \;; -#X scalar liaison 205.914 196.864 232.035 167.63 0 0 0 \;; -#X scalar mass 181.293 300 0 0 \;; -#X scalar mass 252.758 300 1 0 \;; -#X scalar mass 192.826 235.497 2 0 \;; -#X scalar mass 241.225 235.497 3 0 \;; -#X scalar mass 190.913 187.054 4 0 \;; -#X scalar mass 243.137 187.054 5 0 \;; -#X scalar mass 150.806 220.479 6 0 \;; -#X scalar mass 283.244 220.479 7 0 \;; -#X scalar mass 205.914 196.864 8 0 \;; -#X scalar mass 228.137 196.864 9 0 \;; -#X scalar mass 202.014 167.631 10 0 \;; -#X scalar mass 232.035 167.63 11 0 \;; +#X scalar liaison 127.938 300 187.405 185.614 0 0 0 \;; +#X scalar liaison 135.515 184.954 150.735 193.676 0 0 0 \;; +#X scalar liaison 135.515 184.954 187.405 185.614 0 0 0 \;; +#X scalar liaison 185.431 234.14 127.938 300 0 0 0 \;; +#X scalar liaison 149.143 163.975 179.054 166.366 0 0 0 \;; +#X scalar liaison 135.515 184.954 93.8641 216.012 0 0 0 \;; +#X scalar liaison 193.606 300 135.515 184.954 0 0 0 \;; +#X scalar liaison 150.735 193.676 172.65 195.175 0 0 0 \;; +#X scalar liaison 185.431 234.14 135.515 184.954 0 0 0 \;; +#X scalar liaison 193.606 300 185.431 234.14 0 0 0 \;; +#X scalar liaison 172.65 195.175 149.143 163.975 0 0 0 \;; +#X scalar liaison 93.8641 216.012 187.405 185.614 0 0 0 \;; +#X scalar liaison 193.606 300 136.415 233.819 0 0 0 \;; +#X scalar liaison 187.405 185.614 172.65 195.175 0 0 0 \;; +#X scalar liaison 187.405 185.614 185.431 234.14 0 0 0 \;; +#X scalar liaison 127.938 300 136.415 233.819 0 0 0 \;; +#X scalar liaison 179.054 166.366 172.65 195.175 0 0 0 \;; +#X scalar liaison 187.405 185.614 228.226 217.782 0 0 0 \;; +#X scalar liaison 136.415 233.819 185.431 234.14 0 0 0 \;; +#X scalar liaison 150.735 193.676 149.143 163.975 0 0 0 \;; +#X scalar liaison 136.415 233.819 187.405 185.614 0 0 0 \;; +#X scalar liaison 136.415 233.819 135.515 184.954 0 0 0 \;; +#X scalar liaison 150.735 193.676 179.054 166.366 0 0 0 \;; +#X scalar liaison 135.515 184.954 228.226 217.782 0 0 0 \;; +#X scalar mass 127.938 300 0 0 \;; +#X scalar mass 150.735 193.676 8 0 \;; +#X scalar mass 135.515 184.954 4 0 \;; +#X scalar mass 136.415 233.819 2 0 \;; +#X scalar mass 149.143 163.975 10 0 \;; +#X scalar mass 93.8641 216.012 6 0 \;; +#X scalar mass 193.606 300 1 0 \;; +#X scalar mass 172.65 195.175 9 0 \;; +#X scalar mass 187.405 185.614 5 0 \;; +#X scalar mass 185.431 234.14 3 0 \;; +#X scalar mass 179.054 166.366 11 0 \;; +#X scalar mass 228.226 217.782 7 0 \;; #X coords 0 0 300 300 300 300 1; #X restore 466 370 pd \$0-anim; #X obj 52 290 make_anim \$0-anim; @@ -78,30 +69,39 @@ mid2 float lid; #X text 333 321 2 - notch the "poll" case to set DS to actual model state; #X text 95 417 4 - "force" the dancer to move; +#X msg 135 252 link souple \$1 \$2 12 20; +#X msg 211 443 forceY mob -200; +#X msg 212 466 forceY mob 200; +#X msg 86 441 forceX mob 200; +#X msg 86 464 forceX mob -200; +#X msg 52 540 forceX 0 -200 \, forceX 1 200; +#X msg 52 609 forceY 0 -200 \, forceY 1 -200 \, forceX 0 -200 \, forceX +1 200; +#X msg 52 571 forceY 6 -200 \, forceY 7 -200; #X connect 0 0 6 0; -#X connect 1 0 24 0; -#X connect 1 1 24 0; +#X connect 1 0 16 0; +#X connect 1 1 16 0; #X connect 2 0 1 0; #X connect 3 0 6 0; #X connect 4 0 2 0; -#X connect 6 0 14 0; +#X connect 6 0 13 0; #X connect 6 1 9 0; -#X connect 6 2 13 0; +#X connect 6 2 12 0; #X connect 6 4 4 0; -#X connect 8 0 19 0; +#X connect 8 0 14 0; #X connect 9 0 2 0; #X connect 10 0 2 0; #X connect 11 0 1 0; -#X connect 12 0 2 0; -#X connect 13 0 10 0; -#X connect 14 0 12 0; -#X connect 15 0 1 0; +#X connect 12 0 10 0; +#X connect 13 0 21 0; +#X connect 14 0 1 0; +#X connect 14 0 11 0; #X connect 16 0 1 0; -#X connect 17 0 1 0; -#X connect 18 0 1 0; -#X connect 19 0 1 0; -#X connect 19 0 11 0; -#X connect 20 0 1 0; -#X connect 21 0 1 0; +#X connect 21 0 2 0; #X connect 22 0 1 0; +#X connect 23 0 1 0; #X connect 24 0 1 0; +#X connect 25 0 1 0; +#X connect 26 0 1 0; +#X connect 27 0 1 0; +#X connect 28 0 1 0; diff --git a/msd2D/06_msd2Dgravit.pd b/msd2D/06_msd2Dgravit.pd new file mode 100644 index 0000000..12a7e25 --- /dev/null +++ b/msd2D/06_msd2Dgravit.pd @@ -0,0 +1,412 @@ +#N canvas 388 82 843 799 10; +#X obj 167 310 t a; +#X obj 167 32 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 239 84 reset; +#X obj 52 15 loadbang; +#X text 205 33 reset; +#X obj 167 55 t b b b b b; +#X obj 52 572 msd2D --------------------------------; +#X msg 460 409 0 \, destroy; +#X obj 458 500 gemhead; +#X obj 458 553 world_light; +#X obj 52 301 t b; +#N canvas 637 205 605 590 massrender 0; +#X obj 124 5 inlet; +#X obj 291 245 translateXYZ; +#X obj 307 156 gemhead; +#X obj 291 219 separator; +#X obj 291 195 any; +#X obj 292 63 unpack f f f; +#X obj 57 257 translateXYZ; +#X obj 73 168 gemhead; +#X obj 57 231 separator; +#X obj 57 207 any; +#X obj 123 31 route 0 1; +#X obj 296 118 t b; +#X obj 64 71 unpack f f; +#X obj 50 116 t b f; +#X obj 168 262 translateXYZ; +#X obj 184 173 gemhead; +#X obj 168 236 separator; +#X obj 168 212 any; +#X obj 175 76 unpack f f; +#X obj 161 121 t b f; +#X obj 169 290 color 1 0 0; +#X obj 292 291 color 1 1 1; +#X obj 57 315 sphere 0.3 20; +#X obj 292 319 square 0.015; +#X obj 168 320 square 0.04; +#X text 61 351 Sun; +#X text 169 355 Red particule; +#X text 307 355 Particule; +#X connect 0 0 10 0; +#X connect 1 0 21 0; +#X connect 2 0 4 1; +#X connect 3 0 1 0; +#X connect 4 0 3 0; +#X connect 5 0 11 0; +#X connect 5 1 1 1; +#X connect 5 2 1 2; +#X connect 6 0 22 0; +#X connect 7 0 9 1; +#X connect 8 0 6 0; +#X connect 9 0 8 0; +#X connect 10 0 12 0; +#X connect 10 1 18 0; +#X connect 10 2 5 0; +#X connect 11 0 4 0; +#X connect 12 0 13 0; +#X connect 12 1 6 2; +#X connect 13 0 9 0; +#X connect 13 1 6 1; +#X connect 14 0 20 0; +#X connect 15 0 17 1; +#X connect 16 0 14 0; +#X connect 17 0 16 0; +#X connect 18 0 19 0; +#X connect 18 1 14 2; +#X connect 19 0 17 0; +#X connect 19 1 14 1; +#X connect 20 0 24 0; +#X connect 21 0 23 0; +#X restore 52 648 pd massrender; +#X obj 52 278 gemhead; +#X obj 460 458 gemwin; +#X msg 460 433 view 0 0 4 0 0 0 0 1 0; +#X text 501 28 change number of mass to test performance; +#X text 501 41 (and reset afterwards); +#X obj 441 34 nbx 5 14 1 20000 1 1 empty empty empty 0 -6 0 10 -262144 +-1 -1 2291.81 256; +#X msg 170 245 Xmax 4 \, Xmin -4 \, Ymax 4 \, Ymin -4; +#X msg 119 203 setL sun 0; +#X msg 221 107 mass fix 0 100 0 0; +#X obj 458 527 rotateXYZ 30 20 0; +#X msg 167 178 forceX mob 5; +#X text 409 258 0.2 : rigidity \, 0 : damping \, -2 : power \, 0.4 +: Lmin; +#X msg 460 386 reset \, dimen 800 800 \, create \, lighting 1 \, 1 +; +#X msg 52 335 bang \, bang \, get massesPos \, get massesSpeeds; +#X obj 52 611 route massesPos massesSpeeds; +#N canvas 177 95 946 729 synthese 0; +#X obj 366 35 inlet; +#X msg 142 257 \$1 50; +#X obj 142 279 line~; +#X obj 102 283 *~; +#X msg 239 256 \$1 50; +#X obj 239 278 line~; +#X obj 199 282 *~; +#X msg 332 258 \$1 50; +#X obj 332 280 line~; +#X obj 292 284 *~; +#X msg 424 256 \$1 50; +#X obj 424 278 line~; +#X obj 384 282 *~; +#X obj 241 330 dac~; +#X msg 525 259 \$1 50; +#X obj 525 281 line~; +#X obj 485 285 *~; +#X msg 620 259 \$1 50; +#X obj 620 281 line~; +#X obj 580 285 *~; +#X msg 713 261 \$1 50; +#X obj 713 283 line~; +#X obj 673 287 *~; +#X msg 805 259 \$1 50; +#X obj 805 281 line~; +#X obj 765 285 *~; +#X obj 622 333 dac~; +#X obj 100 227 osc~ 55; +#X obj 198 226 osc~ 110; +#X obj 383 227 osc~ 222; +#X obj 113 172 unpack f f; +#X obj 332 177 unpack f f; +#X obj 525 175 unpack f f; +#X obj 714 177 unpack f f; +#X msg 132 461 \$1 50; +#X obj 132 483 line~; +#X obj 92 487 *~; +#X msg 229 460 \$1 50; +#X obj 229 482 line~; +#X obj 189 486 *~; +#X msg 322 462 \$1 50; +#X obj 322 484 line~; +#X obj 282 488 *~; +#X msg 414 460 \$1 50; +#X obj 414 482 line~; +#X obj 374 486 *~; +#X obj 231 534 dac~; +#X msg 515 463 \$1 50; +#X obj 515 485 line~; +#X obj 475 489 *~; +#X msg 610 463 \$1 50; +#X obj 610 485 line~; +#X obj 570 489 *~; +#X msg 703 465 \$1 50; +#X obj 703 487 line~; +#X obj 663 491 *~; +#X msg 795 463 \$1 50; +#X obj 795 485 line~; +#X obj 755 489 *~; +#X obj 612 537 dac~; +#X obj 662 435 osc~ 1113; +#X obj 754 433 osc~ 2229; +#X obj 103 369 unpack f f; +#X obj 322 376 unpack f f; +#X obj 514 376 unpack f f; +#X obj 705 375 unpack f f; +#X obj 291 228 osc~ 165; +#X obj 484 229 osc~ 267; +#X obj 579 229 osc~ 311; +#X obj 672 231 osc~ 366; +#X obj 764 229 osc~ 421; +#X obj 90 431 osc~ 444; +#X obj 188 430 osc~ 554; +#X obj 281 432 osc~ 664; +#X obj 373 430 osc~ 776; +#X obj 474 433 osc~ 888; +#X obj 569 433 osc~ 1000; +#X obj 113 197 / 2; +#X obj 241 202 / 2; +#X obj 800 409 / 10; +#X obj 613 409 / 5; +#X obj 516 403 / 5; +#X obj 703 411 / 5; +#X obj 240 168 unpack f f; +#X obj 429 176 unpack f f; +#X obj 621 175 unpack f f; +#X obj 811 177 unpack f f; +#X obj 229 377 unpack f f; +#X obj 418 377 unpack f f; +#X obj 611 377 unpack f f; +#X obj 396 71 route 1 50 100 150 200 250 300 350 400 450 500 550 600 +650 700 750; +#X obj 802 376 unpack f f; +#X obj 419 406 / 5; +#X obj 322 408 / 5; +#X obj 231 406 / 5; +#X obj 103 401 / 5; +#X obj 810 205 / 5; +#X obj 713 206 / 5; +#X obj 623 205 / 5; +#X obj 526 202 / 5; +#X obj 429 202 / 5; +#X obj 332 204 / 5; +#X connect 0 0 90 0; +#X connect 1 0 2 0; +#X connect 2 0 3 1; +#X connect 3 0 13 0; +#X connect 4 0 5 0; +#X connect 5 0 6 1; +#X connect 6 0 13 0; +#X connect 6 0 13 1; +#X connect 7 0 8 0; +#X connect 8 0 9 1; +#X connect 9 0 13 0; +#X connect 9 0 13 1; +#X connect 10 0 11 0; +#X connect 11 0 12 1; +#X connect 12 0 13 1; +#X connect 14 0 15 0; +#X connect 15 0 16 1; +#X connect 16 0 26 0; +#X connect 17 0 18 0; +#X connect 18 0 19 1; +#X connect 19 0 26 0; +#X connect 19 0 26 1; +#X connect 20 0 21 0; +#X connect 21 0 22 1; +#X connect 22 0 26 0; +#X connect 22 0 26 1; +#X connect 23 0 24 0; +#X connect 24 0 25 1; +#X connect 25 0 26 1; +#X connect 27 0 3 0; +#X connect 28 0 6 0; +#X connect 29 0 12 0; +#X connect 30 0 77 0; +#X connect 31 0 101 0; +#X connect 32 0 99 0; +#X connect 33 0 97 0; +#X connect 34 0 35 0; +#X connect 35 0 36 1; +#X connect 36 0 46 0; +#X connect 37 0 38 0; +#X connect 38 0 39 1; +#X connect 39 0 46 0; +#X connect 39 0 46 1; +#X connect 40 0 41 0; +#X connect 41 0 42 1; +#X connect 42 0 46 0; +#X connect 42 0 46 1; +#X connect 43 0 44 0; +#X connect 44 0 45 1; +#X connect 45 0 46 1; +#X connect 47 0 48 0; +#X connect 48 0 49 1; +#X connect 49 0 59 0; +#X connect 50 0 51 0; +#X connect 51 0 52 1; +#X connect 52 0 59 0; +#X connect 52 0 59 1; +#X connect 53 0 54 0; +#X connect 54 0 55 1; +#X connect 55 0 59 0; +#X connect 55 0 59 1; +#X connect 56 0 57 0; +#X connect 57 0 58 1; +#X connect 58 0 59 1; +#X connect 60 0 55 0; +#X connect 61 0 58 0; +#X connect 62 0 95 0; +#X connect 63 0 93 0; +#X connect 64 0 81 0; +#X connect 65 0 82 0; +#X connect 66 0 9 0; +#X connect 67 0 16 0; +#X connect 68 0 19 0; +#X connect 69 0 22 0; +#X connect 70 0 25 0; +#X connect 71 0 36 0; +#X connect 72 0 39 0; +#X connect 73 0 42 0; +#X connect 74 0 45 0; +#X connect 75 0 49 0; +#X connect 76 0 52 0; +#X connect 77 0 1 0; +#X connect 78 0 4 0; +#X connect 79 0 56 0; +#X connect 80 0 50 0; +#X connect 81 0 47 0; +#X connect 82 0 53 0; +#X connect 83 0 78 0; +#X connect 84 0 100 0; +#X connect 85 0 98 0; +#X connect 86 0 96 0; +#X connect 87 0 94 0; +#X connect 88 0 92 0; +#X connect 89 0 80 0; +#X connect 90 0 30 0; +#X connect 90 1 83 0; +#X connect 90 2 31 0; +#X connect 90 3 84 0; +#X connect 90 4 32 0; +#X connect 90 5 85 0; +#X connect 90 6 33 0; +#X connect 90 7 86 0; +#X connect 90 8 62 0; +#X connect 90 9 87 0; +#X connect 90 10 63 0; +#X connect 90 11 88 0; +#X connect 90 12 64 0; +#X connect 90 13 89 0; +#X connect 90 14 65 0; +#X connect 90 15 91 0; +#X connect 91 0 79 0; +#X connect 92 0 43 0; +#X connect 93 0 40 0; +#X connect 94 0 37 0; +#X connect 95 0 34 0; +#X connect 96 0 23 0; +#X connect 97 0 20 0; +#X connect 98 0 17 0; +#X connect 99 0 14 0; +#X connect 100 0 10 0; +#X connect 101 0 7 0; +#X restore 159 652 pd synthese; +#X text 358 111 Sun; +#X text 267 177 Initial speed; +#N canvas 0 0 945 455 masses 0; +#X obj 151 16 inlet; +#X obj 232 28 inlet; +#X obj 151 347 outlet; +#X msg 151 282 mass mob 1 \$1 \$2 \$3; +#X obj 574 221 random 100; +#X obj 499 220 random 100; +#X msg 422 197 seed 3; +#X obj 151 250 pack f f f; +#X obj 151 228 t b b b; +#X msg 499 199 seed 20; +#X msg 574 201 seed 10; +#X obj 422 217 random 10000; +#X obj 424 236 / 500; +#X obj 500 261 - 1; +#X obj 574 263 - 1; +#X obj 425 258 + 205; +#X obj 499 241 / 10000; +#X obj 574 242 / 10000; +#X obj 151 47 t b; +#X obj 333 52 loadbang; +#X text 516 172 X; +#X text 434 168 M; +#X text 612 173 Y; +#X obj 151 67 until; +#X obj 151 86 f; +#X obj 177 87 + 1; +#X obj 177 118 mod 1000; +#X obj 206 87 sel 0; +#X connect 0 0 18 0; +#X connect 1 0 26 1; +#X connect 3 0 2 0; +#X connect 4 0 17 0; +#X connect 5 0 16 0; +#X connect 6 0 11 0; +#X connect 7 0 3 0; +#X connect 8 0 11 0; +#X connect 8 1 5 0; +#X connect 8 2 4 0; +#X connect 9 0 5 0; +#X connect 10 0 4 0; +#X connect 11 0 12 0; +#X connect 12 0 15 0; +#X connect 13 0 7 1; +#X connect 14 0 7 2; +#X connect 15 0 7 0; +#X connect 16 0 13 0; +#X connect 17 0 14 0; +#X connect 18 0 23 0; +#X connect 19 0 9 0; +#X connect 19 0 10 0; +#X connect 19 0 6 0; +#X connect 23 0 24 0; +#X connect 24 0 25 0; +#X connect 24 0 8 0; +#X connect 25 0 26 0; +#X connect 26 0 27 0; +#X connect 26 0 24 1; +#X connect 27 0 23 1; +#X restore 203 144 pd masses; +#X text 410 277 The power of the link is -2 to simulate a gravity field +in 1/R^2; +#X text 290 147 Particules; +#X msg 171 270 link sun fix mob 0.2 0 -2 0.4; +#X connect 0 0 6 0; +#X connect 1 0 5 0; +#X connect 2 0 0 0; +#X connect 3 0 5 0; +#X connect 5 0 19 0; +#X connect 5 0 22 0; +#X connect 5 1 18 0; +#X connect 5 1 33 0; +#X connect 5 2 30 0; +#X connect 5 3 20 0; +#X connect 5 4 2 0; +#X connect 6 0 26 0; +#X connect 7 0 13 0; +#X connect 8 0 21 0; +#X connect 10 0 25 0; +#X connect 12 0 10 0; +#X connect 14 0 13 0; +#X connect 17 0 30 1; +#X connect 18 0 0 0; +#X connect 19 0 0 0; +#X connect 20 0 0 0; +#X connect 21 0 9 0; +#X connect 22 0 0 0; +#X connect 24 0 13 0; +#X connect 25 0 6 0; +#X connect 26 0 11 0; +#X connect 26 1 27 0; +#X connect 30 0 0 0; +#X connect 33 0 0 0; diff --git a/msd2D/help-msd2D.pd b/msd2D/help-msd2D.pd index b8cba2f..560ce0e 100644 --- a/msd2D/help-msd2D.pd +++ b/msd2D/help-msd2D.pd @@ -1,188 +1,576 @@ -#N canvas 0 0 478 397 10; -#N canvas 289 25 787 879 masses 0; -#X obj 62 154 cnv 15 610 180 empty empty CREATION 20 12 0 14 -262131 --66577 0; -#X msg 79 183 reset; -#X text 249 214 Add a mass; -#X text 335 215 \$1 : Id (symbol); -#X text 334 235 \$2 : fixed or mobile (0/1); -#X text 334 253 \$3 : mass; -#X text 251 184 Delete all masses and links; -#X obj 62 338 cnv 15 610 60 empty empty COMPUTATION 20 12 0 14 -261689 --66577 0; -#X msg 82 367 bang; -#X text 235 367 Compute new masses positions; -#X obj 61 403 cnv 15 610 210 empty empty DYNAMIC_SETTING 20 12 0 14 --262131 -66577 0; -#X text 350 467 \$2 : New value; -#X text 348 521 \$2 : New value; -#X msg 87 429 posX \$1 \$2; -#X text 350 431 Set position of mass(es); -#X text 347 486 Add force on mass(es); -#X msg 85 485 forceX \$1 \$2; -#X obj 61 617 cnv 15 610 260 empty empty GET_ATTRIBUTES 20 12 0 14 --261689 -66577 0; -#X text 248 644 output all masses positions in a list on outlet No -1; -#X text 247 695 output all masses forces in a list on outlet No 1; -#X msg 146 732 get \$1 \$2; -#X text 249 733 Get specific attribute; -#X text 249 758 \$1 : Attribute type ( massesPos / massesSpeeds / massesForces -/ linksPos ); -#X text 249 795 \$2 : Id (symbol or creations numbers); -#X msg 79 290 deleteMass \$1; -#X text 248 292 Delete a mass and associated links; -#X text 338 309 \$1 : Creation No of mass; -#X msg 144 813 infosL; -#X text 247 815 Get infos on all masses and links on outlet No 2; -#X text 347 555 \$1 : Value; -#X text 73 22 MASSES :; -#X text 66 69 They got only one physical parameter \, the value of -their; -#X text 67 83 mass. They can be mobile or fixed \, in this case forces -; -#X text 67 54 The msd masses are the principals objects of the model. -; -#X text 66 97 applied on them automatically \, by links \, or manually -\, by; -#X text 67 112 messages \, don't do anything.; -#X msg 81 578 setMobile \$1 \, setFixed \$1; -#X text 345 578 Change mobile parameter; -#X text 345 594 \$1 : Creation No of mass; -#X msg 79 214 mass \$1 \$2 \$3 \$4 \$5; -#X msg 188 430 posY \$1 \$2; -#X msg 186 486 forceY \$1 \$2; -#X obj 33 821 msd2D; -#X text 347 538 Set minimimum and maximum X \, Y of masses; -#X msg 84 538 Xmin \$1 \, Xmax \$1 \, Ymin \$1 \, Ymax \$1; -#X text 334 271 \$4 \, \$5 : initial position; -#X text 350 449 \$1 : Id (symbol) or No; -#X text 348 503 \$1 : Id (symbol) or No; -#X text 248 669 output all masses x/y position in a list on outlet -No 1; -#X msg 112 838 grabMass \$1 \$2 \$3; -#X text 247 838 Get nearest mass and grab it; -#X text 112 857 \$1 \, \$2 : X \, Y position of mouse; -#X text 357 857 \$3 : grab or not (left click); -#X msg 147 644 massesPosL; -#X msg 147 669 massesPosYL; -#X msg 147 694 massesForcesL; -#X msg 68 669 massesPosXL; -#X text 66 131 Be careful: if masses are deleted \, lists messages +#N canvas 595 54 563 818 10; +#X obj 4 369 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 5 779 cnv 15 550 30 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 8 6 cnv 15 550 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 14 389 cnv 15 75 15 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 14 584 cnv 15 75 15 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 4 527 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 4 562 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 7 76 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 5 729 cnv 15 550 20 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 5 749 cnv 15 550 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#N canvas 76 31 921 714 More_Info 0; +#X text 96 12 MSD : mass - spring - damper model; +#X text 27 155 Be careful : if masses are deleted \, lists messages won't work; -#X connect 1 0 42 0; -#X connect 8 0 42 0; -#X connect 13 0 42 0; -#X connect 16 0 42 0; -#X connect 20 0 42 0; -#X connect 24 0 42 0; -#X connect 27 0 42 0; -#X connect 36 0 42 0; -#X connect 39 0 42 0; -#X connect 44 0 42 0; -#X connect 53 0 42 0; -#X connect 55 0 42 0; -#X connect 56 0 42 0; -#X restore 221 312 pd masses; -#X text 75 312 HELP on masses --->; -#X text 74 343 HELP on links --->; -#X text 13 117 There are 4 types of messages for msd :; -#X text 14 81 It is designed to implement particules physical model -in PD.The model is based on two elements type : mass and link.; -#X obj 13 132 cnv 15 420 30 empty empty empty 20 12 0 14 -262131 -66577 -0; -#X obj 13 165 cnv 15 420 30 empty empty empty 20 12 0 14 -261689 -66577 -0; -#X obj 13 198 cnv 15 420 30 empty empty empty 20 12 0 14 -262131 -66577 -0; -#X obj 13 231 cnv 15 420 30 empty empty empty 20 12 0 14 -261689 -66577 -0; -#X text 16 139 CREATION : To create the model masses and links.; -#X text 16 204 DYNAMIC SETTING : To set the model parameters dynamically. -; -#X text 16 237 ATTRIBUTES : To get the model parameters.; -#X text 16 166 COMPUTATION : To compute the new model state based on -previous instant.; -#X text 94 23 MSD2D : mass - spring - damper model; -#X text 15 68 MSD2D is the 2D object of the msd objects collection. +#X text 27 60 It is designed to implement particules physical model +in PD.The model is based on two elements type : mass and link. The +msd masses are the principals objects of the model. They got only one +physical parameter \, the value of their mass. They can be mobile or +fixed \, in this case forces applied on them automatically \, by links +\, or manually \, by messages \, don't do anything.; +#X obj 456 -5 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 456 294 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#N canvas 0 0 450 300 graph1 0; +#X array rigidity1 4 float 1; +#A 0 -1 0 1 2; +#X array zero 4 float 1; +#A 0 0 0 0 0; +#X coords 0 3 3 -3 200 150 1; +#X restore 121 328 graph; +#X text 179 485 L0; +#N canvas 163 176 956 727 figure 0; +#X obj 182 108 loadbang; +#X msg 191 180 \; rigidity1 resize 1 \; rigidity1 resize 4 \; rigidity1 +bounds 0 3 3 -3 \; rigidity1 0 -1 0 1 2 \; rigidity1 ylabel -0.5 \; +rigidity1 xlabel -3.5 \; rigidity1 xticks 0 1 1 \; rigidity1 yticks +0 0.1 5; +#X obj 388 574 sqrt; +#X obj 316 651 tabwrite rigidity3; +#X obj 343 464 - 20; +#X obj 316 609 f; +#X obj 316 579 t b f; +#X obj 343 494 moses 0; +#X obj 343 517 * -1; +#X obj 343 538 sqrt; +#X obj 343 559 * -1; +#X obj 375 429 counter 0 50; +#X obj 481 479 - 20; +#X obj 453 662 f; +#X obj 453 632 t b f; +#X obj 481 509 moses 0; +#X obj 481 532 * -1; +#X obj 480 612 * -1; +#X obj 528 622 *; +#X obj 480 591 *; +#X obj 525 590 t f f; +#X obj 480 564 t f f; +#X obj 453 683 tabwrite rigidity4; +#X obj 255 350 t b b; +#X obj 374 404 until; +#X obj 620 552 f; +#X obj 620 522 t b f; +#X obj 678 376 until; +#X obj 620 623 tabwrite rigidity2; +#X msg 763 574 0; +#X obj 679 401 counter 0 100; +#X obj 679 437 - 50; +#X obj 751 491 moses 40; +#X obj 681 510 moses -40; +#X obj 620 586 * 1.5; +#X obj 680 462 moses 10; +#X obj 680 488 moses -10; +#X msg 55 419 \; rigidity2 resize 101 \; rigidity2 xticks 1 10 5 \; +rigidity2 yticks 0 5 5 \; rigidity3 resize 51 \; rigidity3 xticks 0 +1 5 \; rigidity3 yticks 0 1 5 \; rigidity4 resize 51 \; rigidity4 xticks +0 1 5 \; rigidity4 yticks 0 100 5; +#X connect 0 0 1 0; +#X connect 0 0 23 0; +#X connect 2 0 5 1; +#X connect 4 0 7 0; +#X connect 5 0 3 0; +#X connect 6 0 5 0; +#X connect 6 1 3 1; +#X connect 7 0 8 0; +#X connect 7 1 2 0; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X connect 10 0 5 1; +#X connect 11 0 4 0; +#X connect 11 0 6 0; +#X connect 11 0 12 0; +#X connect 11 0 14 0; +#X connect 11 1 24 1; +#X connect 12 0 15 0; +#X connect 13 0 22 0; +#X connect 14 0 13 0; +#X connect 14 1 22 1; +#X connect 15 0 16 0; +#X connect 15 1 20 0; +#X connect 16 0 21 0; +#X connect 17 0 13 1; +#X connect 18 0 13 1; +#X connect 19 0 17 0; +#X connect 20 0 18 0; +#X connect 20 1 18 1; +#X connect 21 0 19 0; +#X connect 21 1 19 1; +#X connect 23 0 24 0; +#X connect 23 1 37 0; +#X connect 23 1 27 0; +#X connect 24 0 11 0; +#X connect 25 0 34 0; +#X connect 26 0 25 0; +#X connect 26 1 28 1; +#X connect 27 0 30 0; +#X connect 29 0 25 1; +#X connect 30 0 26 0; +#X connect 30 0 31 0; +#X connect 30 1 27 1; +#X connect 31 0 35 0; +#X connect 32 0 25 1; +#X connect 32 1 29 0; +#X connect 33 0 29 0; +#X connect 33 1 25 1; +#X connect 34 0 28 0; +#X connect 35 0 36 0; +#X connect 35 1 32 0; +#X connect 36 0 33 0; +#X connect 36 1 29 0; +#X restore 403 659 pd figure; +#X text 125 307 Rigidity; +#N canvas 0 0 450 300 graph1 0; +#X array rigidity2 101 float 1; +#A 0 0 0 0 0 0 0 0 0 0 0 0 -60 -58.5 -57 -55.5 -54 -52.5 -51 -49.5 +-48 -46.5 -45 -43.5 -42 -40.5 -39 -37.5 -36 -34.5 -33 -31.5 -30 -28.5 +-27 -25.5 -24 -22.5 -21 -19.5 -18 -16.5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 15 16.5 18 19.5 21 22.5 24 25.5 27 28.5 30 31.5 33 34.5 +36 37.5 39 40.5 42 43.5 45 46.5 48 49.5 51 52.5 54 55.5 57 58.5 0 0 +0 0 0 0 0 0 0 0; +#X array zero 101 float 1; +#A 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0; +#X coords 0 60 100 -60 200 150 1; +#X restore 565 327 graph; +#X text 657 482 L0; +#X text 569 304 Rigidity with Lmin and Lmax; +#X text 673 482 Lmin; +#X text 735 481 Lmax; +#N canvas 0 0 450 300 graph1 0; +#X array rigidity3 51 float 1; +#A 0 -4.47214 -4.3589 -4.24264 -4.12311 -4 -3.87298 -3.74166 -3.60555 +-3.4641 -3.31662 -3.16228 -3 -2.82843 -2.64575 -2.44949 -2.23607 -2 +-1.73205 -1.41421 -1 0 1 1.41421 1.73205 2 2.23607 2.44949 2.64575 +2.82843 3 3.16228 3.31662 3.4641 3.60555 3.74166 3.87298 4 4.12311 +4.24264 4.3589 4.47214 4.58258 4.69042 4.79583 4.89898 5 5.09902 5.19615 +5.2915 5.38516 5.47723; +#X array zero 51 float 1; +#A 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; +#X coords 0 6 50 -6 200 150 1; +#X restore 119 526 graph; +#X text 192 679 L0; +#X text 126 505 Rigidity with power = 1/2; +#N canvas 0 0 450 300 graph1 0; +#X array rigidity4 51 float 1; +#A 0 -400 -361 -324 -289 -256 -225 -196 -169 -144 -121 -100 -81 -64 +-49 -36 -25 -16 -9 -4 -1 0 1 4 9 16 25 36 49 64 81 100 121 144 169 +196 225 256 289 324 361 400 441 484 529 576 625 676 729 784 841 900 ; -#N canvas 222 83 808 841 links 0; -#X obj 33 821 msd; -#X obj 62 192 cnv 15 610 360 empty empty CREATION 20 12 0 14 -262131 --66577 0; -#X msg 79 221 reset; -#X text 402 247 \$1 : Id (symbol); -#X text 314 247 Add a link; -#X text 401 267 \$2 : creation No of mass1; -#X text 401 285 \$3 : creation No of mass2; -#X text 400 303 \$4 : rigidity; -#X text 251 222 Delete all masses and links; -#X text 400 321 \$5 : viscosity; -#X text 400 338 \$6 : damping; -#X obj 61 561 cnv 15 610 82 empty empty DYNAMIC_SETTING 20 12 0 14 --262131 -66577 0; -#X msg 172 583 setD \$1 \$2; -#X text 354 601 \$1 : Id (symbol); -#X text 354 619 \$2 : New value; -#X msg 87 583 setK \$1 \$2; -#X msg 255 583 setD2 \$1 \$2; -#X text 354 583 Set rigidity \, viscosity or damping of link(s); -#X obj 60 650 cnv 15 610 140 empty empty GET_ATTRIBUTES 20 12 0 14 --261689 -66577 0; -#X msg 75 679 get \$1 \$2; -#X text 237 680 Get specific attribute; -#X text 237 705 \$1 : Attribute type ( massesPos / massesSpeeds / massesForces +#X array zero 51 float 1; +#A 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; +#X coords 0 1000 50 -1000 200 150 1; +#X restore 566 530 graph; +#X text 639 684 L0; +#X text 571 508 Rigidity with power = 2; +#X text 571 12 The equations are :; +#X text 497 36 if Lmin<|L[n]-L[0]|<Lmax; +#X text 496 75 else; +#X text 496 95 F[n] = D(L[n]-L[n-1]); +#X text 496 54 F[n] = K(L[n] - L[0])^P + D(L[n] - L[n-1]); +#X text 28 187 Links connect masses two by two. They got 4 physicals +parameters : length \, rigidity \, damping and power.; +#X text 27 216 Rigidity \, damping and power are defined by the creation +message. The lenght is initialised to the distance between the two +masses at the creation.; +#X text 495 124 For oriented links \, the force F[n] is projected onto +a vector which is given during the creation of the link using x1y1 +coordinates.; +#X text 495 169 For normal vector \, the direction is calculated using +the scalar product :; +#X text 495 248 You can build specific links using different links +messages defining the characteristic step by step.; +#X text 496 206 x1x2 + y1y2 = 0; +#X text 27 257 Links can be created in one shot between mutiples masses +\, instead of creation number \, the masses linked are defined with +their Id.; +#X text 28 41 MSD is the 2D object of the msd objects collection.; +#X connect 3 0 4 0; +#X restore 16 785 pd More_Info; +#X text 12 76 Examples:; +#X text 9 369 Inlets:; +#X text 19 388 - Left:; +#X text 10 526 Arguments:; +#X text 11 562 Outlets:; +#X text 19 729 See Also:; +#X text 74 48 Full Name:; +#N canvas 58 22 262 70 Related_Objects 0; +#X obj 3 10 cnv 15 250 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 3 30 cnv 15 250 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 5 10 Externals and libraries; +#X obj 141 38 msd3D; +#X obj 44 37 msd; +#X restore 122 785 pd Related_Objects; +#N canvas 257 262 759 345 init 0; +#X obj 89 215 t a; +#X obj 89 33 loadbang; +#X obj 89 241 s \$0-in; +#X obj 89 59 t b b b b b; +#X msg 161 80 reset; +#X obj 44 13 inlet; +#X msg 143 100 mass fix 0 10 0 0; +#X msg 89 187 Xmax 4 \, Xmin -4 \, Ymax 4 \, Ymin -4; +#X msg 125 120 mass mob 1 100 0 -2 \, mass mob 1 100 2 0 \, mass mob +1 100 0 2 \, mass mob 1 100 -2 0; +#X msg 107 161 link souple fix mob 10 10 \, link souple mob mob 10 +10; +#X connect 0 0 2 0; +#X connect 1 0 3 0; +#X connect 3 0 7 0; +#X connect 3 1 9 0; +#X connect 3 2 8 0; +#X connect 3 3 6 0; +#X connect 3 4 4 0; +#X connect 4 0 0 0; +#X connect 5 0 3 0; +#X connect 6 0 0 0; +#X connect 7 0 0 0; +#X connect 8 0 0 0; +#X connect 9 0 0 0; +#X restore 17 156 pd init; +#X obj 18 321 s \$0-out; +#X obj 18 272 r \$0-in; +#X obj 393 317 s \$0-in; +#N canvas 565 515 355 193 compute 0; +#X obj 27 29 inlet; +#X obj 27 127 s \$0-in; +#X msg 27 96 bang \, get massesPos \, get linksPos; +#X obj 27 66 gemhead; +#X obj 160 36 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X connect 0 0 3 0; +#X connect 2 0 1 0; +#X connect 3 0 2 0; +#X connect 4 0 2 0; +#X restore 17 209 pd compute; +#X obj 17 181 tgl 20 0 empty empty ON/OFF 25 10 1 10 -262144 -1 -1 +1 1; +#X obj 172 270 r \$0-out; +#X obj 17 126 bng 20 250 50 0 empty empty Reset 25 10 1 10 -262144 +-1 -1; +#X text 101 388 Bang - A bang at the left inlet compute the new model +state based on previous instant.; +#X text 158 478 To set the model parameters after creation.; +#X text 158 456 To create the model masses and links.; +#X text 158 501 To get the model parameters; +#N canvas 8 28 967 626 creation________ 0; +#X obj 5 75 cnv 15 450 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 5 3 cnv 15 450 15 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 7 2 CREATION Messages; +#X obj 4 137 cnv 15 450 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 3 351 cnv 15 450 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X msg 32 104 reset; +#X text 202 167 Add a mass; +#X text 57 191 \$1 : Id (symbol); +#X text 57 211 \$2 : fixed or mobile (0/1); +#X text 57 229 \$3 : mass; +#X msg 32 286 deleteMass \$1; +#X text 194 288 Delete a mass and associated links; +#X text 54 309 \$1 : Creation No of mass; +#X text 7 137 Masses :; +#X text 7 74 Reset :; +#X text 129 105 Delete all masses \, links and internal variables; +#X text 6 351 Links :; +#X text 49 406 \$1 : Id (symbol); +#X text 49 459 \$4 : rigidity; +#X msg 30 555 deleteLink \$1; +#X text 166 557 Delete a link; +#X text 47 578 \$1 : Creation No of link; +#X text 49 406 \$1 : Id (symbol); +#X text 49 459 \$4 : rigidity; +#X text 49 424 \$2 : creation No/Id of mass1; +#X text 49 442 \$3 : creation No/Id of mass2; +#X text 266 384 Add link(s); +#X text 49 477 \$5 : damping; +#X text 10 28 Creation messages are used to define the structure of +the model. Messages create links and masses or destroy them.; +#X msg 30 384 link \$1 \$2 \$3 \$4 \$5 ($6 \$7 \$8); +#X msg 32 167 mass \$1 \$2 \$3 \$4 \$5; +#X text 57 247 \$4 \, \$5 : initial position; +#X text 46 495 ($6) : Power of the rigidity distance; +#X text 46 514 ($7) : minimum lenght of link; +#X text 46 531 ($8) : maximum lenght of link; +#X obj 471 75 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 501 75 cnv 15 450 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 471 578 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X text 527 180 \$1 : Id (symbol); +#X text 527 233 \$4 : rigidity; +#X text 527 180 \$1 : Id (symbol); +#X text 527 233 \$4 : rigidity; +#X text 527 198 \$2 : creation No/Id of mass1; +#X text 527 216 \$3 : creation No/Id of mass2; +#X text 527 251 \$5 : damping; +#X text 790 152 Add tangential link(s); +#X text 526 270 \$6 \, \$7 : tangential vector; +#X text 524 289 ($8) : Power of the rigidity distance; +#X text 524 308 ($9) : minimum lenght of link; +#X text 524 325 ($10) : maximum lenght of link; +#X text 528 382 \$1 : Id (symbol); +#X text 528 435 \$4 : rigidity; +#X text 528 382 \$1 : Id (symbol); +#X text 528 435 \$4 : rigidity; +#X text 528 400 \$2 : creation No/Id of mass1; +#X text 528 418 \$3 : creation No/Id of mass2; +#X text 528 453 \$5 : damping; +#X text 525 491 ($8) : Power of the rigidity distance; +#X text 525 510 ($9) : minimum lenght of link; +#X text 525 527 ($10) : maximum lenght of link; +#X msg 508 153 tLink \$1 \$2 \$3 \$4 \$5 \$6 \$7 ($8 \$9 \$10); +#X msg 511 358 nLink \$1 \$2 \$3 \$4 \$5 \$6 \$7 ($8 \$9 \$10); +#X text 527 472 \$6 \, \$7 : normal vector; +#X text 504 75 Oriented links :; +#X text 793 357 Add normal link(s); +#X text 506 102 In 2D (and 3D) there are two specials links : oriented +links. They works as general links excepts their calculation is made +following a vector.; +#X connect 35 0 37 0; +#X restore 12 457 pd creation________; +#X text 103 542 None; +#X text 18 583 - Left:; +#X text 101 584 Outputs the model parameters asked with the attributes +messages.; +#X obj 13 629 cnv 15 75 15 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 17 628 - Right:; +#X text 100 629 Outputs information on model when creation messages +are send or with the special message [infosL( which dump the complete +state of the model.; +#X text 101 420 Messages - Different messages are used to control the +msd object. They are of three types :; +#X text 9 751 CATEGORY: control; +#N canvas 354 125 558 582 dynamic 0; +#X obj 5 3 cnv 15 550 15 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 10 85 cnv 15 150 270 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 4 62 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 10 402 cnv 15 130 180 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 3 378 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X text 7 62 Masses :; +#X text 6 378 Links :; +#X text 7 2 DYNAMIC SETTINGS Messages; +#X msg 31 96 posX \$1 \$2; +#X text 190 144 Add force on mass(es); +#X msg 30 143 forceX \$1 \$2; +#X text 192 216 \$1 : Value; +#X text 193 107 \$1 : Id (symbol) or No; +#X text 193 161 \$1 : Id (symbol) or No; +#X msg 30 195 Xmin \$1; +#X msg 89 195 Xmax \$1; +#X msg 29 244 setMobile \$1; +#X msg 29 265 setFixed \$1; +#X text 193 89 Set position of fixed mass(es); +#X text 193 125 \$2 : Value; +#X text 193 179 \$2 : Value; +#X text 189 200 Set minimimum and maximum position of all masses; +#X text 188 244 Set mass to mobile or fixed; +#X msg 29 466 setD \$1 \$2; +#X text 184 452 \$2 : New value; +#X msg 29 415 setK \$1 \$2; +#X text 184 508 \$2 : New value; +#X text 184 561 \$2 : New value; +#X text 178 416 Set rigidity of link(s); +#X text 178 472 Set damping of link(s); +#X msg 29 521 setL \$1 \$2; +#X text 178 525 Set initial lenght of link(s); +#X text 184 434 \$1 : Id (symbol) or No; +#X text 184 490 \$1 : Id (symbol) or No; +#X text 184 543 \$1 : Id (symbol) or No; +#X text 191 261 \$1 : Id (symbol) or No; +#X text 10 25 Dynamic settings messages allows the user to redefine +internal parameters of links and masses.; +#X msg 29 301 grabMass \$1 \$2 \$3; +#X text 186 301 Grab nearest mass; +#X text 191 317 \$1 \, \$2 : position; +#X text 190 334 \$3 : grab or not (0/1); +#X msg 31 117 posY \$1 \$2; +#X msg 30 164 forceY \$1 \$2; +#X msg 30 217 Ymin \$1; +#X msg 89 217 Ymax \$1; +#X restore 12 478 pd dynamic settings; +#N canvas 382 95 601 642 attributes______ 0; +#X obj 11 95 cnv 15 100 35 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 5 75 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 5 3 cnv 15 590 15 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 10 158 cnv 15 150 110 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 4 137 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 9 305 cnv 15 110 330 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 3 281 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X text 7 74 General :; +#X text 7 2 ATTRIBUTES Messages; +#X text 7 137 Lists :; +#X msg 33 104 infosL; +#X text 136 104 Get infos on all masses and links on right outlet; +#X msg 32 170 massesPosL; +#X msg 32 239 massesForcesL; +#X text 170 170 Output all masses positions in a list on outlet No +1; +#X text 139 346 \$1 : Attribute type ( massesPos / massesSpeeds / massesForces / linksPos ); -#X text 237 742 \$2 : Id (symbol or creations numbers); -#X msg 74 533 deleteLink \$1; -#X text 239 535 Delete a link; -#X text 340 535 \$1 : Creation No of link; -#X msg 73 762 infosL; -#X text 236 762 Get infos on all masses and links on outlet No 2; -#X text 402 247 \$1 : Id (symbol); -#X text 314 247 Add a link; -#X text 401 267 \$2 : creation No of mass1; -#X text 401 285 \$3 : creation No of mass2; -#X text 400 303 \$4 : rigidity; -#X text 400 321 \$5 : viscosity; -#X text 400 338 \$6 : damping; -#X text 463 392 \$1 : Id (symbol); -#X text 462 448 \$4 : rigidity; -#X text 462 466 \$5 : viscosity; -#X text 462 483 \$6 : damping; -#X text 463 392 \$1 : Id (symbol); -#X text 462 448 \$4 : rigidity; -#X text 462 466 \$5 : viscosity; -#X text 462 483 \$6 : damping; -#X text 301 393 Add an interactor link; -#X text 94 52 LINKS :; -#X text 71 91 parameters : length \, rigidity \, viscosity and damping. -; -#X text 72 78 Links connect masses two by two. They got 4 physicals -; -#X text 70 134 the two masses at the creation.; -#X text 71 120 message. The lenght is initialised to the distance between -; -#X text 71 107 Rigidity \, viscosity and damping are defined by the -creation; -#X text 70 148 Interactor links are links between mutiples masses \, -instead; -#X text 70 161 of creation number \, the masses linked are defined -with; -#X text 69 175 their Id.; -#X text 397 356 ($7) : minimum lenght of link; -#X text 397 373 ($8) : maximum lenght of link; -#X msg 78 247 link \$1 \$2 \$3 \$4 \$5 \$6 ($7 \$8); -#X text 462 412 \$2 : Id (symbol) of masses 1; -#X text 462 430 \$3 : Id (symbol) of masses 2; -#X msg 73 393 iLink \$1 \$2 \$3 \$4 \$5 \$6 ($7 \$8); -#X text 458 500 ($7) : minimum lenght of links; -#X text 458 517 ($8) : maximum lenght of links; +#X text 139 321 Get specific attribute on specific element; +#X msg 19 319 get \$1 ($2); +#X text 6 281 Specific :; +#X text 139 416 The get message return the asked attribute preceded +by an identifier and the creation No of the element. The identifier +is made of the asked parameter and the way you asked for it.; +#X text 140 492 message; +#X text 380 492 response; +#X text 139 473 Examples with 3 masses numbered 0 \, 1 and 2 and named +mas:; +#X text 145 582 [get massesPos mas( -----> [massesPosId 0 x0(; +#X text 334 597 [massesPosId 2 x2(; +#X text 334 612 [massesPosId 1 x1(; +#X text 173 511 [get massesPos( -----> [massesPos 0 x0(; +#X text 334 525 [massesPos 2 x2(; +#X text 334 539 [massesPos 1 x1(; +#X text 159 561 [get massesPos 1( -----> [massesPosNo 1 x1(; +#X text 15 30 The attributes messages ask the object to output some +of his internal parameters. They can be output by lists for positions +and forces of masses.; +#X text 169 240 Output all forces applied on masses in a list on outlet +No 1; +#X text 139 383 ($2) : - If not defined all the attributes are send +for all the elements. - Ids or/and creations No; +#X msg 32 192 massesPosXL; +#X text 170 202 Output all masses x or y in a list on outlet No 1; +#X msg 32 213 massesPosYL; +#X restore 12 499 pd attributes______; +#X text 9 761 KEYWORDS: physical model mass spring damper link; +#X text 267 786 - Nicolas Montgermont \, May 12 \, 2005; +#X text 12 8 HELP: msd2D; +#X text 12 18 DESCRIPTION: Mass spring damper physical modeling in +2D.; +#X obj 157 48 msd2D; +#X text 257 730 editor/msd2d-editor.pd; +#X text 112 730 01_msd2Dtest.pd; +#X obj 18 296 msd2D; +#X obj 172 294 route massesPos linksPos; +#N canvas 731 296 450 300 gemmouse 0; +#X obj 189 77 gemmouse; +#X obj 189 184 pack f f; +#X obj 189 218 spigot; +#X obj 109 243 outlet; +#X obj 109 36 inlet; +#X obj 109 98 t b; +#X obj 238 131 + 4; +#X obj 109 125 l 0 0; +#X msg 57 182 posX fix \$1; +#X msg 57 203 posY fix \$2; +#X obj 189 108 / 62.5; +#X obj 237 107 / -62.5; +#X obj 189 131 - 4; +#X connect 0 0 10 0; +#X connect 0 1 11 0; +#X connect 0 2 2 1; +#X connect 1 0 2 0; +#X connect 2 0 7 1; +#X connect 4 0 5 0; +#X connect 5 0 7 0; +#X connect 6 0 1 1; +#X connect 7 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 3 0; +#X connect 9 0 3 0; +#X connect 10 0 12 0; +#X connect 11 0 6 0; +#X connect 12 0 1 0; +#X restore 393 295 pd gemmouse; +#X obj 393 274 gemhead; +#X obj 336 216 gemwin; +#X msg 336 194 0 \, destroy; +#N canvas 472 258 550 319 gemrender 0; +#X obj 48 203 translateXYZ; +#X obj 48 229 sphere 0.1; +#X obj 48 177 separator; +#X obj 48 153 any; +#X obj 64 114 gemhead 45; +#X obj 127 24 inlet; +#X obj 271 51 inlet; +#X obj 192 206 separator; +#X obj 192 182 any; +#X obj 192 251 curve 2; +#X obj 208 143 gemhead 45; +#X msg 348 100 \$4 \$5 0; +#X msg 276 96 \$2 \$3 0; +#X obj 250 170 t b a; +#X obj 127 62 unpack f f f; +#X obj 125 136 t b f; +#X connect 0 0 1 0; #X connect 2 0 0 0; -#X connect 15 0 0 0; -#X connect 19 0 0 0; -#X connect 23 0 0 0; -#X connect 26 0 0 0; -#X connect 55 0 0 0; -#X connect 58 0 0 0; -#X restore 224 340 pd links; +#X connect 3 0 2 0; +#X connect 4 0 3 1; +#X connect 5 0 14 0; +#X connect 6 0 11 0; +#X connect 6 0 12 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 10 0 8 1; +#X connect 11 0 9 2; +#X connect 12 0 13 0; +#X connect 13 0 8 0; +#X connect 13 1 9 1; +#X connect 14 1 15 0; +#X connect 14 2 0 2; +#X connect 15 0 3 0; +#X connect 15 1 0 1; +#X restore 172 320 pd gemrender; +#X msg 336 129 reset \, create \, 1; +#X text 135 98 Sorry \, you need GEM for this example...; +#X text 169 132 1 Create window -->; +#X text 169 163 2 Drag the structure with the mouse; +#X text 169 195 3 Destroy the window -->; +#X connect 21 0 49 0; +#X connect 24 0 23 0; +#X connect 25 0 50 0; +#X connect 26 0 19 0; +#X connect 49 0 20 0; +#X connect 50 0 55 0; +#X connect 50 1 55 1; +#X connect 51 0 22 0; +#X connect 52 0 51 0; +#X connect 54 0 53 0; +#X connect 56 0 53 0; diff --git a/msd3D/01_msd3Dtest.pd b/msd3D/01_msd3Dtest.pd index 7213efb..5f286bf 100644 --- a/msd3D/01_msd3Dtest.pd +++ b/msd3D/01_msd3Dtest.pd @@ -15,7 +15,6 @@ #X text 153 19 reset; #X obj 115 40 t b b b b b; #X msg 133 158 50 50; -#X msg 115 233 link souple \$1 \$2 \$3 \$4 \$5; #X obj 30 290 cnv 15 572 80 empty empty empty 20 12 0 14 -261689 -66577 0; #X obj 33 298 gemhead; @@ -33,7 +32,7 @@ #X text 347 440 ADD FORCE ON ALL MOBILE MASSES; #X obj 27 545 cnv 15 400 200 empty empty empty 20 12 0 14 -261689 -66577 0; -#N canvas 643 123 605 590 massrender 1; +#N canvas 643 123 605 590 massrender 0; #X obj 127 22 inlet; #X obj 48 203 translateXYZ; #X obj 48 229 sphere 0.1; @@ -41,29 +40,29 @@ #X obj 127 109 - 4; #X obj 192 87 / 12.5; #X obj 192 110 - 4; -#X obj 64 114 gemhead; #X obj 48 177 separator; #X obj 48 153 any; #X obj 125 136 t b f; #X obj 244 87 / 12.5; #X obj 244 110 - 4; #X obj 127 57 unpack f f f f; -#X connect 0 0 13 0; +#X obj 64 114 gemhead 45; +#X connect 0 0 12 0; #X connect 1 0 2 0; #X connect 3 0 4 0; -#X connect 4 0 10 0; +#X connect 4 0 9 0; #X connect 5 0 6 0; #X connect 6 0 1 2; -#X connect 7 0 9 1; -#X connect 8 0 1 0; +#X connect 7 0 1 0; +#X connect 8 0 7 0; #X connect 9 0 8 0; -#X connect 10 0 9 0; -#X connect 10 1 1 1; -#X connect 11 0 12 0; -#X connect 12 0 1 3; -#X connect 13 1 3 0; -#X connect 13 2 5 0; -#X connect 13 3 11 0; +#X connect 9 1 1 1; +#X connect 10 0 11 0; +#X connect 11 0 1 3; +#X connect 12 1 3 0; +#X connect 12 2 5 0; +#X connect 12 3 10 0; +#X connect 13 0 8 1; #X restore 114 589 pd massrender; #N canvas 284 227 587 558 linkrender 0; #X obj 93 25 inlet; @@ -71,7 +70,6 @@ #X obj 93 140 - 4; #X obj 147 118 / 12.5; #X obj 147 141 - 4; -#X obj 35 134 gemhead; #X obj 44 222 separator; #X obj 44 192 any; #X obj 93 164 t b f; @@ -89,34 +87,35 @@ #X obj 266 189 pack f f f; #X msg 266 212 \$1 \$2 \$3; #X obj 93 69 unpack f f f f f f f; -#X connect 0 0 22 0; +#X obj 35 133 gemhead 45; +#X connect 0 0 21 0; #X connect 1 0 2 0; -#X connect 2 0 8 0; +#X connect 2 0 7 0; #X connect 3 0 4 0; -#X connect 4 0 16 1; -#X connect 5 0 7 1; -#X connect 6 0 9 0; +#X connect 4 0 15 1; +#X connect 5 0 8 0; +#X connect 6 0 5 0; #X connect 7 0 6 0; -#X connect 8 0 7 0; -#X connect 8 1 16 0; -#X connect 10 0 11 0; -#X connect 11 0 20 0; -#X connect 12 0 13 0; -#X connect 13 0 20 1; -#X connect 14 0 15 0; -#X connect 15 0 16 2; -#X connect 16 0 17 0; -#X connect 17 0 9 1; -#X connect 18 0 19 0; -#X connect 19 0 20 2; -#X connect 20 0 21 0; -#X connect 21 0 9 2; -#X connect 22 1 1 0; -#X connect 22 2 3 0; -#X connect 22 3 14 0; -#X connect 22 4 10 0; -#X connect 22 5 12 0; -#X connect 22 6 18 0; +#X connect 7 1 15 0; +#X connect 9 0 10 0; +#X connect 10 0 19 0; +#X connect 11 0 12 0; +#X connect 12 0 19 1; +#X connect 13 0 14 0; +#X connect 14 0 15 2; +#X connect 15 0 16 0; +#X connect 16 0 8 1; +#X connect 17 0 18 0; +#X connect 18 0 19 2; +#X connect 19 0 20 0; +#X connect 20 0 8 2; +#X connect 21 1 1 0; +#X connect 21 2 3 0; +#X connect 21 3 13 0; +#X connect 21 4 9 0; +#X connect 21 5 11 0; +#X connect 21 6 17 0; +#X connect 22 0 6 1; #X restore 33 610 pd linkrender; #X obj 33 560 route linksPos massesPos; #X text 241 570 DISPLAY MASSES AND LINKS; @@ -124,7 +123,6 @@ #X text 445 561 1 CREATE WINDOW -->; #X text 444 624 3 AND DESTROY IT! -->; #X text 444 592 2 DRAG THE STRUCTURE WITH THE MOUSE; -#X msg 115 211 0 1 5 0.5 0.5 \, 1 2 1 0.5 0; #N canvas 731 296 450 300 gemmouse 0; #X obj 189 77 gemmouse; #X obj 189 184 pack f f; @@ -159,47 +157,49 @@ #X obj 33 497 msd3D --------------------------------; #X msg 62 440 forceZ mob 200; #X msg 188 441 forceZ mob -200; -#X msg 151 114 100 20 10 0 \, 200 20 25 0; #X msg 151 138 mass mob 1 \$1 \$2 \$3 \$4; #X msg 133 179 Xmax 100 \, Xmin 0 \, Ymax 100 \, Ymin 0 \, Zmax 70 \, Zmin 0; #X msg 169 89 mass fix 0 100 50 50 50; +#X msg 115 232 link souple \$1 \$2 5 10; +#X msg 115 211 0 1 \, 1 2; +#X msg 151 114 100 20 10 20 \, 200 20 25 0; #X connect 0 0 12 0; #X connect 3 0 2 0; #X connect 4 0 5 0; #X connect 6 0 2 0; -#X connect 8 0 43 0; +#X connect 8 0 41 0; #X connect 9 0 12 0; #X connect 10 0 8 0; -#X connect 12 0 37 0; +#X connect 12 0 48 0; #X connect 12 1 13 0; -#X connect 12 1 48 0; -#X connect 12 2 46 0; -#X connect 12 3 49 0; +#X connect 12 1 45 0; +#X connect 12 2 49 0; +#X connect 12 3 46 0; #X connect 12 4 10 0; -#X connect 13 0 38 1; -#X connect 14 0 8 0; +#X connect 13 0 36 1; +#X connect 15 0 16 0; #X connect 16 0 17 0; -#X connect 17 0 18 0; -#X connect 18 0 43 0; -#X connect 22 0 43 0; -#X connect 23 0 43 0; -#X connect 24 0 43 0; -#X connect 25 0 43 0; -#X connect 31 0 30 0; -#X connect 31 1 29 0; -#X connect 31 2 1 0; -#X connect 37 0 14 0; -#X connect 38 0 40 0; +#X connect 17 0 41 0; +#X connect 21 0 41 0; +#X connect 22 0 41 0; +#X connect 23 0 41 0; +#X connect 24 0 41 0; +#X connect 30 0 29 0; +#X connect 30 1 28 0; +#X connect 30 2 1 0; +#X connect 36 0 38 0; +#X connect 36 0 39 0; +#X connect 37 0 36 0; #X connect 38 0 41 0; -#X connect 39 0 38 0; -#X connect 40 0 43 0; -#X connect 41 0 43 0; -#X connect 43 0 31 0; -#X connect 43 1 1 0; -#X connect 44 0 43 0; -#X connect 45 0 43 0; -#X connect 46 0 47 0; +#X connect 39 0 41 0; +#X connect 41 0 30 0; +#X connect 41 1 1 0; +#X connect 42 0 41 0; +#X connect 43 0 41 0; +#X connect 44 0 8 0; +#X connect 45 0 8 0; +#X connect 46 0 8 0; #X connect 47 0 8 0; -#X connect 48 0 8 0; -#X connect 49 0 8 0; +#X connect 48 0 47 0; +#X connect 49 0 44 0; diff --git a/msd3D/02_msd3Dperf.pd b/msd3D/02_msd3Dperf.pd index b3b2b63..ba0f30c 100644 --- a/msd3D/02_msd3Dperf.pd +++ b/msd3D/02_msd3Dperf.pd @@ -1,167 +1,195 @@ #N canvas 545 25 696 822 10; -#X obj 177 369 t a; +#X obj 159 280 t a; #X obj 159 5 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; -#X msg 231 146 reset; +#X msg 231 60 reset; #X obj 37 10 loadbang; -#X text 197 96 reset; +#X text 182 5 reset; #X obj 159 27 t b b b b b; #X msg 456 528 0 \, destroy; #X obj 456 583 gemhead; -#X obj 460 670 world_light; +#X obj 456 628 world_light; #X msg 456 468 reset \, create \, lighting 1 \, 1; #X obj 52 380 t b; #N canvas 643 123 605 590 massrender 0; #X obj 127 22 inlet; #X obj 48 203 translateXYZ; -#X obj 127 86 / 12.5; -#X obj 127 109 - 4; -#X obj 192 87 / 12.5; -#X obj 192 110 - 4; #X obj 64 114 gemhead; #X obj 48 177 separator; #X obj 48 153 any; #X obj 125 136 t b f; -#X obj 247 86 / 12.5; -#X obj 247 109 - 4; #X obj 127 57 unpack f f f f; #X obj 48 229 cube 0.03; -#X connect 0 0 12 0; -#X connect 1 0 13 0; -#X connect 2 0 3 0; -#X connect 3 0 9 0; -#X connect 4 0 5 0; -#X connect 5 0 1 2; -#X connect 6 0 8 1; -#X connect 7 0 1 0; -#X connect 8 0 7 0; -#X connect 9 0 8 0; -#X connect 9 1 1 1; -#X connect 10 0 11 0; -#X connect 11 0 1 3; -#X connect 12 1 2 0; -#X connect 12 2 4 0; -#X connect 12 3 10 0; +#X connect 0 0 6 0; +#X connect 1 0 7 0; +#X connect 2 0 4 1; +#X connect 3 0 1 0; +#X connect 4 0 3 0; +#X connect 5 0 4 0; +#X connect 5 1 1 1; +#X connect 6 1 5 0; +#X connect 6 2 1 2; +#X connect 6 3 1 3; #X restore 52 699 pd massrender; -#X obj 425 254 random 100; -#X obj 349 254 random 100; -#X obj 274 233 random 100; -#X msg 274 212 seed 3; -#X obj 274 254 + 100; -#X obj 586 145 t b; -#X obj 586 189 + 1; -#X obj 616 230 f; -#X obj 632 179 + 1; -#X obj 586 210 t f b; -#X msg 632 155 -1; -#X obj 586 166 f -1; -#X obj 586 255 pack f f; -#X msg 177 339 link souple \$1 \$2 100 0.5 0.5; #X obj 52 357 gemhead; #X obj 456 548 gemwin; #X obj 52 655 msd3D --------------------------------; -#X obj 376 105 t b b b b; -#X obj 505 254 random 100; -#X msg 505 233 seed 4; -#X obj 177 271 pack f f f f; -#X msg 177 316 Xmax 100 \, Xmin 0 \, Ymax 100 \, Ymin 0 \, Zmax 100 -\, Zmin 0; #X msg 456 508 view 8 0 0.5 0 0 0 0 0 1; -#X obj 376 83 repeat 300; -#X obj 586 123 repeat 300; -#X text 501 21 <-- Number of masses; +#X text 434 160 <-- Number of masses; #X obj 456 487 t b; #X obj 52 678 route massesPos; #X msg 52 414 bang \, get massesPos; #X text 300 485 <-- Move masses; -#X floatatom 495 615 5 0 0 0 - - -; -#X floatatom 536 618 5 0 0 0 - - -; -#X floatatom 589 619 5 0 0 0 - - -; -#X obj 457 640 rotateXYZ 30 30 0; -#X msg 459 20 3999; -#X msg 198 527 forceY mob 100; -#X msg 197 551 forceY mob -100; -#X msg 211 575 forceZ mob 100; -#X msg 210 599 forceZ mob -100; -#X msg 178 477 forceX mob 100; -#X msg 179 501 forceX mob -100; -#X msg 213 177 mass fix 0 100 50 50 0; -#X msg 177 293 mass mob 1 \$1 \$2 \$3 \$4; +#X obj 456 605 rotateXYZ 30 30 0; +#X msg 213 116 mass fix 0 100 50 50 0; #X obj 75 491 metro 10; #X obj 76 469 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X floatatom 107 470 5 0 0 0 - - -; #X text 74 453 instead of GEM; -#X msg 349 233 seed 20; -#X msg 425 233 seed 10; -#X connect 0 0 28 0; +#N canvas 557 309 632 363 masses 0; +#X msg 417 145 seed 1; +#X msg 342 144 seed 2; +#X msg 239 126 seed 3; +#X obj 42 14 inlet; +#X obj 212 307 outlet; +#X obj 268 47 loadbang; +#X text 284 101 M; +#X text 356 106 X; +#X text 437 106 Y; +#X obj 223 68 t b b; +#X obj 42 45 until; +#X obj 42 78 f; +#X obj 72 78 + 1; +#X obj 72 100 mod 30; +#X obj 90 45 sel 0; +#X obj 164 15 inlet; +#X obj 342 165 random 800; +#X obj 418 165 random 800; +#X obj 239 146 random 800; +#X obj 342 186 / 100; +#X obj 339 206 - 4; +#X obj 407 193 / 100; +#X obj 404 213 - 4; +#X obj 239 166 + 800; +#X obj 502 161 random 800; +#X obj 491 189 / 100; +#X obj 488 209 - 4; +#X text 505 107 Z; +#X msg 501 141 seed 10; +#X obj 211 218 pack f f f f; +#X msg 211 239 mass mob 1 \$1 \$2 \$3 \$4; +#X obj 235 186 / 4; +#X connect 0 0 17 0; +#X connect 1 0 16 0; +#X connect 2 0 18 0; +#X connect 3 0 10 0; +#X connect 5 0 2 0; +#X connect 5 0 1 0; +#X connect 5 0 0 0; +#X connect 5 0 28 0; +#X connect 9 0 18 0; +#X connect 9 1 16 0; +#X connect 9 1 17 0; +#X connect 9 1 24 0; +#X connect 10 0 11 0; +#X connect 11 0 12 0; +#X connect 11 0 9 0; +#X connect 12 0 13 0; +#X connect 13 0 11 1; +#X connect 13 0 14 0; +#X connect 14 0 10 1; +#X connect 15 0 13 1; +#X connect 16 0 19 0; +#X connect 17 0 21 0; +#X connect 18 0 23 0; +#X connect 19 0 20 0; +#X connect 20 0 29 1; +#X connect 21 0 22 0; +#X connect 22 0 29 2; +#X connect 23 0 31 0; +#X connect 24 0 25 0; +#X connect 25 0 26 0; +#X connect 26 0 29 3; +#X connect 28 0 24 0; +#X connect 29 0 30 0; +#X connect 30 0 4 0; +#X connect 31 0 29 0; +#X restore 195 146 pd masses; +#N canvas 0 0 450 300 links 0; +#X obj 136 72 t b; +#X obj 136 116 + 1; +#X obj 130 191 f; +#X obj 92 171 t f b; +#X obj 91 211 pack f f; +#X msg 91 233 link souple \$1 \$2 10 0.5; +#X obj 136 23 inlet; +#X obj 91 260 outlet; +#X obj 136 48 until; +#X obj 202 112 sel 0; +#X obj 184 154 mod 29; +#X obj 136 93 f 0; +#X obj 311 32 inlet; +#X connect 0 0 11 0; +#X connect 1 0 10 0; +#X connect 1 0 2 1; +#X connect 2 0 4 1; +#X connect 3 0 4 0; +#X connect 3 1 2 0; +#X connect 4 0 5 0; +#X connect 5 0 7 0; +#X connect 6 0 8 0; +#X connect 8 0 0 0; +#X connect 9 0 8 1; +#X connect 10 0 9 0; +#X connect 10 0 11 1; +#X connect 11 0 1 0; +#X connect 11 0 3 0; +#X connect 12 0 10 1; +#X restore 159 191 pd links; +#X obj 369 162 nbx 5 14 200 20000 1 0 empty empty empty 0 -6 0 10 -262144 +-1 -1 1755.88 1000; +#X msg 177 228 Xmax 4 \, Xmin -4 \, Ymax 4 \, Ymin -4 \, Zmax 4 \, +Zmin -4; +#X msg 178 477 forceX mob 10; +#X msg 179 501 forceX mob -10; +#X msg 198 527 forceY mob 10; +#X msg 197 551 forceY mob -10; +#X msg 211 575 forceZ mob 10; +#X msg 210 599 forceZ mob -10; +#X connect 0 0 14 0; #X connect 1 0 5 0; #X connect 2 0 0 0; #X connect 3 0 5 0; -#X connect 5 0 36 0; -#X connect 5 1 33 0; -#X connect 5 2 35 0; -#X connect 5 3 53 0; +#X connect 5 0 28 0; +#X connect 5 1 30 0; +#X connect 5 2 27 0; +#X connect 5 3 22 0; #X connect 5 4 2 0; -#X connect 5 4 22 0; -#X connect 5 4 15 0; -#X connect 5 4 60 0; -#X connect 5 4 59 0; -#X connect 5 4 31 0; -#X connect 6 0 27 0; -#X connect 7 0 45 0; -#X connect 9 0 27 0; -#X connect 9 0 38 0; -#X connect 10 0 40 0; -#X connect 12 0 32 2; -#X connect 13 0 32 1; -#X connect 14 0 16 0; -#X connect 15 0 14 0; -#X connect 16 0 32 0; -#X connect 17 0 23 0; -#X connect 18 0 20 0; -#X connect 18 0 21 0; -#X connect 18 0 23 1; -#X connect 19 0 24 1; -#X connect 20 0 19 1; -#X connect 21 0 24 0; -#X connect 21 1 19 0; -#X connect 22 0 23 1; -#X connect 23 0 18 0; -#X connect 24 0 25 0; -#X connect 25 0 0 0; -#X connect 26 0 10 0; -#X connect 28 0 39 0; -#X connect 29 0 14 0; -#X connect 29 1 13 0; -#X connect 29 1 30 0; -#X connect 29 2 12 0; -#X connect 30 0 32 3; -#X connect 31 0 30 0; -#X connect 32 0 54 0; -#X connect 33 0 0 0; -#X connect 34 0 27 0; -#X connect 35 0 29 0; -#X connect 36 0 17 0; -#X connect 38 0 34 0; -#X connect 39 0 11 0; -#X connect 40 0 28 0; -#X connect 42 0 45 1; -#X connect 43 0 45 2; -#X connect 44 0 45 3; -#X connect 45 0 8 0; -#X connect 46 0 35 1; -#X connect 46 0 36 1; -#X connect 47 0 28 0; -#X connect 48 0 28 0; -#X connect 49 0 28 0; -#X connect 50 0 28 0; -#X connect 51 0 28 0; -#X connect 52 0 28 0; -#X connect 53 0 0 0; -#X connect 54 0 0 0; -#X connect 55 0 28 0; -#X connect 56 0 55 0; -#X connect 57 0 55 1; -#X connect 59 0 13 0; -#X connect 60 0 12 0; +#X connect 6 0 13 0; +#X connect 7 0 21 0; +#X connect 9 0 13 0; +#X connect 9 0 17 0; +#X connect 10 0 19 0; +#X connect 12 0 10 0; +#X connect 14 0 18 0; +#X connect 15 0 13 0; +#X connect 17 0 15 0; +#X connect 18 0 11 0; +#X connect 19 0 14 0; +#X connect 21 0 8 0; +#X connect 22 0 0 0; +#X connect 23 0 14 0; +#X connect 24 0 23 0; +#X connect 25 0 23 1; +#X connect 27 0 0 0; +#X connect 28 0 0 0; +#X connect 29 0 27 1; +#X connect 29 0 28 1; +#X connect 30 0 0 0; +#X connect 31 0 14 0; +#X connect 32 0 14 0; +#X connect 33 0 14 0; +#X connect 34 0 14 0; +#X connect 35 0 14 0; +#X connect 36 0 14 0; diff --git a/msd3D/03_msd3Dmemb.pd b/msd3D/03_msd3Dmemb.pd index 766c86b..244ec73 100644 --- a/msd3D/03_msd3Dmemb.pd +++ b/msd3D/03_msd3Dmemb.pd @@ -80,17 +80,15 @@ \, 14 19 \, 15 20 \, 16 21 \, 2 17 \, 18 22 \, 19 23 \, 20 24 \, 21 3; #X msg 166 193 mass mob 1 100 \$1 \$2 \$3; -#X msg 188 560 forceZ mob -1; #X msg 166 130 30 40 40 \, 30 50 40 \, 30 60 40 \, 40 30 40 \, 40 40 40 \, 40 50 40 \, 40 60 40 \, 40 70 40 \, 50 30 40 \, 50 40 40 \, 50 50 40 \, 50 60 40 \, 50 70 40 \, 60 30 40 \, 60 40 40 \, 60 50 40 \, 60 60 40 \, 60 70 40 \, 70 40 40 \, 70 50 40 \, 70 60 40; -#X msg 130 335 link souple \$1 \$2 10 0.5 1; #X msg 466 688 view 0 4 0 0 0 0 0 0 1; #X msg 466 646 view 4 0 0.5 0 0 0 0 0 1; #X obj 312 479 f; #X floatatom 333 456 5 0 0 0 - - -; -#X obj 312 403 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 +#X obj 312 403 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1; #X msg 312 504 forceZ mob \$1; #X obj 312 423 metro 65; @@ -102,7 +100,7 @@ mass fix 0 100 70 30 40 \, mass fix 0 100 70 70 40; #X msg 527 543 posZ fix \$1; #X obj 527 402 vsl 15 128 0 70 0 0 empty empty empty 0 -8 0 8 -262131 --1 -1 0 1; +-1 -1 7900 1; #X text 559 457 Change altitude of corners; #X obj 33 427 t b b b; #X text 385 455 Amplitude; @@ -110,46 +108,48 @@ mass fix 0 100 70 30 40 \, mass fix 0 100 70 70 40; #X text 374 668 Change view; #X obj 130 38 t b b b b b; #X text 98 428 Multiple draw; -#X connect 0 0 44 0; +#X msg 188 560 forceZ mob -0.1; +#X msg 130 335 link souple \$1 \$2 10 20; +#X connect 0 0 42 0; #X connect 3 0 2 0; #X connect 4 0 5 0; #X connect 6 0 2 0; #X connect 7 0 17 0; -#X connect 8 0 44 0; +#X connect 8 0 42 0; #X connect 9 0 7 0; -#X connect 11 0 40 0; +#X connect 11 0 38 0; #X connect 12 0 17 0; #X connect 13 0 17 0; #X connect 14 0 17 0; #X connect 15 0 17 0; -#X connect 17 0 35 0; +#X connect 17 0 33 0; #X connect 17 1 1 0; #X connect 18 0 17 0; #X connect 19 0 7 0; -#X connect 20 0 24 0; +#X connect 20 0 45 0; #X connect 21 0 7 0; -#X connect 22 0 17 0; -#X connect 23 0 21 0; -#X connect 24 0 7 0; -#X connect 25 0 2 0; -#X connect 26 0 2 0; -#X connect 27 0 30 0; -#X connect 28 0 27 1; -#X connect 29 0 31 0; -#X connect 30 0 17 0; -#X connect 31 0 27 0; -#X connect 32 0 2 0; -#X connect 34 0 17 0; -#X connect 34 0 22 0; -#X connect 35 0 16 0; -#X connect 36 0 7 0; -#X connect 37 0 17 0; -#X connect 38 0 37 0; -#X connect 40 0 34 0; -#X connect 40 1 34 0; -#X connect 40 2 34 0; -#X connect 44 0 20 0; -#X connect 44 1 19 0; -#X connect 44 2 23 0; -#X connect 44 3 36 0; -#X connect 44 4 9 0; +#X connect 22 0 21 0; +#X connect 23 0 2 0; +#X connect 24 0 2 0; +#X connect 25 0 28 0; +#X connect 26 0 25 1; +#X connect 27 0 29 0; +#X connect 28 0 17 0; +#X connect 29 0 25 0; +#X connect 30 0 2 0; +#X connect 32 0 17 0; +#X connect 32 0 44 0; +#X connect 33 0 16 0; +#X connect 34 0 7 0; +#X connect 35 0 17 0; +#X connect 36 0 35 0; +#X connect 38 0 32 0; +#X connect 38 1 32 0; +#X connect 38 2 32 0; +#X connect 42 0 20 0; +#X connect 42 1 19 0; +#X connect 42 2 22 0; +#X connect 42 3 34 0; +#X connect 42 4 9 0; +#X connect 44 0 17 0; +#X connect 45 0 7 0; diff --git a/msd3D/04_msd3Dfilet.pd b/msd3D/04_msd3Dfilet.pd index a233122..aa69497 100644 --- a/msd3D/04_msd3Dfilet.pd +++ b/msd3D/04_msd3Dfilet.pd @@ -13,7 +13,7 @@ #X obj 33 298 gemhead; #X obj 33 321 t b; #X msg 33 343 bang \, get massesPos \, get linksPos; -#N canvas 643 123 605 590 massrender 1; +#N canvas 643 123 605 590 massrender 0; #X obj 127 22 inlet; #X obj 48 203 translateXYZ; #X obj 48 229 sphere 0.1; @@ -99,7 +99,6 @@ #X connect 22 6 17 0; #X restore 33 610 pd linkrender; #X obj 33 539 route linksPos massesPos; -#X msg 458 392 view 0 4 0 0 0 0 0 0 1; #X msg 203 83 symbol reset; #X obj 33 497 msd3D --------------------------------; #X msg 107 430 forceZ filet -0.2; @@ -116,29 +115,30 @@ computer!; #X text 383 114 Filet abstraction : x0 y0 stepx stepy ny nx; #X msg 458 371 view 0 0 2 0 0 0 0 1 0; -#X connect 0 0 26 0; +#X msg 458 392 view 0 4 4 0 0 0 0 0 1; +#X connect 0 0 25 0; #X connect 2 0 1 0; #X connect 3 0 4 0; #X connect 5 0 1 0; -#X connect 6 0 18 0; -#X connect 7 0 26 0; +#X connect 6 0 17 0; +#X connect 7 0 25 0; #X connect 8 0 6 0; #X connect 10 0 11 0; #X connect 11 0 12 0; -#X connect 12 0 19 0; #X connect 12 0 18 0; +#X connect 12 0 17 0; #X connect 15 1 13 0; -#X connect 16 0 1 0; -#X connect 17 0 22 1; -#X connect 18 0 15 0; -#X connect 19 0 18 0; +#X connect 16 0 21 1; +#X connect 17 0 15 0; +#X connect 18 0 17 0; +#X connect 19 0 6 0; #X connect 20 0 6 0; #X connect 21 0 6 0; -#X connect 22 0 6 0; -#X connect 23 0 1 0; -#X connect 26 0 20 0; -#X connect 26 1 21 0; -#X connect 26 2 22 0; -#X connect 26 3 8 0; -#X connect 26 3 17 0; +#X connect 22 0 1 0; +#X connect 25 0 19 0; +#X connect 25 1 20 0; +#X connect 25 2 21 0; +#X connect 25 3 8 0; +#X connect 25 3 16 0; +#X connect 28 0 1 0; #X connect 29 0 1 0; diff --git a/msd3D/05_msd3Dvline.pd b/msd3D/05_msd3Dvline.pd index 5387bee..f42ff81 100644 --- a/msd3D/05_msd3Dvline.pd +++ b/msd3D/05_msd3Dvline.pd @@ -17,11 +17,10 @@ 1; #X obj 444 258 f; #X obj 444 234 metro 65; -#X msg 326 468 setD fil 1; #X msg 457 327 reset \, dimen 800 800 \, create \, lighting 1 \, 1 ; #X obj 421 221 vsl 15 128 -1 1 0 0 empty empty empty 0 -8 0 8 -262131 --1 -1 11600 1; +-1 -1 12700 1; #X obj 206 315 sin; #X obj 206 335 *; #X obj 206 255 counter 0 360; @@ -34,21 +33,18 @@ #X obj 154 13 inlet; #X obj 152 238 outlet; #X obj 154 45 t b b; -#X obj 264 43 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; #X obj 156 162 f 0; #X obj 156 186 + 1; #X msg 242 154 0; #X obj 154 129 repeat 450; #X connect 0 0 2 0; -#X connect 2 0 7 0; -#X connect 2 1 6 0; -#X connect 3 0 2 0; -#X connect 4 0 5 0; -#X connect 4 0 1 0; -#X connect 5 0 4 1; -#X connect 6 0 4 1; -#X connect 7 0 4 0; +#X connect 2 0 6 0; +#X connect 2 1 5 0; +#X connect 3 0 4 0; +#X connect 3 0 1 0; +#X connect 4 0 3 1; +#X connect 5 0 3 1; +#X connect 6 0 3 0; #X restore 51 364 pd getmmasses; #N canvas 224 164 901 724 synthese 0; #X obj 284 40 inlet; @@ -195,10 +191,9 @@ #X connect 38 0 5 0; #X restore 33 600 pd synthese; #X obj 183 219 vsl 15 128 0 30 0 0 empty empty empty 0 -8 0 8 -262131 --1 -1 11800 1; +-1 -1 7000 1; #N canvas 259 464 938 386 massrender 0; #X obj 286 2 inlet; -#X obj 60 102 gemhead; #X obj 44 193 any; #X obj 306 144 pack f f f f; #X obj 306 99 % 30; @@ -213,54 +208,55 @@ #X obj 432 177 moses 210; #X text 669 215 Get middle masses; #X obj 555 295 outlet; -#X connect 0 0 7 0; -#X connect 1 0 2 1; -#X connect 2 0 6 0; -#X connect 3 0 5 0; -#X connect 4 0 3 0; -#X connect 4 0 8 0; -#X connect 5 0 6 1; -#X connect 5 1 6 2; -#X connect 5 2 6 3; -#X connect 5 3 6 4; -#X connect 5 4 6 5; -#X connect 5 5 6 6; -#X connect 5 6 6 7; -#X connect 5 7 6 8; -#X connect 5 8 6 9; -#X connect 5 9 6 10; -#X connect 5 10 6 11; -#X connect 5 11 6 12; -#X connect 5 12 6 13; -#X connect 5 13 6 14; -#X connect 5 14 6 15; -#X connect 5 15 6 16; -#X connect 5 16 6 17; -#X connect 5 17 6 18; -#X connect 5 18 6 19; -#X connect 5 19 6 20; -#X connect 5 20 6 21; -#X connect 5 21 6 22; -#X connect 5 22 6 23; -#X connect 5 23 6 24; -#X connect 5 24 6 25; -#X connect 5 25 6 26; -#X connect 5 26 6 27; -#X connect 5 27 6 28; -#X connect 5 28 6 29; -#X connect 5 29 6 30; -#X connect 7 0 4 0; -#X connect 7 0 10 0; -#X connect 7 1 3 1; -#X connect 7 1 9 1; -#X connect 7 2 3 2; -#X connect 7 2 9 2; -#X connect 7 3 3 3; -#X connect 7 3 9 3; -#X connect 8 0 2 0; -#X connect 9 0 13 0; -#X connect 10 0 11 0; -#X connect 11 1 9 0; +#X obj 60 102 gemhead 45; +#X connect 0 0 6 0; +#X connect 1 0 5 0; +#X connect 2 0 4 0; +#X connect 3 0 2 0; +#X connect 3 0 7 0; +#X connect 4 0 5 1; +#X connect 4 1 5 2; +#X connect 4 2 5 3; +#X connect 4 3 5 4; +#X connect 4 4 5 5; +#X connect 4 5 5 6; +#X connect 4 6 5 7; +#X connect 4 7 5 8; +#X connect 4 8 5 9; +#X connect 4 9 5 10; +#X connect 4 10 5 11; +#X connect 4 11 5 12; +#X connect 4 12 5 13; +#X connect 4 13 5 14; +#X connect 4 14 5 15; +#X connect 4 15 5 16; +#X connect 4 16 5 17; +#X connect 4 17 5 18; +#X connect 4 18 5 19; +#X connect 4 19 5 20; +#X connect 4 20 5 21; +#X connect 4 21 5 22; +#X connect 4 22 5 23; +#X connect 4 23 5 24; +#X connect 4 24 5 25; +#X connect 4 25 5 26; +#X connect 4 26 5 27; +#X connect 4 27 5 28; +#X connect 4 28 5 29; +#X connect 4 29 5 30; +#X connect 6 0 3 0; +#X connect 6 0 9 0; +#X connect 6 1 2 1; +#X connect 6 1 8 1; +#X connect 6 2 2 2; +#X connect 6 2 8 2; +#X connect 6 3 2 3; +#X connect 6 3 8 3; +#X connect 7 0 1 0; +#X connect 8 0 12 0; +#X connect 9 0 10 0; +#X connect 10 1 8 0; +#X connect 13 0 1 1; #X restore 33 565 pd massrender; #X msg 165 139 setFixed 0 \, setFixed 29 \, setFixed 420 \, setFixed 449; @@ -271,9 +267,8 @@ #X text 179 18 Reset; #X obj 184 115 filet -3.2 -3.2 0.22068 0.45714 15 30; #X msg 327 449 setK fil 20; -#X obj 146 92 s resban; +#X obj 104 93 s resban; #X msg 425 449 setK fil 10; -#X msg 425 468 setD fil 2.5; #X text 528 458 Change physical parameters of links; #X msg 457 388 view 0 0 5 0 0 0 1 0 0; #X text 624 390 <-- Zoom in; @@ -281,61 +276,57 @@ #X msg 146 173 Xmax 4 \, Xmin -4 \, Ymax 4 \, Ymin -4 \, Zmax 9 \, Zmin -6; #X msg 457 369 view 0 0 11 0 0 0 1 0 0; -#X obj 33 539 route massesPosNo massesPos; #X obj 33 257 t b b; -#X obj 37 219 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; #X msg 29 323 bang; #X text 154 365 Get masses in order; -#X obj 326 541 print; +#X obj 33 539 route massesPosNo; +#X msg 425 468 setD fil 25; +#X msg 326 468 setD fil 2; #X connect 0 0 11 0; #X connect 2 0 1 0; #X connect 3 0 4 0; #X connect 5 0 10 0; #X connect 6 0 11 0; #X connect 7 0 5 0; -#X connect 8 0 48 0; -#X connect 9 0 36 1; -#X connect 10 0 47 0; -#X connect 10 1 52 0; -#X connect 11 0 45 0; -#X connect 11 0 38 0; -#X connect 11 1 30 0; -#X connect 11 2 36 0; +#X connect 8 0 45 0; +#X connect 9 0 35 1; +#X connect 10 0 48 0; +#X connect 11 0 43 0; +#X connect 11 1 29 0; +#X connect 11 2 35 0; #X connect 11 3 7 0; #X connect 11 3 9 0; #X connect 12 0 10 0; #X connect 13 0 15 0; #X connect 14 0 12 0; #X connect 15 0 14 0; -#X connect 16 0 10 0; -#X connect 17 0 1 0; -#X connect 17 0 34 0; -#X connect 18 0 14 1; -#X connect 19 0 20 0; -#X connect 20 0 12 0; -#X connect 21 0 23 0; -#X connect 22 0 25 0; -#X connect 23 0 24 0; -#X connect 24 0 19 0; -#X connect 25 0 21 0; -#X connect 26 0 44 0; -#X connect 28 0 20 1; -#X connect 29 0 27 0; -#X connect 30 0 5 0; -#X connect 34 0 46 0; -#X connect 36 0 5 0; -#X connect 37 0 10 0; -#X connect 39 0 10 0; -#X connect 40 0 10 0; -#X connect 42 0 1 0; -#X connect 44 0 10 0; -#X connect 45 0 5 0; -#X connect 46 0 1 0; -#X connect 47 0 29 0; -#X connect 48 0 26 0; -#X connect 48 0 50 0; -#X connect 48 1 26 0; -#X connect 48 1 50 0; -#X connect 49 0 48 0; +#X connect 16 0 1 0; +#X connect 16 0 33 0; +#X connect 17 0 14 1; +#X connect 18 0 19 0; +#X connect 19 0 12 0; +#X connect 20 0 22 0; +#X connect 21 0 24 0; +#X connect 22 0 23 0; +#X connect 23 0 18 0; +#X connect 24 0 20 0; +#X connect 25 0 42 0; +#X connect 27 0 19 1; +#X connect 28 0 26 0; +#X connect 29 0 5 0; +#X connect 33 0 44 0; +#X connect 35 0 5 0; +#X connect 36 0 10 0; +#X connect 38 0 10 0; +#X connect 40 0 1 0; +#X connect 42 0 10 0; +#X connect 43 0 5 0; +#X connect 44 0 1 0; +#X connect 45 0 25 0; +#X connect 45 0 46 0; +#X connect 45 1 25 0; +#X connect 45 1 46 0; +#X connect 46 0 10 0; +#X connect 48 0 28 0; +#X connect 49 0 10 0; #X connect 50 0 10 0; diff --git a/msd3D/06_msd3Dcylindre.pd b/msd3D/06_msd3Dcylindre.pd new file mode 100644 index 0000000..e25967f --- /dev/null +++ b/msd3D/06_msd3Dcylindre.pd @@ -0,0 +1,201 @@ +#N canvas 545 25 696 822 10; +#X obj 221 384 t a; +#X obj 159 5 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 231 57 reset; +#X obj 37 10 loadbang; +#X text 178 4 reset; +#X obj 159 27 t b b b b b; +#X msg 456 528 0 \, destroy; +#X obj 501 682 gemhead; +#X obj 504 755 world_light; +#X msg 456 468 reset \, create \, lighting 1 \, 1; +#X obj 52 380 t b; +#N canvas 643 123 605 590 massrender 0; +#X obj 127 22 inlet; +#X obj 48 203 translateXYZ; +#X obj 127 86 / 12.5; +#X obj 127 109 - 4; +#X obj 192 87 / 12.5; +#X obj 192 110 - 4; +#X obj 64 114 gemhead; +#X obj 48 177 separator; +#X obj 48 153 any; +#X obj 125 136 t b f; +#X obj 247 86 / 12.5; +#X obj 247 109 - 4; +#X obj 127 57 unpack f f f f; +#X obj 48 229 cube 0.03; +#X connect 0 0 12 0; +#X connect 1 0 13 0; +#X connect 2 0 3 0; +#X connect 3 0 9 0; +#X connect 4 0 5 0; +#X connect 5 0 1 2; +#X connect 6 0 8 1; +#X connect 7 0 1 0; +#X connect 8 0 7 0; +#X connect 9 0 8 0; +#X connect 9 1 1 1; +#X connect 10 0 11 0; +#X connect 11 0 1 3; +#X connect 12 1 2 0; +#X connect 12 2 4 0; +#X connect 12 3 10 0; +#X restore 52 699 pd massrender; +#X obj 556 234 random 100; +#X obj 480 234 random 100; +#X msg 405 192 seed 3; +#X obj 52 357 gemhead; +#X obj 456 548 gemwin; +#X obj 52 655 msd3D --------------------------------; +#X obj 568 279 random 100; +#X msg 568 258 seed 4; +#X obj 405 258 pack f f f f; +#X msg 179 328 Xmax 100 \, Xmin 0 \, Ymax 100 \, Ymin 0 \, Zmax 100 +\, Zmin 0; +#X msg 456 508 view 8 0 0.5 0 0 0 0 0 1; +#X obj 406 131 repeat 300; +#X text 501 21 <-- Number of masses; +#X obj 456 487 t b; +#X obj 52 678 route massesPos; +#X msg 52 414 bang \, get massesPos; +#X text 300 485 <-- Move masses; +#X floatatom 539 700 5 0 0 0 - - -; +#X floatatom 580 703 5 0 0 0 - - -; +#X floatatom 633 704 5 0 0 0 - - -; +#X msg 198 527 forceY mob 100; +#X msg 197 551 forceY mob -100; +#X msg 211 575 forceZ mob 100; +#X msg 210 599 forceZ mob -100; +#X msg 179 501 forceX mob -100; +#X msg 405 280 mass mob 1 \$1 \$2 \$3 \$4; +#X obj 75 491 metro 10; +#X obj 76 469 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 +; +#X floatatom 107 470 5 0 0 0 - - -; +#X text 74 453 instead of GEM; +#X msg 480 213 seed 20; +#X msg 556 213 seed 10; +#X msg 456 582 view 0 0 8 0 0 0 1 0 0; +#X obj 477 162 t b; +#X obj 406 153 t b b; +#X msg 178 477 forceX mob 100; +#X obj 501 725 rotateXYZ 30 30 0; +#X msg 456 619 view 8 8 0 0 0 0 0 1 0; +#X obj 405 234 + 200; +#X obj 405 213 random 50; +#X msg 213 130 mass fix 0 100 50 50 50; +#X obj 34 141 vradio 20 1 0 3 \$0-choix empty empty 0 -6 0 8 -262144 +-1 -1 2; +#N canvas 82 198 791 599 cylindertype 0; +#X obj 49 14 inlet; +#X obj 248 503 outlet; +#X obj 194 33 r \$0-choix; +#X obj 181 112 sel 0 1 2; +#X msg 368 193 nLink cylin fix mob 5 2.5 1 0 0; +#X obj 177 86 f; +#X msg 257 191 setL cylin 45; +#X obj 172 188 t b b; +#X obj 186 226 t b b; +#X obj 162 263 t b b; +#X msg 419 227 nLink cylin fix mob 2 15 1 0 0 1 0 20; +#X msg 440 283 nLink cylin3 fix mob 2 15 1 0 0 1 50 100; +#X msg 312 279 setL cylin3 25; +#X msg 309 225 setL cylin 25; +#X msg 313 251 setL cylin2 30; +#X msg 431 254 nLink cylin2 fix mob 2 15 1 0 0 1 27 40; +#X msg 265 329 nLink cylin fix mob 1 40 1 0 0 1 0 20; +#X msg 161 328 setL cylin 20; +#X connect 0 0 5 0; +#X connect 2 0 5 1; +#X connect 3 0 7 0; +#X connect 3 1 8 0; +#X connect 3 2 9 0; +#X connect 4 0 1 0; +#X connect 5 0 3 0; +#X connect 6 0 1 0; +#X connect 7 0 6 0; +#X connect 7 1 4 0; +#X connect 8 0 13 0; +#X connect 8 0 14 0; +#X connect 8 0 12 0; +#X connect 8 1 10 0; +#X connect 8 1 15 0; +#X connect 8 1 11 0; +#X connect 9 0 17 0; +#X connect 9 1 16 0; +#X connect 10 0 1 0; +#X connect 11 0 1 0; +#X connect 12 0 1 0; +#X connect 13 0 1 0; +#X connect 14 0 1 0; +#X connect 15 0 1 0; +#X connect 16 0 1 0; +#X connect 17 0 1 0; +#X restore 160 217 pd cylindertype; +#X text 62 143 Cylinder; +#X text 63 164 Rings; +#X text 63 184 Obstacle; +#X obj 434 22 nbx 5 14 200 20000 1 0 empty empty empty 0 -6 0 10 -262144 +-1 -1 1473.05 256; +#X connect 0 0 17 0; +#X connect 1 0 5 0; +#X connect 2 0 0 0; +#X connect 3 0 5 0; +#X connect 5 0 54 0; +#X connect 5 1 21 0; +#X connect 5 2 23 0; +#X connect 5 3 52 0; +#X connect 5 4 2 0; +#X connect 5 4 45 0; +#X connect 6 0 16 0; +#X connect 7 0 48 0; +#X connect 9 0 16 0; +#X connect 9 0 25 0; +#X connect 10 0 27 0; +#X connect 12 0 20 2; +#X connect 13 0 20 1; +#X connect 14 0 51 0; +#X connect 15 0 10 0; +#X connect 17 0 26 0; +#X connect 18 0 20 3; +#X connect 19 0 18 0; +#X connect 20 0 37 0; +#X connect 21 0 0 0; +#X connect 22 0 16 0; +#X connect 23 0 46 0; +#X connect 25 0 22 0; +#X connect 26 0 11 0; +#X connect 27 0 17 0; +#X connect 29 0 48 1; +#X connect 30 0 48 2; +#X connect 31 0 48 3; +#X connect 32 0 17 0; +#X connect 33 0 17 0; +#X connect 34 0 17 0; +#X connect 35 0 17 0; +#X connect 36 0 17 0; +#X connect 37 0 0 0; +#X connect 38 0 17 0; +#X connect 39 0 38 0; +#X connect 40 0 38 1; +#X connect 42 0 13 0; +#X connect 43 0 12 0; +#X connect 44 0 16 0; +#X connect 45 0 14 0; +#X connect 45 0 42 0; +#X connect 45 0 43 0; +#X connect 45 0 19 0; +#X connect 46 0 51 0; +#X connect 46 1 13 0; +#X connect 46 1 18 0; +#X connect 46 1 12 0; +#X connect 47 0 17 0; +#X connect 48 0 8 0; +#X connect 49 0 16 0; +#X connect 50 0 20 0; +#X connect 51 0 50 0; +#X connect 52 0 0 0; +#X connect 54 0 0 0; +#X connect 58 0 23 1; diff --git a/msd3D/filet.pd b/msd3D/filet.pd index ccc5fc5..fb67b80 100644 --- a/msd3D/filet.pd +++ b/msd3D/filet.pd @@ -33,7 +33,6 @@ #X obj 344 59 t b b; #X obj 375 370 t b; #X obj 334 391 f; -#X msg 335 468 link fil \$1 \$2 10 2.5 0.5; #X obj 330 253 t f f f f; #X obj 494 339 moses; #X obj 443 431 pack f f; @@ -41,11 +40,12 @@ #X obj 441 390 f; #X obj 473 395 + \$6; #X obj 521 313 - 1; -#X msg 54 359 mass filet 1 80 \$1 \$2 0; #X obj 46 257 * \$3; #X obj 176 256 * \$4; +#X msg 335 468 link fil \$1 \$2 10 25; +#X msg 54 359 mass filet 1 180 \$1 \$2 0; #X connect 1 0 5 0; -#X connect 1 0 41 0; +#X connect 1 0 40 0; #X connect 2 0 5 1; #X connect 2 0 26 0; #X connect 3 0 6 0; @@ -62,7 +62,7 @@ #X connect 9 0 17 1; #X connect 10 0 23 0; #X connect 10 1 24 0; -#X connect 11 0 42 0; +#X connect 11 0 44 0; #X connect 12 0 15 0; #X connect 13 0 9 0; #X connect 13 0 31 0; @@ -72,35 +72,35 @@ #X connect 16 0 17 0; #X connect 17 0 18 0; #X connect 18 0 17 1; -#X connect 18 0 35 0; +#X connect 18 0 34 0; #X connect 19 0 16 1; #X connect 20 0 32 0; #X connect 21 0 11 0; #X connect 22 0 11 1; -#X connect 23 0 43 0; -#X connect 24 0 44 0; +#X connect 23 0 41 0; +#X connect 24 0 42 0; #X connect 26 0 20 1; #X connect 27 0 20 0; -#X connect 28 0 36 0; +#X connect 28 0 35 0; #X connect 29 0 30 1; -#X connect 30 0 34 0; +#X connect 30 0 43 0; #X connect 31 0 1 0; #X connect 31 1 2 0; #X connect 32 0 33 0; #X connect 33 0 30 0; -#X connect 34 0 0 0; -#X connect 35 0 27 0; -#X connect 35 1 29 0; -#X connect 35 1 33 1; -#X connect 35 2 28 0; -#X connect 35 3 40 0; -#X connect 35 3 39 1; -#X connect 36 0 38 0; -#X connect 37 0 34 0; -#X connect 38 0 39 0; -#X connect 39 0 37 0; -#X connect 40 0 37 1; -#X connect 41 0 36 1; -#X connect 42 0 0 0; -#X connect 43 0 21 0; -#X connect 44 0 22 0; +#X connect 34 0 27 0; +#X connect 34 1 29 0; +#X connect 34 1 33 1; +#X connect 34 2 28 0; +#X connect 34 3 39 0; +#X connect 34 3 38 1; +#X connect 35 0 37 0; +#X connect 36 0 43 0; +#X connect 37 0 38 0; +#X connect 38 0 36 0; +#X connect 39 0 36 1; +#X connect 40 0 35 1; +#X connect 41 0 21 0; +#X connect 42 0 22 0; +#X connect 43 0 0 0; +#X connect 44 0 0 0; diff --git a/msd3D/help-msd3D.pd b/msd3D/help-msd3D.pd index 725b9e1..87e9aee 100644 --- a/msd3D/help-msd3D.pd +++ b/msd3D/help-msd3D.pd @@ -1,190 +1,588 @@ -#N canvas 369 233 467 396 10; -#N canvas 271 52 742 855 masses 0; -#X obj 62 132 cnv 15 610 180 empty empty CREATION 20 12 0 14 -262131 --66577 0; -#X msg 79 161 reset; -#X text 249 192 Add a mass; -#X text 335 193 \$1 : Id (symbol); -#X text 334 213 \$2 : fixed or mobile (0/1); -#X text 334 231 \$3 : mass; -#X text 251 162 Delete all masses and links; -#X obj 62 316 cnv 15 610 60 empty empty COMPUTATION 20 12 0 14 -261689 --66577 0; -#X msg 82 345 bang; -#X text 235 345 Compute new masses positions; -#X obj 61 381 cnv 15 610 210 empty empty DYNAMIC_SETTING 20 12 0 14 --262131 -66577 0; -#X text 350 445 \$2 : New value; -#X text 348 499 \$2 : New value; -#X msg 87 407 posX \$1 \$2; -#X text 350 409 Set position of mass(es); -#X text 347 464 Add force on mass(es); -#X msg 82 458 forceX \$1 \$2; -#X obj 61 595 cnv 15 610 245 empty empty GET_ATTRIBUTES 20 12 0 14 --261689 -66577 0; -#X text 248 622 output all masses positions in a list on outlet No -1; -#X text 246 697 output all masses forces in a list on outlet No 1; -#X msg 145 734 get \$1 \$2; -#X text 248 735 Get specific attribute; -#X text 248 760 \$1 : Attribute type ( massesPos / massesSpeeds / massesForces -/ linksPos ); -#X text 248 797 \$2 : Id (symbol or creations numbers); -#X msg 79 268 deleteMass \$1; -#X text 248 270 Delete a mass and associated links; -#X text 338 287 \$1 : Creation No of mass; -#X msg 143 817 infosL; -#X text 246 817 Get infos on all masses and links on outlet No 2; -#X text 347 533 \$1 : Value; -#X text 73 9 MASSES :; -#X text 64 45 They got only one physical parameter \, the value of -their; -#X text 65 59 mass. They can be mobile or fixed \, in this case forces -; -#X text 64 30 The msd masses are the principals objects of the model. -; -#X text 64 73 applied on them automatically \, by links \, or manually -\, by; -#X text 65 88 messages \, don't do anything.; -#X msg 81 556 setMobile \$1 \, setFixed \$1; -#X text 345 556 Change mobile parameter; -#X text 345 572 \$1 : Creation No of mass; -#X msg 166 407 posY \$1 \$2; -#X msg 174 458 forceY \$1 \$2; -#X text 347 516 Set minimimum and maximum X \, Y of masses; -#X msg 83 503 Xmin \$1 \, Xmax \$1 \, Ymin \$1 \, Ymax \$1; -#X msg 79 192 mass \$1 \$2 \$3 \$4 \$5 \$6; -#X text 334 249 \$4 \, \$5 \, \$6 : initial position; -#X msg 246 407 posZ \$1 \$2; -#X msg 83 481 forceZ \$1 \$2; -#X msg 83 526 Zmin \$1 \, Zmax \$1; -#X obj 33 821 msd3D; -#X text 350 427 \$1 : Id (symbol) or No; -#X text 348 481 \$1 : Id (symbol) or No; -#X text 247 648 output all masses x/y/z positions in a list on outlet -No 1; -#X msg 147 622 massesPosL; -#X msg 146 648 massesPosYL; -#X msg 147 670 massesPosZL; -#X msg 146 696 massesForcesL; -#X msg 67 648 massesPosXL; -#X text 64 103 Be careful : if masses are deleted \, lists messages -won't work; -#X connect 1 0 48 0; -#X connect 8 0 48 0; -#X connect 13 0 48 0; -#X connect 16 0 48 0; -#X connect 20 0 48 0; -#X connect 24 0 48 0; -#X connect 27 0 48 0; -#X connect 36 0 48 0; -#X connect 42 0 48 0; -#X connect 43 0 48 0; -#X connect 52 0 48 0; -#X connect 53 0 48 0; -#X connect 54 0 48 0; -#X connect 55 0 48 0; -#X connect 56 0 48 0; -#X restore 159 305 pd masses; -#X text 12 305 HELP on masses --->; -#X text 11 336 HELP on links --->; -#X text -50 110 There are 4 types of messages for msd :; -#X text -49 74 It is designed to implement particules physical model -in PD.The model is based on two elements type : mass and link.; -#X obj -50 125 cnv 15 420 30 empty empty empty 20 12 0 14 -262131 -66577 +#N canvas 595 54 563 818 10; +#X obj 4 369 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 5 779 cnv 15 550 30 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 8 6 cnv 15 550 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 14 389 cnv 15 75 15 empty empty empty 20 12 0 14 -233017 -66577 0; -#X obj -50 158 cnv 15 420 30 empty empty empty 20 12 0 14 -261689 -66577 +#X obj 14 584 cnv 15 75 15 empty empty empty 20 12 0 14 -233017 -66577 0; -#X obj -50 191 cnv 15 420 30 empty empty empty 20 12 0 14 -262131 -66577 +#X obj 4 527 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 0; -#X obj -50 224 cnv 15 420 30 empty empty empty 20 12 0 14 -261689 -66577 +#X obj 4 562 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 0; -#X text -47 132 CREATION : To create the model masses and links.; -#X text -47 197 DYNAMIC SETTING : To set the model parameters dynamically. +#X obj 7 76 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 5 729 cnv 15 550 20 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 5 749 cnv 15 550 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#N canvas 76 31 967 770 More_Info 0; +#X text 123 27 MSD : mass - spring - damper model; +#X text 53 170 Be careful : if masses are deleted \, lists messages +won't work; +#X text 54 75 It is designed to implement particules physical model +in PD.The model is based on two elements type : mass and link. The +msd masses are the principals objects of the model. They got only one +physical parameter \, the value of their mass. They can be mobile or +fixed \, in this case forces applied on them automatically \, by links +\, or manually \, by messages \, don't do anything.; +#X obj 476 19 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 476 318 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#N canvas 0 0 450 300 graph1 0; +#X array rigidity1 4 float 1; +#A 0 -1 0 1 2; +#X array zero 4 float 1; +#A 0 0 0 0 0; +#X coords 0 3 3 -3 200 150 1; +#X restore 163 345 graph; +#X text 221 498 L0; +#N canvas 163 176 956 727 figure 0; +#X obj 182 108 loadbang; +#X msg 191 180 \; rigidity1 resize 1 \; rigidity1 resize 4 \; rigidity1 +bounds 0 3 3 -3 \; rigidity1 0 -1 0 1 2 \; rigidity1 ylabel -0.5 \; +rigidity1 xlabel -3.5 \; rigidity1 xticks 0 1 1 \; rigidity1 yticks +0 0.1 5; +#X obj 388 574 sqrt; +#X obj 316 651 tabwrite rigidity3; +#X obj 343 464 - 20; +#X obj 316 609 f; +#X obj 316 579 t b f; +#X obj 343 494 moses 0; +#X obj 343 517 * -1; +#X obj 343 538 sqrt; +#X obj 343 559 * -1; +#X obj 375 429 counter 0 50; +#X obj 481 479 - 20; +#X obj 453 662 f; +#X obj 453 632 t b f; +#X obj 481 509 moses 0; +#X obj 481 532 * -1; +#X obj 480 612 * -1; +#X obj 528 622 *; +#X obj 480 591 *; +#X obj 525 590 t f f; +#X obj 480 564 t f f; +#X obj 453 683 tabwrite rigidity4; +#X obj 255 350 t b b; +#X obj 374 404 until; +#X obj 620 552 f; +#X obj 620 522 t b f; +#X obj 678 376 until; +#X obj 620 623 tabwrite rigidity2; +#X msg 763 574 0; +#X obj 679 401 counter 0 100; +#X obj 679 437 - 50; +#X obj 751 491 moses 40; +#X obj 681 510 moses -40; +#X obj 620 586 * 1.5; +#X obj 680 462 moses 10; +#X obj 680 488 moses -10; +#X msg 55 419 \; rigidity2 resize 101 \; rigidity2 xticks 1 10 5 \; +rigidity2 yticks 0 5 5 \; rigidity3 resize 51 \; rigidity3 xticks 0 +1 5 \; rigidity3 yticks 0 1 5 \; rigidity4 resize 51 \; rigidity4 xticks +0 1 5 \; rigidity4 yticks 0 100 5; +#X connect 0 0 1 0; +#X connect 0 0 23 0; +#X connect 2 0 5 1; +#X connect 4 0 7 0; +#X connect 5 0 3 0; +#X connect 6 0 5 0; +#X connect 6 1 3 1; +#X connect 7 0 8 0; +#X connect 7 1 2 0; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X connect 10 0 5 1; +#X connect 11 0 4 0; +#X connect 11 0 6 0; +#X connect 11 0 12 0; +#X connect 11 0 14 0; +#X connect 11 1 24 1; +#X connect 12 0 15 0; +#X connect 13 0 22 0; +#X connect 14 0 13 0; +#X connect 14 1 22 1; +#X connect 15 0 16 0; +#X connect 15 1 20 0; +#X connect 16 0 21 0; +#X connect 17 0 13 1; +#X connect 18 0 13 1; +#X connect 19 0 17 0; +#X connect 20 0 18 0; +#X connect 20 1 18 1; +#X connect 21 0 19 0; +#X connect 21 1 19 1; +#X connect 23 0 24 0; +#X connect 23 1 37 0; +#X connect 23 1 27 0; +#X connect 24 0 11 0; +#X connect 25 0 34 0; +#X connect 26 0 25 0; +#X connect 26 1 28 1; +#X connect 27 0 30 0; +#X connect 29 0 25 1; +#X connect 30 0 26 0; +#X connect 30 0 31 0; +#X connect 30 1 27 1; +#X connect 31 0 35 0; +#X connect 32 0 25 1; +#X connect 32 1 29 0; +#X connect 33 0 29 0; +#X connect 33 1 25 1; +#X connect 34 0 28 0; +#X connect 35 0 36 0; +#X connect 35 1 32 0; +#X connect 36 0 33 0; +#X connect 36 1 29 0; +#X restore 439 721 pd figure; +#X text 167 322 Rigidity; +#N canvas 0 0 450 300 graph1 0; +#X array rigidity2 101 float 1; +#A 0 0 0 0 0 0 0 0 0 0 0 0 -60 -58.5 -57 -55.5 -54 -52.5 -51 -49.5 +-48 -46.5 -45 -43.5 -42 -40.5 -39 -37.5 -36 -34.5 -33 -31.5 -30 -28.5 +-27 -25.5 -24 -22.5 -21 -19.5 -18 -16.5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 15 16.5 18 19.5 21 22.5 24 25.5 27 28.5 30 31.5 33 34.5 +36 37.5 39 40.5 42 43.5 45 46.5 48 49.5 51 52.5 54 55.5 57 58.5 0 0 +0 0 0 0 0 0 0 0; +#X array zero 101 float 1; +#A 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0; +#X coords 0 60 100 -60 200 150 1; +#X restore 578 341 graph; +#X text 670 496 L0; +#X text 583 318 Rigidity with Lmin and Lmax; +#X text 686 496 Lmin; +#X text 748 496 Lmax; +#N canvas 0 0 450 300 graph1 0; +#X array rigidity3 51 float 1; +#A 0 -4.47214 -4.3589 -4.24264 -4.12311 -4 -3.87298 -3.74166 -3.60555 +-3.4641 -3.31662 -3.16228 -3 -2.82843 -2.64575 -2.44949 -2.23607 -2 +-1.73205 -1.41421 -1 0 1 1.41421 1.73205 2 2.23607 2.44949 2.64575 +2.82843 3 3.16228 3.31662 3.4641 3.60555 3.74166 3.87298 4 4.12311 +4.24264 4.3589 4.47214 4.58258 4.69042 4.79583 4.89898 5 5.09902 5.19615 +5.2915 5.38516 5.47723; +#X array zero 51 float 1; +#A 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; +#X coords 0 6 50 -6 200 150 1; +#X restore 162 547 graph; +#X text 235 700 L0; +#X text 167 525 Rigidity with power = 1/2; +#N canvas 0 0 450 300 graph1 0; +#X array rigidity4 51 float 1; +#A 0 -400 -361 -324 -289 -256 -225 -196 -169 -144 -121 -100 -81 -64 +-49 -36 -25 -16 -9 -4 -1 0 1 4 9 16 25 36 49 64 81 100 121 144 169 +196 225 256 289 324 361 400 441 484 529 576 625 676 729 784 841 900 ; -#X text -47 230 ATTRIBUTES : To get the model parameters.; -#X text -47 159 COMPUTATION : To compute the new model state based -on previous instant.; -#X text 32 16 MSD3D : mass - spring - damper model; -#X text -48 61 MSD3D is the 3D object of the msd objects collection. +#X array zero 51 float 1; +#A 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; +#X coords 0 1000 50 -1000 200 150 1; +#X restore 575 551 graph; +#X text 648 705 L0; +#X text 582 529 Rigidity with power = 2; +#X text 601 26 The equations are :; +#X text 525 50 if Lmin<|L[n]-L[0]|<Lmax; +#X text 524 89 else; +#X text 533 109 F[n] = D(L[n]-L[n-1]); +#X text 533 69 F[n] = K(L[n] - L[0])^P + D(L[n] - L[n-1]); +#X text 53 202 Links connect masses two by two. They got 4 physicals +parameters : length \, rigidity \, damping and power.; +#X text 52 231 Rigidity \, damping and power are defined by the creation +message. The lenght is initialised to the distance between the two +masses at the creation.; +#X text 524 284 You can build specific links using different links +messages defining the characteristic step by step.; +#X text 51 272 Links can be created in one shot between mutiples masses +\, instead of creation number \, the masses linked are defined with +their Id.; +#X text 533 250 x1x2 + y1y2 + z1z2 = 0; +#X text 525 138 For oriented links \, the force F[n] is projected using +a vector which is given during the creation of the link using x1y1z1 +coordinates.; +#X text 524 179 For tangentials links \, the force is projected onto +the given vector x1y1z1.; +#X text 533 266 x1x3 + y1y3 + z1z3 = 0; +#X text 524 209 For normals links \, the force is projected onto a +plane define with x2y2z2 and x3y3z3 calculated with the scalar products +:; +#X text 55 56 MSD is the 3D object of the msd objects collection.; +#X connect 3 0 4 0; +#X restore 16 785 pd More_Info; +#X text 12 76 Examples:; +#X text 9 369 Inlets:; +#X text 19 388 - Left:; +#X text 10 526 Arguments:; +#X text 11 562 Outlets:; +#X text 19 729 See Also:; +#X text 74 48 Full Name:; +#N canvas 58 22 262 70 Related_Objects 0; +#X obj 3 10 cnv 15 250 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 3 30 cnv 15 250 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 5 10 Externals and libraries; +#X obj 44 37 msd; +#X obj 141 38 msd2D; +#X restore 122 785 pd Related_Objects; +#N canvas 257 262 759 345 init 0; +#X obj 89 215 t a; +#X obj 89 33 loadbang; +#X obj 89 241 s \$0-in; +#X obj 89 59 t b b b b b; +#X msg 161 80 reset; +#X obj 44 13 inlet; +#X msg 143 100 mass fix 0 10 0 0; +#X msg 89 187 Xmax 4 \, Xmin -4 \, Ymax 4 \, Ymin -4; +#X msg 125 120 mass mob 1 100 0 -2 \, mass mob 1 100 2 0 \, mass mob +1 100 0 2 \, mass mob 1 100 -2 0; +#X msg 107 161 link souple fix mob 10 10 \, link souple mob mob 10 +10; +#X connect 0 0 2 0; +#X connect 1 0 3 0; +#X connect 3 0 7 0; +#X connect 3 1 9 0; +#X connect 3 2 8 0; +#X connect 3 3 6 0; +#X connect 3 4 4 0; +#X connect 4 0 0 0; +#X connect 5 0 3 0; +#X connect 6 0 0 0; +#X connect 7 0 0 0; +#X connect 8 0 0 0; +#X connect 9 0 0 0; +#X restore 17 156 pd init; +#X obj 18 321 s \$0-out; +#X obj 18 272 r \$0-in; +#X obj 393 317 s \$0-in; +#N canvas 565 515 355 193 compute 0; +#X obj 27 29 inlet; +#X obj 27 127 s \$0-in; +#X msg 27 96 bang \, get massesPos \, get linksPos; +#X obj 27 66 gemhead; +#X obj 160 36 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X connect 0 0 3 0; +#X connect 2 0 1 0; +#X connect 3 0 2 0; +#X connect 4 0 2 0; +#X restore 17 209 pd compute; +#X obj 17 181 tgl 20 0 empty empty ON/OFF 25 10 1 10 -262144 -1 -1 +0 1; +#X obj 172 270 r \$0-out; +#X obj 17 126 bng 20 250 50 0 empty empty Reset 25 10 1 10 -262144 +-1 -1; +#X text 101 388 Bang - A bang at the left inlet compute the new model +state based on previous instant.; +#X text 158 478 To set the model parameters after creation.; +#X text 158 456 To create the model masses and links.; +#X text 158 501 To get the model parameters; +#N canvas 8 28 963 606 creation________ 0; +#X obj 5 75 cnv 15 450 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 5 3 cnv 15 450 15 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 7 2 CREATION Messages; +#X obj 4 137 cnv 15 450 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 3 329 cnv 15 450 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X msg 32 104 reset; +#X text 245 168 Add a mass; +#X text 70 191 \$1 : Id (symbol); +#X text 69 211 \$2 : fixed or mobile (0/1); +#X text 69 229 \$3 : mass; +#X msg 32 277 deleteMass \$1; +#X text 171 276 Delete a mass and associated links; +#X text 66 302 \$1 : Creation No of mass; +#X text 7 137 Masses :; +#X text 7 74 Reset :; +#X text 100 105 Delete all masses \, links and internal variables; +#X text 6 329 Links :; +#X text 62 388 \$1 : Id (symbol); +#X text 62 441 \$4 : rigidity; +#X msg 30 542 deleteLink \$1; +#X text 164 542 Delete a link; +#X text 57 570 \$1 : Creation No of link; +#X text 62 388 \$1 : Id (symbol); +#X text 62 441 \$4 : rigidity; +#X text 62 406 \$2 : creation No/Id of mass1; +#X text 62 424 \$3 : creation No/Id of mass2; +#X text 281 363 Add link(s); +#X text 62 459 \$5 : damping; +#X text 10 28 Creation messages are used to define the structure of +the model. Messages create links and masses or destroy them.; +#X msg 30 362 link \$1 \$2 \$3 \$4 \$5 ($6 \$7 \$8); +#X text 59 477 ($6) : Power of the rigidity distance; +#X text 59 496 ($7) : minimum lenght of link; +#X text 59 513 ($8) : maximum lenght of link; +#X obj 461 3 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 482 75 cnv 15 450 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 461 572 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X text 519 197 \$1 : Id (symbol); +#X text 519 250 \$4 : rigidity; +#X text 519 197 \$1 : Id (symbol); +#X text 519 250 \$4 : rigidity; +#X text 519 215 \$2 : creation No/Id of mass1; +#X text 519 233 \$3 : creation No/Id of mass2; +#X text 519 268 \$5 : damping; +#X text 799 169 Add tangential link(s); +#X text 516 306 ($8) : Power of the rigidity distance; +#X text 516 325 ($9) : minimum lenght of link; +#X text 516 342 ($10) : maximum lenght of link; +#X text 520 401 \$1 : Id (symbol); +#X text 520 454 \$4 : rigidity; +#X text 520 401 \$1 : Id (symbol); +#X text 520 454 \$4 : rigidity; +#X text 520 419 \$2 : creation No/Id of mass1; +#X text 520 437 \$3 : creation No/Id of mass2; +#X text 520 472 \$5 : damping; +#X text 517 510 ($8) : Power of the rigidity distance; +#X text 517 529 ($9) : minimum lenght of link; +#X text 517 546 ($10) : maximum lenght of link; +#X text 485 75 Oriented links :; +#X text 801 368 Add normal link(s); +#X msg 32 167 mass \$1 \$2 \$3 \$4 \$5 \$6; +#X msg 489 168 tLink \$1 \$2 \$3 \$4 \$5 \$6 \$7 \$8 ($9 \$10 \$11) ; -#N canvas 222 83 808 841 links 0; -#X obj 33 821 msd; -#X obj 62 192 cnv 15 610 360 empty empty CREATION 20 12 0 14 -262131 --66577 0; -#X msg 79 221 reset; -#X text 402 247 \$1 : Id (symbol); -#X text 314 247 Add a link; -#X text 401 267 \$2 : creation No of mass1; -#X text 401 285 \$3 : creation No of mass2; -#X text 400 303 \$4 : rigidity; -#X text 251 222 Delete all masses and links; -#X text 400 321 \$5 : viscosity; -#X text 400 338 \$6 : damping; -#X obj 61 561 cnv 15 610 82 empty empty DYNAMIC_SETTING 20 12 0 14 --262131 -66577 0; -#X msg 172 583 setD \$1 \$2; -#X text 354 601 \$1 : Id (symbol); -#X text 354 619 \$2 : New value; -#X msg 87 583 setK \$1 \$2; -#X msg 255 583 setD2 \$1 \$2; -#X text 354 583 Set rigidity \, viscosity or damping of link(s); -#X obj 60 650 cnv 15 610 140 empty empty GET_ATTRIBUTES 20 12 0 14 --261689 -66577 0; -#X msg 75 679 get \$1 \$2; -#X text 237 680 Get specific attribute; -#X text 237 705 \$1 : Attribute type ( massesPos / massesSpeeds / massesForces -/ linksPos ); -#X text 237 742 \$2 : Id (symbol or creations numbers); -#X msg 74 533 deleteLink \$1; -#X text 239 535 Delete a link; -#X text 340 535 \$1 : Creation No of link; -#X msg 73 762 infosL; -#X text 236 762 Get infos on all masses and links on outlet No 2; -#X text 402 247 \$1 : Id (symbol); -#X text 314 247 Add a link; -#X text 401 267 \$2 : creation No of mass1; -#X text 401 285 \$3 : creation No of mass2; -#X text 400 303 \$4 : rigidity; -#X text 400 321 \$5 : viscosity; -#X text 400 338 \$6 : damping; -#X text 463 392 \$1 : Id (symbol); -#X text 462 448 \$4 : rigidity; -#X text 462 466 \$5 : viscosity; -#X text 462 483 \$6 : damping; -#X text 463 392 \$1 : Id (symbol); -#X text 462 448 \$4 : rigidity; -#X text 462 466 \$5 : viscosity; -#X text 462 483 \$6 : damping; -#X text 301 393 Add an interactor link; -#X text 94 52 LINKS :; -#X text 71 91 parameters : length \, rigidity \, viscosity and damping. +#X msg 491 368 nLink \$1 \$2 \$3 \$4 \$5 \$6 \$7 \$8 ($9 \$10 \$11) ; -#X text 72 78 Links connect masses two by two. They got 4 physicals +#X text 519 491 \$6 \, \$7 \, \$8 : normal vector; +#X text 518 287 \$6 \, \$7 \, \$8 : tangential vector; +#X text 69 247 \$4 \, \$5 \, \$8 : initial position; +#X text 487 102 In 2D (and 3D) there are two specials links : oriented +links. They works as general links excepts their calculation is made +following a vector for tangentials links or a plane for normals links. ; -#X text 70 134 the two masses at the creation.; -#X text 71 120 message. The lenght is initialised to the distance between +#X connect 33 0 35 0; +#X restore 12 457 pd creation________; +#X text 103 542 None; +#X text 18 583 - Left:; +#X text 101 584 Outputs the model parameters asked with the attributes +messages.; +#X obj 13 629 cnv 15 75 15 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X text 17 628 - Right:; +#X text 100 629 Outputs information on model when creation messages +are send or with the special message [infosL( which dump the complete +state of the model.; +#X text 101 420 Messages - Different messages are used to control the +msd object. They are of three types :; +#X text 9 751 CATEGORY: control; +#N canvas 354 125 579 668 dynamic 0; +#X obj 5 3 cnv 15 550 15 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 10 85 cnv 15 150 300 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 4 62 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 10 420 cnv 15 130 180 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 3 396 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X text 7 62 Masses :; +#X text 6 396 Links :; +#X text 7 2 DYNAMIC SETTINGS Messages; +#X msg 30 88 posX \$1 \$2; +#X text 190 148 Add force on mass(es); +#X msg 30 151 forceX \$1 \$2; +#X text 192 232 \$1 : Value; +#X text 193 107 \$1 : Id (symbol) or No; +#X text 193 165 \$1 : Id (symbol) or No; +#X msg 30 215 Xmin \$1; +#X msg 88 215 Xmax \$1; +#X msg 30 278 setMobile \$1; +#X msg 30 299 setFixed \$1; +#X text 193 89 Set position of fixed mass(es); +#X text 193 125 \$2 : Value; +#X text 193 183 \$2 : Value; +#X text 189 216 Set minimimum and maximum position of all masses; +#X text 189 278 Set mass to mobile or fixed; +#X msg 29 484 setD \$1 \$2; +#X text 184 470 \$2 : New value; +#X msg 29 433 setK \$1 \$2; +#X text 184 526 \$2 : New value; +#X text 184 579 \$2 : New value; +#X text 178 434 Set rigidity of link(s); +#X text 178 490 Set damping of link(s); +#X msg 29 539 setL \$1 \$2; +#X text 178 543 Set initial lenght of link(s); +#X text 184 452 \$1 : Id (symbol) or No; +#X text 184 508 \$1 : Id (symbol) or No; +#X text 184 561 \$1 : Id (symbol) or No; +#X text 192 295 \$1 : Id (symbol) or No; +#X text 10 25 Dynamic settings messages allows the user to redefine +internal parameters of links and masses.; +#X msg 30 329 grabMass \$1 \$2 \$3; +#X text 187 329 Grab nearest mass; +#X text 192 345 \$1 \, \$2 : position; +#X text 191 362 \$3 : grab or not (0/1); +#X msg 30 234 Ymin \$1; +#X msg 89 234 Ymax \$1; +#X msg 30 107 posY \$1 \$2; +#X msg 30 171 forceY \$1 \$2; +#X msg 30 126 posZ \$1 \$2; +#X msg 30 191 forceZ \$1 \$2; +#X msg 30 253 Zmin \$1; +#X msg 89 253 Zmax \$1; +#X restore 12 478 pd dynamic settings; +#N canvas 382 95 600 656 attributes______ 0; +#X obj 11 95 cnv 15 100 35 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 5 75 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 5 3 cnv 15 590 15 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 10 158 cnv 15 150 130 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 4 137 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 10 314 cnv 15 110 330 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 4 290 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X text 7 74 General :; +#X text 7 2 ATTRIBUTES Messages; +#X text 7 137 Lists :; +#X msg 33 104 infosL; +#X text 136 104 Get infos on all masses and links on right outlet; +#X msg 32 170 massesPosL; +#X msg 31 255 massesForcesL; +#X text 171 170 Output all masses positions in a list on outlet No +1; +#X text 140 355 \$1 : Attribute type ( massesPos / massesSpeeds / massesForces +/ linksPos ); +#X text 140 330 Get specific attribute on specific element; +#X msg 20 328 get \$1 ($2); +#X text 7 290 Specific :; +#X text 140 425 The get message return the asked attribute preceded +by an identifier and the creation No of the element. The identifier +is made of the asked parameter and the way you asked for it.; +#X text 141 501 message; +#X text 381 501 response; +#X text 140 482 Examples with 3 masses numbered 0 \, 1 and 2 and named +mas:; +#X text 15 30 The attributes messages ask the object to output some +of his internal parameters. They can be output by lists for positions +and forces of masses.; +#X text 171 256 Output all forces applied on masses in a list on outlet +No 1; +#X text 140 392 ($2) : - If not defined all the attributes are send +for all the elements. - Ids or/and creations No; +#X text 174 520 [get massesPos( -----> [massesPos 0 x0 y0 z0(; +#X text 335 534 [massesPos 2 x2 y2 z2(; +#X text 335 548 [massesPos 1 x1 y1 z1(; +#X text 160 570 [get massesPos 1( -----> [massesPosNo 1 x1 y1 z1(; +#X text 146 591 [get massesPos mas( -----> [massesPosId 0 x0 y0 z0( ; -#X text 71 107 Rigidity \, viscosity and damping are defined by the -creation; -#X text 70 148 Interactor links are links between mutiples masses \, -instead; -#X text 70 161 of creation number \, the masses linked are defined -with; -#X text 69 175 their Id.; -#X text 397 356 ($7) : minimum lenght of link; -#X text 397 373 ($8) : maximum lenght of link; -#X msg 78 247 link \$1 \$2 \$3 \$4 \$5 \$6 ($7 \$8); -#X text 462 412 \$2 : Id (symbol) of masses 1; -#X text 462 430 \$3 : Id (symbol) of masses 2; -#X msg 73 393 iLink \$1 \$2 \$3 \$4 \$5 \$6 ($7 \$8); -#X text 458 500 ($7) : minimum lenght of links; -#X text 458 517 ($8) : maximum lenght of links; +#X text 335 606 [massesPosId 2 x2 y2 z2(; +#X text 335 621 [massesPosId 1 x1 y1 z1(; +#X msg 32 194 massesPosXL; +#X msg 32 215 massesPosYL; +#X msg 32 234 massesPosZL; +#X text 171 215 Output all masses x \, y or z in a list on outlet No +1; +#X restore 12 499 pd attributes______; +#X text 9 761 KEYWORDS: physical model mass spring damper link; +#X text 267 786 - Nicolas Montgermont \, May 12 \, 2005; +#X obj 18 296 msd2D; +#X obj 172 294 route massesPos linksPos; +#N canvas 731 296 450 300 gemmouse 0; +#X obj 189 77 gemmouse; +#X obj 189 184 pack f f; +#X obj 189 218 spigot; +#X obj 109 243 outlet; +#X obj 109 36 inlet; +#X obj 109 98 t b; +#X obj 238 131 + 4; +#X obj 109 125 l 0 0; +#X msg 57 182 posX fix \$1; +#X msg 57 203 posY fix \$2; +#X obj 189 108 / 62.5; +#X obj 237 107 / -62.5; +#X obj 189 131 - 4; +#X connect 0 0 10 0; +#X connect 0 1 11 0; +#X connect 0 2 2 1; +#X connect 1 0 2 0; +#X connect 2 0 7 1; +#X connect 4 0 5 0; +#X connect 5 0 7 0; +#X connect 6 0 1 1; +#X connect 7 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 3 0; +#X connect 9 0 3 0; +#X connect 10 0 12 0; +#X connect 11 0 6 0; +#X connect 12 0 1 0; +#X restore 393 295 pd gemmouse; +#X obj 393 274 gemhead; +#X obj 336 216 gemwin; +#X msg 336 194 0 \, destroy; +#X text 169 132 1 CREATE WINDOW -->; +#X text 168 163 2 DRAG THE STRUCTURE WITH THE MOUSE; +#N canvas 472 258 550 319 gemrender 0; +#X obj 48 203 translateXYZ; +#X obj 48 229 sphere 0.1; +#X obj 48 177 separator; +#X obj 48 153 any; +#X obj 64 114 gemhead 45; +#X obj 127 24 inlet; +#X obj 271 51 inlet; +#X obj 192 206 separator; +#X obj 192 182 any; +#X obj 192 251 curve 2; +#X obj 208 143 gemhead 45; +#X msg 348 100 \$4 \$5 0; +#X msg 276 96 \$2 \$3 0; +#X obj 250 170 t b a; +#X obj 127 62 unpack f f f; +#X obj 125 136 t b f; +#X connect 0 0 1 0; #X connect 2 0 0 0; -#X connect 15 0 0 0; -#X connect 19 0 0 0; -#X connect 23 0 0 0; -#X connect 26 0 0 0; -#X connect 55 0 0 0; -#X connect 58 0 0 0; -#X restore 160 335 pd links; +#X connect 3 0 2 0; +#X connect 4 0 3 1; +#X connect 5 0 14 0; +#X connect 6 0 11 0; +#X connect 6 0 12 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 10 0 8 1; +#X connect 11 0 9 2; +#X connect 12 0 13 0; +#X connect 13 0 8 0; +#X connect 13 1 9 1; +#X connect 14 1 15 0; +#X connect 14 2 0 2; +#X connect 15 0 3 0; +#X connect 15 1 0 1; +#X restore 172 321 pd gemrender; +#X msg 336 129 reset \, create \, 1; +#X text 168 195 3 AND DESTROY IT -->; +#X text 12 8 HELP: msd3D; +#X text 12 18 DESCRIPTION: Mass spring damper physical modeling in +3D.; +#X obj 157 48 msd3D; +#X text 112 730 01_msd3Dtest.pd; +#X connect 21 0 44 0; +#X connect 24 0 23 0; +#X connect 25 0 45 0; +#X connect 26 0 19 0; +#X connect 44 0 20 0; +#X connect 45 0 52 0; +#X connect 45 1 52 1; +#X connect 46 0 22 0; +#X connect 47 0 46 0; +#X connect 49 0 48 0; +#X connect 53 0 48 0; |