https://github.com/nlfmt/buzzer-music
Create shell commands to play music on buzzers
https://github.com/nlfmt/buzzer-music
Last synced: about 1 year ago
JSON representation
Create shell commands to play music on buzzers
- Host: GitHub
- URL: https://github.com/nlfmt/buzzer-music
- Owner: nlfmt
- Created: 2025-01-25T15:11:24.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-20T00:10:17.000Z (over 1 year ago)
- Last Synced: 2025-06-30T22:52:24.505Z (about 1 year ago)
- Language: TypeScript
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Buzzer Music
This repo contains code to create shell commands from songs using the /dev/speaker device in OpenBSD
## How to import a song from `arduino-songs`:
1. Clone this repository
2. Make sure [NodeJS](https://nodejs.org) is installed
2. Install packages using `npm i`
3. Visit [arduino-songs](https://github.com/robsoncouto/arduino-songs)
5. Pick a song of your choice and note the folder name in the repo (i.e. `imperialmarch`)
8. Run the converter
```sh
npm run convert -- imperialmarch
```
with config options:
```sh
npm run convert -- imperialmarch --octaveShift=-2 --bpm=120
```
1. Copy the command to your machine and run it!
## How to add a custom note definition
1. Add a new file to `/songs`.
3. Add your song definition as a default export
```ts
import { NOTE, REST } from "../src/note"
export default [
NOTE.A4, 4, REST, 2, NOTE.A5, 4
]
```
4. Go to `main.ts`, import your song definition and add the code to convert:
```ts
import mySong from "./songs/mySong"
const song = Song.from(mySong, { octaveShift: -2 })
console.log(song.toShellCommand())
```
5. Run the program using `npm start` (run `npm i` first if you haven't yet)
6. Run the code on your machine!