From 30d9fabdef8a1669257b9daf702773fe861309c5 Mon Sep 17 00:00:00 2001 From: danigb Date: Mon, 22 Apr 2024 07:47:27 +0200 Subject: [PATCH 1/3] fix: loop font data sample rate --- .changeset/odd-ravens-guess.md | 5 +++++ src/soundfont/soundfont-loops.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/odd-ravens-guess.md diff --git a/.changeset/odd-ravens-guess.md b/.changeset/odd-ravens-guess.md new file mode 100644 index 0000000..82126e0 --- /dev/null +++ b/.changeset/odd-ravens-guess.md @@ -0,0 +1,5 @@ +--- +"smplr": patch +--- + +Fix sampleRate used to calculate Soundfont's loop points 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) { From e25dc76ca26d45297d930396c9eb73e785deacd7 Mon Sep 17 00:00:00 2001 From: danigb Date: Mon, 22 Apr 2024 07:49:24 +0200 Subject: [PATCH 2/3] bum: 0.13.4 --- CHANGELOG.md | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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", From 7749cf237c5c1e5948610cbd126198ae9d3ac406 Mon Sep 17 00:00:00 2001 From: danigb Date: Mon, 22 Apr 2024 07:51:30 +0200 Subject: [PATCH 3/3] chore: fix deploy site --- .changeset/odd-ravens-guess.md | 5 ----- site/next.config.js | 1 + site/package.json | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) delete mode 100644 .changeset/odd-ravens-guess.md diff --git a/.changeset/odd-ravens-guess.md b/.changeset/odd-ravens-guess.md deleted file mode 100644 index 82126e0..0000000 --- a/.changeset/odd-ravens-guess.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"smplr": patch ---- - -Fix sampleRate used to calculate Soundfont's loop points 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" },