├── .husky
├── .gitignore
├── pre-commit
└── commit-msg
├── testing
├── datasets
│ └── .gitkeep
├── index.html
├── types.ts
├── tools
│ ├── generate-manifest.ts
│ ├── utils.ts
│ └── bpm-reporter.ts
└── index.ts
├── .versionrc.json
├── docs
├── vite-env.d.ts
├── public
│ ├── realtime-bpm-analyzer-icon.png
│ └── realtime-bpm-analyzer-share.png
├── .vitepress
│ ├── theme
│ │ ├── index.ts
│ │ └── custom.css
│ ├── config.ts
│ └── components
│ │ └── ExampleEmbed.vue
├── .gitignore
├── favicon-settings.json
├── package.json
├── scripts
│ ├── dev-examples.ts
│ └── build-examples.ts
├── readme.md
├── examples
│ ├── basic-usage.md
│ ├── streaming-audio.md
│ ├── microphone-input.md
│ ├── react.md
│ └── vue.md
├── guide
│ ├── migration-v5.md
│ ├── introduction.md
│ └── getting-started.md
└── index.md
├── codecov.yml
├── examples
├── 04-react-basic
│ ├── src
│ │ ├── vite-env.d.ts
│ │ ├── main.tsx
│ │ ├── app.tsx
│ │ ├── app.css
│ │ └── components
│ │ │ ├── bpm-analyzer.css
│ │ │ └── bpm-analyzer.tsx
│ ├── vite.config.ts
│ ├── index.html
│ ├── readme.md
│ ├── package.json
│ └── tsconfig.json
├── 05-react-streaming
│ ├── src
│ │ ├── vite-env.d.ts
│ │ ├── main.tsx
│ │ ├── app.tsx
│ │ ├── app.css
│ │ └── components
│ │ │ └── bpm-analyzer.css
│ ├── vite.config.ts
│ ├── index.html
│ ├── readme.md
│ ├── tsconfig.json
│ └── package.json
├── 06-react-microphone
│ ├── src
│ │ ├── vite-env.d.ts
│ │ ├── main.tsx
│ │ ├── app.tsx
│ │ ├── app.css
│ │ └── components
│ │ │ ├── bpm-analyzer.css
│ │ │ └── bpm-analyzer.tsx
│ ├── vite.config.ts
│ ├── index.html
│ ├── readme.md
│ ├── tsconfig.json
│ └── package.json
├── 08-vue-streaming
│ ├── src
│ │ ├── vite-env.d.ts
│ │ ├── main.ts
│ │ ├── app.vue
│ │ └── style.css
│ ├── vite.config.ts
│ ├── index.html
│ ├── package.json
│ ├── readme.md
│ └── tsconfig.json
├── 09-vue-microphone
│ ├── src
│ │ ├── vite-env.d.ts
│ │ ├── main.ts
│ │ ├── app.vue
│ │ ├── style.css
│ │ └── components
│ │ │ └── bpm-analyzer.vue
│ ├── vite.config.ts
│ ├── index.html
│ ├── readme.md
│ ├── package.json
│ └── tsconfig.json
├── 07-vue-basic
│ ├── src
│ │ ├── main.ts
│ │ ├── app.vue
│ │ ├── style.css
│ │ └── components
│ │ │ └── bpm-analyzer.vue
│ ├── vite.config.ts
│ ├── index.html
│ ├── package.json
│ ├── readme.md
│ └── tsconfig.json
├── 01-vanilla-basic
│ ├── vite.config.ts
│ ├── tsconfig.json
│ ├── package.json
│ ├── readme.md
│ ├── src
│ │ └── main.ts
│ └── index.html
├── 02-vanilla-streaming
│ ├── vite.config.ts
│ ├── tsconfig.json
│ ├── package.json
│ ├── readme.md
│ ├── src
│ │ └── main.ts
│ └── index.html
├── 03-vanilla-microphone
│ ├── vite.config.ts
│ ├── tsconfig.json
│ ├── package.json
│ ├── readme.md
│ ├── index.html
│ └── src
│ │ └── main.ts
└── readme.md
├── brand
├── icon-vector.ai
├── github-share.png
├── github-share.psd
├── icon-vector-rgb.ai
├── realtime-bpm-analyzer-icon.png
├── realtime-bpm-analyzer-icon.psd
└── icon.svg
├── tests
├── fixtures
│ └── bass-test.wav
├── lib
│ ├── analyzer.ts
│ ├── utils.ts
│ └── realtime-bpm-analyzer.ts
└── integration
│ └── create-processor.test.ts
├── tsconfig.docs.json
├── .commitlintrc.cjs
├── types
└── env.d.ts
├── web-dev-server.config.mjs
├── .gitignore
├── .npmignore
├── tsconfig.json
├── bin
└── build
│ └── library.sh
├── .editorconfig
├── .releaserc.json
├── code-of-conduct.md
├── web-test-runner.config.mjs
├── contributing.md
├── typedoc.json
├── src
├── core
│ ├── consts.ts
│ └── utils.ts
└── processor
│ └── realtime-bpm-processor.ts
├── security.md
├── .github
└── workflows
│ ├── main.yml
│ └── codeql.yml
├── readme.md
├── privacy.md
└── package.json
/.husky/.gitignore:
--------------------------------------------------------------------------------
1 | _
2 |
--------------------------------------------------------------------------------
/testing/datasets/.gitkeep:
--------------------------------------------------------------------------------
1 | !.gitignore
2 |
--------------------------------------------------------------------------------
/.versionrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "infile": "changelog.md"
3 | }
4 |
--------------------------------------------------------------------------------
/docs/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/codecov.yml:
--------------------------------------------------------------------------------
1 | codecov:
2 | token: 9d63d0e7-3a40-4010-9727-eed86c66aec2
3 |
--------------------------------------------------------------------------------
/examples/04-react-basic/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/05-react-streaming/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/06-react-microphone/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/08-vue-streaming/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/09-vue-microphone/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | . "$(dirname "$0")/_/husky.sh"
3 |
4 | npx lint-staged
5 |
--------------------------------------------------------------------------------
/brand/icon-vector.ai:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dlepaux/realtime-bpm-analyzer/HEAD/brand/icon-vector.ai
--------------------------------------------------------------------------------
/brand/github-share.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dlepaux/realtime-bpm-analyzer/HEAD/brand/github-share.png
--------------------------------------------------------------------------------
/brand/github-share.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dlepaux/realtime-bpm-analyzer/HEAD/brand/github-share.psd
--------------------------------------------------------------------------------
/brand/icon-vector-rgb.ai:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dlepaux/realtime-bpm-analyzer/HEAD/brand/icon-vector-rgb.ai
--------------------------------------------------------------------------------
/.husky/commit-msg:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | . "$(dirname "$0")/_/husky.sh"
3 |
4 | npx --no-install commitlint --edit "$1"
5 |
--------------------------------------------------------------------------------
/tests/fixtures/bass-test.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dlepaux/realtime-bpm-analyzer/HEAD/tests/fixtures/bass-test.wav
--------------------------------------------------------------------------------
/brand/realtime-bpm-analyzer-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dlepaux/realtime-bpm-analyzer/HEAD/brand/realtime-bpm-analyzer-icon.png
--------------------------------------------------------------------------------
/brand/realtime-bpm-analyzer-icon.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dlepaux/realtime-bpm-analyzer/HEAD/brand/realtime-bpm-analyzer-icon.psd
--------------------------------------------------------------------------------
/docs/public/realtime-bpm-analyzer-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dlepaux/realtime-bpm-analyzer/HEAD/docs/public/realtime-bpm-analyzer-icon.png
--------------------------------------------------------------------------------
/docs/public/realtime-bpm-analyzer-share.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dlepaux/realtime-bpm-analyzer/HEAD/docs/public/realtime-bpm-analyzer-share.png
--------------------------------------------------------------------------------
/examples/07-vue-basic/src/main.ts:
--------------------------------------------------------------------------------
1 | import { createApp } from 'vue';
2 | import App from './app.vue';
3 | import './style.css';
4 |
5 | createApp(App).mount('#app');
6 |
--------------------------------------------------------------------------------
/examples/08-vue-streaming/src/main.ts:
--------------------------------------------------------------------------------
1 | import { createApp } from 'vue';
2 | import App from './app.vue';
3 | import './style.css';
4 |
5 | createApp(App).mount('#app');
6 |
--------------------------------------------------------------------------------
/examples/09-vue-microphone/src/main.ts:
--------------------------------------------------------------------------------
1 | import { createApp } from 'vue';
2 | import App from './app.vue';
3 | import './style.css';
4 |
5 | createApp(App).mount('#app');
6 |
--------------------------------------------------------------------------------
/tsconfig.docs.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "include": ["src/**/*.ts"],
4 | "exclude": ["tests/**", "testing/**", "node_modules/**", "dist/**", "docs/**"]
5 | }
6 |
--------------------------------------------------------------------------------
/testing/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/examples/01-vanilla-basic/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite';
2 |
3 | export default defineConfig({
4 | server: {
5 | port: process.env.PORT ? parseInt(process.env.PORT) : 3001,
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/examples/02-vanilla-streaming/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite';
2 |
3 | export default defineConfig({
4 | server: {
5 | port: process.env.PORT ? parseInt(process.env.PORT) : 3002,
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/examples/03-vanilla-microphone/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite';
2 |
3 | export default defineConfig({
4 | server: {
5 | port: process.env.PORT ? parseInt(process.env.PORT) : 3003,
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/.commitlintrc.cjs:
--------------------------------------------------------------------------------
1 | const commitlint = {
2 | extends: ['@commitlint/config-conventional'],
3 | rules: {
4 | 'body-max-line-length': [0, 'never'], // Disable the line length check
5 | },
6 | };
7 |
8 | module.exports = commitlint;
9 |
--------------------------------------------------------------------------------
/types/env.d.ts:
--------------------------------------------------------------------------------
1 | export {};
2 |
3 | declare global {
4 | namespace NodeJS {
5 | interface ProcessEnv { // eslint-disable-line @typescript-eslint/consistent-type-definitions
6 | processors: Record;
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/examples/04-react-basic/src/main.tsx:
--------------------------------------------------------------------------------
1 | import { StrictMode } from 'react';
2 | import { createRoot } from 'react-dom/client';
3 | import App from './app';
4 |
5 | createRoot(document.getElementById('root')!).render(
6 |
7 |
8 |
9 | );
10 |
--------------------------------------------------------------------------------
/examples/07-vue-basic/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite';
2 | import vue from '@vitejs/plugin-vue';
3 |
4 | export default defineConfig({
5 | plugins: [vue()],
6 | server: {
7 | port: process.env.PORT ? parseInt(process.env.PORT) : 3007,
8 | },
9 | });
10 |
--------------------------------------------------------------------------------
/testing/types.ts:
--------------------------------------------------------------------------------
1 | import type {Tempo} from '../src/index';
2 |
3 | export type Manifest = Record;
4 |
5 | export type Closure = () => Promise;
6 |
7 | export type AudioFile = {
8 | filename: string;
9 | bpm: number;
10 | tempos: Tempo[];
11 | };
12 |
--------------------------------------------------------------------------------
/examples/05-react-streaming/src/main.tsx:
--------------------------------------------------------------------------------
1 | import { StrictMode } from 'react';
2 | import { createRoot } from 'react-dom/client';
3 | import App from './app';
4 |
5 | createRoot(document.getElementById('root')!).render(
6 |
7 |
8 |
9 | );
10 |
--------------------------------------------------------------------------------
/examples/06-react-microphone/src/main.tsx:
--------------------------------------------------------------------------------
1 | import { StrictMode } from 'react';
2 | import { createRoot } from 'react-dom/client';
3 | import App from './app';
4 |
5 | createRoot(document.getElementById('root')!).render(
6 |
7 |
8 |
9 | );
10 |
--------------------------------------------------------------------------------
/examples/08-vue-streaming/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite';
2 | import vue from '@vitejs/plugin-vue';
3 |
4 | export default defineConfig({
5 | plugins: [vue()],
6 | server: {
7 | port: process.env.PORT ? parseInt(process.env.PORT) : 3008,
8 | },
9 | });
10 |
--------------------------------------------------------------------------------
/examples/09-vue-microphone/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite';
2 | import vue from '@vitejs/plugin-vue';
3 |
4 | export default defineConfig({
5 | plugins: [vue()],
6 | server: {
7 | port: process.env.PORT ? parseInt(process.env.PORT) : 3009,
8 | },
9 | });
10 |
--------------------------------------------------------------------------------
/examples/04-react-basic/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite';
2 | import react from '@vitejs/plugin-react';
3 |
4 | export default defineConfig({
5 | plugins: [react()],
6 | server: {
7 | port: process.env.PORT ? parseInt(process.env.PORT) : 3004,
8 | },
9 | });
10 |
--------------------------------------------------------------------------------
/examples/05-react-streaming/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite';
2 | import react from '@vitejs/plugin-react';
3 |
4 | export default defineConfig({
5 | plugins: [react()],
6 | server: {
7 | port: process.env.PORT ? parseInt(process.env.PORT) : 3005,
8 | },
9 | });
10 |
--------------------------------------------------------------------------------
/examples/06-react-microphone/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite';
2 | import react from '@vitejs/plugin-react';
3 |
4 | export default defineConfig({
5 | plugins: [react()],
6 | server: {
7 | port: process.env.PORT ? parseInt(process.env.PORT) : 3006,
8 | },
9 | });
10 |
--------------------------------------------------------------------------------
/web-dev-server.config.mjs:
--------------------------------------------------------------------------------
1 | import {esbuildPlugin} from '@web/dev-server-esbuild';
2 |
3 | export default {
4 | open: false,
5 | watch: false,
6 | nodeResolve: true,
7 | appIndex: 'testing/index.html',
8 | rootDir: '.',
9 | plugins: [esbuildPlugin({ts: true, target: 'auto'})],
10 | };
11 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .next
2 | *.DS_Store
3 | coverage
4 | dist
5 | node_modules
6 | tests/datasets/*
7 | testing/datasets
8 | testing/manifest.json
9 |
10 | # Generated files (auto-created during build)
11 | src/generated-processor.ts
12 |
13 | # VitePress documentation build output
14 | docs/.vitepress/dist
15 | docs/.vitepress/cache
16 | docs/node_modules
17 |
--------------------------------------------------------------------------------
/examples/07-vue-basic/src/app.vue:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/07-vue-basic/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | BPM Analyzer - Vue
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/04-react-basic/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | BPM Analyzer - React
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/08-vue-streaming/src/app.vue:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/08-vue-streaming/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | BPM Analyzer - Vue Streaming
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/09-vue-microphone/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | BPM Analyzer - Vue Microphone
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/09-vue-microphone/src/app.vue:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/05-react-streaming/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | BPM Analyzer - React Streaming
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/06-react-microphone/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | BPM Analyzer - React Microphone
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/docs/.vitepress/theme/index.ts:
--------------------------------------------------------------------------------
1 | import DefaultTheme from 'vitepress/theme'
2 | import type { Theme } from 'vitepress'
3 | import ExampleEmbed from '../components/ExampleEmbed.vue'
4 | import './custom.css'
5 |
6 | export default {
7 | extends: DefaultTheme,
8 | enhanceApp({ app }: { app: any }) {
9 | // Register ExampleEmbed component globally
10 | app.component('ExampleEmbed', ExampleEmbed)
11 | }
12 | } satisfies Theme
13 |
--------------------------------------------------------------------------------
/examples/01-vanilla-basic/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "module": "ESNext",
5 | "lib": ["ES2020", "DOM", "DOM.Iterable"],
6 | "moduleResolution": "bundler",
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "esModuleInterop": true,
10 | "resolveJsonModule": true,
11 | "isolatedModules": true,
12 | "noEmit": true
13 | },
14 | "include": ["src"]
15 | }
16 |
--------------------------------------------------------------------------------
/docs/.gitignore:
--------------------------------------------------------------------------------
1 | # VitePress build output
2 | .vitepress/dist
3 | .vitepress/cache
4 | .vitepress/.temp
5 |
6 | # TypeDoc legacy HTML output (we use markdown now)
7 | docs/
8 | api/
9 |
10 | # Dependencies
11 | node_modules/
12 |
13 | # System files
14 | .DS_Store
15 |
16 | # Copied from root
17 | contributing.md
18 | code-of-conduct.md
19 | security.md
20 | privacy.md
21 |
22 | # Generated assets
23 | public/favicon/
24 | favicon.json
25 |
--------------------------------------------------------------------------------
/examples/02-vanilla-streaming/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "module": "ESNext",
5 | "lib": ["ES2020", "DOM", "DOM.Iterable"],
6 | "moduleResolution": "bundler",
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "esModuleInterop": true,
10 | "resolveJsonModule": true,
11 | "isolatedModules": true,
12 | "noEmit": true
13 | },
14 | "include": ["src"]
15 | }
16 |
--------------------------------------------------------------------------------
/examples/03-vanilla-microphone/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "module": "ESNext",
5 | "lib": ["ES2020", "DOM", "DOM.Iterable"],
6 | "moduleResolution": "bundler",
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "esModuleInterop": true,
10 | "resolveJsonModule": true,
11 | "isolatedModules": true,
12 | "noEmit": true
13 | },
14 | "include": ["src"]
15 | }
16 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | .github
2 | .husky
3 | bin
4 | brand
5 | coverage
6 | docs
7 | github-pages
8 | node_modules
9 | src
10 | testing
11 | tests
12 | types
13 | .commitlintrc.cjs
14 | .editorconfig
15 | .eslintignore
16 | .gitignore
17 | .npmignore
18 | .versionrc.json
19 | build.ts
20 | changelog.md
21 | code-of-conduct.md
22 | codecov.yml
23 | contributing.md
24 | tsconfig.json
25 | typedoc.json
26 | web-test-runner.config.mjs
27 | web-dev-server.config.mjs
28 |
--------------------------------------------------------------------------------
/examples/01-vanilla-basic/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "realtime-bpm-analyzer-example-vanilla-basic",
3 | "version": "1.0.0",
4 | "private": true,
5 | "type": "module",
6 | "scripts": {
7 | "dev": "vite",
8 | "build": "vite build",
9 | "preview": "vite preview"
10 | },
11 | "dependencies": {
12 | "realtime-bpm-analyzer": "file:../.."
13 | },
14 | "devDependencies": {
15 | "typescript": "^5.6.0",
16 | "vite": "^5.4.0"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/examples/02-vanilla-streaming/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "realtime-bpm-analyzer-example-vanilla-streaming",
3 | "version": "1.0.0",
4 | "private": true,
5 | "type": "module",
6 | "scripts": {
7 | "dev": "vite",
8 | "build": "vite build",
9 | "preview": "vite preview"
10 | },
11 | "dependencies": {
12 | "realtime-bpm-analyzer": "file:../.."
13 | },
14 | "devDependencies": {
15 | "typescript": "^5.6.0",
16 | "vite": "^5.4.0"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/examples/04-react-basic/src/app.tsx:
--------------------------------------------------------------------------------
1 | import BpmAnalyzer from './components/bpm-analyzer';
2 | import './app.css';
3 |
4 | function App() {
5 | return (
6 |
15 | );
16 | }
17 |
18 | export default App;
19 |
--------------------------------------------------------------------------------
/docs/.vitepress/theme/custom.css:
--------------------------------------------------------------------------------
1 | /* Custom styles for documentation */
2 |
3 | /* Enhance code blocks */
4 | .vp-doc div[class*='language-'] {
5 | margin: 1.5rem 0;
6 | }
7 |
8 | /* Make example embeds stand out */
9 | .example-embed {
10 | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
11 | }
12 |
13 | /* Dark mode adjustments */
14 | .dark .example-embed {
15 | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
16 | }
17 |
18 | .dark .example-frame {
19 | background: #1a1a1a;
20 | }
21 |
--------------------------------------------------------------------------------
/examples/01-vanilla-basic/readme.md:
--------------------------------------------------------------------------------
1 | # Basic Usage Example
2 |
3 | A minimal example demonstrating how to analyze BPM from audio files using offline analysis.
4 |
5 | ## Features
6 |
7 | - File upload interface
8 | - Offline BPM analysis with `analyzeFullBuffer`
9 | - Clean, modern UI
10 | - No audio playback required
11 |
12 | ## Run Locally
13 |
14 | ```bash
15 | npm install
16 | npm run dev
17 | ```
18 |
19 | Open [http://localhost:3000](http://localhost:3000) in your browser.
20 |
--------------------------------------------------------------------------------
/examples/03-vanilla-microphone/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "realtime-bpm-analyzer-example-vanilla-microphone",
3 | "version": "1.0.0",
4 | "private": true,
5 | "type": "module",
6 | "scripts": {
7 | "dev": "vite",
8 | "build": "vite build",
9 | "preview": "vite preview"
10 | },
11 | "dependencies": {
12 | "realtime-bpm-analyzer": "file:../.."
13 | },
14 | "devDependencies": {
15 | "typescript": "^5.6.0",
16 | "vite": "^5.4.0"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/examples/02-vanilla-streaming/readme.md:
--------------------------------------------------------------------------------
1 | # Streaming Audio Example
2 |
3 | Demonstrates real-time BPM analysis from streaming audio sources (URLs).
4 |
5 | ## Features
6 |
7 | - Load audio from remote URLs
8 | - Real-time BPM detection during playback
9 | - Continuous analysis with confidence scores
10 | - Play/pause/stop controls
11 |
12 | ## Run Locally
13 |
14 | ```bash
15 | npm install
16 | npm run dev
17 | ```
18 |
19 | Open [http://localhost:3001](http://localhost:3001) in your browser.
20 |
--------------------------------------------------------------------------------
/examples/05-react-streaming/src/app.tsx:
--------------------------------------------------------------------------------
1 | import BpmAnalyzer from './components/bpm-analyzer';
2 | import './app.css';
3 |
4 | function App() {
5 | return (
6 |
15 | );
16 | }
17 |
18 | export default App;
19 |
--------------------------------------------------------------------------------
/examples/06-react-microphone/src/app.tsx:
--------------------------------------------------------------------------------
1 | import BpmAnalyzer from './components/bpm-analyzer';
2 | import './app.css';
3 |
4 | function App() {
5 | return (
6 |
15 | );
16 | }
17 |
18 | export default App;
19 |
--------------------------------------------------------------------------------
/examples/03-vanilla-microphone/readme.md:
--------------------------------------------------------------------------------
1 | # Microphone Input Example
2 |
3 | Real-time BPM detection from microphone or line-in audio input.
4 |
5 | ## Features
6 |
7 | - Real-time microphone input processing
8 | - Live BPM detection with continuous analysis
9 | - Tempo categorization (Slow, Moderate, Fast, etc.)
10 | - Visual feedback with animated microphone icon
11 |
12 | ## Run Locally
13 |
14 | ```bash
15 | npm install
16 | npm run dev
17 | ```
18 |
19 | Open [http://localhost:3002](http://localhost:3002) in your browser.
20 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2015",
4 | "module": "commonjs",
5 | "lib": ["dom", "dom.iterable", "es6"],
6 | "skipLibCheck": true,
7 | "declaration": true,
8 | "strict": true,
9 | "moduleResolution": "node",
10 | "sourceMap": true,
11 | "types" : ["mocha"]
12 | },
13 | "include": ["tests/**/*.ts", "testing/**/*.ts", "github-pages/*.ts", "types/*.ts", "src/*.ts", "processor/*.ts"],
14 | "exclude": ["node_modules"]
15 | }
16 |
--------------------------------------------------------------------------------
/bin/build/library.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e # Exit on error
4 |
5 | echo "🔨 Building JavaScript bundles..."
6 | ts-node build.ts
7 |
8 | echo "📝 Generating TypeScript declarations..."
9 | tsc --skipLibCheck --emitDeclarationOnly src/index.ts --declaration --outdir dist
10 | tsc --skipLibCheck --emitDeclarationOnly src/processor/realtime-bpm-processor.ts --declaration --outfile dist/realtime-bpm-processor.d.ts
11 |
12 | echo "✅ Build complete! Files in dist/:"
13 | ls -lh dist/ | grep -E '\.(js|d\.ts)$' | awk '{print " " $9 " (" $5 ")"}'
14 |
--------------------------------------------------------------------------------
/examples/07-vue-basic/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "realtime-bpm-analyzer-example-vue-basic",
3 | "version": "1.0.0",
4 | "private": true,
5 | "type": "module",
6 | "scripts": {
7 | "dev": "vite",
8 | "build": "vite build",
9 | "preview": "vite preview"
10 | },
11 | "dependencies": {
12 | "vue": "^3.5.0",
13 | "realtime-bpm-analyzer": "file:../.."
14 | },
15 | "devDependencies": {
16 | "@vitejs/plugin-vue": "^5.1.0",
17 | "typescript": "^5.6.0",
18 | "vite": "^5.4.0",
19 | "vue-tsc": "^2.1.0"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/examples/07-vue-basic/readme.md:
--------------------------------------------------------------------------------
1 | # Vue Example
2 |
3 | Vue 3 integration with Composition API and TypeScript for offline BPM analysis.
4 |
5 | ## Features
6 |
7 | - Vue 3 with Composition API
8 | - `
145 |