Skip to content

0.3.0-dev.1: AHAP accuracy fixes, primitives, AHAP parsing, demo app improvements - #1

Merged
imedboumalek merged 10 commits into
mainfrom
dev
Jul 13, 2026
Merged

0.3.0-dev.1: AHAP accuracy fixes, primitives, AHAP parsing, demo app improvements#1
imedboumalek merged 10 commits into
mainfrom
dev

Conversation

@imedboumalek

Copy link
Copy Markdown
Owner

Summary

  • Fix a real AHAP bug: curve control point times are now encoded relative to the curve's start (Core Haptics spec), not absolute pattern time — every curve segment after the first in a long sound was previously mistimed on iOS
  • Scale the intensity-curve point budget with segment duration (--curve-rate) so long/complex uploads keep envelope detail instead of being flattened into a fixed 32-point cap; RDP simplifier now binary-searches its tolerance to use the full budget
  • Sample Android waveform amplitudes at step midpoints instead of segment starts, removing a half-step lag that dulled ramps
  • Add Android primitive composition support: pattern.toPrimitives() + --formats primitives CLI output, mapping patterns onto VibrationEffect.Composition primitives
  • Add AHAP parsing: HapticPattern.fromAhap + CLI accepts .ahap inputs directly, converting to Android formats without re-analyzing audio
  • Fix the demo app's playback sync (vibration leading audio, playhead jump/reset) by driving the playhead from a monotonic clock keyed off PlayerState.playing instead of the player's position stream
  • Fix demo app asset bundling after the CLI's new grouped output layout (assets/haptics/ahap/, assets/haptics/waveform/)
  • Refactor the demo app's main.dart into models/, playback/, widgets/ — extracting a standalone PlaybackController

Version bumped to 0.3.0-dev.1 (prerelease); tag v0.3.0-dev.1 staged locally, not yet pushed.

Test plan

  • dart analyze --fatal-infos clean on the package
  • dart test — 139 tests passing (AHAP encoder/decoder, waveform, primitives, analyzer, CLI, MP3)
  • flutter analyze clean on example_app
  • flutter test passing on example_app
  • dart pub publish --dry-run clean
  • Manual on-device check of the demo app's playback sync fix (recommended before tagging/publishing)

@imedboumalek
imedboumalek merged commit 6a2e770 into main Jul 13, 2026
0 of 2 checks passed
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