Skip to content

Internal media source: silence at idle, drive for patterns + T-code - #42

Open
quixotic1111 wants to merge 1 commit into
diglet48:masterfrom
quixotic1111:fix/internal-source-activity
Open

Internal media source: silence at idle, drive for patterns + T-code#42
quixotic1111 wants to merge 1 commit into
diglet48:masterfrom
quixotic1111:fix/internal-source-activity

Conversation

@quixotic1111

Copy link
Copy Markdown

Problem

Selecting the Internal media source and pressing Start emits a steady
carrier tone even when nothing is driving the output, because
Internal.state() unconditionally returns CONNECTED_AND_PLAYING. The
mute guard in the audio-gen algorithm therefore never engages for the
Internal source.

Conversely, anyone who fixes that idle tone by gating Internal on
activity then finds the built-in pattern generator no longer drives the
electrodes
— it doesn't mark itself as activity, so Internal reports
"not playing" and the carrier is muted. That makes Internal + a pattern
(e.g. for electrode calibration) produce no output.

Change

Gate Internal.state() on recent activity, and have every drive source
mark activity:

  • External T-code — websocket / TCP-UDP / serial / buttplug, via the
    existing new_tcode_command signal.
  • Built-in pattern generatormotion_3 / motion_4, via their
    existing position_updated signal, but only when the emitted position
    actually changes. A static / at-rest pattern marks no activity, so
    the carrier still goes quiet at true idle (the anti-drone behavior).

No change to pattern output, timing, or shapes — patterns emit exactly as
before; this only governs the Internal source's reported play state.

Result

  • Internal is silent at true idle (no surprise carrier tone).
  • A moving built-in pattern drives the electrodes with no external T-code
    stream — useful for calibration.
  • External T-code drives as it always has.

Two files, +59/-1.

The Internal media source previously reported CONNECTED_AND_PLAYING
unconditionally, so selecting Internal + Start emitted a steady carrier
tone even when nothing was driving the output.

Gate its reported state on recent activity instead: it returns PLAYING
only while a drive source has written within ACTIVITY_TIMEOUT_S (2s) and
silences otherwise. Every drive source marks activity:

  - external T-code (websocket, TCP/UDP, serial, buttplug) via their
    existing new_tcode_command signal;
  - the built-in pattern generator (motion_3 / motion_4) via its
    position_updated signal, but only when the position actually
    changes -- so a static / at-rest pattern still silences, preserving
    the anti-drone behavior.

Net effect: the built-in pattern generator now drives the electrodes
when Internal is selected (e.g. for calibration) without requiring an
external T-code stream, while the carrier stays quiet at true idle.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@diglet48

diglet48 commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Sorry for the delay.

I don't want to change this, I feel the current behavior already is not great because the lack of feedback in the user interface and harsh ramp. With this change, testing a non-moving position with the mouse doesn't seem possible anymore.

There already is a feature that reduces the output volume when there are no axis changes ("lower volume during pauses"), it is in the volume tab and updates the volume bar.

@quixotic1111

quixotic1111 commented Jul 12, 2026 via email

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants