feat: implement music extension with sample-based audio playback#402
Merged
Conversation
ea38a8f to
234e9a4
Compare
Play drums and instrument notes using MP3 samples from scratch-vm. Bundle 61 MP3 files (18 drums + 43 instrument samples) in assets/music/. Uses SDL2::Mixer for audio playback with 16 channels. - play_drum: loads drum MP3 and plays via SDL2::Mixer - play_note: selects closest sample for target note, plays via SDL2::Mixer - Instrument/tempo management matching Scratch - Allocate 16 mixer channels on init Closes #391 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
234e9a4 to
69cf0ca
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Music 拡張で実際にドラム・楽器の音声を再生。
assets/music/にバンドルplay_drum: ドラム番号に対応するサンプルを再生play_note: 楽器の最適サンプルを選択して再生(Scratch と同じ_selectSampleIndexForNoteロジック)SDL2::Mixer::Channels.allocate(16))テスト
cd ruby/smalruby3 ../rsdl/rsdl -I../ruby-sdl2 -I../ruby-sdl2/lib -Ilib examples/test_music.rbCloses #391
🤖 Generated with Claude Code