Skip to content

Convert music theory logic to Rust WebAssembly#1

Merged
kako-jun merged 4 commits into
mainfrom
claude/music-theory-wasm-rust-01JDZ19CjBzUhUibMkvErrJj
Nov 17, 2025
Merged

Convert music theory logic to Rust WebAssembly#1
kako-jun merged 4 commits into
mainfrom
claude/music-theory-wasm-rust-01JDZ19CjBzUhUibMkvErrJj

Conversation

@kako-jun

Copy link
Copy Markdown
Owner

Pull Request

📋 Summary

Type of Change:

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧪 Test improvements

🔗 Related Issues

Fixes #
Relates to #

📝 Changes Made

🧪 Testing

Test Coverage:

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • Benchmarks run (if applicable)

Test Results:

# Paste relevant test output here
npm test / cargo test / pytest / etc.

📚 Documentation

  • Code is self-documenting with clear variable/function names
  • Public APIs are documented with /// comments
  • README.md updated (if needed)
  • docs/ updated (if needed)
  • CHANGELOG.md updated (if needed)

✅ Checklist

Before submitting this PR, please ensure:

Code Quality

  • Code follows the project's style guidelines
  • Linting passes (eslint/clippy/flake8/etc.)
  • All tests pass
  • Code builds without warnings

Testing

  • New code has appropriate test coverage
  • All existing tests still pass
  • Edge cases have been considered and tested

Documentation

  • Public APIs are properly documented
  • Complex logic includes inline comments
  • User-facing changes are documented

Breaking Changes

  • Breaking changes are clearly documented
  • Migration guide provided (if applicable)
  • Version bump planned appropriately

🎯 Performance Impact

  • No performance impact
  • Performance improvement (include benchmark results)
  • Potential performance regression (justified by benefits)

Benchmark Results (if applicable):

# Include before/after benchmark results
npm run bench / cargo bench / pytest-benchmark / etc.

🔍 Reviewer Notes

Focus Areas:

Questions for Reviewers:

📸 Screenshots (if applicable)

🚀 Deployment Notes

  • No special deployment requirements
  • Requires configuration changes
  • Requires data migration
  • Other:

By submitting this PR, I confirm that:

  • I have read and followed the Contributing Guidelines
  • My code follows the project's coding standards
  • I have tested my changes thoroughly
  • I understand this will be released under the MIT License

音楽理論機能をRust + WASMで実装しました。

- すべてのTypeScript util関数を完全に移植
- 21個のテストがすべて成功
- 既存のTypeScriptコードは保持(呼ばないだけ)

主な機能:
- Note: 五線譜位置計算、ピッチ比較、音価テキスト変換
- Chord: ルート音抽出、フレット位置計算、インターバル判定
- Scale: 構成音取得、ダイアトニックコード生成(トライアド・7th)
- Harmony: 機能和声分析、カデンツ判定、ローマ数字表記
- Utils: クロマチック判定、コード名別表記
TypeScript実装のテストを作成し、Rust実装との比較を実施。

重要な発見:
- 元のTypeScript comparePitch()にバグを発見
- C#2とD♭2の異名同音判定がfalseを返す(本来はtrue)
- Rust実装では半音インデックスで比較し、正しく動作

テスト結果:
- 34個のテストケース作成
- 33個のテストが両実装で一致
- 1個のテストでTypeScriptにバグを発見(Rustは正しい)

Rust実装は元の仕様より改善されていることを確認。
プロジェクトの構想、設計、TODOを.claude/内で管理。

追加ファイル:
- CLAUDE.md: プロジェクト全体の設計ドキュメント
  - アーキテクチャ、ドメインモデル、技術的負債など
- TODO.md: 詳細なタスク管理
  - Phase別のタスク、バグリスト、マイルストーン
- music-theory-wasm-rust-progress.md: 更新
  - デグレチェック結果を追加
  - 発見したバグの詳細を記録

これにより、プロジェクトの全体像と進捗が一元管理される。
@kako-jun kako-jun merged commit 26c2b65 into main Nov 17, 2025
2 of 3 checks passed
@vercel

vercel Bot commented Nov 17, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sid-note Ready Ready Preview Comment Nov 17, 2025 6:35am

kako-jun added a commit that referenced this pull request Dec 17, 2025
…DZ19CjBzUhUibMkvErrJj

Convert music theory logic to Rust WebAssembly
@kako-jun kako-jun deleted the claude/music-theory-wasm-rust-01JDZ19CjBzUhUibMkvErrJj branch December 17, 2025 07:33
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