Skip to content

Commit

Permalink
limit render
Browse files Browse the repository at this point in the history
  • Loading branch information
tomara-x committed Aug 5, 2024
1 parent dd0e9b8 commit eaa8842
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ for more info about osc: https://opensoundcontrol.stanford.edu/spec-1_0.html
- process the input array as input to the given audio node (array length must match the number of input channels the node has) output of the node is written to this circle's array (process one audio frame)
- `render`
- inputs: `n`, `0 -> 1` (input node), `n -> 2` (trigger)
- render n samples from the given audio node into the array when the second input is non-zero (node must have 0 ins, and 1 out)
- render n samples from the given audio node into the array when the second input is non-zero (node must have 0 ins, and 1 out). can process a maximum of 10 million samples at a time (a limit to avoid causing memory issues and excessive cpu usage)
- `store`
- inputs: `n -> 1`
- store the input num into self's num, but doesn't open the white holes reading nums like usual
Expand Down
3 changes: 2 additions & 1 deletion src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,8 @@ pub fn process(
}
if wh.link_types == (-1, 2) && num_query.get(wh.bh_parent).unwrap().0 != 0.
{
let len = num_query.get(*id).unwrap().0 as usize;
let mut len = num_query.get(*id).unwrap().0 as usize;
len = std::cmp::Ord::min(len, 10000000);
let output = &mut arr_query.get_mut(*id).unwrap().0;
let net = &mut net_query.get_mut(*id).unwrap().0;
if net.inputs() == 0 && net.outputs() == 1 {
Expand Down

0 comments on commit eaa8842

Please sign in to comment.