{"id":13433332,"url":"https://github.com/scribbletune/scribbletune","last_synced_at":"2026-03-01T01:06:44.787Z","repository":{"id":12110104,"uuid":"14699489","full_name":"scribbletune/scribbletune","owner":"scribbletune","description":"Create music with JavaScript","archived":false,"fork":false,"pushed_at":"2026-02-18T06:31:26.000Z","size":2244,"stargazers_count":3762,"open_issues_count":20,"forks_count":237,"subscribers_count":88,"default_branch":"master","last_synced_at":"2026-02-18T06:41:04.120Z","etag":null,"topics":["ableton","ableton-live","chords","javascript","live","midi","music","nodejs","scale","webaudio","webaudioapi","webmidi"],"latest_commit_sha":null,"homepage":"https://scribbletune.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scribbletune.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2013-11-25T21:44:43.000Z","updated_at":"2026-02-18T06:30:51.000Z","dependencies_parsed_at":"2024-06-18T15:37:42.642Z","dependency_job_id":"1f4c5dd3-d194-4976-84ae-dcf7fa0034b8","html_url":"https://github.com/scribbletune/scribbletune","commit_stats":{"total_commits":478,"total_committers":29,"mean_commits":"16.482758620689655","dds":"0.17573221757322177","last_synced_commit":"3bc0ac20936555c2a98a92105816d93c4e48f8aa"},"previous_names":["walmik/scribbletune"],"tags_count":45,"template":false,"template_full_name":null,"purl":"pkg:github/scribbletune/scribbletune","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scribbletune%2Fscribbletune","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scribbletune%2Fscribbletune/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scribbletune%2Fscribbletune/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scribbletune%2Fscribbletune/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scribbletune","download_url":"https://codeload.github.com/scribbletune/scribbletune/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scribbletune%2Fscribbletune/sbom","scorecard":{"id":806272,"data":{"date":"2025-08-11","repo":{"name":"github.com/scribbletune/scribbletune","commit":"12d0cc19007d09c1bdb48da2a422cbe9c1b9364a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":1,"reason":"Found 2/13 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":5,"reason":"5 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 21 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":3,"reason":"7 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T11:50:36.726Z","repository_id":12110104,"created_at":"2025-08-23T11:50:36.726Z","updated_at":"2025-08-23T11:50:36.726Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29957128,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T22:53:01.873Z","status":"ssl_error","status_checked_at":"2026-02-28T22:52:50.699Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ableton","ableton-live","chords","javascript","live","midi","music","nodejs","scale","webaudio","webaudioapi","webmidi"],"created_at":"2024-07-31T02:01:24.280Z","updated_at":"2026-03-01T01:06:44.773Z","avatar_url":"https://github.com/scribbletune.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg width=\"64\" src=\"https://scribbletune.com/images/scribbletune-logo.png\" alt=\"Scribbletune\"\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eScribbletune\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  Create music with JavaScript. Use simple strings and arrays to craft rhythms, melodies, and chord progressions — then export MIDI files or play them live in the browser with \u003ca href=\"https://tonejs.github.io/\"\u003eTone.js\u003c/a\u003e or use the CLI to directly emit MIDI file from your terminal.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/scribbletune\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/scribbletune.svg\" alt=\"npm version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/scribbletune\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/scribbletune.svg\" alt=\"license\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## Install\n\n```bash\nnpm install scribbletune\n```\n\n## Quick start\n\n### Option 1: CLI\n\nIf you installed Scribbletune globally via `npm i -g scribbletune` then you can directly use `scribbletune` as the command. If you installed it locally via `npm i scribbletune` then please use `npx scribbletune` as the command.\n\nRun modes:\n\n```bash\n# Global install\nnpm install -g scribbletune\nscribbletune --help\n\n# Local/project install\nnpm install scribbletune\nnpx scribbletune --help\n```\n\nQuick command examples:\n\n#### Command format\n\n```bash\nscribbletune --riff \u003croot\u003e \u003cmode\u003e \u003cpattern\u003e \u003csubdiv\u003e [options]\nscribbletune --chord \u003croot\u003e \u003cmode\u003e \u003cpattern\u003e \u003csubdiv\u003e \u003cprogression|random\u003e [options]\nscribbletune --arp \u003croot\u003e \u003cmode\u003e \u003cpattern\u003e \u003csubdiv\u003e \u003cprogression|random\u003e [options]\n```\n\nProgression input rules for `--chord` and `--arp`:\n\n```bash\n1645            # degree digits\n\"I IV vi V\"     # roman numerals (space separated)\nI,IV,vi,V       # roman numerals (comma separated)\nrandom          # generated progression\nCM-FM-Am-GM     # explicit chord names (`root` and `mode` are ignored)\n```\n\nCommon options:\n\n```bash\n--outfile \u003cfile.mid\u003e  # default: music.mid\n--subdiv \u003c4n|8n|1m...\u003e\n--sizzle [sin|cos|rampUp|rampDown] [reps]\n--sizzle-reps \u003cnumber\u003e\n--amp \u003c0-127\u003e\n--accent \u003cx--x...\u003e\n--accent-low \u003c0-127\u003e\n--style \u003cletters\u003e     # riff motif/style, e.g. AABC\n--fit-pattern         # explicit enable (already enabled by default)\n--no-fit-pattern      # disable automatic pattern fitting\n--bpm \u003cnumber\u003e        # your DAW may or may not support it\n```\n\nNote: if your pattern uses `[` and `]` (for subdivisions), quote it in shell:\n\n```bash\nscribbletune --arp C3 major 1 'x-x[xx]-x-[xx]' 16n\n```\n\nPattern helpers:\n\n```bash\nx.repeat(4)       # -\u003e xxxx\n'x-x[xx]'.repeat(2)\n2(x-x[xx])        # prefix repeat shorthand\n(x-x[xx])2        # suffix repeat shorthand\n```\n\n#### `--riff` examples\n\n```bash\n# Basic riff from scale\nscribbletune --riff C3 phrygian x-xRx_RR --outfile riff.mid\n\n# With motif/style and positional subdiv\nscribbletune --riff C3 phrygian x-xRx_RR 8n --style AABC --sizzle sin 2 --outfile riff-aabc.mid\n\n# Set riff subdivision via positional arg\nscribbletune --riff C3 phrygian x-xRx_RR 8n --style AABC --outfile riff-8n.mid\n\n# Pattern with subdivisions (quote [] in shell)\nscribbletune --riff C3 phrygian 'x-x[xx]-x-[xx]' 8n --style AABC --outfile riff-subdiv.mid\n```\n\nRiff + motif note:\n\n- `--style` creates riff sections by repeating the full pattern per letter.\n- Example: `--style AABC` with pattern `x-x[xx]` creates 4 sections: `A`, `A`, `B`, `C`.\n- Repeated letters reuse the exact same generated section (same rhythm and same notes, including random `R` choices).\n\n#### `--chord` examples\n\n```bash\n# Degree digits (resolved against root/mode)\nscribbletune --chord C3 major xxxx 1m 1645 --sizzle cos 1 --outfile chords-1645.mid\n\n# Roman numerals (space/comma separated)\nscribbletune --chord C3 major xxxx 1m \"I IV vi V\" --outfile chords-roman.mid\n\n# Random progression\nscribbletune --chord C3 major xxxx 1m random --outfile chords-random.mid\n\n# Explicit chord names (root/mode currently ignored for this style)\nscribbletune --chord C3 major xxxx 1m CM-FM-Am-GM --outfile chords-explicit.mid\n\n# Subdivisions in pattern\nscribbletune --chord C3 major 'x-x[xx]-x-[xx]' 8n I,IV,vi,V --outfile chords-subdiv.mid\n```\n\n#### `--arp` examples\n\n```bash\n# Arp from degree progression\nscribbletune --arp C3 major xxxx 1m 1736 --sizzle cos 4 --outfile arp-1736.mid\n\n# Single degree \"1\" means tonic chord in the chosen key/mode\nscribbletune --arp C3 major xxxx 4n 1 --outfile arp-degree-1.mid\n\n# Arp from explicit chords\nscribbletune --arp C3 major xxxx 1m CM-FM-Am-GM --count 4 --order 1234 --outfile arp-explicit.mid\n\n# Custom note order inside each arpeggiated chord (one-based)\nscribbletune --arp C3 major xxxx 4n 1 --order 2143 --outfile arp-order-2143.mid\n\n# Same custom order using local dist build\nnode dist/cli.cjs --arp C3 major xxxx 4n 1 --order 2143 --outfile arp-order-local.mid\n\n# Auto-fit is default (single x expands to full generated arp length)\nscribbletune --arp C3 major x 4n 1736 --outfile arp-fit-default.mid\n\n# Disable auto-fit if you want a short clip\nscribbletune --arp C3 major x 4n 1736 --no-fit-pattern --outfile arp-no-fit.mid\n```\n\n`--order` behavior:\n\n- One-based order is supported (`1234`, `2143`) and is recommended.\n- Zero-based order is also accepted for backward compatibility (`0123`, `1032`).\n\nRun `scribbletune --help` to see the latest CLI usage text.\n\n### Option 2: Node.js\n\n```js\nimport { scale, clip, midi } from \"scribbletune\";\n\nconst notes = scale(\"C4 major\");\nconst c = clip({ notes, pattern: \"x\".repeat(8) });\n\nmidi(c, \"c-major.mid\");\n```\n\nRun it with `node` and open the `.mid` file in Ableton Live, GarageBand, Logic, or any DAW.\n\n### Option 3: Browser (with Tone.js)\n\nScribbletune's browser entry point adds `Session`, `Channel`, and live `clip()` support on top of [Tone.js](https://tonejs.github.io/).\n\n```js\nimport { Session } from \"scribbletune/browser\";\n\nconst session = new Session();\nconst channel = session.createChannel({\n  instrument: \"PolySynth\",\n  clips: [\n    { pattern: \"x-x-\", notes: \"C4 E4 G4\" },\n    { pattern: \"[-xx]\", notes: \"C4 D#4\" },\n  ],\n});\n\nawait Tone.start();\nTone.Transport.start();\nchannel.startClip(0);\n```\n\n### Standalone sample clip (no Session/Channel needed)\n\n```js\nimport { clip } from \"scribbletune/browser\";\n\nconst kickClip = clip({\n  sample: \"https://scribbletune.com/sounds/kick.wav\",\n  pattern: \"x-x-\",\n});\n\nconst btn = document.querySelector(\"#btn\");\n\nbtn.addEventListener(\"click\", async () =\u003e {\n  await Tone.start();\n  Tone.Transport.start();\n  kickClip.start(0);\n});\n```\n\n## Core concepts\n\n### Pattern language\n\nScribbletune uses a simple string notation to describe rhythms:\n\n| Char | Meaning                                         |\n| ---- | ----------------------------------------------- |\n| `x`  | Note on                                         |\n| `-`  | Note off (rest)                                 |\n| `_`  | Sustain previous note                           |\n| `R`  | Random note (from `randomNotes` pool)           |\n| `[]` | Subdivide (e.g. `[xx]` = two notes in one beat) |\n\n```js\n\"x---x---x-x-x---\"; // basic kick pattern\n\"[xx][xx]x-x-\"; // hihat with subdivisions\n\"x___\"; // one long sustained note\n```\n\n### Scales and chords\n\nPowered by [harmonics](https://github.com/scribbletune/harmonics):\n\n```js\nimport { scale, chord, scales, chords } from \"scribbletune\";\n\nscale(\"C4 major\"); // ['C4', 'D4', 'E4', 'F4', 'G4', 'A4', 'B4']\nchord(\"CM\"); // ['C4', 'E4', 'G4']\nscales(); // list all available scale names\nchords(); // list all available chord names\n```\n\n### Arpeggios\n\n```js\nimport { arp } from \"scribbletune\";\n\narp({ chords: \"CM FM\", count: 4, order: \"0123\" });\n// ['C4', 'E4', 'G4', 'C5', 'F4', 'A4', 'C5', 'F5']\n```\n\n### Chord progressions\n\n```js\nimport { progression, getChordsByProgression } from \"scribbletune\";\n\nprogression(\"M\", 4); // e.g. ['I', 'ii', 'V', 'IV']\n\ngetChordsByProgression(\"C4 major\", \"I IV V IV\");\n// 'CM_4 FM_4 GM_4 FM_4'\n```\n\n## Browser API\n\nThe browser entry point (`scribbletune/browser`) provides everything above plus:\n\n### Session and Channel\n\n```js\nimport { Session } from \"scribbletune/browser\";\n\nconst session = new Session();\nconst drums = session.createChannel({\n  sample: \"https://scribbletune.com/sounds/kick.wav\",\n  clips: [{ pattern: \"x---x---\" }, { pattern: \"x-x-x-x-\" }],\n});\n\nconst synth = session.createChannel({\n  instrument: \"PolySynth\",\n  clips: [{ pattern: \"x-x-\", notes: \"C4 E4 G4\" }],\n});\n\nawait Tone.start();\nTone.Transport.start();\n\n// Start clips independently\ndrums.startClip(0);\nsynth.startClip(0);\n\n// Switch patterns on the fly\ndrums.startClip(1);\n\n// Or start a row across all channels\nsession.startRow(0);\n```\n\n### Channel options\n\nChannels accept various sound sources:\n\n```js\n// Built-in Tone.js synth (by name)\n{ instrument: 'PolySynth' }\n\n// Pre-built Tone.js instrument\n{ instrument: new Tone.FMSynth() }\n\n// Audio sample URL\n{ sample: 'https://example.com/kick.wav' }\n\n// Multi-sample instrument\n{ samples: { C3: 'piano-c3.wav', D3: 'piano-d3.wav' } }\n\n// With effects\n{ instrument: 'PolySynth', effects: ['Chorus', 'Reverb'] }\n```\n\n## API reference\n\n| Export                                   | Description                                                                 |\n| ---------------------------------------- | --------------------------------------------------------------------------- |\n| `clip(params)`                           | Create a clip — returns note objects (Node.js) or a Tone.Sequence (browser) |\n| `midi(clip, filename?)`                  | Export a clip to a MIDI file                                                |\n| `scale(name)`                            | Get notes of a scale, e.g. `'C4 minor'`                                     |\n| `chord(name)`                            | Get notes of a chord, e.g. `'CM'`                                           |\n| `scales()`                               | List all available scale names                                              |\n| `chords()`                               | List all available chord names                                              |\n| `arp(params)`                            | Generate arpeggiated note sequences                                         |\n| `progression(type, count)`               | Generate a chord progression (`'M'` or `'m'`)                               |\n| `getChordsByProgression(scale, degrees)` | Convert Roman numeral degrees to chord names                                |\n| `getChordDegrees(mode)`                  | Get Roman numeral degrees for a mode                                        |\n| `Session`                                | _(browser only)_ Manage multiple channels and coordinate playback           |\n\n## Development\n\n```bash\nnpm install       # install dependencies\nnpm test          # run tests\nnpm run build     # build with tsup\nnpm run lint      # check with biome\nnpm run dev       # build in watch mode\n```\n\nIf developing new features for the CLI, use the following command after running `npm run build` to test before publishing,\n\n```bash\nnode dist/cli.cjs --help\n```\n\n## License\n\nMIT\n\n---\n\n[scribbletune.com](https://scribbletune.com) | [Soundcloud](https://soundcloud.com/scribbletune)\n","funding_links":[],"categories":["TypeScript","目录"],"sub_categories":["框架、库和组件"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscribbletune%2Fscribbletune","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscribbletune%2Fscribbletune","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscribbletune%2Fscribbletune/lists"}