Mercurial > hg > beaglert
view projects/heavy/envelopeTrigger/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 | |
children |
line wrap: on
line source
/** * Copyright (c) 2014,2015 Enzien Audio, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, and/or * sublicense copies of the Software, strictly on a non-commercial basis, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * DO NOT MODIFY. THIS CODE IS MACHINE GENERATED BY THE SECTION6 HEAVY COMPILER. */ /* * System Includes */ #include <assert.h> #include <math.h> #include <string.h> #include <stdarg.h> #include "HvContext_bbb.h" #include "HeavyMath.h" /* * Function Declarations */ static const float hTable_Pcegq_data[512] = {0.0f, 0.0625f, 0.0883883f, 0.108253f, 0.125f, 0.139754f, 0.153093f, 0.165359f, 0.176777f, 0.1875f, 0.197642f, 0.207289f, 0.216506f, 0.225347f, 0.233854f, 0.242061f, 0.25f, 0.257694f, 0.265165f, 0.272431f, 0.279509f, 0.286411f, 0.293151f, 0.299739f, 0.306186f, 0.3125f, 0.318689f, 0.32476f, 0.330719f, 0.336573f, 0.342327f, 0.347985f, 0.353553f, 0.359035f, 0.364434f, 0.369755f, 0.375f, 0.380173f, 0.385276f, 0.390312f, 0.395285f, 0.400195f, 0.405046f, 0.40984f, 0.414578f, 0.419263f, 0.423896f, 0.428478f, 0.433013f, 0.4375f, 0.441942f, 0.446339f, 0.450694f, 0.455007f, 0.459279f, 0.463512f, 0.467707f, 0.471865f, 0.475986f, 0.480072f, 0.484123f, 0.488141f, 0.492125f, 0.496078f, 0.5f, 0.503891f, 0.507752f, 0.511585f, 0.515388f, 0.519164f, 0.522913f, 0.526634f, 0.53033f, 0.534f, 0.537645f, 0.541266f, 0.544862f, 0.548435f, 0.551985f, 0.555512f, 0.559017f, 0.5625f, 0.565962f, 0.569402f, 0.572822f, 0.576222f, 0.579601f, 0.582961f, 0.586302f, 0.589624f, 0.592927f, 0.596212f, 0.599479f, 0.602728f, 0.60596f, 0.609175f, 0.612372f, 0.615554f, 0.618718f, 0.621867f, 0.625f, 0.628117f, 0.631219f, 0.634306f, 0.637377f, 0.640434f, 0.643477f, 0.646505f, 0.649519f, 0.652519f, 0.655506f, 0.658478f, 0.661438f, 0.664384f, 0.667317f, 0.670238f, 0.673146f, 0.676041f, 0.678924f, 0.681795f, 0.684653f, 0.6875f, 0.690335f, 0.693159f, 0.695971f, 0.698771f, 0.701561f, 0.704339f, 0.707107f, 0.709864f, 0.71261f, 0.715345f, 0.71807f, 0.720785f, 0.72349f, 0.726184f, 0.728869f, 0.731544f, 0.734209f, 0.736864f, 0.73951f, 0.742146f, 0.744773f, 0.747391f, 0.75f, 0.7526f, 0.75519f, 0.757772f, 0.760345f, 0.76291f, 0.765466f, 0.768013f, 0.770552f, 0.773082f, 0.775605f, 0.778119f, 0.780625f, 0.783123f, 0.785613f, 0.788095f, 0.790569f, 0.793036f, 0.795495f, 0.797947f, 0.800391f, 0.802827f, 0.805256f, 0.807678f, 0.810093f, 0.8125f, 0.8149f, 0.817294f, 0.81968f, 0.822059f, 0.824432f, 0.826797f, 0.829156f, 0.831508f, 0.833854f, 0.836193f, 0.838525f, 0.840851f, 0.843171f, 0.845484f, 0.847791f, 0.850092f, 0.852386f, 0.854675f, 0.856957f, 0.859233f, 0.861503f, 0.863767f, 0.866025f, 0.868278f, 0.870524f, 0.872765f, 0.875f, 0.877229f, 0.879453f, 0.881671f, 0.883883f, 0.88609f, 0.888292f, 0.890488f, 0.892679f, 0.894864f, 0.897044f, 0.899218f, 0.901388f, 0.903552f, 0.905711f, 0.907865f, 0.910014f, 0.912157f, 0.914296f, 0.91643f, 0.918559f, 0.920682f, 0.922801f, 0.924916f, 0.927025f, 0.929129f, 0.931229f, 0.933324f, 0.935414f, 0.9375f, 0.939581f, 0.941657f, 0.943729f, 0.945797f, 0.947859f, 0.949918f, 0.951972f, 0.954021f, 0.956066f, 0.958107f, 0.960143f, 0.962175f, 0.964203f, 0.966227f, 0.968246f, 0.970261f, 0.972272f, 0.974279f, 0.976281f, 0.97828f, 0.980274f, 0.982265f, 0.984251f, 0.986233f, 0.988212f, 0.990186f, 0.992157f, 0.994123f, 0.996086f, 0.998045f, 1.0f, 0.992172f, 0.984375f, 0.976609f, 0.968874f, 0.961169f, 0.953495f, 0.945852f, 0.938239f, 0.930657f, 0.923106f, 0.915586f, 0.908097f, 0.900638f, 0.89321f, 0.885813f, 0.878447f, 0.871111f, 0.863806f, 0.856532f, 0.849289f, 0.842076f, 0.834894f, 0.827743f, 0.820623f, 0.813533f, 0.806474f, 0.799446f, 0.792449f, 0.785483f, 0.778547f, 0.771642f, 0.764767f, 0.757924f, 0.751111f, 0.744329f, 0.737578f, 0.730857f, 0.724168f, 0.717509f, 0.71088f, 0.704283f, 0.697716f, 0.69118f, 0.684675f, 0.678201f, 0.671757f, 0.665344f, 0.658962f, 0.652611f, 0.64629f, 0.64f, 0.633741f, 0.627513f, 0.621315f, 0.615148f, 0.609012f, 0.602907f, 0.596832f, 0.590788f, 0.584775f, 0.578793f, 0.572841f, 0.56692f, 0.56103f, 0.555171f, 0.549343f, 0.543545f, 0.537778f, 0.532041f, 0.526336f, 0.520661f, 0.515017f, 0.509404f, 0.503822f, 0.49827f, 0.492749f, 0.487259f, 0.481799f, 0.476371f, 0.470973f, 0.465605f, 0.460269f, 0.454963f, 0.449689f, 0.444444f, 0.439231f, 0.434048f, 0.428897f, 0.423775f, 0.418685f, 0.413625f, 0.408597f, 0.403599f, 0.398631f, 0.393695f, 0.388789f, 0.383914f, 0.37907f, 0.374256f, 0.369473f, 0.364721f, 0.36f, 0.355309f, 0.35065f, 0.346021f, 0.341423f, 0.336855f, 0.332318f, 0.327812f, 0.323337f, 0.318893f, 0.314479f, 0.310096f, 0.305744f, 0.301423f, 0.297132f, 0.292872f, 0.288643f, 0.284444f, 0.280277f, 0.27614f, 0.272034f, 0.267958f, 0.263914f, 0.2599f, 0.255917f, 0.251965f, 0.248043f, 0.244152f, 0.240292f, 0.236463f, 0.232664f, 0.228897f, 0.22516f, 0.221453f, 0.217778f, 0.214133f, 0.210519f, 0.206936f, 0.203383f, 0.199862f, 0.196371f, 0.19291f, 0.189481f, 0.186082f, 0.182714f, 0.179377f, 0.176071f, 0.172795f, 0.16955f, 0.166336f, 0.163153f, 0.16f, 0.156878f, 0.153787f, 0.150727f, 0.147697f, 0.144698f, 0.14173f, 0.138793f, 0.135886f, 0.13301f, 0.130165f, 0.127351f, 0.124567f, 0.121815f, 0.119093f, 0.116401f, 0.113741f, 0.111111f, 0.108512f, 0.105944f, 0.103406f, 0.1009f, 0.0984237f, 0.0959785f, 0.093564f, 0.0911803f, 0.0888274f, 0.0865052f, 0.0842138f, 0.0819531f, 0.0797232f, 0.077524f, 0.0753556f, 0.073218f, 0.0711111f, 0.069035f, 0.0669896f, 0.064975f, 0.0629911f, 0.0610381f, 0.0591157f, 0.0572241f, 0.0553633f, 0.0535332f, 0.0517339f, 0.0499654f, 0.0482276f, 0.0465206f, 0.0448443f, 0.0431988f, 0.041584f, 0.04f, 0.0384467f, 0.0369243f, 0.0354325f, 0.0339715f, 0.0325413f, 0.0311419f, 0.0297732f, 0.0284352f, 0.027128f, 0.0258516f, 0.0246059f, 0.023391f, 0.0222068f, 0.0210534f, 0.0199308f, 0.0188389f, 0.0177778f, 0.0167474f, 0.0157478f, 0.0147789f, 0.0138408f, 0.0129335f, 0.0120569f, 0.0112111f, 0.010396f, 0.00961169f, 0.00885813f, 0.00813533f, 0.00744329f, 0.00678201f, 0.00615148f, 0.00555171f, 0.0049827f, 0.00444444f, 0.00393695f, 0.00346021f, 0.00301423f, 0.002599f, 0.00221453f, 0.00186082f, 0.00153787f, 0.00124567f, 0.000984237f, 0.000753556f, 0.000553633f, 0.000384467f, 0.000246059f, 0.000138408f, 6.15148e-05f, 1.53787e-05f, 0.0f}; static void cVar_rLv9w_sendMessage(HvBase *, int, const HvMessage *const); static void cSystem_tp4VA_sendMessage(HvBase *, int, const HvMessage *const); static void cVar_rQhd0_sendMessage(HvBase *, int, const HvMessage *const); static void cSlice_LzkmO_sendMessage(HvBase *, int, const HvMessage *const); static void cSwitchcase_y60Gw_onMessage(HvBase *, void *, int letIn, const HvMessage *const, void *); static void cLoadbang_TuCQI_sendMessage(HvBase *, int, const HvMessage *const); static void cBinop_ER1x8_sendMessage(HvBase *, int, const HvMessage *const); static void cMsg_oCnjm_sendMessage(HvBase *, int, const HvMessage *const); static void cSlice_HqIeY_sendMessage(HvBase *, int, const HvMessage *const); static void cVar_BTo3t_sendMessage(HvBase *, int, const HvMessage *const); static void cVar_ZzlGn_sendMessage(HvBase *, int, const HvMessage *const); static void cBinop_HqDsI_sendMessage(HvBase *, int, const HvMessage *const); static void cSwitchcase_EV1Bl_onMessage(HvBase *, void *, int letIn, const HvMessage *const, void *); static void cLoadbang_nVUh2_sendMessage(HvBase *, int, const HvMessage *const); static void cSystem_jIjhB_sendMessage(HvBase *, int, const HvMessage *const); static void cMsg_En77U_sendMessage(HvBase *, int, const HvMessage *const); static void cMsg_IbQ3q_sendMessage(HvBase *, int, const HvMessage *const); static void cSystem_zz1F7_sendMessage(HvBase *, int, const HvMessage *const); static void cBinop_oOwFV_sendMessage(HvBase *, int, const HvMessage *const); static void cBinop_P09tj_sendMessage(HvBase *, int, const HvMessage *const); static void cVar_NnTc2_sendMessage(HvBase *, int, const HvMessage *const); static void cLoadbang_2QoTi_sendMessage(HvBase *, int, const HvMessage *const); static void cBinop_f8PBr_sendMessage(HvBase *, int, const HvMessage *const); static void cMsg_qocid_sendMessage(HvBase *, int, const HvMessage *const); static void cBinop_ITJR9_sendMessage(HvBase *, int, const HvMessage *const); static void cUnop_nBNe2_sendMessage(HvBase *, int, const HvMessage *const); static void cSystem_ZnUnS_sendMessage(HvBase *, int, const HvMessage *const); static void cMsg_FhRde_sendMessage(HvBase *, int, const HvMessage *const); static void cBinop_cxljx_sendMessage(HvBase *, int, const HvMessage *const); static void cBinop_0UlVT_sendMessage(HvBase *, int, const HvMessage *const); static void cBinop_MJQIs_sendMessage(HvBase *, int, const HvMessage *const); static void cMsg_xzUtJ_sendMessage(HvBase *, int, const HvMessage *const); static void cBinop_a2rE6_sendMessage(HvBase *, int, const HvMessage *const); static void cBinop_govla_sendMessage(HvBase *, int, const HvMessage *const); static void cSlice_oxbrV_sendMessage(HvBase *, int, const HvMessage *const); static void cBinop_rzeQ2_sendMessage(HvBase *, int, const HvMessage *const); static void cSlice_yZctV_sendMessage(HvBase *, int, const HvMessage *const); static void cSlice_HCNcS_sendMessage(HvBase *, int, const HvMessage *const); static void cVar_ItOCU_sendMessage(HvBase *, int, const HvMessage *const); static void cSlice_Nx0UC_sendMessage(HvBase *, int, const HvMessage *const); static void cLoadbang_4O9oF_sendMessage(HvBase *, int, const HvMessage *const); static void cVar_VE9tg_sendMessage(HvBase *, int, const HvMessage *const); static void cBinop_RE1w0_sendMessage(HvBase *, int, const HvMessage *const); static void cSlice_Pkd46_sendMessage(HvBase *, int, const HvMessage *const); static void cLoadbang_KAaax_sendMessage(HvBase *, int, const HvMessage *const); /* * Static Helper Functions */ static void ctx_intern_scheduleMessageForReceiver( HvBase *const _c, const char *name, HvMessage *m) { switch (msg_symbolToHash(name)) { default: return; } } static struct HvTable *ctx_intern_getTableForHash(HvBase *const _c, hv_uint32_t h) { switch (h) { case 0xB6D0D974: return &Context(_c)->hTable_Pcegq; // env1 default: return NULL; } } /* * Context Include and Implementatons */ Hv_bbb *hv_bbb_new_with_pool(double sampleRate, int poolKb) { hv_assert(sampleRate > 0.0); // can't initialise with sampling rate of 0 hv_assert(poolKb >= 1); // a message pool of some reasonable size is always needed Hv_bbb *const _c = (Hv_bbb *) hv_malloc(sizeof(Hv_bbb)); Base(_c)->numInputChannels = 10; Base(_c)->numOutputChannels = 2; Base(_c)->sampleRate = sampleRate; Base(_c)->blockStartTimestamp = 0; Base(_c)->f_scheduleMessageForReceiver = &ctx_intern_scheduleMessageForReceiver; Base(_c)->f_getTableForHash = &ctx_intern_getTableForHash; mq_initWithPoolSize(&Base(_c)->mq, poolKb); Base(_c)->basePath = NULL; Base(_c)->printHook = NULL; Base(_c)->sendHook = NULL; Base(_c)->userData = NULL; Base(_c)->name = "bbb"; Base(_c)->numBytes = sizeof(Hv_bbb); Base(_c)->numBytes += sVarf_init(&_c->sVarf_DIQHM, 1.0f, 0.0f, false); Base(_c)->numBytes += sVarf_init(&_c->sVarf_EIzJc, 44100.0f, 0.0f, false); Base(_c)->numBytes += sVarf_init(&_c->sVarf_J0BAW, 0.0f, 0.0f, false); Base(_c)->numBytes += sRPole_init(&_c->sRPole_vtJYw); Base(_c)->numBytes += sVarf_init(&_c->sVarf_haFXq, 1.0f, 0.0f, false); Base(_c)->numBytes += sDel1_init(&_c->sDel1_8dkfF); Base(_c)->numBytes += sVarf_init(&_c->sVarf_4RU63, 0.0f, 0.0f, false); Base(_c)->numBytes += sVarf_init(&_c->sVarf_5BIjv, 0.0f, 0.0f, false); Base(_c)->numBytes += sVarf_init(&_c->sVarf_82QyC, -1e-37f, 0.0f, false); Base(_c)->numBytes += sBiquad_k_init(&_c->sBiquad_k_8Keaz, -1.0f, 1.0f, 0.0f, 0.0f, 0.0f); Base(_c)->numBytes += sVarf_init(&_c->sVarf_2muG8, 0.5f, 0.0f, false); Base(_c)->numBytes += sVarf_init(&_c->sVarf_YrcAl, 0.0f, 0.0f, false); Base(_c)->numBytes += sVarf_init(&_c->sVarf_1pbLN, -1e-37f, 0.0f, false); Base(_c)->numBytes += sRPole_init(&_c->sRPole_Q5SA1); Base(_c)->numBytes += sVarf_init(&_c->sVarf_ZTuE8, 1.0f, 0.0f, false); Base(_c)->numBytes += sVarf_init(&_c->sVarf_9Q4iz, 0.0f, 0.0f, false); Base(_c)->numBytes += sVarf_init(&_c->sVarf_QHeut, 1.0f, 0.0f, false); Base(_c)->numBytes += sVarf_init(&_c->sVarf_BWg3y, 100000.0f, 0.0f, false); Base(_c)->numBytes += sVarf_init(&_c->sVarf_yW7Co, 1e-05f, 0.0f, false); Base(_c)->numBytes += sVarf_init(&_c->sVarf_BMuCC, 0.0f, 0.0f, false); Base(_c)->numBytes += sVarf_init(&_c->sVarf_1vLiI, 0.0f, 0.0f, false); Base(_c)->numBytes += sVarf_init(&_c->sVarf_ZKIZB, 0.0f, 0.0f, false); Base(_c)->numBytes += sVarf_init(&_c->sVarf_SmDJi, 0.0f, 0.0f, false); Base(_c)->numBytes += sTabread_init(&_c->sTabread_ef8Y2, &_c->hTable_Pcegq, false); Base(_c)->numBytes += sVarf_init(&_c->sVarf_Z1CfH, 0.0f, 0.0f, false); Base(_c)->numBytes += sTabread_init(&_c->sTabread_nnJuj, &_c->hTable_Pcegq, false); Base(_c)->numBytes += sVarf_init(&_c->sVarf_CwdRa, 0.0f, 0.0f, false); Base(_c)->numBytes += sVarf_init(&_c->sVarf_z5YqL, 0.0f, 0.0f, false); Base(_c)->numBytes += sVarf_init(&_c->sVarf_AMYc1, 0.0f, 0.0f, false); Base(_c)->numBytes += sVarf_init(&_c->sVarf_yGh3v, 0.0f, 0.0f, false); Base(_c)->numBytes += sVarf_init(&_c->sVarf_ThV6W, 0.0f, 0.0f, false); Base(_c)->numBytes += sVarf_init(&_c->sVarf_U0HuI, 0.0f, 0.0f, false); Base(_c)->numBytes += sTabread_init(&_c->sTabread_g0gGp, &_c->hTable_Pcegq, false); Base(_c)->numBytes += sVarf_init(&_c->sVarf_rLY2o, 0.0f, 0.0f, false); Base(_c)->numBytes += sTabread_init(&_c->sTabread_joe74, &_c->hTable_Pcegq, false); Base(_c)->numBytes += sVarf_init(&_c->sVarf_tTp9Q, 0.0f, 0.0f, false); Base(_c)->numBytes += sVarf_init(&_c->sVarf_Ip7Ud, 0.0f, 0.0f, false); Base(_c)->numBytes += sPhasor_init(&_c->sPhasor_KqGIr, sampleRate); Base(_c)->numBytes += hTable_initWithData(&_c->hTable_Pcegq, 512, hTable_Pcegq_data); Base(_c)->numBytes += cVar_init_s(&_c->cVar_rLv9w, "env1"); Base(_c)->numBytes += cVar_init_f(&_c->cVar_rQhd0, 0.0f); Base(_c)->numBytes += cSlice_init(&_c->cSlice_LzkmO, 1, 1); Base(_c)->numBytes += cSlice_init(&_c->cSlice_HqIeY, 1, 1); Base(_c)->numBytes += cVar_init_s(&_c->cVar_BTo3t, "env1"); Base(_c)->numBytes += cVar_init_f(&_c->cVar_ZzlGn, 0.0f); Base(_c)->numBytes += cVar_init_f(&_c->cVar_NnTc2, 1.0f); Base(_c)->numBytes += cBinop_init(&_c->cBinop_ITJR9, 0.0f); // __div Base(_c)->numBytes += cBinop_init(&_c->cBinop_cxljx, 0.0f); // __mul Base(_c)->numBytes += cBinop_init(&_c->cBinop_0UlVT, 1.0f); // __min Base(_c)->numBytes += cBinop_init(&_c->cBinop_MJQIs, 0.0f); // __max Base(_c)->numBytes += cSlice_init(&_c->cSlice_oxbrV, 2, 1); Base(_c)->numBytes += cSlice_init(&_c->cSlice_yZctV, 3, 1); Base(_c)->numBytes += cSlice_init(&_c->cSlice_HCNcS, 4, 1); Base(_c)->numBytes += cVar_init_f(&_c->cVar_ItOCU, 0.0f); Base(_c)->numBytes += cSlice_init(&_c->cSlice_Nx0UC, 0, 1); Base(_c)->numBytes += cVar_init_f(&_c->cVar_VE9tg, 0.0f); Base(_c)->numBytes += cSlice_init(&_c->cSlice_Pkd46, 1, 1); // loadbang ctx_scheduleMessage(Base(_c), msg_initWithBang(HV_MESSAGE_ON_STACK(1), 0), &cLoadbang_2QoTi_sendMessage, 0); ctx_scheduleMessage(Base(_c), msg_initWithBang(HV_MESSAGE_ON_STACK(1), 0), &cLoadbang_4O9oF_sendMessage, 0); ctx_scheduleMessage(Base(_c), msg_initWithBang(HV_MESSAGE_ON_STACK(1), 0), &cLoadbang_KAaax_sendMessage, 0); ctx_scheduleMessage(Base(_c), msg_initWithBang(HV_MESSAGE_ON_STACK(1), 0), &cLoadbang_TuCQI_sendMessage, 0); ctx_scheduleMessage(Base(_c), msg_initWithBang(HV_MESSAGE_ON_STACK(1), 0), &cLoadbang_nVUh2_sendMessage, 0); return _c; } Hv_bbb *hv_bbb_new(double sampleRate) { return hv_bbb_new_with_pool(sampleRate, 10); // default to 10KB MessagePool } void hv_bbb_free(Hv_bbb *_c) { hTable_free(&_c->hTable_Pcegq); hv_free(Base(_c)->basePath); mq_free(&Base(_c)->mq); // free queue after all objects have been freed, messages may be cancelled hv_free(_c); } /* * Static Function Implementation */ static void hTable_Pcegq_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { } static void cVar_rLv9w_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { cMsg_oCnjm_sendMessage(_c, 0, m); } static void cSystem_tp4VA_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { cBinop_k_onMessage(_c, NULL, HV_BINOP_SUBTRACT, 2.0f, 0, m, &cBinop_ER1x8_sendMessage); } static void cVar_rQhd0_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { cBinop_k_onMessage(_c, NULL, HV_BINOP_SUBTRACT, 2.0f, 0, m, &cBinop_ER1x8_sendMessage); } static void cSlice_LzkmO_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { switch(letIn) { case 0: { sTabread_onMessage(_c, &Context(_c)->sTabread_ef8Y2, 1, m); sTabread_onMessage(_c, &Context(_c)->sTabread_nnJuj, 1, m); cVar_onMessage(_c, &Context(_c)->cVar_rLv9w, 0, m, &cVar_rLv9w_sendMessage); break; } case 1: { break; } default: return; } } static void cSwitchcase_y60Gw_onMessage(HvBase *_c, void *o, int letIn, const HvMessage *const m, void *sendMessage) { switch (msg_getHash(m,0)) { case 0x3E004DAB: { // "set" cSlice_onMessage(_c, &Context(_c)->cSlice_LzkmO, 0, m, &cSlice_LzkmO_sendMessage); break; } default: { break; } } } static void cLoadbang_TuCQI_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { cVar_onMessage(_c, &Context(_c)->cVar_rLv9w, 0, m, &cVar_rLv9w_sendMessage); } static void cBinop_ER1x8_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { sVarf_onMessage(_c, &Context(_c)->sVarf_SmDJi, m); } static void cMsg_oCnjm_sendMessage(HvBase *_c, int letIn, const HvMessage *const n) { HvMessage *m = NULL; m = HV_MESSAGE_ON_STACK(3); msg_init(m, 3, msg_getTimestamp(n)); msg_setSymbol(m, 0, "table"); msg_setElementToFrom(m, 1, n, 0); msg_setSymbol(m, 2, "size"); cSystem_onMessage(_c, NULL, 0, m, &cSystem_tp4VA_sendMessage); } static void cSlice_HqIeY_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { switch(letIn) { case 0: { sTabread_onMessage(_c, &Context(_c)->sTabread_g0gGp, 1, m); sTabread_onMessage(_c, &Context(_c)->sTabread_joe74, 1, m); cVar_onMessage(_c, &Context(_c)->cVar_BTo3t, 0, m, &cVar_BTo3t_sendMessage); break; } case 1: { break; } default: return; } } static void cVar_BTo3t_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { cMsg_En77U_sendMessage(_c, 0, m); } static void cVar_ZzlGn_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { cBinop_k_onMessage(_c, NULL, HV_BINOP_SUBTRACT, 2.0f, 0, m, &cBinop_HqDsI_sendMessage); } static void cBinop_HqDsI_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { sVarf_onMessage(_c, &Context(_c)->sVarf_U0HuI, m); } static void cSwitchcase_EV1Bl_onMessage(HvBase *_c, void *o, int letIn, const HvMessage *const m, void *sendMessage) { switch (msg_getHash(m,0)) { case 0x3E004DAB: { // "set" cSlice_onMessage(_c, &Context(_c)->cSlice_HqIeY, 0, m, &cSlice_HqIeY_sendMessage); break; } default: { break; } } } static void cLoadbang_nVUh2_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { cVar_onMessage(_c, &Context(_c)->cVar_BTo3t, 0, m, &cVar_BTo3t_sendMessage); } static void cSystem_jIjhB_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { cBinop_k_onMessage(_c, NULL, HV_BINOP_SUBTRACT, 2.0f, 0, m, &cBinop_HqDsI_sendMessage); } static void cMsg_En77U_sendMessage(HvBase *_c, int letIn, const HvMessage *const n) { HvMessage *m = NULL; m = HV_MESSAGE_ON_STACK(3); msg_init(m, 3, msg_getTimestamp(n)); msg_setSymbol(m, 0, "table"); msg_setElementToFrom(m, 1, n, 0); msg_setSymbol(m, 2, "size"); cSystem_onMessage(_c, NULL, 0, m, &cSystem_jIjhB_sendMessage); } static void cMsg_IbQ3q_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_zz1F7_sendMessage); } static void cSystem_zz1F7_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { sVarf_onMessage(_c, &Context(_c)->sVarf_EIzJc, m); } static void cBinop_oOwFV_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { cBinop_k_onMessage(_c, NULL, HV_BINOP_MULTIPLY, 0.5f, 0, m, &cBinop_a2rE6_sendMessage); } static void cBinop_P09tj_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { sVarf_onMessage(_c, &Context(_c)->sVarf_J0BAW, m); } static void cVar_NnTc2_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { cBinop_onMessage(_c, &Context(_c)->cBinop_cxljx, HV_BINOP_MULTIPLY, 0, m, &cBinop_cxljx_sendMessage); } static void cLoadbang_2QoTi_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { cMsg_FhRde_sendMessage(_c, 0, m); cVar_onMessage(_c, &Context(_c)->cVar_NnTc2, 0, m, &cVar_NnTc2_sendMessage); } static void cBinop_f8PBr_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { cBinop_onMessage(_c, &Context(_c)->cBinop_ITJR9, HV_BINOP_DIVIDE, 0, m, &cBinop_ITJR9_sendMessage); } static void cMsg_qocid_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_setFloat(m, 0, 1.0f); cUnop_onMessage(_c, HV_UNOP_ATAN, m, &cUnop_nBNe2_sendMessage); } static void cBinop_ITJR9_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { cBinop_onMessage(_c, &Context(_c)->cBinop_cxljx, HV_BINOP_MULTIPLY, 1, m, &cBinop_cxljx_sendMessage); } static void cUnop_nBNe2_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { cBinop_k_onMessage(_c, NULL, HV_BINOP_MULTIPLY, 8.0f, 0, m, &cBinop_f8PBr_sendMessage); } static void cSystem_ZnUnS_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { cBinop_onMessage(_c, &Context(_c)->cBinop_ITJR9, HV_BINOP_DIVIDE, 1, m, &cBinop_ITJR9_sendMessage); cMsg_qocid_sendMessage(_c, 0, m); } static void cMsg_FhRde_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_ZnUnS_sendMessage); } static void cBinop_cxljx_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { cMsg_xzUtJ_sendMessage(_c, 0, m); } static void cBinop_0UlVT_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { cBinop_onMessage(_c, &Context(_c)->cBinop_MJQIs, HV_BINOP_MAX, 0, m, &cBinop_MJQIs_sendMessage); } static void cBinop_MJQIs_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { cBinop_k_onMessage(_c, NULL, HV_BINOP_ADD, 1.0f, 0, m, &cBinop_oOwFV_sendMessage); cBinop_k_onMessage(_c, NULL, HV_BINOP_MULTIPLY, -1.0f, 0, m, &cBinop_P09tj_sendMessage); } static void cMsg_xzUtJ_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, 1.0f); msg_setElementToFrom(m, 1, n, 0); cBinop_k_onMessage(_c, NULL, HV_BINOP_SUBTRACT, 0.0f, 0, m, &cBinop_govla_sendMessage); } static void cBinop_a2rE6_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { sVarf_onMessage(_c, &Context(_c)->sVarf_4RU63, m); } static void cBinop_govla_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { cBinop_onMessage(_c, &Context(_c)->cBinop_0UlVT, HV_BINOP_MIN, 0, m, &cBinop_0UlVT_sendMessage); } static void cSlice_oxbrV_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { switch(letIn) { case 0: { sBiquad_k_onMessage(&Context(_c)->sBiquad_k_8Keaz, 1, m); break; } case 1: { break; } default: return; } } static void cBinop_rzeQ2_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { sBiquad_k_onMessage(&Context(_c)->sBiquad_k_8Keaz, 4, m); } static void cSlice_yZctV_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { switch(letIn) { case 0: { sBiquad_k_onMessage(&Context(_c)->sBiquad_k_8Keaz, 2, m); break; } case 1: { break; } default: return; } } static void cSlice_HCNcS_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { switch(letIn) { case 0: { sBiquad_k_onMessage(&Context(_c)->sBiquad_k_8Keaz, 3, m); break; } case 1: { break; } default: return; } } static void cVar_ItOCU_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { cBinop_k_onMessage(_c, NULL, HV_BINOP_MULTIPLY, -1.0f, 0, m, &cBinop_RE1w0_sendMessage); } static void cSlice_Nx0UC_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { switch(letIn) { case 0: { cBinop_k_onMessage(_c, NULL, HV_BINOP_MULTIPLY, -1.0f, 0, m, &cBinop_rzeQ2_sendMessage); break; } case 1: { break; } default: return; } } static void cLoadbang_4O9oF_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { cVar_onMessage(_c, &Context(_c)->cVar_VE9tg, 0, m, &cVar_VE9tg_sendMessage); cVar_onMessage(_c, &Context(_c)->cVar_ItOCU, 0, m, &cVar_ItOCU_sendMessage); } static void cVar_VE9tg_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { cBinop_k_onMessage(_c, NULL, HV_BINOP_MULTIPLY, -1.0f, 0, m, &cBinop_rzeQ2_sendMessage); } static void cBinop_RE1w0_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { sBiquad_k_onMessage(&Context(_c)->sBiquad_k_8Keaz, 5, m); } static void cSlice_Pkd46_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { switch(letIn) { case 0: { cBinop_k_onMessage(_c, NULL, HV_BINOP_MULTIPLY, -1.0f, 0, m, &cBinop_RE1w0_sendMessage); break; } case 1: { break; } default: return; } } static void cLoadbang_KAaax_sendMessage(HvBase *_c, int letIn, const HvMessage *const m) { cMsg_IbQ3q_sendMessage(_c, 0, m); } /* * Context Process Implementation */ int hv_bbb_process(Hv_bbb *const _c, float **const inputBuffers, float **const outputBuffers, int nx) { const int n4 = nx & ~HV_N_SIMD_MASK; // ensure that the block size is a multiple of HV_N_SIMD // temporary signal vars hv_bufferf_t Bf0, Bf1, Bf2, Bf3, Bf4, Bf5, Bf6, Bf7; hv_bufferi_t Bi0, Bi1; // input and output vars hv_bufferf_t O0, O1; hv_bufferf_t I0, I1, I2, I3, I4, I5, I6, I7, I8, I9; // declare and init the zero buffer hv_bufferf_t ZERO; __hv_zero_f(VOf(ZERO)); hv_uint32_t nextBlock = Base(_c)->blockStartTimestamp; for (int n = 0; n < n4; n += HV_N_SIMD) { // process all of the messages for this block nextBlock += HV_N_SIMD; while (mq_hasMessageBefore(&Base(_c)->mq, nextBlock)) { MessageNode *const node = mq_peek(&Base(_c)->mq); node->sendMessage(Base(_c), node->let, node->m); mq_pop(&Base(_c)->mq); } // load input buffers __hv_load_f(inputBuffers[0]+n, VOf(I0)); __hv_load_f(inputBuffers[1]+n, VOf(I1)); __hv_load_f(inputBuffers[2]+n, VOf(I2)); __hv_load_f(inputBuffers[3]+n, VOf(I3)); __hv_load_f(inputBuffers[4]+n, VOf(I4)); __hv_load_f(inputBuffers[5]+n, VOf(I5)); __hv_load_f(inputBuffers[6]+n, VOf(I6)); __hv_load_f(inputBuffers[7]+n, VOf(I7)); __hv_load_f(inputBuffers[8]+n, VOf(I8)); __hv_load_f(inputBuffers[9]+n, VOf(I9)); // zero output buffers __hv_zero_f(VOf(O0)); __hv_zero_f(VOf(O1)); // process all signal functions __hv_var_f(&_c->sVarf_DIQHM, VOf(Bf0)); __hv_var_f(&_c->sVarf_EIzJc, VOf(Bf1)); __hv_div_f(VIf(Bf0), VIf(Bf1), VOf(Bf1)); __hv_var_f(&_c->sVarf_J0BAW, VOf(Bf0)); __hv_rpole_f(&_c->sRPole_vtJYw, VIf(I7), VIf(Bf0), VOf(Bf0)); __hv_var_f(&_c->sVarf_haFXq, VOf(Bf2)); __hv_del1_f(&_c->sDel1_8dkfF, VIf(Bf0), VOf(Bf3)); __hv_mul_f(VIf(Bf3), VIf(Bf2), VOf(Bf2)); __hv_sub_f(VIf(Bf0), VIf(Bf2), VOf(Bf2)); __hv_var_f(&_c->sVarf_4RU63, VOf(Bf0)); __hv_mul_f(VIf(Bf2), VIf(Bf0), VOf(Bf0)); __hv_abs_f(VIf(Bf0), VOf(Bf0)); __hv_min_f(VIf(Bf0), VIf(I8), VOf(Bf0)); __hv_sub_f(VIf(Bf0), VIf(I8), VOf(Bf0)); __hv_var_f(&_c->sVarf_5BIjv, VOf(Bf2)); __hv_min_f(VIf(Bf0), VIf(Bf2), VOf(Bf2)); __hv_var_f(&_c->sVarf_82QyC, VOf(Bf0)); __hv_max_f(VIf(Bf2), VIf(Bf0), VOf(Bf0)); __hv_var_k_f(VOf(Bf2), 1e-37f, 1e-37f, 1e-37f, 1e-37f, 1e-37f, 1e-37f, 1e-37f, 1e-37f, 0); __hv_add_f(VIf(Bf0), VIf(Bf2), VOf(Bf2)); __hv_var_k_f(VOf(Bf0), 1e+37f, 1e+37f, 1e+37f, 1e+37f, 1e+37f, 1e+37f, 1e+37f, 1e+37f, 0); __hv_mul_f(VIf(Bf2), VIf(Bf0), VOf(Bf0)); __hv_biquad_k_f(&_c->sBiquad_k_8Keaz, VIf(Bf0), VOf(Bf2)); __hv_var_k_f(VOf(Bf3), -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, 0); __hv_mul_f(VIf(Bf2), VIf(Bf3), VOf(Bf3)); __hv_var_f(&_c->sVarf_2muG8, VOf(Bf2)); __hv_max_f(VIf(Bf3), VIf(Bf2), VOf(Bf3)); __hv_sub_f(VIf(Bf3), VIf(Bf2), VOf(Bf2)); __hv_var_k_f(VOf(Bf3), -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, 0); __hv_mul_f(VIf(Bf2), VIf(Bf3), VOf(Bf3)); __hv_var_f(&_c->sVarf_YrcAl, VOf(Bf2)); __hv_min_f(VIf(Bf3), VIf(Bf2), VOf(Bf2)); __hv_var_f(&_c->sVarf_1pbLN, VOf(Bf3)); __hv_max_f(VIf(Bf2), VIf(Bf3), VOf(Bf3)); __hv_var_k_f(VOf(Bf2), 1e-37f, 1e-37f, 1e-37f, 1e-37f, 1e-37f, 1e-37f, 1e-37f, 1e-37f, 0); __hv_add_f(VIf(Bf3), VIf(Bf2), VOf(Bf2)); __hv_var_k_f(VOf(Bf3), 1e+37f, 1e+37f, 1e+37f, 1e+37f, 1e+37f, 1e+37f, 1e+37f, 1e+37f, 0); __hv_mul_f(VIf(Bf2), VIf(Bf3), VOf(Bf3)); __hv_var_k_f(VOf(Bf2), -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, 0); __hv_mul_f(VIf(Bf3), VIf(Bf2), VOf(Bf2)); __hv_rpole_f(&_c->sRPole_Q5SA1, VIf(Bf1), VIf(Bf2), VOf(Bf2)); __hv_var_f(&_c->sVarf_ZTuE8, VOf(Bf1)); __hv_min_f(VIf(Bf2), VIf(Bf1), VOf(Bf1)); __hv_var_f(&_c->sVarf_9Q4iz, VOf(Bf2)); __hv_max_f(VIf(Bf1), VIf(Bf2), VOf(Bf2)); __hv_var_f(&_c->sVarf_QHeut, VOf(Bf1)); __hv_mul_f(VIf(I9), VIf(I9), VOf(Bf3)); __hv_var_f(&_c->sVarf_BWg3y, VOf(Bf4)); __hv_min_f(VIf(Bf3), VIf(Bf4), VOf(Bf4)); __hv_var_f(&_c->sVarf_yW7Co, VOf(Bf3)); __hv_max_f(VIf(Bf4), VIf(Bf3), VOf(Bf3)); __hv_div_f(VIf(Bf1), VIf(Bf3), VOf(Bf3)); __hv_mul_f(VIf(Bf2), VIf(Bf3), VOf(Bf3)); __hv_var_k_f(VOf(Bf2), 512.0f, 512.0f, 512.0f, 512.0f, 512.0f, 512.0f, 512.0f, 512.0f, 0); __hv_mul_f(VIf(Bf3), VIf(Bf2), VOf(Bf2)); __hv_var_f(&_c->sVarf_BMuCC, VOf(Bf3)); __hv_var_f(&_c->sVarf_1vLiI, VOf(Bf1)); __hv_var_f(&_c->sVarf_ZKIZB, VOf(Bf4)); __hv_add_f(VIf(Bf2), VIf(Bf4), VOf(Bf4)); __hv_var_f(&_c->sVarf_SmDJi, VOf(Bf5)); __hv_min_f(VIf(Bf4), VIf(Bf5), VOf(Bf5)); __hv_add_f(VIf(Bf1), VIf(Bf5), VOf(Bf5)); __hv_var_k_f(VOf(Bf1), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0); __hv_max_f(VIf(Bf5), VIf(Bf1), VOf(Bf1)); __hv_cast_fi(VIf(Bf1), VOi(Bi0)); __hv_var_k_i(VOi(Bi1), 1, 1, 1, 1, 1, 1, 1, 1, 0); __hv_add_i(VIi(Bi0), VIi(Bi1), VOi(Bi1)); __hv_tabread_if(&_c->sTabread_ef8Y2, VIi(Bi1), VOf(Bf5)); __hv_var_f(&_c->sVarf_Z1CfH, VOf(Bf4)); __hv_add_f(VIf(Bf5), VIf(Bf4), VOf(Bf4)); __hv_tabread_if(&_c->sTabread_nnJuj, VIi(Bi0), VOf(Bf5)); __hv_sub_f(VIf(Bf4), VIf(Bf5), VOf(Bf4)); __hv_add_f(VIf(Bf3), VIf(Bf4), VOf(Bf4)); __hv_var_f(&_c->sVarf_CwdRa, VOf(Bf3)); __hv_add_f(VIf(Bf3), VIf(Bf1), VOf(Bf3)); __hv_floor_f(VIf(Bf1), VOf(Bf1)); __hv_sub_f(VIf(Bf3), VIf(Bf1), VOf(Bf1)); __hv_var_f(&_c->sVarf_z5YqL, VOf(Bf3)); __hv_add_f(VIf(Bf5), VIf(Bf3), VOf(Bf3)); __hv_fma_f(VIf(Bf4), VIf(Bf1), VIf(Bf3), VOf(Bf3)); __hv_var_f(&_c->sVarf_AMYc1, VOf(Bf1)); __hv_var_f(&_c->sVarf_yGh3v, VOf(Bf4)); __hv_var_f(&_c->sVarf_ThV6W, VOf(Bf5)); __hv_add_f(VIf(Bf2), VIf(Bf5), VOf(Bf5)); __hv_var_f(&_c->sVarf_U0HuI, VOf(Bf6)); __hv_min_f(VIf(Bf5), VIf(Bf6), VOf(Bf6)); __hv_add_f(VIf(Bf4), VIf(Bf6), VOf(Bf6)); __hv_var_k_f(VOf(Bf4), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0); __hv_max_f(VIf(Bf6), VIf(Bf4), VOf(Bf4)); __hv_cast_fi(VIf(Bf4), VOi(Bi0)); __hv_var_k_i(VOi(Bi1), 1, 1, 1, 1, 1, 1, 1, 1, 0); __hv_add_i(VIi(Bi0), VIi(Bi1), VOi(Bi1)); __hv_tabread_if(&_c->sTabread_g0gGp, VIi(Bi1), VOf(Bf6)); __hv_var_f(&_c->sVarf_rLY2o, VOf(Bf5)); __hv_add_f(VIf(Bf6), VIf(Bf5), VOf(Bf5)); __hv_tabread_if(&_c->sTabread_joe74, VIi(Bi0), VOf(Bf6)); __hv_sub_f(VIf(Bf5), VIf(Bf6), VOf(Bf5)); __hv_add_f(VIf(Bf1), VIf(Bf5), VOf(Bf5)); __hv_var_f(&_c->sVarf_tTp9Q, VOf(Bf1)); __hv_add_f(VIf(Bf1), VIf(Bf4), VOf(Bf1)); __hv_floor_f(VIf(Bf4), VOf(Bf4)); __hv_sub_f(VIf(Bf1), VIf(Bf4), VOf(Bf4)); __hv_var_f(&_c->sVarf_Ip7Ud, VOf(Bf1)); __hv_add_f(VIf(Bf6), VIf(Bf1), VOf(Bf1)); __hv_fma_f(VIf(Bf5), VIf(Bf4), VIf(Bf1), VOf(Bf1)); __hv_mul_f(VIf(Bf1), VIf(Bf1), VOf(Bf1)); __hv_var_k_f(VOf(Bf4), 1000.0f, 1000.0f, 1000.0f, 1000.0f, 1000.0f, 1000.0f, 1000.0f, 1000.0f, 0); __hv_var_k_f(VOf(Bf5), 50.0f, 50.0f, 50.0f, 50.0f, 50.0f, 50.0f, 50.0f, 50.0f, 0); __hv_fma_f(VIf(Bf1), VIf(Bf4), VIf(Bf5), VOf(Bf5)); __hv_phasor_f(&_c->sPhasor_KqGIr, VIf(Bf5), VOf(Bf5)); __hv_var_k_f(VOf(Bf4), 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0); __hv_sub_f(VIf(Bf5), VIf(Bf4), VOf(Bf4)); __hv_abs_f(VIf(Bf4), VOf(Bf4)); __hv_var_k_f(VOf(Bf5), 0.25f, 0.25f, 0.25f, 0.25f, 0.25f, 0.25f, 0.25f, 0.25f, 0); __hv_sub_f(VIf(Bf4), VIf(Bf5), VOf(Bf5)); __hv_var_k_f(VOf(Bf4), 6.28319f, 6.28319f, 6.28319f, 6.28319f, 6.28319f, 6.28319f, 6.28319f, 6.28319f, 0); __hv_mul_f(VIf(Bf5), VIf(Bf4), VOf(Bf4)); __hv_mul_f(VIf(Bf4), VIf(Bf4), VOf(Bf5)); __hv_mul_f(VIf(Bf4), VIf(Bf5), VOf(Bf1)); __hv_mul_f(VIf(Bf1), VIf(Bf5), VOf(Bf5)); __hv_var_k_f(VOf(Bf6), 0.00784314f, 0.00784314f, 0.00784314f, 0.00784314f, 0.00784314f, 0.00784314f, 0.00784314f, 0.00784314f, 0); __hv_var_k_f(VOf(Bf7), 0.166667f, 0.166667f, 0.166667f, 0.166667f, 0.166667f, 0.166667f, 0.166667f, 0.166667f, 0); __hv_mul_f(VIf(Bf1), VIf(Bf7), VOf(Bf7)); __hv_sub_f(VIf(Bf4), VIf(Bf7), VOf(Bf7)); __hv_fma_f(VIf(Bf5), VIf(Bf6), VIf(Bf7), VOf(Bf7)); __hv_mul_f(VIf(Bf3), VIf(Bf7), VOf(Bf7)); __hv_add_f(VIf(Bf7), VIf(O1), VOf(O1)); __hv_add_f(VIf(Bf7), VIf(O0), VOf(O0)); // save output vars to output buffer __hv_store_f(outputBuffers[0]+n, VIf(O0)); __hv_store_f(outputBuffers[1]+n, VIf(O1)); } Base(_c)->blockStartTimestamp = nextBlock; return n4; // return the number of frames processed } int hv_bbb_process_inline(Hv_bbb *c, float *const inputBuffers, float *const outputBuffers, int n4) { hv_assert(!(n4 & HV_N_SIMD_MASK)); // ensure that n4 is a multiple of HV_N_SIMD int i = ctx_getNumInputChannels(Base(c)); float **bIn = (float **) hv_alloca(i*sizeof(float *)); while (i--) bIn[i] = inputBuffers+(i*n4); i = ctx_getNumOutputChannels(Base(c)); float **bOut = (float **) hv_alloca(i*sizeof(float *)); while (i--) bOut[i] = outputBuffers+(i*n4); int n = hv_bbb_process(c, bIn, bOut, n4); return n; } int hv_bbb_process_inline_short(Hv_bbb *c, short *const inputBuffers, short *const outputBuffers, int n4) { hv_assert(!(n4 & HV_N_SIMD_MASK)); // ensure that n4 is a multiple of HV_N_SIMD int numChannels = ctx_getNumInputChannels(Base(c)); float *bIn = (float *) hv_alloca(numChannels*n4*sizeof(float)); for (int i = 0; i < numChannels; ++i) { for (int j = 0; j < n4; ++j) { bIn[i*n4+j] = ((float) inputBuffers[i+numChannels*j]) * 0.00003051757813f; } } numChannels = ctx_getNumOutputChannels(Base(c)); float *bOut = (float *) hv_alloca(numChannels*n4*sizeof(float)); int n = hv_bbb_process_inline(c, bIn, bOut, n4); for (int i = 0; i < numChannels; ++i) { for (int j = 0; j < n4; ++j) { outputBuffers[i+numChannels*j] = (short) (bOut[i*n4+j] * 32767.0f); } } return n; }