added a receive_symbol to the numeric input
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
#X obj 226 223 dac~;
|
||||
#X obj 392 165 loadbang;
|
||||
#X msg 392 189 \; pd dsp 1;
|
||||
#X floatatom 226 121 5 0 0 0 - - - 0;
|
||||
#X floatatom 226 121 5 0 0 0 - osc_freq_input - 0;
|
||||
#X connect 0 0 1 0;
|
||||
#X connect 0 0 1 1;
|
||||
#X connect 2 0 3 0;
|
||||
|
||||
@ -83,8 +83,8 @@ 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_t0xipsEt, 440.0f, sampleRate);
|
||||
numBytes += cVar_init_f(&cVar_AeJUniP3, 0.0f);
|
||||
numBytes += sPhasor_k_init(&sPhasor_cYzbYXma, 440.0f, sampleRate);
|
||||
numBytes += cVar_init_f(&cVar_suKVph5y, 0.0f);
|
||||
|
||||
// schedule a message to trigger all loadbangs via the __hv_init receiver
|
||||
scheduleMessageForReceiver(0xCE5CC65B, msg_initWithBang(HV_MESSAGE_ON_STACK(1), 0));
|
||||
@ -101,7 +101,11 @@ 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);
|
||||
mq_addMessageByTimestamp(&mq, m, 0, &cReceive_lcgmg3zT_sendMessage);
|
||||
break;
|
||||
}
|
||||
case 0xBDE02A5C: { // osc_freq_input
|
||||
mq_addMessageByTimestamp(&mq, m, 0, &cReceive_VnPTYsLb_sendMessage);
|
||||
break;
|
||||
}
|
||||
default: return;
|
||||
@ -132,11 +136,11 @@ 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::cVar_suKVph5y_sendMessage(HeavyContextInterface *_c, int letIn, const HvMessage *m) {
|
||||
sPhasor_k_onMessage(_c, &Context(_c)->sPhasor_cYzbYXma, 0, m);
|
||||
}
|
||||
|
||||
void Heavy_temp_a2960967::cMsg_YmvBriBK_sendMessage(HeavyContextInterface *_c, int letIn, const HvMessage *const n) {
|
||||
void Heavy_temp_a2960967::cMsg_yxSgDNKY_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));
|
||||
@ -145,8 +149,12 @@ void Heavy_temp_a2960967::cMsg_YmvBriBK_sendMessage(HeavyContextInterface *_c, i
|
||||
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);
|
||||
void Heavy_temp_a2960967::cReceive_lcgmg3zT_sendMessage(HeavyContextInterface *_c, int letIn, const HvMessage *m) {
|
||||
cMsg_yxSgDNKY_sendMessage(_c, 0, m);
|
||||
}
|
||||
|
||||
void Heavy_temp_a2960967::cReceive_VnPTYsLb_sendMessage(HeavyContextInterface *_c, int letIn, const HvMessage *m) {
|
||||
cVar_onMessage(_c, &Context(_c)->cVar_suKVph5y, 0, m, &cVar_suKVph5y_sendMessage);
|
||||
}
|
||||
|
||||
|
||||
@ -195,7 +203,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_t0xipsEt, VOf(Bf0));
|
||||
__hv_phasor_k_f(&sPhasor_cYzbYXma, 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));
|
||||
@ -210,8 +218,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(O1), VOf(O1));
|
||||
__hv_add_f(VIf(Bf1), VIf(O0), VOf(O0));
|
||||
__hv_add_f(VIf(Bf1), VIf(O1), VOf(O1));
|
||||
|
||||
// save output vars to output buffer
|
||||
__hv_store_f(outputBuffers[0]+n, VIf(O0));
|
||||
|
||||
@ -61,13 +61,14 @@ class Heavy_temp_a2960967 : public HeavyContext {
|
||||
void scheduleMessageForReceiver(hv_uint32_t receiverHash, HvMessage *m) override;
|
||||
|
||||
// static sendMessage functions
|
||||
static void cVar_AeJUniP3_sendMessage(HeavyContextInterface *, int, const HvMessage *);
|
||||
static void cMsg_YmvBriBK_sendMessage(HeavyContextInterface *, int, const HvMessage *);
|
||||
static void cReceive_wS26lFsz_sendMessage(HeavyContextInterface *, int, const HvMessage *);
|
||||
static void cVar_suKVph5y_sendMessage(HeavyContextInterface *, int, const HvMessage *);
|
||||
static void cMsg_yxSgDNKY_sendMessage(HeavyContextInterface *, int, const HvMessage *);
|
||||
static void cReceive_lcgmg3zT_sendMessage(HeavyContextInterface *, int, const HvMessage *);
|
||||
static void cReceive_VnPTYsLb_sendMessage(HeavyContextInterface *, int, const HvMessage *);
|
||||
|
||||
// objects
|
||||
SignalPhasor sPhasor_t0xipsEt;
|
||||
ControlVar cVar_AeJUniP3;
|
||||
SignalPhasor sPhasor_cYzbYXma;
|
||||
ControlVar cVar_suKVph5y;
|
||||
};
|
||||
|
||||
#endif // _HEAVY_CONTEXT_TEMP_A2960967_HPP_
|
||||
|
||||
Reference in New Issue
Block a user