8#ifndef SBL_DSP_PM_SWITCHED_EXCITER_HPP_
9#define SBL_DSP_PM_SWITCHED_EXCITER_HPP_
18template<
typename A,
typename B>
20 static_assert(is_exciter_v<A> && is_exciter_v<B>,
"both sides are Exciters (physical-modeling.md §4.2)");
29 bool second()
const {
return use_b_; }
32 if (pending_ != use_b_) {
34 if (use_b_) b_.reset();
else a_.reset();
36 if (use_b_) b_.advance(n);
else a_.advance(n);
40 float energy()
const {
return use_b_ ? b_.energy() : a_.energy(); }
48 return use_b_ ? b_.describe(g, group, name) : a_.describe(g, group, name);
55 bool pending_ =
false;
SwitchedExciter(A &a, B &b)
float excite(const JunctionState &j)
diagram::Ports describe(diagram::Graph &g, uint8_t group, const char *name="exciter") const
void select(bool second)
Which one plays: false the first, true the second. Takes effect at the next block.
What a load, an exciter, a termination and a friction law provide (Physical modeling — cross-cutting)
A model's wiring, as data (AP-037)
Physical modeling: laws, bows, junctions, loads, resonators, strings (docs/conventions/physical-model...
The ports a component exposes after describing itself, so an owner can wire them.
What the guide reports at an excitation point, each sample.