diff projects/heavy/samphold/HvContext_bbb.c @ 162:c3e8226a5651 heavy-updated

- added additional flags to C rules (-DNDEBUG, -mfpu=neon) - sample-accurate envelope triggering pd/heavy example
author chnrx <chris.heinrichs@gmail.com>
date Thu, 12 Nov 2015 14:59:46 +0000
parents 5bcf04234f80
children
line wrap: on
line diff
--- a/projects/heavy/samphold/HvContext_bbb.c	Thu Nov 05 19:27:44 2015 +0000
+++ b/projects/heavy/samphold/HvContext_bbb.c	Thu Nov 12 14:59:46 2015 +0000
@@ -39,21 +39,21 @@
 /*
  * Function Declarations
  */
-static void cBinop_62MLs_sendMessage(HvBase *, int, const HvMessage *const);
-static void cUnop_Rm4T9_sendMessage(HvBase *, int, const HvMessage *const);
-static void cRandom_Uxs9y_sendMessage(HvBase *, int, const HvMessage *const);
-static void cLoadbang_XJMP6_sendMessage(HvBase *, int, const HvMessage *const);
-static void cMsg_eMw6t_sendMessage(HvBase *, int, const HvMessage *const);
-static void cBinop_vHnCM_sendMessage(HvBase *, int, const HvMessage *const);
-static void cBinop_PmuD1_sendMessage(HvBase *, int, const HvMessage *const);
-static void cBinop_lT4qw_sendMessage(HvBase *, int, const HvMessage *const);
-static void cBinop_vpZDi_sendMessage(HvBase *, int, const HvMessage *const);
-static void cMsg_zpcIL_sendMessage(HvBase *, int, const HvMessage *const);
-static void cMsg_pfnj7_sendMessage(HvBase *, int, const HvMessage *const);
-static void cSystem_lJZJR_sendMessage(HvBase *, int, const HvMessage *const);
-static void cVar_cPxQc_sendMessage(HvBase *, int, const HvMessage *const);
-static void cBinop_1u9M5_sendMessage(HvBase *, int, const HvMessage *const);
-static void cLoadbang_AXnu9_sendMessage(HvBase *, int, const HvMessage *const);
+static void cMsg_5KHpJ_sendMessage(HvBase *, int, const HvMessage *const);
+static void cSystem_tEzb9_sendMessage(HvBase *, int, const HvMessage *const);
+static void cBinop_DXD3m_sendMessage(HvBase *, int, const HvMessage *const);
+static void cBinop_tyjup_sendMessage(HvBase *, int, const HvMessage *const);
+static void cMsg_QrCwu_sendMessage(HvBase *, int, const HvMessage *const);
+static void cBinop_iWcBL_sendMessage(HvBase *, int, const HvMessage *const);
+static void cBinop_6USpC_sendMessage(HvBase *, int, const HvMessage *const);
+static void cBinop_QuDfQ_sendMessage(HvBase *, int, const HvMessage *const);
+static void cLoadbang_0Dgs1_sendMessage(HvBase *, int, const HvMessage *const);
+static void cVar_lxt7X_sendMessage(HvBase *, int, const HvMessage *const);
+static void cMsg_qW1tH_sendMessage(HvBase *, int, const HvMessage *const);
+static void cLoadbang_bGFum_sendMessage(HvBase *, int, const HvMessage *const);
+static void cBinop_79eIJ_sendMessage(HvBase *, int, const HvMessage *const);
+static void cRandom_zn9Go_sendMessage(HvBase *, int, const HvMessage *const);
+static void cUnop_2Y2rq_sendMessage(HvBase *, int, const HvMessage *const);
 
 
 
@@ -99,24 +99,24 @@
   Base(_c)->name = "bbb";
 
   Base(_c)->numBytes = sizeof(Hv_bbb);
