Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some fixes #20

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions generators/ir2c/static/HvLightPipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
#define hv_sfence() _mm_sfence()
#elif __arm__ || HV_SIMD_NEON
#if __ARM_ACLE
#ifdef __clang__
// this is defined by Xenomai's compiler.h and it causes
// troubles when including the below, where it is defined as a function
#undef __clz
#endif /* __clang_ */

#include <arm_acle.h>
// https://msdn.microsoft.com/en-us/library/hh875058.aspx#BarrierRestrictions
// http://doxygen.reactos.org/d8/d47/armintr_8h_a02be7ec76ca51842bc90d9b466b54752.html
Expand Down
12 changes: 12 additions & 0 deletions generators/ir2c/templates/Heavy_NAME.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#ifndef _HEAVY_CONTEXT_{{name|upper}}_HPP_
#define _HEAVY_CONTEXT_{{name|upper}}_HPP_

#include <new> // for std::bad_alloc
// object includes
#include "HeavyContext.hpp"
{%- for i in include_set %}
Expand All @@ -15,6 +16,17 @@ class Heavy_{{name}} : public HeavyContext {
Heavy_{{name}}(double sampleRate, int poolKb=10, int inQueueKb=2, int outQueueKb=0);
~Heavy_{{name}}();

// ensure desired alignment is achieved even for heap allocation
void* operator new(size_t sz) {
printf("alignment: %d\n", alignof(Heavy_{{name}}));
auto ptr = aligned_alloc(alignof(Heavy_{{name}}), sz);
if(!ptr)
{
std::bad_alloc e;
throw(e);
}
return ptr;
}
const char *getName() override { return "{{name}}"; }
int getNumInputChannels() override { return {{signal.numInputBuffers}}; }
int getNumOutputChannels() override { return {{signal.numOutputBuffers}}; }
Expand Down
16 changes: 8 additions & 8 deletions interpreters/pd2hv/libs/pd/bendout.pd
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#N canvas 1122 327 232 295 10;
#N canvas 1048 327 232 295 10;
#X obj 52 201 pack f f;
#X obj 97 74 inlet channel;
#X obj 97 146 f \$1;
#X obj 97 168 clip 0 15;
#X obj 114 106 loadbang;
#X obj 52 233 s __hv_bendout;
#X obj 52 233 s __hv_bendout @hv_param;
#X obj 52 40 inlet bend;
#X connect 0 0 5 0;
#X obj 97 168 - 1;
#X connect 0 0 4 0;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 3 0 0 1;
#X connect 4 0 2 0;
#X connect 6 0 0 0;
#X connect 2 0 6 0;
#X connect 3 0 2 0;
#X connect 5 0 0 0;
#X connect 6 0 0 1;
20 changes: 10 additions & 10 deletions interpreters/pd2hv/libs/pd/ctlout.pd
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#N canvas 1436 214 309 367 10;
#N canvas 971 214 309 367 10;
#X obj 59 267 pack f f f;
#X obj 155 76 loadbang;
#X obj 116 156 inlet channel;
#X obj 59 299 s __hv_ctlout;
#X obj 59 299 s __hv_ctlout @hv_param;
#X obj 59 46 inlet value;
#X obj 116 203 f \$2;
#X obj 87 76 inlet cc;
#X obj 116 225 clip 0 15;
#X obj 87 118 f \$1;
#X obj 155 98 t b b;
#X obj 116 225 - 1;
#X connect 0 0 3 0;
#X connect 1 0 9 0;
#X connect 1 0 8 0;
#X connect 2 0 5 0;
#X connect 4 0 0 0;
#X connect 5 0 7 0;
#X connect 6 0 8 0;
#X connect 7 0 0 2;
#X connect 8 0 0 1;
#X connect 9 0 8 0;
#X connect 9 1 5 0;
#X connect 5 0 9 0;
#X connect 6 0 7 0;
#X connect 7 0 0 1;
#X connect 8 0 7 0;
#X connect 8 1 5 0;
#X connect 9 0 0 2;
6 changes: 3 additions & 3 deletions interpreters/pd2hv/libs/pd/noteout.pd
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#N canvas 1122 327 278 331 10;
#N canvas 1002 327 278 331 10;
#X obj 59 217 pack f f f;
#X obj 59 249 s __hv_noteout;
#X obj 59 249 s __hv_noteout @hv_param;
#X obj 59 46 inlet note;
#X obj 87 76 inlet vel;
#X obj 126 133 loadbang;
#X obj 116 163 f \$1;
#X obj 116 106 inlet channel;
#X obj 116 185 clip 0 16;
#X obj 116 185 - 1;
#X connect 0 0 1 0;
#X connect 2 0 0 0;
#X connect 3 0 0 1;
Expand Down
14 changes: 7 additions & 7 deletions interpreters/pd2hv/libs/pd/pgmout.pd
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#N canvas 1122 327 232 295 10;
#X obj 52 233 s __hv_pgmout;
#N canvas 1048 327 232 295 10;
#X obj 52 233 s __hv_pgmout @hv_param;
#X obj 52 201 pack f f;
#X obj 97 74 inlet channel;
#X obj 97 146 f \$1;
#X obj 97 168 clip 0 15;
#X obj 114 106 loadbang;
#X obj 52 40 inlet program;
#X obj 97 168 - 1;
#X connect 1 0 0 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 4 0 1 1;
#X connect 5 0 3 0;
#X connect 6 0 1 0;
#X connect 3 0 6 0;
#X connect 4 0 3 0;
#X connect 5 0 1 0;
#X connect 6 0 1 1;
16 changes: 8 additions & 8 deletions interpreters/pd2hv/libs/pd/touchout.pd
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#N canvas 1122 327 232 295 10;
#N canvas 1048 327 232 295 10;
#X obj 52 201 pack f f;
#X obj 97 74 inlet channel;
#X obj 97 146 f \$1;
#X obj 97 168 clip 0 15;
#X obj 114 106 loadbang;
#X obj 52 40 inlet touch;
#X obj 52 233 s __hv_touchout;
#X connect 0 0 6 0;
#X obj 52 233 s __hv_touchout @hv_param;
#X obj 97 168 - 1;
#X connect 0 0 5 0;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 3 0 0 1;
#X connect 4 0 2 0;
#X connect 5 0 0 0;
#X connect 2 0 6 0;
#X connect 3 0 2 0;
#X connect 4 0 0 0;
#X connect 6 0 0 1;