{"id":16357804,"url":"https://github.com/rsta2/minisynth","last_synced_at":"2025-04-04T13:11:56.166Z","repository":{"id":41443373,"uuid":"85812568","full_name":"rsta2/minisynth","owner":"rsta2","description":"A virtual analog synthesizer for Raspberry Pi","archived":false,"fork":false,"pushed_at":"2024-10-05T11:14:05.000Z","size":511,"stargazers_count":183,"open_issues_count":4,"forks_count":21,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-10-18T05:10:40.044Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rsta2.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":"2017-03-22T10:04:12.000Z","updated_at":"2024-10-05T21:23:14.000Z","dependencies_parsed_at":"2024-07-09T16:59:12.674Z","dependency_job_id":"5bc4f71e-802e-4250-9a7a-40fe0a181582","html_url":"https://github.com/rsta2/minisynth","commit_stats":{"total_commits":119,"total_committers":4,"mean_commits":29.75,"dds":0.03361344537815125,"last_synced_commit":"37345af76063a29b8965b4f30a00a249e3ee9d31"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsta2%2Fminisynth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsta2%2Fminisynth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsta2%2Fminisynth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsta2%2Fminisynth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rsta2","download_url":"https://codeload.github.com/rsta2/minisynth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247182367,"owners_count":20897380,"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":[],"created_at":"2024-10-11T02:04:09.897Z","updated_at":"2025-04-04T13:11:56.148Z","avatar_url":"https://github.com/rsta2.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"MiniSynth Pi\n============\n\n\u003e Raspberry Pi is a trademark of Raspberry Pi Ltd.\n\n\u003e If you read this file in an editor you should switch line wrapping on.\n\nOverview\n--------\n\nMiniSynth Pi is a polyphonic virtual analog audio synthesizer, running bare metal (without separate operating system) on the Raspberry Pi. On the Raspberry Pi 2, 3, 4 and 5 it allows to play up to 24 polyphonic voices at a time, on the Raspberry Pi 1 only 4 voices.\n\nYou have to attach an USB MIDI keyboard controller (which supports the USB Audio Class MIDI specification) or an USB PC keyboard to your Raspberry Pi to play on it. Alternatively you can feed serial MIDI data (at 31250 Bps) into GPIO15 (Broadcom numbering). Normally you will need some external circuit to be able to attach a device with serial MIDI interface.\n\nThe audio signal is normally available on the 3.5mm headphones jack (I2S and USB usage see below). On the Raspberry Pi Zero (2) (W) and Raspberry Pi 5 the audio signal is available on GPIO12/13 (L/R) and you need an external adapter (like [this](https://learn.adafruit.com/assets/28851)) to use it. The graphical user interface (GUI) of MiniSynth Pi can be controlled using a standard USB mouse, the official Raspberry Pi touch screen (not on Raspberry Pi 5) or an USB HID-class touch screen in  digitizer mode.\n\nThis version of MiniSynth Pi can be configured, so that it can be used with an external I2S interface. The audio signal is then available via this interface. MiniSynth Pi has been tested with the following I2S interfaces:\n\n* pHAT DAC (with PCM5102A DAC)\n* PiFi DAC+ v2.0 (with PCM5122 DAC)\n* [Adafruit I2S Audio Bonnet](https://www.adafruit.com/product/4037) (with UDA1334A DAC)\n* [Adafruit I2S 3W Class D Amplifier Breakout](https://www.adafruit.com/product/3006) (with MAX98357A DAC)\n* WM8960 DAC\n\nOther I2S interfaces with these DACs may be compatible too. The I2C slave address of the DAC is auto-probed (0x4C, 0x4D or 0x1A).\n\nOn the Raspberry Pi 4, 400 and 5 also external USB sound cards can be used.\n\nPlease note that the included reverb effect module is experimental, because it generates some noise, when no note is played. Just leave the reverb volume (wet/dry ratio) at 0% to eliminate it, if it disturbs.\n\nGetting\n-------\n\nBinaries of the latest release of MiniSynth Pi can be downloaded [here](https://github.com/rsta2/minisynth/releases). Just download the *MiniSynthNN.zip* file and follow the instructions in the *INSTALL.md* file, which is included in the archive.\n\nNormally you need a *Git* client to get the MiniSynth Pi source code. Go to the directory where you want to place MiniSynth Pi on your hard disk and enter:\n\n\tgit clone https://github.com/rsta2/minisynth.git minisynth\n\tcd minisynth\n\tgit submodule update --init\n\tcd circle\n\tgit submodule update --init addon/lvgl/lvgl\n\tcd ..\n\nThis will place the source code in the subdirectory *minisynth/* and clones the submodule *circle* (with the required submodule *addon/lvgl/lvgl*) into the *minisynth/circle/* subdirectory.\n\nBuilding\n--------\n\nMiniSynth Pi uses the Circle bare metal build environment for the Raspberry Pi. You need an appropriate compiler toolchain for ARM processors to build it. Have a look at the Circle *README.md* file (in *circle/*) for further information on this (section *Building*). The build information herein is for Linux hosts only.\n\nWhen the toolchain is installed on your computer you can build MiniSynth Pi using the following commands:\n\n\t./configure 3 arm-eabi-\n\t./makeall clean\n\t./makeall\n\nThe `configure` command writes a *Config.mk* file for Circle and patches Circle, so that it allows to use multiple CPU cores. \"3\" is the major revision number of your Raspberry Pi (1, 2, 3, 4 or 5). The second (optional) parameter is the prefix of the commands of your toolchain and can be preceded with a path. Do not forget the dash at the end of the prefix!\n\nAn optional third parameter can be appended to specify the bit size of the ARM architecture to be used as build target. It can be \"32\" (default) or \"64\" (for Raspberry Pi 3 and 4 only). For the Raspberry Pi 5 it must be \"64\" (default).\n\nIf the build was successful, you find the executable image file of MiniSynth Pi in the *src/* subdirectory with the name *kernel.img* (Raspberry Pi 1), *kernel7.img* (Raspberry Pi 2), *kernel8-32.img* (Raspberry Pi 3), *kernel7l.img* (Raspberry Pi 4) or *kernel_2712.img* (Raspberry Pi 5).\n\nInstallation\n------------\n\nYou will need a SD card with FAT16 or FAT32 partition to install MiniSynth Pi. This partition must be the first file system on the SD card. You have to copy the *kernel???.img* file, built in the previous step, to this FAT partition. All files have to be placed in the root directory of this partition.\n\nFurthermore you need the Raspberry Pi firmware. You can get it as follows:\n\n\tcd circle/boot\n\tmake\n\nYou have to copy the three files *bootcode.bin*, *start.elf* and *fixup.dat* from the *circle/boot/* subdirectory to the FAT partition on the SD card. The Raspberry Pi 4 and 5 require different firmware files. Please read the file *circle/boot/README* for details!\n\nFinally you have to copy the configuration files *cmdline.txt*, *patchN.txt* (example patches), *velocity-???.txt* (keyboard velocity curve) and *midi-cc.txt* (MIDI CC mapping) from the *config/* subdirectory to the SD card. The appropriate velocity curve file has to be renamed to *velocity.txt* to be used. You can optionally create a subdirectory */patches* and copy the example patches there, if you do not want to have them in the root directory of your SD card.\n\nIf you want to use an I2S interface, you have to modify to file *cmdline.txt* on the SD card, so that it contains the following option (default is `sndpwm`):\n\n\tsounddev=sndi2s\n\nIf you want to use an USB sound card (on the Raspberry Pi 4, 400 and 5 only), you have to attach it, before the system is started. The file *cmdline.txt* must contain the following options, where `soundopt=` specifies the width of one audio sample in number of bits, and must be `24` for some (especially Pro) devices:\n\n\tsounddev=sndusb soundopt=16\n\nPut the SD card into the card reader of your Raspberry Pi.\n\nUSB Touch Screen Calibration\n----------------------------\n\nIf you want to use an USB touch screen, an additional calibration step may be required. Your touch screen must be compliant with the USB HID-class specification and must support the digitizer mode. Touch screens which emulate an USB mouse with absolute coordinates cannot be used. Touch screen calibration is needed, if your touch screen does not send screen pixel coordinates. If you are unsure about this, you can apply this step and will get the required information from the calibration program.\n\nAfter building the MiniSynth Pi application, enter from MiniSynth Pi project root:\n\n\tcd circle/tools/touchscreen-calibrator\n\tmake clean\n\tmake\n\nA file *kernel???.img* should be created, which is the calibration program. Copy it to the SD card, which has been prepared in the previous step. Because the kernel image of MiniSynth Pi is needed later, you should temporary rename it. Now put the SD card into your Raspberry Pi and start it. Please read the file *README* in the subdirectory of the calibration program for further info on the calibration process!\n\nThe calibration program will finally tell you, if your touch screen needs calibration. If so, the option `touchscreen=min-x,max-x,min-y,max-y` (parameters given by the calibration program) has to be added to the first line of the file *cmdline.txt*. Multiple options will be delimited with a space character in this file.\n\nUsing\n-----\n\nBefore powering on your Raspberry Pi, the following devices have to be attached:\n\n* HDMI display (1920x1080 pixels max.)\n* USB MIDI keyboard controller, USB PC keyboard or device with serial MIDI interface (at GPIO15, requires external circuit)\n* Standard USB mouse (if touch screen is not used)\n* Headphones or amplifier (on the 3.5mm jack or via external I2S interface or USB sound card)\n\nMiniSynth Pi starts in about four seconds. It is controlled using the following GUI (*MAIN* tab):\n\n![MiniSynth Pi GUI](gui-main.png)\n\nYou will get that picture when you click the *HELP* button with the mouse or on the touch screen. By default the GUI does not show the help info, but the values of the different parameters of the currently selected patch (see *Parameters*).\n\nA parameter value can be modified using the down (\u003c) and up (\u003e) buttons or can be directly entered using a screen keyboard for numeric parameters, when the parameter value is clicked with the mouse or touched on a touch screen.\n\nThe GUI allows to select 48 different sound configurations (patches 0-47) on the *PATCHES* tab:\n\n![PATCHES tab](gui-patches.png)\n\nThere is always one (highlighted) active patch, which can be edited using the different parameter controls on the *MAIN* tab (see above). A tab can be selected by clicking on its name in the top right corner of the screen.\n\nThe parameters of the active patch can be saved to a configuration file on the SD card (*patchX.txt* where X is the number of the patch). If the subdirectory */patches* exists, the patches will be saved here. On start-up the configuration of all patches is loaded from these files (if available) or initialized to the default preset.\n\nA patch can be described with the additional one-line text properties *Patch name*, *Patch author* and *Any comment*. To edit one of these strings, just click into the corresponding text box. The GUI will open a screen keyboard then:\n\n![Screen keyboard](gui-main-kbd.png)\n\nAfter editing one property, you can save it using the OK check (in the bottom right corner) or reject the latest changes by clicking on the keyboard key (left corner). The *ENTER* key has no function here. Please note that any changes will be saved to a patch file only when you click the *SAVE* button on the *PATCHES* tab.\n\nThe USB PC keyboard allows playing two octaves (keys C2-C4). Its mapping is as follows:\n\n\t   +-----+-----+     +-----+-----+-----+\n\t   |2 C#2|3 D#2|     |5 F#2|6 G#2|7 A#3|\n\t+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\n\t|Q C2 |W D2 |E E2 |R F2 |T G2 |Y A3 |U B3 |\n\t+-----+--+--+--+--+--+--+--+--+--+--+--+--+--+\n\t         |S C#3|D D#3|     |G F#3|H G#3|J A#4|\n\t      +--+--+--+--+--+--+--+--+--+--+--+--+--+--+-----+\n\t      |Z C3 |X D3 |C E3 |V F3 |B G3 |N A4 |M B4 |, C4 |\n\t      +-----+-----+-----+-----+-----+-----+-----+-----+\n\n\t+--------+\n\t|Key Note|\n\t+--------+\n\nThe inscription of the keyboard may vary, but the physical position of the piano keys is the same on all keyboards. Using this scheme you should be able to find them. Please note that PC keyboards often do not allow to use all voices simultaneously.\n\nA Raspberry Pi running MiniSynth Pi can be powered off at any time when the green activity LED is not on.\n\nParameters\n----------\n\nOne patch of MiniSynth Pi has the following parameters:\n\n| Section    | Module   | Parameter | Unit | Range     | Default | Description          | MIDI CC |\n| ---------- | -------- | --------- | ---- | --------- | ------- | -------------------- | ------- |\n| OSCILLATOR | VCO      | Wave      |      |           | Square  | Waveform (*)         |         |\n| OSCILLATOR | VCO (2)  | Detune    | %    | 0-200     | 100     | Semitone -/+         | 94 (**) |\n| OSCILLATOR | LFO      | Wave      |      |           | Sine    | Waveform (*)         |         |\n| OSCILLATOR | LFO      | Rate      | Hz   | 1-35      | 20      | Modulation frequency |         |\n| OSCILLATOR | LFO      | Volume    | %    | 0-100     | 0       | Modulation volume    |         |\n| FILTER     | VCF      | Cutoff    | %    | 10-100    | 80      | Cutoff frequency     | 74      |\n| FILTER     | VCF      | Resonance | %    | 0-100     | 50      | Resonance parameter  | 71      |\n| FILTER     | LFO      | Wave      |      |           | Sine    | Waveform (*)         |         |\n| FILTER     | LFO      | Rate      | Hz   | 0.5-5.0   | 2.0     | Modulation frequency |         |\n| FILTER     | LFO      | Volume    | %    | 0-100     | 0       | Modulation volume    |         |\n| FILTER     | ENVELOPE | Attack    | ms   | 0-2000    | 0       | Attack delay         |         |\n| FILTER     | ENVELOPE | Decay     | ms   | 100-10000 | 4000    | Decay delay          |         |\n| FILTER     | ENVELOPE | Sustain   | %    | 0-100     | 100     | Sustain level        |         |\n| FILTER     | ENVELOPE | Release   | ms   | 0-5000    | 1000    | Release delay        |         |\n| AMPLIFIER  |          | Volume    | %    | 0-100     | 50      | Master volume        | 7       |\n| AMPLIFIER  | LFO      | Wave      |      |           | Sine    | Waveform (*)         |         |\n| AMPLIFIER  | LFO      | Rate      | Hz   | 0.5-5.0   | 2.0     | Modulation frequency |         |\n| AMPLIFIER  | LFO      | Volume    | %    | 0-100     | 0       | Modulation volume    |         |\n| AMPLIFIER  | ENVELOPE | Attack    | ms   | 0-2000    | 100     | Attack delay         |         |\n| AMPLIFIER  | ENVELOPE | Decay     | ms   | 100-10000 | 4000    | Decay delay          |         |\n| AMPLIFIER  | ENVELOPE | Sustain   | %    | 0-100     | 100     | Sustain level        |         |\n| AMPLIFIER  | ENVELOPE | Release   | ms   | 0-5000    | 100     | Release delay        |         |\n| EFFECTS    | REVERB   | Decay     | %    | 0-50      | 20      | Rate of decay        |         |\n| EFFECTS    | REVERB   | Volume    | %    | 0-30      | 0       | Wet/dry ratio        | 91      |\n| MIDI       |          | Channel   |      | 1-16, Omni|Omni Mode| Input channel (***)  |         |\n\n(*) Waveform can be: Sine, Square, Sawtooth, Triangle, Pulse 12.5%, Pulse 25% or Noise (Noise not for LFO)\n\n(\\*\\*) The MIDI CC mapping can be modified in the file *midi-cc.txt*. This is the default mapping.\n\n(\\*\\*\\*) MiniSynth Pi receives MIDI events only on the selected channel. In Omni Mode (default) it receives on all channels.\n\nMiniSynth Pi provides two VCOs, one runs at the pitch frequency, the other at pitch frequency detuned by a configurable value (max. one semitone - or +, default 100% = Detune off). The VCF uses a second order recursive linear filter, containing two poles and two zeros (biquad), which is implemented as a low-pass filter.\n\nMiniSynth Pi allows to use a specific keyboard velocity curve, which fits best to your keyboard and your playing style. It has to be provided in the file *velocity.txt* on the SD card. The default velocity curve is linear. Have a look into the example files in the *config/* subdirectory. If you want to use one of these files, it has to be renamed to *velocity.txt* on the SD card. It should be easy to modify one example file to adjust the velocity curve to your own needs.\n\nTroubleshooting\n---------------\n\nSome USB MIDI keyboard controllers have been reported to lose \"Note on\" and/or \"Note off\" events, if used with MiniSynth Pi. As a workaround you can modify the file *cmdline.txt* on the SD card as follows:\n\n\tsounddev=sndpwm logdev=null usbspeed=full\n\nSome USB PC keyboards may not work with MiniSynth Pi, because its USB HID report descriptor cannot be fetched from the keyboard. As a workaround you can try to suppress fetching this descriptor by adding the `usbignore=` option to the file *cmdline.txt* on the SD card:\n\n\tsounddev=sndpwm logdev=null usbspeed=auto usbignore=int3-0-0\n\nPlease note, that you cannot use an USB PC keyboard to input data in MiniSynth Pi. It is just an replacement for an USB MIDI keyboard controller, in case you do not have the latter.\n\nCredits\n-------\n\nMiniSynth Pi uses the following source modules:\n\n* [Circle C++ bare metal environment for the Raspberry Pi](https://github.com/rsta2/circle/) (includes USB MIDI driver by Joshua Otto)\n* [Light and Versatile Graphics Library](https://lvgl.io/) by LVGL Kft\n* [EMMC SD card driver (part of rpi-boot)](https://github.com/jncronin/rpi-boot/blob/master/emmc.c) by John Cronin\n* [FatFs file system module](http://elm-chan.org/fsw/ff/00index_e.html) by ChaN\n\nAdditional information has been obtained from:\n\n* [Cookbook formulae for audio EQ biquad filter coefficients](https://webaudio.github.io/Audio-EQ-Cookbook/Audio-EQ-Cookbook.txt) by Robert Bristow-Johnson\n* [Digital Synth WRA32](https://github.com/risgk/digital-synth-wra32/) by Ryo Ishigaki\n* [Effect Design, Part 1: Reverberator and Other Filters](https://ccrma.stanford.edu/~dattorro/EffectDesignPart1.pdf) by Jon Dattorro\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsta2%2Fminisynth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frsta2%2Fminisynth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsta2%2Fminisynth/lists"}