Skip to main content

Audio library for FlashForge Adventurer 5M using the pwm device as audio output to play frequencies and midi files.

Project description

FlashForge Adventurer 5M Audio library

Can be used to play midi files and frequencies on the speaker of the FlashForge Adventurer 5M (pro). Can also be used to play on other linux devices which use a simple PWM driver as audio device.

Note: midi files online are a mess, you might have to seek a while. Try finding the channel with piano or other keytype instrument, usually works best.

Usage:

$ audio --help
usage: FF AD5M Audio 'player' [-h] [-f FREQUENCY] [-d DURATION] [-c CHANNEL] [-m MIDIFILE] [-p PWM] [-v] [--nopwm]
                              {midi,freq,disable}

This program can either play a midi file, single track, single note, single chanel or a frequency for a specific duration

positional arguments:
  {midi,freq,disable}   Either midi or freq

options:
  -h, --help            show this help message and exit
  -f FREQUENCY, --frequency FREQUENCY
                        Frequency
  -d DURATION, --duration DURATION
                        Duration of frequency
  -c CHANNEL, --channel CHANNEL
                        Channel of track to play
  -m MIDIFILE, --midifile MIDIFILE
                        Midi filename
  -p PWM, --pwm PWM     pwm device to use
  -v, --verbose         Be verbose (might slow down playback in case of heavy pitch changes)
  --nopwm               Disable PWM driver, used for testing midi file reading

See https://github.com/xblax/flashforge_adm5_klipper_mod and https://github.com/consp/flashforge_adm5_audio

License

This work is licensed under CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)

Known issues

  • Using verbose can significanly slow down your playback on slower machines
  • Midi files get load into memory completely, if you have little available be wary of large midi files.
  • Since the pwm device is monotone, channels with polytone audio will not sound proper. There is no way to do anything about this, seek monotone channels.
  • Only pwmchip0 can be used at this time, the FF Ad5M only has one.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ff-ad5m-audio-0.4.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

ff_ad5m_audio-0.4-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file ff-ad5m-audio-0.4.tar.gz.

File metadata

  • Download URL: ff-ad5m-audio-0.4.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.12

File hashes

Hashes for ff-ad5m-audio-0.4.tar.gz
Algorithm Hash digest
SHA256 9012c1fa3a6638f2092f30a131bd43370f3351bbb55835f6bdeff17dfff96d7e
MD5 256315420d97314bb0194607d64f4593
BLAKE2b-256 540c0d02ce982b032efd797069682b1689644ab1e701de3a413d7a01fb2ae462

See more details on using hashes here.

File details

Details for the file ff_ad5m_audio-0.4-py3-none-any.whl.

File metadata

  • Download URL: ff_ad5m_audio-0.4-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.12

File hashes

Hashes for ff_ad5m_audio-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 06d85cb830b56f14f8bdb43ce8ea4f91fad68b055503445b2d7182faee3d5d2d
MD5 5bfa694d869c7a76a6705622d7bd4530
BLAKE2b-256 335cd814cbfd0c0c50b30568c0a65f00d5326a1e9dbbf93c0c93fa97477818e1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page