-  Base(_c)->numBytes += sVari_init(&_c->sVari_ecpIx, 0, 0, false);
-  Base(_c)->numBytes += sVarf_init(&_c->sVarf_VF9rD, 0.0f, 0.0f, false);
-  Base(_c)->numBytes += sVarf_init(&_c->sVarf_0bFmM, 0.0f, 0.0f, false);
-  Base(_c)->numBytes += sRPole_init(&_c->sRPole_WxgWS);
-  Base(_c)->numBytes += sPhasor_k_init(&_c->sPhasor_YcHM3, 880.0f, sampleRate);
-  Base(_c)->numBytes += sDel1_init(&_c->sDel1_FfVih);
-  Base(_c)->numBytes += sSamphold_init(&_c->sSamphold_hq9sm);
-  Base(_c)->numBytes += sPhasor_init(&_c->sPhasor_n1TcS, sampleRate);
-  Base(_c)->numBytes += cBinop_init(&_c->cBinop_62MLs, 8388610.0f); // __mul
-  Base(_c)->numBytes += cRandom_init(&_c->cRandom_Uxs9y, -1512500956);
-  Base(_c)->numBytes += cBinop_init(&_c->cBinop_vHnCM, 1.0f); // __min
-  Base(_c)->numBytes += cBinop_init(&_c->cBinop_PmuD1, 0.0f); // __max
-  Base(_c)->numBytes += cBinop_init(&_c->cBinop_lT4qw, 0.0f); // __mul
-  Base(_c)->numBytes += cVar_init_f(&_c->cVar_cPxQc, 1.0f);
+  Base(_c)->numBytes += sVari_init(&_c->sVari_9lqOg, 0, 0, false);
+  Base(_c)->numBytes += sVarf_init(&_c->sVarf_a6sNx, 0.0f, 0.0f, false);
+  Base(_c)->numBytes += sVarf_init(&_c->sVarf_l59CR, 0.0f, 0.0f, false);
+  Base(_c)->numBytes += sRPole_init(&_c->sRPole_ACVjc);
+  Base(_c)->numBytes += sPhasor_k_init(&_c->sPhasor_GKtI5, 880.0f, sampleRate);
+  Base(_c)->numBytes += sDel1_init(&_c->sDel1_OZ8Kl);
+  Base(_c)->numBytes += sSamphold_init(&_c->sSamphold_XcpkT);
+  Base(_c)->numBytes += sPhasor_init(&_c->sPhasor_6rvdw, sampleRate);
+  Base(_c)->numBytes += cBinop_init(&_c->cBinop_tyjup, 0.0f); // __mul
+  Base(_c)->numBytes += cBinop_init(&_c->cBinop_iWcBL, 0.0f); // __max
+  Base(_c)->numBytes += cBinop_init(&_c->cBinop_6USpC, 1.0f); // __min
+  Base(_c)->numBytes += cVar_init_f(&_c->cVar_lxt7X, 1.0f);
+  Base(_c)->numBytes += cBinop_init(&_c->cBinop_79eIJ, 8388610.0f); // __mul
+  Base(_c)->numBytes += cRandom_init(&_c->cRandom_zn9Go, 1159211063);
 
   // loadbang
-  ctx_scheduleMessage(Base(_c), msg_initWithBang(HV_MESSAGE_ON_STACK(1), 0), &cLoadbang_AXnu9_sendMessage, 0);
-  ctx_scheduleMessage(Base(_c), msg_initWithBang(HV_MESSAGE_ON_STACK(1), 0), &cLoadbang_XJMP6_sendMessage, 0);
+  ctx_scheduleMessage(Base(_c), msg_initWithBang(HV_MESSAGE_ON_STACK(1), 0), &cLoadbang_0Dgs1_sendMessage, 0);
+  ctx_scheduleMessage(Base(_c), msg_initWithBang(HV_MESSAGE_ON_STACK(1), 0), &cLoadbang_bGFum_sendMessage, 0);
 
   return _c;
 }
@@ -138,80 +138,80 @@
 /*
  * Static Function Implementation
  */
-static void cBinop_62MLs_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) {
-  cUnop_onMessage(_c, HV_UNOP_FLOOR, m, &cUnop_Rm4T9_sendMessage);
+static void cMsg_5KHpJ_sendMessage(HvBase *_c, int letIn, const HvMessage *const n) {
+  HvMessage *m = NULL;
+  m = HV_MESSAGE_ON_STACK(1);
+  msg_init(m, 1, msg_getTimestamp(n));
+  msg_setSymbol(m, 0, "samplerate");
+  cSystem_onMessage(_c, NULL, 0, m, &cSystem_tEzb9_sendMessage);
 }
 
-static void cUnop_Rm4T9_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) {
-  cMsg_eMw6t_sendMessage(_c, 0, m);
+static void cSystem_tEzb9_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) {
+  cMsg_QrCwu_sendMessage(_c, 0, m);
 }
 
-static void cRandom_Uxs9y_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) {
-  cBinop_onMessage(_c, &Context(_c)->cBinop_62MLs, HV_BINOP_MULTIPLY, 0, m, &cBinop_62MLs_sendMessage);
+static void cBinop_DXD3m_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) {
+  cBinop_onMessage(_c, &Context(_c)->cBinop_tyjup, HV_BINOP_MULTIPLY, 1, m, &cBinop_tyjup_sendMessage);
 }
 
-static void cLoadbang_XJMP6_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) {
-  cRandom_onMessage(_c, &Context(_c)->cRandom_Uxs9y, 0, m, &cRandom_Uxs9y_sendMessage);
+static void cBinop_tyjup_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) {
+  cBinop_onMessage(_c, &Context(_c)->cBinop_6USpC, HV_BINOP_MIN, 0, m, &cBinop_6USpC_sendMessage);
 }
 
