Just catching myself up on this thread. Here are some notes on the design intent:
-
Elements can be “on” (except for oneshot elements) and/or “making sound” (including oneshot elements, e.g. playing a sample).
-
“on” elements are blue in the Master Interface.
-
“making sound” elements have an amplitude glow and button visualisation in the Master Interface.
-
Elements (including oneshot elements) can be directly started or indirectly started via mood start, which trigger a startElement
event.
-
Elements (except oneshot elements) will be “on” after being started.
-
Once “on”, elements never automatically stop without direct or indirect user action unless exhausted (playlist set to not repeat).
-
Oneshot elements will never be “on”. They can be started multiple times overlapping.
-
Oneshot elements cannot be directly stopped in the Master Interface because we would need an additional different UI to support both multiple triggers and stop. But they can be directly stopped via API, which triggers a stopElement
event.
-
Oneshot elements can be indirectly stopped via stop all or mood stop, which trigger a stopElement
event.
You should consider the start*
and stop*
events to indicate “I’ve been told to start FOO” and “I’ve been told to stop FOO”, rather than “I have started FOO” and “I have stopped FOO”.
If you want to visually indicate that an element is “making sound”, regardless of its “on” state and including oneshots, you should look at the visualisation system.
Our documentation describes its use it to create a global visualiser from the global analyser node. But we also use it in the Master Interface for per element visualisers from individual element analyser nodes. If you’re interested, I can help you with that over email.
Note that in general use (not SoundSet creation) our Master Interface also generally does not concern itself with samples, either. Users typically start and stop moods and elements.
In the past, when oneshot elements did not have artwork, we used to turn them blue when triggered (like an “on” element) and then immediately (after 0.5s) reset to the grey button state to indicate it could be triggered again. Now we rely on the element visualisation to indicate that a oneshot is “making sound”.
One other thing we use in the Master Interface is the animated ring around each element which indicates “time to stop or next sample”. When you receive a startElement
event you get timeToFirstSample
. If this is non-zero, then there is a delay until the first sample and we show the ring as a countdown to the first sample start.
Then with each startSample
event you get timeToNextSample
(including any delay between samples) and timeToStop
(when that sample will stop “making sound”). Sample duration should approximately equal timeToStop
.
If you don’t want to use the visualisation system, you could use these timeTo*
values to implement a simple visualisation with timers, without removing the ability to trigger multiple overlapping oneshots. You’ll just need to be careful to clear existing timers when a new event comes in for that element.
The visualisation system is the best way to determine what is actually being heard in the mix without having to worry about maintaining synchronised state.