adding "+" to cyclone's path
so "add-to-path" message works
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
-/* Porres 2016:
- This library has been fixed and updated by Porres in 2016;
+/* Porres 2016-2018:
+ This library has been fixed and updated by Porres;
This is the cyclone library containing 12 non alphanumeric objects.
Originally, the externals in cyclone used to come in a library called
"cyclone", which included these 12 objects plus the "hammer" and "sickle"
[!-~], [!/~], [%~], [+=~] (the original code for such objects used to be
called 'nettles.c'.
- The plan is to, in the future, have all objects into this library.
+ The cyclone library also adds the cyclone path to Pd so you can load all the
+ objects compiled as separate binaries and abstractions. This needs Pd 0.48+
Alternatively, alphanumeric versions of these objects are also included as
single binaries in the cyclone package */
#include "common/shared.h"
#include "magicbit.h"
#include <math.h>
+#include <string.h>
/* think about float-to-int conversion -- there is no point in making
the two below compatible, while all the others are not compatible... */
@@ -654,8 +656,13 @@ void cyclone_setup(void)
cyclone_class = class_new(gensym("cyclone"), cyclone_new, 0, sizeof(t_cyclone), 0, 0);
class_addmethod(cyclone_class, (t_method)cyclone_about, gensym("about"), 0);
+ char cyclone_dir[MAXPDSTRING];
+ strcpy(cyclone_dir, cyclone_class->c_externdir->s_name);
+ char encoded[strlen(cyclone_dir)+1];
+ sprintf(encoded, "+%s", cyclone_dir);
+
t_atom ap[2];
- SETSYMBOL(ap, cyclone_class->c_externdir);
+ SETSYMBOL(ap, gensym(encoded));
SETFLOAT (ap+1, 0.f);
pd_typedmess(gensym("pd")->s_thing, gensym("add-to-path"), 2, ap);