-static void cMsg_eMw6t_sendMessage(HvBase *_c, int letIn, const HvMessage *const n) {
+static void cMsg_QrCwu_sendMessage(HvBase *_c, int letIn, const HvMessage *const n) {
+  HvMessage *m = NULL;
+  m = HV_MESSAGE_ON_STACK(2);
+  msg_init(m, 2, msg_getTimestamp(n));
+  msg_setFloat(m, 0, 6.28319f);
+  msg_setElementToFrom(m, 1, n, 0);
+  cBinop_k_onMessage(_c, NULL, HV_BINOP_DIVIDE, 0.0f, 0, m, &cBinop_DXD3m_sendMessage);
+}
+
+static void cBinop_iWcBL_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) {
+  cBinop_k_onMessage(_c, NULL, HV_BINOP_SUBTRACT, 1.0f, 0, m, &cBinop_QuDfQ_sendMessage);
+  sVarf_onMessage(_c, &Context(_c)->sVarf_a6sNx, m);
+}
+
+static void cBinop_6USpC_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) {
+  cBinop_onMessage(_c, &Context(_c)->cBinop_iWcBL, HV_BINOP_MAX, 0, m, &cBinop_iWcBL_sendMessage);
+}
+
+static void cBinop_QuDfQ_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) {
+  sVarf_onMessage(_c, &Context(_c)->sVarf_l59CR, m);
+}
+
+static void cLoadbang_0Dgs1_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) {
+  cMsg_5KHpJ_sendMessage(_c, 0, m);
+  cVar_onMessage(_c, &Context(_c)->cVar_lxt7X, 0, m, &cVar_lxt7X_sendMessage);
+}
+
+static void cVar_lxt7X_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) {
+  cBinop_onMessage(_c, &Context(_c)->cBinop_tyjup, HV_BINOP_MULTIPLY, 0, m, &cBinop_tyjup_sendMessage);
+}
+
+static void cMsg_qW1tH_sendMessage(HvBase *_c, int letIn, const HvMessage *const n) {
   HvMessage *m = NULL;
   m = HV_MESSAGE_ON_STACK(2);
   msg_init(m, 2, msg_getTimestamp(n));
   msg_setElementToFrom(m, 0, n, 0);
   msg_setFloat(m, 1, 1.0f);
-  sVari_onMessage(_c, &Context(_c)->sVari_ecpIx, m);
+  sVari_onMessage(_c, &Context(_c)->sVari_9lqOg, m);
 }
 
-static void cBinop_vHnCM_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) {
-  cBinop_onMessage(_c, &Context(_c)->cBinop_PmuD1, HV_BINOP_MAX, 0, m, &cBinop_PmuD1_sendMessage);
+static void cLoadbang_bGFum_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) {
+  cRandom_onMessage(_c, &Context(_c)->cRandom_zn9Go, 0, m, &cRandom_zn9Go_sendMessage);
 }
 
-static void cBinop_PmuD1_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) {
-  cBinop_k_onMessage(_c, NULL, HV_BINOP_SUBTRACT, 1.0f, 0, m, &cBinop_1u9M5_sendMessage);
-  sVarf_onMessage(_c, &Context(_c)->sVarf_VF9rD, m);
+static void cBinop_79eIJ_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) {
+  cUnop_onMessage(_c, HV_UNOP_FLOOR, m, &cUnop_2Y2rq_sendMessage);
 }
 
-static void cBinop_lT4qw_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) {
-  cBinop_onMessage(_c, &Context(_c)->cBinop_vHnCM, HV_BINOP_MIN, 0, m, &cBinop_vHnCM_sendMessage);
+static void cRandom_zn9Go_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) {
+  cBinop_onMessage(_c, &Context(_c)->cBinop_79eIJ, HV_BINOP_MULTIPLY, 0, m, &cBinop_79eIJ_sendMessage);
 }
 
