SynthMaker

problem with certain triggers

Archive · 2012 8 old posts

From the original SynthMaker forum (2004–2014), with its members’ names and dates.

tester ·

I'm trying to identify a problem that causes glitches in large sound schematics. Right now I have a suspicion, that the problem is not within general triggers, but only with triggers related to boolean (0/1) switches that turn somethig on/off or switch something between streams. Strange thing is, that even at less than 15% of CPU (windows taks manager; no spikers, C2D CPU), glitches are present, and it does not matters whether switch operates on active stream or inactive (turned off). No buses in schematic, not too many multiplexers too (resigned from previous idea to find the problem). Any general ideas?

trogluddite ·

Yes, that is perfectly normal.

Any change to stream routing - even parts which seem disconnected - will cause SM to re-compile the code for the entire schematic. This is for two reasons...

1) CPU saving - when a module (or chain) has no output connected, that part of the code doesn't run. But SM has to determine which parts are on or off, and then alter the code slightly so that it jumps over the "dormant" parts.

2) Execution Order - when switching elements, SM has to re-assess the order in which the currently active modules are processed. This to ensure that a module is not processed before those that feed it with inputs, otherwise the audio would not flow through the schematic.

As the number of modules, and complexity of connection increases, so does the difficulty of analysing the correct processing order for the network - and hence a big spike in CPU activity (hard to see on a CPU meter because it is so brief). The glitches are often made much worse because a re-compile will always force code and assembly modules to run stage(0) - which can cause the reset of counters etc. This is often desirable - when modules "awake" from the CPU-saving state they do quite often need buffers flushing etc, to enter a known start state. It is possible to design stage(0) routines that are more benign - I did that just today with the Delays in the Trogz toolkit. By default, preset changes also cause a re-compile - this can be turned off, but if a preset changes the position of stream routing, a re-compile will still happen anyway.

This is a price we pay for SM's wonderful user interface. The re-compilation is a reflection of the complexity of turning the on-screen "flowchart" into executable code - all the things that are hidden from us in order to make SM a more comfortable environment.

SOLUTIONS This depends a lot on whether you can tolerate increased CPU load. It is possible to use gain control etc. to switch signals, so that there is no re-routing of selectors etc. - but you will lose SM's automatic CPU saving features. In effect, the whole schematic must be "always on" - even those parts currently not in use. You can get around the loss of CPU-saving to a degree - but only by using assembly, as the code module does not allow jumping over blocks of code (except for hopping). There is another advantage to this approach. Modules which are asleep remain locked in "stasis" - all variable values and buffers are remembered. So switching an oscillator in or out of circuit will normally have an effect on its phase (its clock no longer ticks when disconnected). In contrast an "always running" design retains its timing even when not contributing to the sound. If that is too extreme, you can still ease the problem by combining networks of primitives into simple code blocks, and making many small code blocks into bigger ones. In effect this does some of the job of 'compiling' the schematic, as the lines of code make execution order explicit - making less work for SM to do when it analyses the network of links.

In practice, I would mix the "always on" approach with the conventional selector/multiplex method - according to where CPU saving is most needed, or where the worse glitch problems are.

tester ·

"Always running" will not work correctly at that complexity or at least not on all computers (even if a part of schematic is running). Count: 12-16x stereo units, each has stereo AM and stereo FM, and there are 10 other stereo modulators per parameter of both - units and modulators. I'm not saying that all play at once, but they are/should be present. Preset manager is simplified - only load/save and only 1 program (at least for testing) inside - just finished. I send you the template of where am I right now, so maybe step by step we can figure out how to make it run correctly. For phase reset I have a manual resync button 😉 I redesigned gui (lot of things are removed, everything is vector now), so I use copy-gui method this time - at least for testing.

Thanks for engagement and patience.

oddson ·

trogluddite wrote: Any change to stream routing - even parts which seem disconnected - will cause SM to re-compile the code for the entire schematic. This is for two reasons...

😕 ?

That was once true and remained true for the multiplexer for long after it was fixed in the selector but it's not the case and hasn't been for a LONG time.

Or perhaps your speaking of something else?

trogluddite ·

I beg to differ....

The switch-over may have been made more benign for certain modules etc., by changing their stage(0) behaviour, but the re-compile, force to stage(0) is still there in general.

treacherousumbrella ·

would have to agree, have noticed unpleasant glitches coming from one part of a schematic when a switch in an unrelated area is toggled. Definitely still an issue so tend to use ASM and jnz where possible instead of selectors

oddson ·

I see... it's stage zero that's affected but audio processess are not necessarily interrupted.

I'm not at my SynthMaker machine so I haven't seen your example yet.

trogluddite ·

oddson wrote: I see... it's stage zero that's affected but audio processess are not necessarily interrupted.

Yes, my guess is that the improvements made previously were probably some re-programming of stage(0) for the stock components to make this more benign. I just had to to exactly that with a couple of delays just this week after reports that stage(0) was causing problems. Maybe things are a little different for poly, I'm less sure about those as I have used poly so rarely. Could also be that it's more of a problem for custom code/assembly - the stock modules may well have access to this stuff at a deeper level - e.g. stage(0) in poly is somehow slightly independent for each SSE channel (i.e. voice), which even in assembly would be very tricky to program explicitly using the limited instruction set.

Wrote something here? To have a post removed or your name hidden, write to [email protected].

Before your first post

A few rules keep this a friendly place. You agree to them once.

Shown next to what you post, here and in the app. It doesn’t have to be your real name: 3–24 lower-case letters, digits or _ (capitals become lower case, spaces become _).

    Then your post goes up straight away.

    Delete this reply?

    Open it in SynthMaker?

    It goes on the track you’re editing there, in place of that track’s sound, and into My sounds. Your other tracks stay as they are.

    Want to keep that track’s sound? Start a new song in SynthMaker first (Song › New song), then open this.

    Report this reply?

    Only the developer reads reports. The person isn’t told who reported them.

    What’s wrong with it?

    Block this person?

    You won’t see their posts and replies here any more. They aren’t told, and you can unblock them at any time.

    People you’ve blocked

    Their posts and replies are hidden from you. Unblock someone to see them again.

    The community rules

    A few rules keep this a friendly place. Everyone agrees to them once, before their first post.