Showing the changes to Spectacle/Spectacle.cpp (1 of 2 files). Show all
Unified · Split
| @@ -41,6 +41,9 @@ CK_DLL_MFUN(spectacle_getMinFreq); · 40 unmodified lines | ||
| 41 | 41 | CK_DLL_MFUN(spectacle_setMaxFreq); |
| 42 | 42 | CK_DLL_MFUN(spectacle_getMaxFreq); |
| 43 | 43 | |
| 44 | +CK_DLL_MFUN(spectacle_setDelayTimes); | |
| 45 | +CK_DLL_MFUN(spectacle_getDelayTimes); | |
| 46 | + | |
| 44 | 47 | |
| 45 | 48 | // for Chugins extending UGen, this is mono synthesis function for 1 sample |
| 46 | 49 | CK_DLL_TICKF(spectacle_tick); |
| @@ -107,8 +110,13 @@ public: · 60 unmodified lines | ||
| 107 | 110 | void tick( SAMPLE* in, SAMPLE* out, int nframes) |
| 108 | 111 | { |
| 109 | 112 | memset (out, 0, sizeof(SAMPLE)*nframes); |
| 113 | + for (int i=0; i<nframes; i+=2) | |
| 114 | + { | |
| 115 | + spectdelay->run(in+i, out+i, 1); | |
| 116 | + spectdelay->run(in+i, out+i+1, 1); | |
| 117 | + } | |
| 110 | 118 | // process a block of samples |
| 111 | − spectdelay->run(in, out, nframes); | |
| 119 | + //spectdelay->run(in, out, nframes); | |
| 112 | 120 | } |
| 113 | 121 | |
| 114 | 122 | void clear() |
| @@ -125,6 +133,11 @@ public: · 10 unmodified lines | ||
| 125 | 133 | |
| 126 | 134 | // get parameter example |
| 127 | 135 | float getParam() { return m_param; } |
| 136 | + | |
| 137 | + int setDelayTimes ( Chuck_Object *o) | |
| 138 | + { | |
| 139 | + fprintf(stderr, "**** %d %d", (int)o->data[0], o->data[1]); | |
| 140 | + } | |
| 128 | 141 | |
| 129 | 142 | private: |
| 130 | 143 | // instance data |
| @@ -172,6 +185,11 @@ CK_DLL_QUERY( Spectacle ) · 41 unmodified lines | ||
| 172 | 185 | QUERY->add_mfun(QUERY, spectacle_setParam, "float", "param"); |
| 173 | 186 | // example of adding argument to the above method |
| 174 | 187 | QUERY->add_arg(QUERY, "float", "arg"); |
| 188 | + | |
| 189 | + // example of adding setter method | |
| 190 | + QUERY->add_mfun(QUERY, spectacle_setDelayTimes, "Object", "setDelayTimes"); | |
| 191 | + // example of adding argument to the above method | |
| 192 | + QUERY->add_arg(QUERY, "Object", "arg"); | |
| 175 | 193 | |
| 176 | 194 | // example of adding getter method |
| 177 | 195 | QUERY->add_mfun(QUERY, spectacle_getParam, "float", "param"); |
| @@ -251,3 +269,12 @@ CK_DLL_MFUN(spectacle_getParam) · 73 unmodified lines | ||
| 251 | 269 | // set the return value |
| 252 | 270 | RETURN->v_float = bcdata->getParam(); |
| 253 | 271 | } |
| 272 | + | |
| 273 | +// example implementation for setter | |
| 274 | +CK_DLL_MFUN(spectacle_setDelayTimes) | |
| 275 | +{ | |
| 276 | + // get our c++ class pointer | |
| 277 | + Spectacle * bcdata = (Spectacle *) OBJ_MEMBER_INT(SELF, spectacle_data_offset); | |
| 278 | + // set the return value | |
| 279 | + RETURN->v_int = bcdata->setDelayTimes(GET_NEXT_OBJECT(ARGS)); | |
| 280 | +} | |