-static void cBinop_vpZDi_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) {
-  cBinop_onMessage(_c, &Context(_c)->cBinop_lT4qw, HV_BINOP_MULTIPLY, 1, m, &cBinop_lT4qw_sendMessage);
-}
-
-static void cMsg_zpcIL_sendMessage(HvBase *_c, int letIn, const HvMessage *const n) {
-  HvMessage *m = NULL;
-  m = HV_MESSAGE_ON_STACK(2);
-  msg_init(m, 2, msg_getTimestamp(n));
-  msg_setFloat(m, 0, 6.28319f);
-  msg_setElementToFrom(m, 1, n, 0);
-  cBinop_k_onMessage(_c, NULL, HV_BINOP_DIVIDE, 0.0f, 0, m, &cBinop_vpZDi_sendMessage);
-}
-
-static void cMsg_pfnj7_sendMessage(HvBase *_c, int letIn, const HvMessage *const n) {
-  HvMessage *m = NULL;
-  m = HV_MESSAGE_ON_STACK(1);
-  msg_init(m, 1, msg_getTimestamp(n));
-  msg_setSymbol(m, 0, "samplerate");
-  cSystem_onMessage(_c, NULL, 0, m, &cSystem_lJZJR_sendMessage);
-}
-
-static void cSystem_lJZJR_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) {
-  cMsg_zpcIL_sendMessage(_c, 0, m);
-}
-
-static void cVar_cPxQc_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) {
-  cBinop_onMessage(_c, &Context(_c)->cBinop_lT4qw, HV_BINOP_MULTIPLY, 0, m, &cBinop_lT4qw_sendMessage);
-}
-
-static void cBinop_1u9M5_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) {
-  sVarf_onMessage(_c, &Context(_c)->sVarf_0bFmM, m);
-}
-
-static void cLoadbang_AXnu9_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) {
-  cMsg_pfnj7_sendMessage(_c, 0, m);
-  cVar_onMessage(_c, &Context(_c)->cVar_cPxQc, 0, m, &cVar_cPxQc_sendMessage);
+static void cUnop_2Y2rq_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) {
+  cMsg_qW1tH_sendMessage(_c, 0, m);
 }
 
 
@@ -252,24 +252,24 @@
     __hv_zero_f(VOf(O1));
 
     // process all signal functions
-    __hv_var_i(&_c->sVari_ecpIx, VOi(Bi0));
+    __hv_var_i(&_c->sVari_9lqOg, VOi(Bi0));
     __hv_var_k_i(VOi(Bi1), 16807, 16807, 16807, 16807, 16807, 16807, 16807, 16807, 0);
     __hv_mul_i(VIi(Bi0), VIi(Bi1), VOi(Bi1));
+    sVarseti_process(&_c->sVari_9lqOg, VIi(Bi1));
     __hv_cast_if(VIi(Bi1), VOf(Bf0));
     __hv_var_k_f(VOf(Bf1), 4.65661e-10f, 4.65661e-10f, 4.65661e-10f, 4.65661e-10f, 4.65661e-10f, 4.65661e-10f, 4.65661e-10f, 4.65661e-10f, 0);
     __hv_mul_f(VIf(Bf0), VIf(Bf1), VOf(Bf1));
-    sVarseti_process(&_c->sVari_ecpIx, VIi(Bi1));
-    __hv_var_f(&_c->sVarf_VF9rD, VOf(Bf0));
+    __hv_var_f(&_c->sVarf_a6sNx, VOf(Bf0));
     __hv_mul_f(VIf(Bf1), VIf(Bf0), VOf(Bf0));
-    __hv_var_f(&_c->sVarf_0bFmM, VOf(Bf1));
-    __hv_rpole_f(&_c->sRPole_WxgWS, VIf(Bf0), VIf(Bf1), VOf(Bf1));
+    __hv_var_f(&_c->sVarf_l59CR, VOf(Bf1));
+    __hv_rpole_f(&_c->sRPole_ACVjc, VIf(Bf0), VIf(Bf1), VOf(Bf1));
     __hv_var_k_f(VOf(Bf0), 1000000.0f, 1000000.0f, 1000000.0f, 1000000.0f, 1000000.0f, 1000000.0f, 1000000.0f, 1000000.0f, 0);
     __hv_mul_f(VIf(Bf1), VIf(Bf0), VOf(Bf0));
-    __hv_phasor_k_f(&_c->sPhasor_YcHM3, VOf(Bf1));
-    __hv_del1_f(&_c->sDel1_FfVih, VIf(Bf1), VOf(Bf2));
+    __hv_phasor_k_f(&_c->sPhasor_GKtI5, VOf(Bf1));
+    __hv_del1_f(&_c->sDel1_OZ8Kl, VIf(Bf1), VOf(Bf2));
     __hv_lt_f(VIf(Bf1), VIf(Bf2), VOf(Bf2));
-    __hv_samphold_f(&_c->sSamphold_hq9sm, VIf(Bf0), VIf(Bf2), VOf(Bf2));
-    __hv_phasor_f(&_c->sPhasor_n1TcS, VIf(Bf2), VOf(Bf2));
+    __hv_samphold_f(&_c->sSamphold_XcpkT, VIf(Bf0), VIf(Bf2), VOf(Bf2));
+    __hv_phasor_f(&_c->sPhasor_6rvdw, VIf(Bf2), VOf(Bf2));
     __hv_var_k_f(VOf(Bf0), 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0);
     __hv_sub_f(VIf(Bf2), VIf(Bf0), VOf(Bf0));
     __hv_abs_f(VIf(Bf0), VOf(Bf0));