Skip to content

Commit

Permalink
fix bug where python callback for getFloat was casting values to inte…
Browse files Browse the repository at this point in the history
…gers
  • Loading branch information
David Braun committed Feb 4, 2022
1 parent 1e65bef commit 8ae41bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Binary file modified ChucKDesigner.toe
Binary file not shown.
4 changes: 2 additions & 2 deletions src/ChucKListenerCHOP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#endif

const char* PythonCallbacksDATStubs =
"# This is an example callbacks DAT for a ChucK Audio Operator.\n"
"# This is an example callbacks DAT for a ChucK Listener Operator.\n"
"# In all callback methods, \"listener\" is the ChucK Listener operator doing the callback.\n"
"\n\n"
"def getFloat(listener, name, val):\n"
Expand Down Expand Up @@ -322,7 +322,7 @@ ChucKListenerCHOP::execute(CHOP_Output* output,
PyObject* args = myNodeInfo->context->createArgumentsTuple(2, nullptr);
// The first argument is already set to the 'op' variable, so we set the second argument to our speed value
PyTuple_SET_ITEM(args, 1, PyUnicode_FromString(name));
PyTuple_SET_ITEM(args, 2, PyLong_FromDouble(val));
PyTuple_SET_ITEM(args, 2, PyFloat_FromDouble(val));


PyObject *result = myNodeInfo->context->callPythonCallback("getFloat", args, nullptr, nullptr);
Expand Down

0 comments on commit 8ae41bc

Please sign in to comment.