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
4141 CK_DLL_MFUN(spectacle_setMaxFreq);
4242 CK_DLL_MFUN(spectacle_getMaxFreq);
4343
44+CK_DLL_MFUN(spectacle_setDelayTimes);
45+CK_DLL_MFUN(spectacle_getDelayTimes);
46+
4447
4548 // for Chugins extending UGen, this is mono synthesis function for 1 sample
4649 CK_DLL_TICKF(spectacle_tick);
@@ -107,8 +110,13 @@ public: · 60 unmodified lines
107110 void tick( SAMPLE* in, SAMPLE* out, int nframes)
108111 {
109112 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+ }
110118 // process a block of samples
111− spectdelay->run(in, out, nframes);
119+ //spectdelay->run(in, out, nframes);
112120 }
113121
114122 void clear()
@@ -125,6 +133,11 @@ public: · 10 unmodified lines
125133
126134 // get parameter example
127135 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+ }
128141
129142 private:
130143 // instance data
@@ -172,6 +185,11 @@ CK_DLL_QUERY( Spectacle ) · 41 unmodified lines
172185 QUERY->add_mfun(QUERY, spectacle_setParam, "float", "param");
173186 // example of adding argument to the above method
174187 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");
175193
176194 // example of adding getter method
177195 QUERY->add_mfun(QUERY, spectacle_getParam, "float", "param");
@@ -251,3 +269,12 @@ CK_DLL_MFUN(spectacle_getParam) · 73 unmodified lines
251269 // set the return value
252270 RETURN->v_float = bcdata->getParam();
253271 }
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+}

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