Giter Site home page Giter Site logo

dogayuksel / webkeyfinder Goto Github PK

View Code? Open in Web Editor NEW
20.0 1.0 4.0 158.66 MB

Musical Key Detection in the browser

Home Page: https://keyfinder.live

License: GNU General Public License v3.0

Dockerfile 1.28% Makefile 3.49% JavaScript 15.41% C++ 5.91% TypeScript 62.49% HTML 0.88% CSS 10.43% Shell 0.11%
webaudio webassembly preact webworkers

webkeyfinder's Introduction

Introduction

webKeyFinder is a browser application for musical key detection. webKeyFinder works with an audio stream or audio files.

Audio Stream / Live Detection

Using an AudioWorkletProcessor, incoming audio stream is recorded in pulse-code modulation format. Once roughly one second of audio is recorded, the chuck is sent to a web worker running the key finder WebAssembly module. Message passing and analysis repeats until key detection is ended.

Audio File / File Analysis

To prepare for analysis, audio files are first decoded into pulse-code modulation format. Once decoding is done, one second chunks are sent to the web worker running the key finder WebAssembly module. Message passing and analysis repeats until whole audio file is exhausted.

In contrast to live analysis, key detection workload for audio files can be processed in parallel. Once decoding is completed on the main thread, each audio file in the queue works with a dedicated web worker.

Refer to system overview for more details.

Instructions

webKeyFinder consists of two packages. key-finder-wasm provides the web worker for audio key analysis. key-finder-web consumes key-finder-wasm and provides the interfaces to run the key analysis on audio streams and audio files.

key-finder-wasm already includes the built artifacts, key-finder-web can be run without compiling the wasm module.

key-finder-wasm

Prerequisites

emscripten

source ./<emsdk-directory>/emsdk.env.sh

curl

sudo apt-get update
sudo apt-get install curl

Installation

Following command will fetch FFTW3 and libKeyFinder and compile it using emscripten.

yarn build:wasm

key-finder-web

Prerequisites

yarn

Install dependencies

yarn install

Build

yarn build:web

Serve Locally

yarn serve

Acknowledgments

This project is possible thanks to the emscripten library which allowed me to compile, libKeyFinder (originally written by Ibrahim Sha’ath) and its dependency FFTW for the browser.

webkeyfinder's People

Contributors

axeldelafosse avatar dogayuksel avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

webkeyfinder's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update dependency typescript to v5.4.5
  • Update dependency preact to v10.20.2
  • Update dependency husky to v9
  • 🔐 Create all rate-limited PRs at once 🔐

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
Dockerfile
  • docker/dockerfile 1.4
github-actions
.github/workflows/build-and-test.yml
  • docker/setup-buildx-action v2
  • actions/checkout v4
  • cypress-io/github-action v6
  • actions/upload-artifact v3
.github/workflows/clean-old-packages.yml
  • snok/container-retention-policy v2
npm
package.json
  • cypress 13.6.1
  • husky 8.0.3
  • lint-staged 15.2.0
  • prettier 3.1.1
  • yarn 3.6.4
packages/key-finder-wasm/package.json
  • yarn 3.6.4
packages/key-finder-web/package.json
  • @rollup/plugin-node-resolve 15.2.3
  • @rollup/plugin-typescript 11.1.6
  • @surma/rollup-plugin-off-main-thread 2.2.3
  • normalize.css 8.0.1
  • preact 10.19.6
  • preact-router 4.1.2
  • rollup 2.79.1
  • rollup-plugin-css-only 4.5.2
  • serve 13.0.4
  • tslib 2.6.2
  • typescript 5.4.2
  • uuid 9.0.1
  • yarn 3.6.4

  • Check this box to trigger a request for Renovate to run again on this repository

Inconsistent live detection results on Safari

Live results on Safari are consistently inconsistent. While playing the test song, Firefox and Chrome quickly converge on Gm, but Safari lands on A♭m. Audio levels on Safari waveform is also suspiciously low.

safari-firefox-chrome-results

Key analysis on files seems work fine for all the browsers. It is likely that the AudioWorklet for Safari needs an adjustment. Testing with gain adjusted sources yields the same results. Perhaps there is an index mismatch regarding the inputs of the process method.

safari-firefox-chrome-results-gain-adjusted.mov

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.