{"id":13692920,"url":"https://github.com/james1236/buzzer_music","last_synced_at":"2025-05-02T20:30:22.118Z","repository":{"id":43743300,"uuid":"340789681","full_name":"james1236/buzzer_music","owner":"james1236","description":"RPI Pico / Micropython library to play music through one or more buzzers, can automatically replace chords with fast arpeggios to simulate polyphony with a single buzzer. Music can be easily taken from onlinesequencer.net","archived":false,"fork":false,"pushed_at":"2024-10-27T00:35:07.000Z","size":45,"stargazers_count":84,"open_issues_count":2,"forks_count":17,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-11-12T18:42:25.111Z","etag":null,"topics":["buzzer","micropython","passive-buzzer","raspberry-pi","raspberry-pi-pico","rp2040","rpi-pico","rpi-rp2"],"latest_commit_sha":null,"homepage":"","language":"Python","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/james1236.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2021-02-21T01:10:41.000Z","updated_at":"2024-10-27T00:35:10.000Z","dependencies_parsed_at":"2024-04-08T02:17:01.367Z","dependency_job_id":"38035d46-b850-4da6-b98f-f2d1ef8669ff","html_url":"https://github.com/james1236/buzzer_music","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/james1236%2Fbuzzer_music","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/james1236%2Fbuzzer_music/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/james1236%2Fbuzzer_music/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/james1236%2Fbuzzer_music/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/james1236","download_url":"https://codeload.github.com/james1236/buzzer_music/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252103807,"owners_count":21695371,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["buzzer","micropython","passive-buzzer","raspberry-pi","raspberry-pi-pico","rp2040","rpi-pico","rpi-rp2"],"created_at":"2024-08-02T17:01:03.489Z","updated_at":"2025-05-02T20:30:21.894Z","avatar_url":"https://github.com/james1236.png","language":"Python","funding_links":[],"categories":["Resources"],"sub_categories":["Projects"],"readme":"# buzzer_music\nPlay thousands of songs on your Raspberry Pi Pico with a buzzer\n\nMicropython library to play music through a buzzer, automatically replaces chords with fast arpeggios to simulate polyphony. Music can be easily taken from [onlinesequencer.net](https://onlinesequencer.net/)\n\nAlso supports playing music through multiple buzzers, dividing the currently playing notes across them for polyphony\n\n### Online Simulator\nSee it working or test it out using this online simulator! [One Buzzer](https://wokwi.com/projects/384484222930823169) | [Multiple Buzzers](https://wokwi.com/projects/384484055755294721) \u003cbr\u003e\u003cbr\u003e\n![buzzers](https://github.com/james1236/buzzer_music/assets/32351696/87245a5d-99e1-4d9d-a607-87499c3d1e27)\n\n\u003cvideo src=\"https://user-images.githubusercontent.com/32351696/215248051-8b161d79-5e79-405d-bb80-717d03b9edb8.mp4](https://user-images.githubusercontent.com/32351696/215248120-8da75442-0793-4c2a-8c1f-44bfb2d84262.mp4)\"\u003e\u003c/video\u003e\n\n\u003cbr\u003e\n\n### Usage with RPi Pico / Other Micropython Board \n1) Connect your buzzer to a ground pin and pin 0 on your Pico\n2) Install micropython on your Pico and copy the files in this repository to it\n3) Find some music on onlinesequencer.net (music aligned to the grid works best), click edit, select all notes with CTRL + A and then copy them with CTRL + C\n4) Paste the string in place of the one in the example file, making sure to remove the \"Online Sequencer:120233:\" from the start and the \";:\" from the end\n\u003cbr\u003e\n\nYou can pause and resume with `mySong.stop()` and `mySong.resume()`\n\n### Board Compatibility\n| Board | Compatible? |\n|-------|-------------|\n| Raspberry Pi Pico | Yes |\n| Wemos D1 mini (ESP8266) | Yes [i8](/../../issues/8)|\n| Raspberry Pi 3, 4 | Follow steps below |\n| ESP32 | Yes [i14](/../../issues/14#issuecomment-2439775389)|\n\u003cbr\u003e\n\n### Raspberry Pi 3, 4 Compatibility\nThe following code was contributed by [@Miniontoby](https://github.com/Miniontoby) in [i10](/../../issues/10), simply create a file called `machine.py` in the same folder as the other files and put this code in it:\n```python3\nimport RPi.GPIO as GPIO\nGPIO.setwarnings(False)\nGPIO.setmode(GPIO.BCM)\n\nclass PWMchanged(GPIO.PWM):\n    def __init__(self, chan, freq):\n        super().__init__(chan, freq)\n        self.start(freq)\n    def duty(self,dutycycle): self.ChangeDutyCycle(dutycycle/65535)\n    def freq(self, value): self.ChangeFrequency(value)\n    def deinit(self): self.stop()\n    pass\n\ndef PWM(pin):\n    GPIO.setup(pin, GPIO.OUT) # Just to make sure\n    return PWMchanged(pin, 50)\n\ndef Pin(pin):\n    GPIO.setup(pin, GPIO.OUT)\n    return pin\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjames1236%2Fbuzzer_music","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjames1236%2Fbuzzer_music","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjames1236%2Fbuzzer_music/lists"}