| 141 | |
| 142 | |
| 143 | static void Cable_step(Cable* that) { |
| 144 | Output* output = &that->outputModule->outputs[that->outputId]; |
| 145 | Input* input = &that->inputModule->inputs[that->inputId]; |
| 146 | // Match number of polyphonic channels to output port |
| 147 | const int channels = output->channels; |
| 148 | // Copy all voltages from output to input |
| 149 | for (int c = 0; c < channels; c++) { |
| 150 | if (!std::isfinite(output->voltages[c])) |
| 151 | __builtin_unreachable(); |
| 152 | input->voltages[c] = output->voltages[c]; |
| 153 | } |
| 154 | // Set higher channel voltages to 0 |
| 155 | for (int c = channels; c < input->channels; c++) { |
| 156 | input->voltages[c] = 0.f; |
| 157 | } |
| 158 | input->channels = channels; |
| 159 | } |
| 160 | |
| 161 | |
| 162 | #ifndef HEADLESS |
no outgoing calls
no test coverage detected