Skip to content
2 changes: 1 addition & 1 deletion apps/common-app/src/examples/DrumMachine/DrumMachine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const DrumMachine: React.FC = () => {
label="BPM"
step={1}
min={24}
max={1000}
max={1500}
value={bpm}
onValueChange={setBpm}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <audioapi/core/AudioParam.h>

#include <jsi/jsi.h>
#include <utility>
#include <memory>
#include <vector>
#include <cstddef>
Expand Down Expand Up @@ -81,12 +82,13 @@ class AudioParamHostObject : public JsiHostObject {

JSI_HOST_FUNCTION(setValueCurveAtTime) {
auto arrayBuffer = args[0].getObject(runtime).getPropertyAsObject(runtime, "buffer").getArrayBuffer(runtime);
auto values = reinterpret_cast<float *>(arrayBuffer.data(runtime));
auto rawValues = reinterpret_cast<float *>(arrayBuffer.data(runtime));
auto length = static_cast<int>(arrayBuffer.size(runtime));
auto values = std::make_unique<std::vector<float>>(rawValues, rawValues + length);

double startTime = args[1].getNumber();
double duration = args[2].getNumber();
param_->setValueCurveAtTime(values, length, startTime, duration);
param_->setValueCurveAtTime(std::move(values), length, startTime, duration);
return jsi::Value::undefined();
}

Expand Down
Loading