-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
81 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
title: TriggerMult node documentation | ||
description: TriggerMult: Distribute any triggers to all output nodes. | ||
|
||
[Reference library](../../index.md) > [Operators](../index.md) > [TriggerMult](index.md) | ||
|
||
# TriggerMult | ||
|
||
```python | ||
TriggerMult(a=0) | ||
``` | ||
|
||
Distribute any triggers to all output nodes. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#pragma once | ||
|
||
#include "signalflow/core/constants.h" | ||
#include "signalflow/node/node.h" | ||
|
||
namespace signalflow | ||
{ | ||
|
||
/**--------------------------------------------------------------------------------* | ||
* Distribute any triggers to all output nodes. | ||
*---------------------------------------------------------------------------------*/ | ||
class TriggerMult : public UnaryOpNode | ||
{ | ||
|
||
public: | ||
TriggerMult(NodeRef a = 0); | ||
|
||
virtual void process(Buffer &out, int num_frames) override; | ||
virtual void trigger(std::string = SIGNALFLOW_DEFAULT_TRIGGER, | ||
float value = SIGNALFLOW_NULL_FLOAT) override; | ||
}; | ||
|
||
REGISTER(TriggerMult, "trigger-mult") | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include "signalflow/node/operators/trigger-mult.h" | ||
#include <math.h> | ||
|
||
namespace signalflow | ||
{ | ||
|
||
TriggerMult::TriggerMult(NodeRef a) | ||
: UnaryOpNode(a) | ||
{ | ||
this->name = "trigger-mult"; | ||
} | ||
|
||
void TriggerMult::process(Buffer &out, int num_frames) | ||
{ | ||
for (int channel = 0; channel < this->num_output_channels; channel++) | ||
{ | ||
for (int frame = 0; frame < num_frames; frame++) | ||
{ | ||
float value = this->input->out[channel][frame]; | ||
out[channel][frame] = value; | ||
} | ||
} | ||
} | ||
|
||
void TriggerMult::trigger(std::string name, float value) | ||
{ | ||
for (auto output : this->get_outputs()) | ||
{ | ||
auto output_node = output.first; | ||
output_node->trigger(name, value); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters