History

explored methods for passing in array - no success yet

Joel Matthys committed 12 years ago

Commit 2dbe36b1 parent 4325a602 files · +38 −2Browse files

Showing the changes to Spectacle/Spectacle.cpp (1 of 2 files). Show all

Unified · Split

Spectacle/Spectacle.cpp+28−1
@@ -41,6 +41,9 @@ CK_DLL_MFUN(spectacle_getMinFreq); · 40 unmodified lines
41CK_DLL_MFUN(spectacle_setMaxFreq);41CK_DLL_MFUN(spectacle_setMaxFreq);
42CK_DLL_MFUN(spectacle_getMaxFreq);42CK_DLL_MFUN(spectacle_getMaxFreq);
43 43
44CK_DLL_MFUN(spectacle_setDelayTimes);
45CK_DLL_MFUN(spectacle_getDelayTimes);
46
44 47
45// for Chugins extending UGen, this is mono synthesis function for 1 sample48// for Chugins extending UGen, this is mono synthesis function for 1 sample
46CK_DLL_TICKF(spectacle_tick);49CK_DLL_TICKF(spectacle_tick);
@@ -107,8 +110,13 @@ public: · 60 unmodified lines
107 void tick( SAMPLE* in, SAMPLE* out, int nframes)110 void tick( SAMPLE* in, SAMPLE* out, int nframes)
108 {111 {
109 memset (out, 0, sizeof(SAMPLE)*nframes);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 // process a block of samples118 // process a block of samples
111 spectdelay->run(in, out, nframes);119 //spectdelay->run(in, out, nframes);
112 }120 }
113 121
114 void clear()122 void clear()
@@ -125,6 +133,11 @@ public: · 10 unmodified lines
125 133
126 // get parameter example134 // get parameter example
127 float getParam() { return m_param; }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
129private:142private:
130 // instance data143 // instance data
@@ -172,6 +185,11 @@ CK_DLL_QUERY( Spectacle ) · 41 unmodified lines
172 QUERY->add_mfun(QUERY, spectacle_setParam, "float", "param");185 QUERY->add_mfun(QUERY, spectacle_setParam, "float", "param");
173 // example of adding argument to the above method186 // example of adding argument to the above method
174 QUERY->add_arg(QUERY, "float", "arg");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 // example of adding getter method194 // example of adding getter method
177 QUERY->add_mfun(QUERY, spectacle_getParam, "float", "param");195 QUERY->add_mfun(QUERY, spectacle_getParam, "float", "param");
@@ -251,3 +269,12 @@ CK_DLL_MFUN(spectacle_getParam) · 73 unmodified lines
251 // set the return value269 // set the return value
252 RETURN->v_float = bcdata->getParam();270 RETURN->v_float = bcdata->getParam();
253}271}
272
273// example implementation for setter
274CK_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}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t