diff --git a/CHANGELOG.md b/CHANGELOG.md index 426b7a3..61bb6a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 0.13.x -- DrumMachines accept a DrumMachineInstrument as source +#### DrumMachines accept a DrumMachineInstrument as source Previously you could use a instrument name or a instrument url to load a DrumMachine. @@ -27,6 +27,7 @@ const drums = new DrumMachine(context, { }); ``` +- Fix: sample rate used to calculate soundfont loop data - DrumMachine uses https://github.com/smpldsnds/drum-machines as source of samples - Fix: `detune` param on `start` method diff --git a/package.json b/package.json index a819eab..6a06e88 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "smplr", - "version": "0.13.3", + "version": "0.13.4", "homepage": "https://github.com/danigb/smplr#readme", "description": "A Sampled collection of instruments", "main": "dist/index.js", diff --git a/site/next.config.js b/site/next.config.js index d4d4344..99dfbee 100644 --- a/site/next.config.js +++ b/site/next.config.js @@ -10,6 +10,7 @@ if (isDeploy) { } /** @type {import('next').NextConfig} */ const nextConfig = { + output: "export", assetPrefix, basePath, reactStrictMode: true, diff --git a/site/package.json b/site/package.json index c005b39..fa0d4d5 100644 --- a/site/package.json +++ b/site/package.json @@ -7,7 +7,7 @@ "devs": "next-dev-https --https --port 3001", "deploy": "npm run deploy:build && npm run deploy:github", "deploy:github": "npm run deploy:build && gh-pages -d out/ -t true", - "deploy:build": "DEPLOY=true next build && DEPLOY=true next export", + "deploy:build": "DEPLOY=true next build", "start": "next start", "lint": "next lint" }, diff --git a/src/soundfont/soundfont-loops.ts b/src/soundfont/soundfont-loops.ts index 73f35bc..4dce2f4 100644 --- a/src/soundfont/soundfont-loops.ts +++ b/src/soundfont/soundfont-loops.ts @@ -13,7 +13,8 @@ export function getGoldstSoundfontLoopsUrl(instrument: string, kit: string) { * @see https://github.com/danigb/smplr/issues/23 */ export async function fetchSoundfontLoopData( - url?: string + url?: string, + sampleRate = 44100 ): Promise { if (!url) return undefined; try { @@ -22,7 +23,6 @@ export async function fetchSoundfontLoopData( const raw = await req.json(); const loopData: LoopData = {}; - const sampleRate = 41000; // this is sample rate from the repository samples Object.keys(raw).forEach((key) => { const midi = toMidi(key); if (midi) {