-
Notifications
You must be signed in to change notification settings - Fork 0
Read the kit off the card, so a kit no longer means a rebuild #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
aae02f3
Let a kit own its words instead of pointing at the firmware's
deva0x a615b91
Read the kit off the card, so a kit no longer means a rebuild
deva0x e4bfcd3
Answer the review: nothing a card holds becomes a path
deva0x aed0c6a
Answer the second round: a field said twice is a file that says two t…
deva0x a4634c6
Answer the third round: say what the duplicate-field test depends on
deva0x File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| #include "engine/kit.h" | ||
|
|
||
| #include <cstring> | ||
|
|
||
| namespace engine { | ||
|
|
||
| namespace { | ||
|
|
||
| bool same(const DegreeList& a, const DegreeList& b) { | ||
| return a.length == b.length && std::memcmp(a.degrees, b.degrees, a.length) == 0; | ||
| } | ||
|
|
||
| bool same(const TapTemplate& a, const TapTemplate& b) { | ||
| if (a.step_count != b.step_count) return false; | ||
| for (int i = 0; i < a.step_count; ++i) { | ||
| if (a.steps[i] != b.steps[i]) return false; | ||
| } | ||
| return true; | ||
| } | ||
|
|
||
| bool same(const KitPad& a, const KitPad& b) { | ||
| if (std::strcmp(a.name, b.name) != 0 || a.voice != b.voice || std::strcmp(a.source, b.source) != 0) return false; | ||
| if (a.pitch_semitones != b.pitch_semitones || a.start != b.start || a.decay != b.decay) return false; | ||
| if (a.octave != b.octave || a.send != b.send || a.template_count != b.template_count) return false; | ||
| for (int i = 0; i < a.template_count; ++i) { | ||
| if (!same(a.templates[i], b.templates[i])) return false; | ||
| } | ||
| return true; | ||
| } | ||
|
|
||
| } // namespace | ||
|
|
||
| bool operator==(const Kit& a, const Kit& b) { | ||
| if (std::strcmp(a.id, b.id) != 0) return false; | ||
| for (int i = 0; i < kTrackCount; ++i) { | ||
| if (!same(a.pads[i], b.pads[i])) return false; | ||
| } | ||
| for (int i = 0; i < kModeCount; ++i) { | ||
| if (!same(a.progressions[i], b.progressions[i])) return false; | ||
| } | ||
| if (!same(a.pluck_sequence, b.pluck_sequence)) return false; | ||
| if (a.dice_loop_count != b.dice_loop_count) return false; | ||
| for (int i = 0; i < a.dice_loop_count; ++i) { | ||
| if (std::strcmp(a.dice_loops[i], b.dice_loops[i]) != 0) return false; | ||
| } | ||
| return a.swing_hundredths == b.swing_hundredths && a.filter == b.filter && a.fx == b.fx && | ||
| a.sidechain.on == b.sidechain.on && a.sidechain.duck_db == b.sidechain.duck_db && | ||
| a.sidechain.release_ms == b.sidechain.release_ms; | ||
| } | ||
|
|
||
| } // namespace engine |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Reject a kit whose
iddiffers from the selected folder.boot_settings.kitselectskits/<id>/kit.txt, but a successfully parsed file can retain a differentKit.id. Then D-108 loads samples fromkits/<Kit.id>/, while settings and song selection still refer to the configured folder. Comparekit.idwithboot_settings.kitafter loading. Fall back when they differ. Add a T-101 case for this mismatch.🤖 Prompt for AI Agents