Skip to content

low jitter timer monotonic and various bug fixes#1329

Open
emrum wants to merge 17 commits into
muse-sequencer:masterfrom
emrum:clock_new
Open

low jitter timer monotonic and various bug fixes#1329
emrum wants to merge 17 commits into
muse-sequencer:masterfrom
emrum:clock_new

Conversation

@emrum

@emrum emrum commented Jun 26, 2026

Copy link
Copy Markdown

Summary

  • This branch also contains the CLAP host integration.

  • Current Status: works well, more testing recommended.

  • This PR introduces a modern monotonic high‑resolution timer with optional real‑time priority,
    replaces legacy POSIX timer usage,
    fixes several stability issues,
    and ensures correct MIDI PPQN application during file load.

  • Fix for hexfloat_reading and application of mixer settings.

  • **Fixes number parsing with different locale setting **

  • ** Fix minor compiler warnings **

Key Improvements

CLAP Plugin Host Integration

  • Synths are supported

  • CLAP plugin GUI - supported.

  • Preset save/restore - supported.

  • Not supported yet: CLAP Effects plugins (muse "plugin" type) .

Modern Monotonic Timer

  • Replaces older posix_timer logic with a monotonic high‑resolution timer.

  • Uses real‑time priority if permitted by the system for improved jitter and stability.

MIDI Division (PPQN) Handling

  • Correct application of MIDI division (PPQN) during file load to ensure accurate timing resolution.

Bug Fixes

  •    Fixed CtrlList::read parsing issue
    
  •    Fixed JUCE timer crash in CLAP host integration
    
  •    Fixed parseDouble XML conversion edge cases
    
  •    Additional minor stability fixes
    

Why This Matters

  • These changes improve timing accuracy, reduce jitter, prevent several runtime crashes, and ensure correct MIDI interpretation.

emrum added 17 commits June 16, 2026 13:53
…ribute values

Two bugs in the #else (non-HAVE_ISTRINGSTREAM_HEXFLOAT) path:

1. QString('.') in Qt6 resolves to QString(int=46, QChar()) instead of a
   single-character string ".". This caused s.replace('.', hexfloatDecimalPoint)
   to expand each '.' in the hex-float string to 46 null chars, making
   ba.size() >> (end - sc), so ok was always false and the parsed value
   was discarded.

2. xml.s2() can carry a trailing space or newline from the XML tokeniser.
   strtod parses the value correctly but stops before the whitespace, so
   (end - sc) < ba.size() and ok was set false even though rv was correct.
   This caused spurious "CtrlList::read failed reading _curVal string" log
   spam on every song load, for all automation values stored as hex-floats.

Fix: remove the locale-translation replace() entirely (strtod handles
hex-float '.' natively in all C99+ implementations regardless of system
locale), and call s.trimmed() before toLatin1() so trailing whitespace
does not affect the size comparison.

hexfloatDecimalPoint is retained as a symbol for ABI compatibility but
is no longer used; initialised as QString(QChar('.')) to document the
correct Qt5/Qt6 portable spelling.
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.

1 participant