added a number input and a loadbang for setting the dsp on 1, compiled the patch
This commit is contained in:
@ -83,8 +83,11 @@ extern "C" {
|
||||
|
||||
Heavy_temp_a2960967::Heavy_temp_a2960967(double sampleRate, int poolKb, int inQueueKb, int outQueueKb)
|
||||
: HeavyContext(sampleRate, poolKb, inQueueKb, outQueueKb) {
|
||||
numBytes += sPhasor_k_init(&sPhasor_dLinxAVa, 440.0f, sampleRate);
|
||||
numBytes += sPhasor_k_init(&sPhasor_t0xipsEt, 440.0f, sampleRate);
|
||||
numBytes += cVar_init_f(&cVar_AeJUniP3, 0.0f);
|
||||
|
||||
// schedule a message to trigger all loadbangs via the __hv_init receiver
|
||||
scheduleMessageForReceiver(0xCE5CC65B, msg_initWithBang(HV_MESSAGE_ON_STACK(1), 0));
|
||||
}
|
||||
|
||||
Heavy_temp_a2960967::~Heavy_temp_a2960967() {
|
||||
@ -97,6 +100,10 @@ HvTable *Heavy_temp_a2960967::getTableForHash(hv_uint32_t tableHash) {
|
||||
|
||||
void Heavy_temp_a2960967::scheduleMessageForReceiver(hv_uint32_t receiverHash, HvMessage *m) {
|
||||
switch (receiverHash) {
|
||||
case 0xCE5CC65B: { // __hv_init
|
||||
mq_addMessageByTimestamp(&mq, m, 0, &cReceive_wS26lFsz_sendMessage);
|
||||
break;
|
||||
}
|
||||
default: return;
|
||||
}
|
||||
}
|
||||
@ -125,6 +132,23 @@ int Heavy_temp_a2960967::getParameterInfo(int index, HvParameterInfo *info) {
|
||||
*/
|
||||
|
||||
|
||||
void Heavy_temp_a2960967::cVar_AeJUniP3_sendMessage(HeavyContextInterface *_c, int letIn, const HvMessage *m) {
|
||||
sPhasor_k_onMessage(_c, &Context(_c)->sPhasor_t0xipsEt, 0, m);
|
||||
}
|
||||
|
||||
void Heavy_temp_a2960967::cMsg_YmvBriBK_sendMessage(HeavyContextInterface *_c, int letIn, const HvMessage *const n) {
|
||||
HvMessage *m = nullptr;
|
||||
m = HV_MESSAGE_ON_STACK(3);
|
||||
msg_init(m, 3, msg_getTimestamp(n));
|
||||
msg_setSymbol(m, 0, "pd");
|
||||
msg_setSymbol(m, 1, "dsp");
|
||||
msg_setFloat(m, 2, 1.0f);
|
||||
}
|
||||
|
||||
void Heavy_temp_a2960967::cReceive_wS26lFsz_sendMessage(HeavyContextInterface *_c, int letIn, const HvMessage *m) {
|
||||
cMsg_YmvBriBK_sendMessage(_c, 0, m);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -171,7 +195,7 @@ int Heavy_temp_a2960967::process(float **inputBuffers, float **outputBuffers, in
|
||||
__hv_zero_f(VOf(O1));
|
||||
|
||||
// process all signal functions
|
||||
__hv_phasor_k_f(&sPhasor_dLinxAVa, VOf(Bf0));
|
||||
__hv_phasor_k_f(&sPhasor_t0xipsEt, VOf(Bf0));
|
||||
__hv_var_k_f(VOf(Bf1), 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f);
|
||||
__hv_sub_f(VIf(Bf0), VIf(Bf1), VOf(Bf1));
|
||||
__hv_abs_f(VIf(Bf1), VOf(Bf1));
|
||||
@ -186,8 +210,8 @@ int Heavy_temp_a2960967::process(float **inputBuffers, float **outputBuffers, in
|
||||
__hv_var_k_f(VOf(Bf4), -0.166666666666667f, -0.166666666666667f, -0.166666666666667f, -0.166666666666667f, -0.166666666666667f, -0.166666666666667f, -0.166666666666667f, -0.166666666666667f);
|
||||
__hv_fma_f(VIf(Bf2), VIf(Bf4), VIf(Bf1), VOf(Bf1));
|
||||
__hv_fma_f(VIf(Bf0), VIf(Bf3), VIf(Bf1), VOf(Bf1));
|
||||
__hv_add_f(VIf(Bf1), VIf(O0), VOf(O0));
|
||||
__hv_add_f(VIf(Bf1), VIf(O1), VOf(O1));
|
||||
__hv_add_f(VIf(Bf1), VIf(O0), VOf(O0));
|
||||
|
||||
// save output vars to output buffer
|
||||
__hv_store_f(outputBuffers[0]+n, VIf(O0));
|
||||
|
||||
Reference in New Issue
Block a user