Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

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

License

NotificationsYou must be signed in to change notification settings

james1236/buzzer_music

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Play thousands of songs on your Raspberry Pi Pico with a buzzer

Micropython library to play music through a buzzer, automatically replaces chords with fast arpeggios to simulate polyphony. Music can be easily taken fromonlinesequencer.net

Also supports playing music through multiple buzzers, dividing the currently playing notes across them for polyphony

Online Simulator

See it working or test it out using this online simulator!One Buzzer |Multiple Buzzers

buzzers

Demo.mp4


Usage with RPi Pico / Other Micropython Board

  1. Connect your buzzer to a ground pin and pin 0 on your Pico
  2. Install micropython on your Pico and copy the files in this repository to it
  3. 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
  4. 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

You can pause and resume withmySong.stop() andmySong.resume()

Board Compatibility

BoardCompatible?
Raspberry Pi PicoYes
Wemos D1 mini (ESP8266)Yesi8
Raspberry Pi 3, 4Follow steps below
ESP32Yesi14

Raspberry Pi 3, 4 Compatibility

The following code was contributed by@Miniontoby ini10, simply create a file calledmachine.py in the same folder as the other files and put this code in it:

importRPi.GPIOasGPIOGPIO.setwarnings(False)GPIO.setmode(GPIO.BCM)classPWMchanged(GPIO.PWM):def__init__(self,chan,freq):super().__init__(chan,freq)self.start(freq)defduty(self,dutycycle):self.ChangeDutyCycle(dutycycle/65535)deffreq(self,value):self.ChangeFrequency(value)defdeinit(self):self.stop()passdefPWM(pin):GPIO.setup(pin,GPIO.OUT)# Just to make surereturnPWMchanged(pin,50)defPin(pin):GPIO.setup(pin,GPIO.OUT)returnpin

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp