Skip to content

Commit

Permalink
Merge pull request #20 from ryohey/fix-bank-select
Browse files Browse the repository at this point in the history
Fix bank select
  • Loading branch information
ryohey authored Jun 12, 2024
2 parents 140c04c + ceab6d5 commit 7c2722a
Show file tree
Hide file tree
Showing 5 changed files with 5,988 additions and 5,500 deletions.
16 changes: 8 additions & 8 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
"wav-encoder": "^1.3.0"
},
"devDependencies": {
"@guanghechen/rollup-plugin-copy": "^2.1.4",
"@rollup/plugin-commonjs": "^24.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-typescript": "^10.0.1",
"@types/wav-encoder": "^1.3.0",
"rollup": "^3.7.5",
"@guanghechen/rollup-plugin-copy": "^5.0.12",
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.6",
"@types/wav-encoder": "^1.3.3",
"rollup": "^4.18.0",
"rollup-plugin-serve": "^2.0.2",
"tslib": "^2.4.1",
"typescript": "^4.9.4"
"tslib": "^2.6.3",
"typescript": "^5.4.5"
}
}
22 changes: 11 additions & 11 deletions lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ryohey/wavelet",
"version": "0.7.2",
"version": "0.7.3",
"description": "A wavetable synthesizer that never stops the UI thread created by AudioWorklet.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -17,15 +17,15 @@
"midifile-ts": "^1.5.1"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^24.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-typescript": "^10.0.1",
"@types/audioworklet": "^0.0.36",
"@types/jest": "^29.2.4",
"jest": "^29.3.1",
"rollup": "^3.7.5",
"ts-jest": "^29.0.3",
"tslib": "^2.4.1",
"typescript": "^4.9.4"
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.6",
"@types/audioworklet": "^0.0.55",
"@types/jest": "^29.5.12",
"jest": "^29.7.0",
"rollup": "^4.18.0",
"ts-jest": "^29.1.4",
"tslib": "^2.6.3",
"typescript": "^5.4.5"
}
}
7 changes: 6 additions & 1 deletion lib/src/processor/SampleTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,13 @@ export class SampleTable {
pitch: number,
velocity: number
): Sample[] {
const instrumentParameters =
this.sampleParameters[bank]?.[instrument] ??
this.sampleParameters[0]?.[instrument] ?? // fallback to bank 0
null

const parameters =
this.sampleParameters?.[bank]?.[instrument]?.[pitch]?.filter(
instrumentParameters?.[pitch]?.filter(
(s) => velocity >= s.velRange[0] && velocity <= s.velRange[1]
) ?? []

Expand Down
Loading

0 comments on commit 7c2722a

Please sign in to comment.