Skip to content

RadMageIRL/re-moct

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

120 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RE-MOCT - Music On Console Terminal

A homage to MOC - keyboard-driven terminal CD player and ripper for Windows.

Download

⬇ RE-MOCT v1.0.0-RC1 — Windows x64 · all releases

Release candidate. Extract and run remoct.exe — all DLLs included. Windows 10+.

📖 Documentation & Feature Guide


Status: Work in progress - Release candidate available. A prebuilt Windows x64 binary is published as v1.0.0-RC1 on the GitHub Releases page. Polishing the Windows client, Linux port planned.

Built with C++20 · ncurses · miniaudio · TagLib · AccurateRip

Highlights

  • AccurateRip CRCv2 + CUETools (CTDB) verification. Disc-absolute CRCs computed from the 150-sector lead-in; pressing offset auto-detected via frame-450 CRC scan; drive offset applied as a combined sample shift split into whole-sector LBA advance plus sub-sector skip. Offset-immune CTDB fallback when AccurateRip has no entry.
  • Real-time-safe audio path. Raw CDDA sector reads on a dedicated thread feeding a lock-free ring buffer - no mutex in the audio callback. Next track is pre-decoded into a second buffer for gapless/crossfade transitions.
  • Correct handling of awkward discs - hidden lead-in audio, Blue Book / CD-Extra multisession discs, non-standard pressings (see Verified Rips).
  • Gapless, crossfade, ReplayGain, 10-band biquad EQ, BPM detection, MusicBrainz DiscID lookup with Discogs fallback, tag editor, LRC lyrics.

Verified Rips

Real RE-MOCT logs from discs that trip up naïve rippers are in logs/:

Joan Osborne - Relish (1995) - non-standard lead-in: track 1 begins at lba=182 instead of the usual 150, i.e. a 32-frame pregap. RE-MOCT detects the true track-1 LBA and still verifies all 12 tracks at AccurateRip v2, conf 200.

  track[01] lba=182  rel=32        # normal is lba=150 — 32-frame pregap
  t1_lba=182  leadout_rel=275790
  === Summary ===
  AR: 12 v2 + 0 v1 matched, 0 not found / 12 total

Goo Goo Dolls - Gutterflower (2002) - Blue Book / Enhanced CD with a data session alongside the audio. RE-MOCT parses the audio TOC, excludes the data track, and verifies all 12 tracks at AccurateRip v2, conf 200.

  === Summary ===
  AR: 12 v2 + 0 v1 matched, 0 not in database, 0 network error / 12 total

Both ripped on a HL-DT-ST GHD3N at +6-sample offset. A third log (Prince_Rip.log) shows the same pipeline verifying clean on a different drive (ASUS SDRW-08U7M-U) - evidence the offset handling generalises across drives, not just one unit.

Example TUI:

image

image

image

Joan Osborne - Relish (The Lead-in LBA Issue - Solved)


image

Goo Goo Dolls - Gutterflower (Enhanced CD and Hidden Track - Solved)


image

AccurateRip Pipeline (RE-MOCT Native Handshake Implementation)

%%{init: {'flowchart': {'htmlLabels': true, 'padding': 18}}}%%
graph TD
    classDef hardware fill:#13161b,stroke:#4fc8a0,stroke-width:2px,color:#cdd5df;
    classDef handshake fill:#1a1e25,stroke:#c98bff,stroke-width:2px,color:#cdd5df;
    classDef forensic fill:#111418,stroke:#f0c060,stroke-width:2px,color:#cdd5df;
    Start([START RIP]) --> A[Phase 01: Disc ID Gen]
    A --> B[Phase 02: WinInet Handshake]
    B --> C{HTTP 200?}
    C -- Yes --> D[Phase 03: .bin Binary Parse]
    C -- No/404 --> F([NOT FOUND])
    D --> O[Phase 04: Drive Offset Correction]
    O --> P["Phase 04a: Pregap Preamble Read<br/>150 sectors before track start"]
    P --> E["Phase 04b: CRC Accumulate<br/>disc-absolute mul_by anchoring"]
    E --> G[Phase 05: Verify CRCv1/v2 vs DB]
    G --> H{Match Found?}
    H -- Yes --> I([VERIFIED: BIT-PERFECT])
    H -- No --> J{Retry Pass 2?}
    J -- Yes --> K["Flush Hardware Cache<br/>Reduce to 1x Speed"]
    K --> P
    J -- No --> L([ABORT: VERIFY FAIL])
    class A,B,D,O hardware;
    class C,G,H,J handshake;
    class P,E,K forensic;
Loading

Acknowledgements

Verification & metadata services

  • AccurateRip (Spoon / Illustrate) — the AccurateRip verification database, used under non-commercial terms. Drive-offset table sourced from accuraterip.com/driveoffsets.htm.
  • CUETools Database (CTDB) — secondary rip verification via the CTDB lookup service.
  • MusicBrainz — open music metadata database; DiscID lookup and text search.
  • Cover Art Archive — release cover art, embedded into output files via TagLib.
  • AccurateRip CRC and disc-identifier algorithms, and the offset-finding CRC technique, are documented by Spoon (Illustrate / dBpoweramp). RE-MOCT implements them independently.

Algorithm references

  • HydrogenAudio thread #97603 — the canonical public description of the AccurateRip v1/v2 checksum; the primary source for the multiply-accumulate formula used here.
  • Leo Bogert — accuraterip-checksum (accuraterip-checksum.c, GPLv3) — a clean reference implementation of the per-track CRC formula and the first/last-track 5-sector skip; consulted to validate the accumulation against an independent implementation.
  • whipper & CUETools — reference implementations consulted during AccurateRip research.
  • Blue Book (CD-Extra / CD Plus) — the multi-session Enhanced-CD standard. Understanding the two-session layout (audio first, data second) was key to computing correct AccurateRip disc IDs for Enhanced discs such as Goo Goo Dolls — Gutterflower.

Libraries

RE-MOCT links the following third-party libraries. See THIRD_PARTY-NOTICES.md for full license details.

  • libFLAC (Xiph.Org) — FLAC encoding. BSD-3-Clause.
  • LAME (libmp3lame) — MP3 encoding. LGPL-2.1.
  • TagLib — audio metadata tagging. LGPL-2.1 / MPL-1.1.
  • libebur128 — EBU R128 / ReplayGain loudness measurement. MIT.
  • ncurses — terminal UI. MIT-style (X11).
  • miniaudio — audio playback. Public domain (Unlicense) or MIT-0.
  • WinINet (Microsoft Windows) — HTTP transport for database lookups. Windows system API.

License: MIT C++20 Platform: Windows AccurateRip

About

A homage to MOC. Keyboard-driven terminal Music/CD player and ripper but for Windows. AccurateRip verified, FLAC+MP3 output simultaneously.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors