SLOOP 2.0

This commit is contained in:
isod89 committed 2026-10-04 11:08:49 -04:00
commit a3f9fd04c8
221 files changed
+66070

No files matched your search

+7
View File
@@ -0,0 +1,7 @@
* text=auto
*.bat text eol=crlf
*.ps1 text eol=crlf
*.sh text eol=lf
*.wav binary
*.png binary
*.ttf binary
+3
View File
@@ -0,0 +1,3 @@
build/
.DS_Store
__pycache__/
+110
View File
@@ -0,0 +1,110 @@
# Building SLOOP
The build makes three files in `build/`:
| File | What |
| --- | --- |
| `felucca.bin` | the firmware app |
| `loader/ota.bin` | the update loader |
| `felucca.fwsc` | the installable package (app + loader) |
## Windows (WSL)
`INSTALL-SLOOP.bat` builds in a WSL distribution and opens the installer on
`http://localhost:8766/webapp/installer/`. It needs Python 3 with Pillow on Windows, a WSL
distribution with the JieLi toolchain, and the three SDK files (below) in `build/deps/ac79`.
Set `SLOOP_WSL_DISTRO` (default `Ubuntu`) and `SLOOP_TOOLCHAIN` (a Linux path, default
`/root/.jieli/toolchain`) if yours differ.
## Prerequisites (macOS)
- Python 3 with Pillow: `pip3 install Pillow`
- Docker Desktop. The JieLi toolchain is Linux x86-64 only; the build runs each tool in a
`linux/amd64` `debian:bookworm-slim` container (Rosetta on Apple silicon). Keep the source
tree in a folder Docker can share, e.g. under `/Users`.
- The JieLi Linux toolchain (clang 4.0.1 for pi32v2, from JieLi's package server):
```
tools/get_toolchain.sh # installs to ~/.jieli/toolchain
```
- The JieLi AC79 SDK (Apache-2.0). The package uses three of its files
(`cpu/wl82/tools/uboot.boot`, `cfg_tool.bin`, `cfg/eq_cfg_hw.bin`); they are not part of this tree.
```
git clone --depth 1 --branch AC79NN_SDK_V1.2.1_2023-12-13 \
https://gitee.com/Jieli-Tech/fw-AC79_AIoT_SDK.git ~/fw-AC79_AIoT_SDK
```
- Node.js (optional, for the web tests).
On Linux x86-64 the toolchain runs natively and Docker is not needed.
## Build
```
./build.sh
```
`JIELI_TOOLCHAIN` and `AC79_SDK` override the default locations
(`~/.jieli/toolchain`, `~/fw-AC79_AIoT_SDK`).
`./build.sh --release 0.9-beta` makes a release build: the package identity becomes
`FM-1_909` and the version string `0.9-BETA`; the package is `build/felucca-0.9-beta.fwsc`.
Build options (environment, `0` or `1`; defaults in `firmware/src/felucca.c`):
| Flag | Default | |
| --- | --- | --- |
| `FELUCCA_FLASH` | 1 | settings, presets and projects in flash |
| `FELUCCA_OTA` | 1 | update entry (needs `FELUCCA_FLASH`) |
| `FELUCCA_CDC` | 1 | USB serial console |
| `FELUCCA_UART` | 0 | TRS MIDI IN (not tested on hardware) |
## Samples
The CC0 instrument samples that the SAMPLE engine uses are in `assets/samples-cc0/`
(Versilian Studios, see `ATTRIBUTION.txt` there). `tools/fetch_cc0.py` downloads them
again from the source repositories. Without that folder the build still works and the
SAMPLE engine has only the generated drum kit.
## Tests
```
tests/run_tests.sh
```
Runs the host tests (flash storage, user presets, MIDI parser, update entry, update
loader, a DSP render, the 4-track mix, project formats, the SLICER, the regression suite,
the command-line installer) and, with Node.js, the web page tests. Run it after `./build.sh`
(it uses `build/` and needs `AC79_SDK` set as for the build).
The regression suite (`tests/regress.c`) renders every engine and preset and compares a
hash of each render with `tests/golden.txt`; it also checks levels, voices and the CPU
cost (`tests/cpu_baseline.txt`, `tests/target_budget.txt`). After an intended change of
the sound, `GOLDEN_UPDATE=1 sh tests/run_tests.sh` rewrites the hashes; `BUDGET_UPDATE=1`
does the same for the cost files.
## Install
On Windows, `INSTALL-SLOOP.bat` builds and opens the web installer (Chrome or Edge). The
`.fwsc` of each release is on the GitHub releases page.
From the command line (needs `pip3 install mido python-rtmidi`):
```
python3 tools/fm1_install.py build/felucca.fwsc
python3 tools/fm1_install.py --info # identity of the connected FM-1
```
Or, to install your own build from the web installer, make a local copy of the site and open it from `localhost`
(Web MIDI needs a secure context):
```
python3 web/make_site.py build/felucca.fwsc dev /tmp/felucca-site
cd /tmp/felucca-site && python3 -m http.server 8000
# open http://localhost:8000/webapp/installer/
```
Installing firmware is at your own risk. If an install fails and the FM-1 no longer
starts, recovery needs [FM-1-transporter](https://github.com/kurogedelic/FM-1-transporter).
+145
View File
@@ -0,0 +1,145 @@
<p align="center"><img src="assets/logo/sloop-logo.png" alt="SLOOP" width="360"></p>
# SLOOP 2.0 — démarrage rapide
**SLOOP** transforme le M-VAVE FM-1 en machine à beats hip-hop : trois synthés et une batterie de 16 sons sur les touches blanches, 54 sons hip-hop / drum & bass, 34 kits, ghost notes et ratchets, note repeat, accords sur une touche, 16 effets punch-in, et un écran à la teenage engineering qui montre toujours ce que tes mains peuvent faire. Aucun motif d'usine : tout ce que tu entends, tu le joues.
Le manuel complet (en anglais) : [SLOOP.md](SLOOP.md).
---
## Installer
1. Double-clique **`INSTALL-SLOOP.bat`** dans le dossier SLOOP : il compile le firmware et ouvre l'installateur sur `http://localhost:8766/webapp/installer/`.
2. Dans **Chrome ou Edge**, branche le FM-1 en USB (câble de données, directement, sans hub).
3. **INSTALL**, autorise le MIDI, attends *Done*. Garde la fenêtre noire ouverte jusque-là.
L'éditeur web : `http://localhost:8766/webapp/editor/` (ou **`OPEN-EDITOR.bat`**).
## Un beat en soixante secondes
1. **ALGORITHM** sur la piste **4** (orange, batterie). Les touches blanches jouent 16 sons : **F3 kick**, G3 kick 2, A3 snare, B3 clap, **C4 charley**… **PRESETS** choisit le kit : essaie *808* ou *BOOMBAP*.
2. **REC** : *rec ready*. **Joue librement, à ton tempo** — pas de clic, pas de décompte. Garde **OCT−** enfoncé en frappant pour des ghost notes, **OCT+** pour des frappes fortes.
3. **Appuie sur REC sur le « 1 » qui suit ta dernière mesure** : la boucle se ferme, sa durée fixe le tempo, les frappes se calent sur la grille et la boucle joue aussitôt.
4. **REC** pendant la lecture : tu enregistres par-dessus (overdub). Maintiens **ARP** et garde la touche du charley : un roulement en 1/16, enregistré en ratchets.
5. **ALGORITHM** sur la piste **1** (bleue, *808 BOOM*), **REC**, joue une basse. Maintiens **SCL** et appuie sur la tonalité du morceau (ex. ré) ; sur la piste 2, maintiens SCL et tourne **KNOB 1** sur *7TH* : chaque touche blanche joue un accord de la gamme.
6. Maintiens **FX** + une touche blanche : un effet punch-in. Toujours FX enfoncé : **KNOB 2** = DUST (vinyle), **KNOB 3** = DUCK (pompe).
7. Une erreur ? Maintiens **EDIT** et appuie sur **OCT−** : annuler.
## Les couleurs
| Couleur | Piste | Bouton |
| --- | --- | --- |
| **bleu** | 1 · synthé | KNOB 1 |
| **vert** | 2 · synthé | KNOB 2 |
| **jaune** | 3 · synthé | KNOB 3 |
| **orange** | 4 · batterie | KNOB 4 |
Blanc = ce que tu touches. Rouge = enregistrement.
## Tapé ou maintenu : les calques
Chaque bouton de fonction a deux vies. **Tapé** (appuyé puis relâché sans rien toucher d'autre) : ses pages s'ouvrent, comme avant. **Maintenu** : un **calque** — les 16 touches blanches et les KNOB 1–4 changent de rôle, l'écran affiche les 16 touches en tuiles et les boutons en cadrans. Relâché : on rejoue.
| Maintenir | Touches | KNOB 1 · 2 · 3 · 4 |
| --- | --- | --- |
| **FX** — *punch* | effet punch-in tant que la touche est tenue | FILTRE · DUST · DUCK · — |
| **EDIT** — *effacer* | efface ce son / cette note du motif | DÉCALER · LONGUEUR ×2 / ½ · TRANSPOSER · — |
| **ARP** — *roll* | note repeat calé sur la grille | VITESSE · — · — · — |
| **SEQ** — *pas* | les pas 1–16 de la page | SON / NOTE · DIV · SWING · LONGUEUR |
| **SCL** — *tonalité* | la tonalité du morceau | ACCORD · GAMME · TOUCHES · TRANSPOSER |
| **GLO** — *mix* | 1–4 mute · 5–8 solo · 16 tap tempo | volume des pistes 1 · 2 · 3 · 4 |
| Commande | Action |
| --- | --- |
| **PLAY** | lecture / arrêt des quatre pistes (marche aussi dans un calque) |
| **REC** | en lecture : enregistre tout de suite / arrête · à l'arrêt : arme (la première note démarre) · prise libre : ferme la boucle |
| **REC maintenu** | efface la piste choisie (un anneau se remplit, ~2 s ; relâche avant et rien ne se passe) |
| **SAVE** | sur TRACKS : l'écran SONG · ailleurs : les pages SAVE |
| **SAVE maintenu** | sauvegarde le projet dans son emplacement (SAVE → PROJECT, SLOT 1–4) |
| **EDIT + OCT− / OCT+** | annuler / rétablir |
| **ALGORITHM** | choisit la piste (sur toutes les pages) |
| **PRESETS** | le son de la piste, ou le kit de batterie |
| **SELECT** | tempo (toujours, même dans un calque) |
| **OCT− / OCT+** | synthés : octave (les deux : retour à 0) · batterie, maintenus : ghost / fort |
| **HOME** | l'écran TRACKS · maintenu : menu (couleur, coupe-bas, zoom, calibration, à propos) |
## La batterie : 16 sons sur les touches blanches
| Touche | Son | Touche | Son | Touche | Son | Touche | Son |
| --- | --- | --- | --- | --- | --- | --- | --- |
| F3 | kick | C4 | charley fermé | G4 | snare 2 | D5 | ride |
| G3 | kick 2 | D4 | charley ouvert | A4 | tom grave | E5 | shaker |
| A3 | snare | E4 | charley pédale | B4 | tom aigu | F5 | conga |
| B3 | clap | F4 | rim | C5 | crash | G5 | cloche |
Une touche noire joue le son de la touche blanche à sa gauche (deux doigts sur un son pour les roulements rapides). Chaque frappe a un **niveau** — GHOST, SOFT, NORM (comme jouée), HARD — et un **ratchet** x1–x4 (la frappe répétée dans son pas).
## Enregistrer
| Quand | REC fait | Ensuite |
| --- | --- | --- |
| **En lecture** | enregistre la piste **tout de suite** | REC à nouveau arrête l'enregistrement, la boucle continue |
| **À l'arrêt, projet avec des notes** | arme (*rec ready*) | **ta première note démarre la boucle et devient le pas 1** |
| **À l'arrêt, projet vide** | arme (*play freely*) | une **prise libre** : la boucle suit ton jeu |
**Prise libre :** joue librement ; l'écran montre les secondes et la boucle que ça donnerait (*2 bars · 92 bpm*). **REC sur le « 1 » qui suit ta dernière mesure** : SLOOP choisit 1, 2 ou 4 mesures au tempo le plus proche, cale tes notes et lance la boucle. **PLAY** abandonne la prise.
Les notes vont au pas le plus proche **tel que tu l'as entendu** (la latence de ~12 ms est compensée). La lumière PLAY clignote à chaque temps : un métronome visuel. Clic audible : GLO → GLOBAL → CLICK.
**Swing** façon MPC : de 50 % (droit) à 75 % — GLO → GLOBAL → SWING pour tout, SEQ maintenu + KNOB 3 par piste (ils s'additionnent).
## Les calques en détail
**FX — punch.** Les 16 touches blanches = les 16 effets (boucles 1/4 à 1/32, stutter, reverse, tape stop, demi-vitesse, filtres, téléphone, bit crush, alias, gate, écho, wobble), tant que la touche est tenue. KNOB 1 = filtre DJ (gauche passe-bas, droite passe-haut, centre OFF), KNOB 2 = DUST, KNOB 3 = DUCK.
**EDIT — effacer.** EDIT + une touche : ce son (batterie) ou cette note (synthé) quitte le motif — **en lecture**, de chaque pas que la tête de lecture traverse tant que tu tiens la touche (façon MPC : garde le charley une mesure et les charleys de cette mesure disparaissent) ; **à l'arrêt**, de tout le motif. KNOB 1 décale le motif d'un pas, KNOB 2 le double (×2, copie) ou le coupe en deux, KNOB 3 transpose (synthés). **EDIT + OCT−** annule, **EDIT + OCT+** rétablit.
**ARP — roll (note repeat).** ARP + une touche tenue : elle se répète sur la grille à la vitesse de KNOB 1 (1/8, 1/16, 1/32, 32T, 1/64), toujours en rythme. En enregistrement, un roll s'écrit en ratchets.
**SEQ — pas (séquenceur pas à pas).** Les 16 touches blanches = les 16 pas de la page ; les quatre premières touches noires (F#3, G#3, A#3, C#4) ou OCT− / OCT+ = pages 1–4.
- Pas vide : appuie, il est posé (batterie : avec le son affiché, le dernier pad frappé ou KNOB 1 ; synthé : avec la dernière note ou le dernier accord joué).
- Pas posé : appuie et relâche, il s'efface. Tiens-le et tourne un bouton : il est modifié et gardé — KNOB 1 son / note, **KNOB 2 niveau**, **KNOB 3 ratchet**. Plusieurs pas tenus se modifient ensemble.
- Sans pas tenu : KNOB 2 = DIV, KNOB 3 = swing de la piste, KNOB 4 = longueur (1–64 pas ; chaque piste boucle sur sa longueur).
**SCL — tonalité et accords.** Une touche = la tonalité du morceau (la fondamentale des trois synthés). KNOB 1 = **ACCORD** de la piste : OFF, TRIAD, 7TH, 9TH (1-3-7-9, le voicing lo-fi / R&B), SUS4, POWER. Avec un accord, **les touches blanches parcourent la gamme à partir de C4** : C4 = l'accord du I, D4 du II, E4 du III… un doigt, un accord, enregistré comme tel. KNOB 2 = gamme (16 gammes), KNOB 3 = touches (OFF chromatique, SNAP arrondi à la gamme, WHITE gamme sur les blanches), KNOB 4 = transposition. Changer de son ne change jamais la tonalité, le motif ni le mix de la piste.
**GLO — mix.** Touches blanches 1–4 = mute des pistes 1–4, 5–8 = solo, la dernière (G5) = **tap tempo**. KNOB 1–4 = volume des pistes 1–4.
## Annuler, effacer, sauvegarder
- **Annuler / rétablir :** EDIT + OCT− / OCT+ (un niveau : le dernier passage d'enregistrement, effacement, piste effacée, modification de pas ou de motif).
- **Effacer une piste :** maintiens REC ; après 0,7 s un anneau se remplit ; tiens encore ~1,3 s. Relâche avant : rien. Annuler la ramène.
- **Sauvegarder :** maintiens SAVE, l'anneau, puis le projet est écrit dans son emplacement (SAVE → PROJECT : SLOT 1–4).
- **Sauvegarde automatique :** à l'arrêt, 2,5 s sans toucher (au plus toutes les 20 s), le projet en cours est gardé ; au rallumage, SLOOP revient comme tu l'as laissé.
- **Nouveau projet :** SAVE → TOOLS → NEW (tourner sur GO).
## Le master : DUST, DUCK, FILT
- **DUST** : le mix dans un vieux sampler et sur un vinyle — saturation douce, fréquence d'échantillonnage réduite, moins de bits, passe-bas, et pendant la lecture un léger souffle et des craquements (à l'arrêt, silence).
- **DUCK** : chaque kick fait « pomper » les synthés (sidechain), sur une croche, à tout tempo.
- **FILT** : filtre DJ — à gauche passe-bas, à droite passe-haut, au centre OFF.
Réglables avec FX maintenu (KNOB 1–3) ou GLO → MASTER.
## Mode chanson
1. Fais une boucle, arrête, et appuie sur **SAVE** sur TRACKS : l'écran SONG.
2. **KNOB 2** choisit la section A–D ; **REC** y mémorise les quatre pistes (une section occupée demande un second REC dans les 3 s).
3. **KNOB 1** choisit une étape de la chaîne, **KNOB 3** sa durée en mesures, **KNOB 4** la longueur de la chaîne. **SAVE** sauvegarde la chaîne.
4. **OCT−** bascule boucle / chanson, **PLAY** joue la chaîne jusqu'au bout ; ta boucle de travail revient à l'arrêt. **OCT+ deux fois** (en 3 s) recharge une section pour la modifier.
## L'éditeur web
Chrome ou Edge, FM-1 en USB, **Connect**. Il suit l'appareil en direct.
- **Sequencer** sur la piste batterie : une grille 16 sons × pas, avec le **kit**. Choisis un **niveau** (GHOST, SOFT, NORM, HARD) et un **roll** (x1–x4), puis clique : une frappe ; reclique (même niveau et roll) : effacée ; Maj+clic : un niveau plus fort.
- **Settings → MASTER** : DUST, DUCK, FILT, ROLL. **Tracks** : les quatre tranches (volume, pan, mute ; SOLO et REC affichés). **Samples** : tes sons USR1–USR3 et le découpage CHOP.
## Secours
- **Secours USB :** maintiens **OCT−** seul à l'allumage (*SLOOP USB RESCUE*), puis réinstalle.
- **Installation interrompue :** le FM-1 reste en mode mise à jour ; relance INSTALL et il termine. Un paquet abîmé est refusé et le FM-1 attend un paquet correct.
- **Retour au firmware officiel :** M-UPGRADE de M-VAVE et le firmware FM-1 de m-vave.com.
SLOOP est libre (GPL-3.0), basé sur Felucca de Leo Kuroshita (Hügelton Instruments). M-VAVE et FM-1 sont des marques de leurs propriétaires ; SLOOP n'y est pas affilié.
+4
View File
@@ -0,0 +1,4 @@
@echo off
title SLOOP installer
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0build-sloop.ps1"
pause
+674
View File
@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
+65
View File
@@ -0,0 +1,65 @@
# Felucca licensing
Felucca is free software. Its **code** is licensed under the GNU General Public License,
version 3 only (`GPL-3.0-only`, full text in `LICENSE`). Its **assets** are not part of
that licence: the icon atlas `assets/icons.png`, the panel image `docs/panel.jpg` and the drum sounds made by
`tools/gen_waves.py` (the Hügelton Sample Pack) are Copyright (C) 2026 Hügelton Instruments,
all rights reserved. Their licence terms will be published later.
Copyright (C) 2026 Leo Kuroshita (@kurogedelic), Hügelton Instruments
## What is code (GPL-3.0-only)
Every file in this tree that carries an `SPDX-License-Identifier: GPL-3.0-only` header:
- the firmware: `firmware/` (app, HAL, update loader)
- the build script and tools: `build.sh`, `tools/`
- the web pages (installer, editor) and their tests: `web/` (not the Fukiai font, below)
- the host tests: `tests/`
You may use, study, change and share it under the GPL. If you distribute Felucca, or
firmware derived from it, you must also give your recipients its complete corresponding
source under the same licence. That includes devices that ship with modified Felucca
inside.
## Additional permission (GPL-3.0 section 7)
As an additional permission under GPL-3.0 section 7, you may combine Felucca, or a work
based on it, with the Felucca Assets (above), and convey the combination.
This is allowed even though the Felucca Assets are not licensed under the GPL, provided
that:
- you follow the GPL for every part that is not a Felucca Asset; and
- you follow the terms published for the assets.
The Felucca Assets are data (wavetables, icons, sample data). They are not program
code. A firmware image built from the GPL sources with replacement assets, or with no
assets, is entirely governed by the GPL.
## Third-party material
| What | Licence | Where |
| --- | --- | --- |
| Instrument samples (Versilian Studios VSCO-2 CE, VCSL) | CC0 1.0 | `assets/samples-cc0/`, provenance in `ATTRIBUTION.txt` there |
| Terminus font 8x16 (ter-u16n) | SIL OFL 1.1 | `assets/fonts/ter-u16n.bdf`, `assets/fonts/Terminus-LICENSE.txt` |
| Fukiai icon font (Hügelton Instruments), web editor only | MIT | `web/fukiai.ttf`, `web/FUKIAI-LICENSE.txt` |
| CrispyZebra by Leo Kuroshita (<https://github.com/hugelton/CrispyZebra>): the PHASE engine's waveforms are a C port of its oscillator | GPL-3.0 | `firmware/src/eng_phase.c` |
| klattsch by Tony Gies (<https://github.com/tgies/klattsch>): design reference for the VOICE (formant) engine; no code copied. Formant data from Klatt (1980) / Hillenbrand et al. (1995) | MIT (klattsch) | credit only |
| JieLi AC79 SDK: `uboot.boot`, `cfg_tool.bin`, `eq_cfg_hw.bin` are read from your SDK checkout at build time and placed in the package; no SDK files are in this tree | Apache-2.0 | <https://gitee.com/Jieli-Tech/fw-AC79_AIoT_SDK> |
## Contributions
Contributions are welcome under GPL-3.0-only. By submitting one, you agree that it may be
combined with the Felucca Assets under the section 7 permission above.
## Trademarks
"Felucca" and "Hügelton Instruments" are names of Hügelton Instruments.
"M-VAVE" and "FM-1" are trademarks of their respective owners. Felucca is independent
firmware that runs on FM-1 hardware. It is not affiliated with, endorsed by or supported
by those owners.
## Radio
Felucca never enables the Bluetooth / Wi-Fi radio of the hardware.
+12
View File
@@ -0,0 +1,12 @@
@echo off
title SLOOP editor
cd /d "%~dp0"
if not exist build\sloop-site\webapp\editor\index.html (
echo The editor is not built yet: run INSTALL-SLOOP.bat first.
pause
exit /b 1
)
start "" http://localhost:8766/webapp/editor/
echo SLOOP editor: http://localhost:8766/webapp/editor/ (keep this window open while you use it)
python -m http.server 8766 --bind 127.0.0.1 --directory build/sloop-site
pause
+55
View File
@@ -0,0 +1,55 @@
<p align="center"><img src="assets/logo/sloop-logo.png" alt="SLOOP" width="420"></p>
<p align="center"><b>A hip-hop beat machine firmware for the M-VAVE FM-1.</b><br>
Free and open source (GPL-3.0), based on <a href="https://github.com/hugelton/Felucca">Felucca</a>.</p>
---
SLOOP turns the FM-1 into a four-track beat machine you play live: three synths and a drum machine with 16 sounds on the white keys. No factory patterns, nothing to load: everything you hear, you play.
## Features
- **Hold a button, touch a key.** Every function button is a layer: hold it and the 16 white keys and the four knobs change job, and the screen shows how. Tap it and its pages open.
- **FX**: 16 punch-in effects (loops, stutter, reverse, tape stop, filters, crush…)
- **EDIT**: erase a sound or a note as the loop plays; shift, double or halve the pattern; undo / redo
- **ARP**: note repeat (1/8 to 1/64), locked to the grid
- **SEQ**: step entry, with a level and a ratchet per step
- **SCL**: the key of the song, and one-key chords (triad, 7th, 9th, sus4, power)
- **GLO**: mute, solo, tap tempo, track levels
- **Drums:** 16 sounds on the white keys, ghost and hard hits (hold OCT− / OCT+), ratchets x1–x4, 34 kits (5 sampled, 29 synthesised: 808, 909, boom bap, trap, drill, lo-fi, jungle…).
- **Sounds:** 54 presets for hip-hop and drum & bass on 9 engines — 808s that slide, Rhodes, organs, horn and string stabs, talkbox, granular pads, scratches.
- **Recording with no click:** a free take sets the loop length and the tempo from your playing; REC records at once while playing; notes land where you heard them (latency-compensated).
- **Groove:** MPC-style swing (50–75 %), a sample-accurate clock (no drift at any tempo), polymeters.
- **Master:** DUST (old sampler + vinyl), DUCK (the kick pumps the synths), a DJ filter.
- **Memory:** undo / redo, autosave of the working project, 4 projects, 32 user presets, a song mode of 4 sections.
- **Your own samples:** three user slots; the web editor chops a recording into 16 pieces (tap along while it plays) and uploads them.
- **Web editor:** every parameter, the drum track as a 16-lane grid, the mixer, a preset library, sample upload. Live sync with the device.
## Install
1. Get the `.fwsc` of the latest [release](../../releases), or build it (below).
2. On Windows, double-click **`INSTALL-SLOOP.bat`**: it builds the firmware and opens the installer in the browser.
3. Connect the FM-1 by USB (a data cable, no hub), open the installer in **Chrome or Edge**, press **INSTALL** and wait for *Done*.
Going back: M-VAVE's own updater (M-UPGRADE) and the official FM-1 firmware. If an install is cut off, the FM-1 stays in update mode: press Install again and it finishes.
> Custom firmware is installed at your own risk. If an FM-1 no longer starts, recovery needs [FM-1-transporter](https://github.com/kurogedelic/FM-1-transporter).
## Documentation
- [SLOOP.md](SLOOP.md) — the manual
- [DEMARRAGE-RAPIDE-FR.md](DEMARRAGE-RAPIDE-FR.md) — guide de démarrage en français
- [BUILDING.md](BUILDING.md) — building and testing
- [web/EDITOR_PROTOCOL.md](web/EDITOR_PROTOCOL.md) — the editor's SysEx protocol
## Building
See [BUILDING.md](BUILDING.md). In short: the JieLi toolchain and three files of the AC79 SDK, then `./build.sh` (Linux / macOS) or `INSTALL-SLOOP.bat` (Windows with WSL). `tests/run_tests.sh` runs the host test suite (audio renders, sequencer timing, UI, storage, update loader, web pages).
## Credits
SLOOP is a fork of **[Felucca](https://github.com/hugelton/Felucca)** by Leo Kuroshita (@kurogedelic), Hügelton Instruments: the engines, the sequencer, the editor and the installer come from there. Font: Terminus (SIL OFL 1.1). Samples: Versilian Studios VSCO-2 CE and VCSL (CC0), Hügelton Sample Pack. PHASE engine after CrispyZebra; VOICE after klattsch. Icons: Fukiai.
## Licence
Code: GPL-3.0-only (see [LICENSE](LICENSE) and [LICENSING.md](LICENSING.md) for the assets). No warranty. M-VAVE and FM-1 are trademarks of their owners; SLOOP is not affiliated with M-VAVE. Drum kit names describe styles, not products.
+320
View File
@@ -0,0 +1,320 @@
<p align="center"><img src="assets/logo/sloop-logo.png" alt="SLOOP" width="480"></p>
# SLOOP 2.0
**The hip-hop beat machine firmware for the M-VAVE FM-1.** Four tracks — three synths and a drum machine with 16 sounds on the white keys — 54 sounds for hip-hop and drum & bass, 34 drum kits, ghost notes and ratchets, note repeat, one-key chords, 16 punch-in effects, a vinyl / sidechain / DJ-filter master, and a teenage-engineering-style screen that always shows what your hands can do next. No factory patterns, nothing to load: everything you hear, you play.
SLOOP is free and open source (GPL-3.0), based on [Felucca](https://github.com/hugelton/Felucca) by Leo Kuroshita / Hügelton Instruments.
> **Status:** 2.0, running on the FM-1. Still a beta: install at your own risk, and please report what you find (GitHub issues).
### New in 2.0
- **Hold a button, touch a key.** Every function button is a *layer*: hold it and the 16 white keys and the four knobs change job, the screen shows how. Tap it and its pages open as before.
- **16 drum sounds on the white keys**, black keys double them. **OCT− / OCT+ held** = ghost / hard hits. Hits keep their level and a **ratchet** (x1–x4) in the pattern.
- **Note repeat** (ARP + key), **erase as it plays** (EDIT + key), **steps under your fingers** (SEQ + key, Elektron style), **one-key chords in the song's key** (SCL), **mute / solo / tap tempo** (GLO).
- **Undo / redo** (EDIT + OCT− / OCT+), **hold REC to clear**, **hold SAVE to save**, and an **autosave** that brings your beat back at power-on.
- **MPC swing** (50–75 %), a sample-accurate clock (no drift, any tempo), tighter glides for the 808s.
- **Master:** **DUST** (an old sampler and a record: bits, rate, crackle), **DUCK** (the kick pumps the synths), **FILT** (DJ filter: low-pass ← OFF → high-pass).
- **Web editor:** the drum track as a 16-lane grid with levels and ratchets, the kit, the master page.
- **Safer updates:** the installer checks the package's SHA-256 and only resumes SLOOP's own update loader; the loader checks the package CRC before it starts the new firmware, and refuses a flash chip it does not know.
---
## Contents
1. [Install](#install)
2. [Sixty seconds to a beat](#sixty-seconds-to-a-beat)
3. [The colour code](#the-colour-code)
4. [The panel: tap, hold, layers](#the-panel-tap-hold-layers)
5. [The drum track](#the-drum-track)
6. [Recording](#recording)
7. [Layers in detail](#layers-in-detail)
8. [Undo, clear, save, autosave](#undo-clear-save-autosave)
9. [Master: DUST, DUCK, FILT](#master-dust-duck-filt)
10. [Punch-in effects](#punch-in-effects)
11. [Screens](#screens)
12. [The sound bank](#the-sound-bank)
13. [Drum kits](#drum-kits)
14. [Your own samples](#your-own-samples-usr1usr3)
15. [Song mode](#song-mode)
16. [The web editor](#the-web-editor)
17. [Sound design pages](#sound-design-pages)
18. [Specifications](#specifications)
19. [Rescue, going back, credits](#rescue-going-back-credits)
---
## Install
1. Double-click **`INSTALL-SLOOP.bat`** in the SLOOP folder. It builds the firmware and opens the installer at `http://localhost:8766/webapp/installer/`.
2. In **Chrome or Edge**, connect the FM-1 to the computer by USB (a data cable, directly — no hub).
3. Press **INSTALL**, allow MIDI access, and wait for *Done*. Keep the black window open until then.
The FM-1 restarts on the SLOOP logo. The editor is at `http://localhost:8766/webapp/editor/` (or **`OPEN-EDITOR.bat`**).
## Sixty seconds to a beat
1. **ALGORITHM** to track **4** (orange, drums). The white keys play 16 sounds: **F3 kick**, G3 kick 2, A3 snare, B3 clap, **C4 hat**, D4 open hat… **PRESETS** picks a kit: try *808* or *BOOMBAP*.
2. Press **REC**: *rec ready*. **Play a beat freely, at your own tempo** — no click, no count-in. Hold **OCT−** while you hit for ghost notes, **OCT+** for hard ones.
3. **Press REC on the "1" after your last bar.** The loop closes: its length sets the tempo, the hits snap to the grid, the loop plays at once.
4. **REC** again while it plays: you record on top (overdub). Hold **ARP** and hold the hat key: a 1/16 hat roll, recorded as ratchets.
5. Turn **ALGORITHM** to track **1** (blue, *808 BOOM*), **REC**, play a bass line. Hold **SCL** and press the key of your song (e.g. D); on track 2 hold SCL and turn **KNOB 1** to *7TH*: every white key is now a chord of the key.
6. Hold **FX** and press a white key for a punch-in effect; still holding FX, turn **KNOB 2** for DUST, **KNOB 3** for DUCK.
7. Made a mistake? Hold **EDIT** and press **OCT−**: undo.
## The colour code
| Colour | Track | Knob |
| --- | --- | --- |
| **blue** | 1 · synth | KNOB 1 |
| **green** | 2 · synth | KNOB 2 |
| **yellow** | 3 · synth | KNOB 3 |
| **orange** | 4 · drums | KNOB 4 |
The four dials at the bottom of the screen show what KNOB 1–4 do now. White always means *what you are touching*. Red always means *recording*.
## The panel: tap, hold, layers
Every function button has two lives. **Tap** it (press and let go, touching nothing else): its pages open, as on any FM-1 firmware. **Hold** it: a **layer** — the 16 white keys and KNOB 1–4 change job while it is held, and after 0.14 s the screen shows the 16 keys as tiles and the knobs as dials. Let go: back to playing.
| Hold | Keys | KNOB 1 · 2 · 3 · 4 | Tap |
| --- | --- | --- | --- |
| **FX** — *punch* | a punch-in effect while the key is held | FILTER · DUST · DUCK · — | FX pages |
| **EDIT** — *erase* | erase that sound / note from the pattern | SHIFT · LENGTH ×2 / ½ · TRANSPOSE · — | EDIT pages (drums: grid / kit) |
| **ARP** — *roll* | note repeat on the grid | RATE · — · — · — | ARP pages |
| **SEQ** — *steps* | steps 1–16 of the page | SOUND / NOTE · DIV · SWING · LENGTH | SEQ pages (drums: grid / kit) |
| **SCL** — *key* | the key of the song | CHORD · SCALE · KEYS · TRANSPOSE | SCL pages |
| **GLO** — *mix* | 1–4 mute · 5–8 solo · 16 tap tempo | level of tracks 1 · 2 · 3 · 4 | GLO pages |
Other controls:
| Control | Action |
| --- | --- |
| **PLAY** | start / stop all four tracks (works inside any layer) |
| **REC** | playing: record now / stop · stopped: arm (the first note starts) · free take: close the loop |
| hold **REC** | clear the selected track (a ring fills: keep holding ~2 s; let go before and nothing happens) |
| **SAVE** | on TRACKS: the SONG screen · elsewhere: the SAVE pages |
| hold **SAVE** | save the project into its slot (PROJECT page, SLOT 1–4) |
| **EDIT + OCT− / OCT+** | undo / redo |
| **ALGORITHM** | select the track (on every page) |
| **PRESETS** | the selected track's sound, or the drum kit |
| **SELECT** | tempo (always, even inside a layer) |
| **OCT− / OCT+** | synth tracks: octave (both: back to 0) · drum track, held: ghost / hard hits |
| **HOME** | the TRACKS screen · hold: menu (colour, low cut, zoom, calibration, about) |
| **ENV / LFO** | their pages |
## The drum track
Track 4 plays **16 sounds, one per white key** from the lowest F to the highest G; a black key plays the sound of the white key on its left (two fingers on one sound, for fast rolls).
| Key | Sound | Key | Sound | Key | Sound | Key | Sound |
| --- | --- | --- | --- | --- | --- | --- | --- |
| F3 | kick | C4 | hat | G4 | snare 2 | D5 | ride |
| G3 | kick 2 | D4 | open hat | A4 | low tom | E5 | shaker |
| A3 | snare | E4 | pedal hat | B4 | hi tom | F5 | conga |
| B3 | clap | F4 | rim | C5 | crash | G5 | cowbell |
**Levels:** every hit has one of four levels — **GHOST**, **SOFT**, **NORM** (as played), **HARD**. Hold **OCT−** while you hit for ghost notes, **OCT+** for hard hits; they are recorded so. **Ratchets:** a hit can repeat x1–x4 inside its step (ARP rolls record them; SEQ + a step + KNOB 3 sets them). The closed and pedal hats choke the open one.
## Recording
SLOOP records live and layers every pass on top of the last (overdub). Notes go to the nearest step **as you heard it**: the time between a key and its sound (~12 ms) is taken back, so what you play on the beat lands on the beat. Chords are kept on the synth tracks (up to 4 notes a step); held notes become ties.
| When | REC does | Then |
| --- | --- | --- |
| **Playing** | records the selected track **at once** | REC again stops recording, the loop plays on |
| **Stopped, project with notes** | arms (*rec ready*, the REC light blinks) | **your first note starts the loop and is step 1**; PLAY starts it too |
| **Stopped, empty project** | arms (*rec ready* · *play freely*) | a **free take**: see below |
**Free take — the loop follows you.** On an empty project there is no tempo yet, so you set it by playing:
1. REC, then play freely. The screen shows *free take*, the seconds, and the loop it would make right now (*2 bars · 92 bpm*).
2. **Press REC on the "1" after your last bar.** The time from your first note to that press is the loop: SLOOP picks 1, 2 or 4 bars at the tempo nearest the one set (within 3 % the set tempo is kept), writes your notes into it with their lengths and levels, and plays it at once. All four tracks take that length.
3. **PLAY** during a free take drops it. A take closes by itself after 24 s.
- While recording the REC light is solid and the track shows a red *rec*. Turn ALGORITHM and the take moves to the next track without stopping.
- The **PLAY light flashes on every beat**: a visual metronome. An audible click: GLO → GLOBAL → **CLICK** (`OFF`, `REC`, `ON`); it is never recorded.
- **Swing** is MPC swing: 50 % straight to 75 % (GLO → GLOBAL → SWING for all tracks, SEQ + KNOB 3 per track). The swing of a track adds to the global one.
## Layers in detail
### FX — punch
The 16 white keys are the [punch-in effects](#punch-in-effects); they run while the key is held. The knobs drive the [master](#master-dust-duck-filt): **KNOB 1 FILTER** (turn left: low-pass, right: high-pass, centre: off), **KNOB 2 DUST**, **KNOB 3 DUCK**. Keys pressed while FX is held never play or record notes.
### EDIT — erase
Hold EDIT and press a key: that sound (drums) or that note (synths; with CHORD on, the notes of its chord) leaves the selected track's pattern — **while playing**, from every step the playhead passes while you hold the key (MPC style: hold the hat key for one bar and the hats of that bar are gone); **stopped**, from the whole pattern at once. *ERASED* flashes. The knobs reshape the whole pattern:
- **KNOB 1 SHIFT** — every step one later / earlier (turns the groove around).
- **KNOB 2 LENGTH** — right: ×2 (the pattern copied after itself, up to 64 steps); left: ½.
- **KNOB 3 TRANSPOSE** — every note a semitone up / down (synth tracks).
- **OCT− undo · OCT+ redo** (the knob turns of one hold count as one change).
### ARP — roll (note repeat)
Hold ARP and hold a key: it repeats on the grid at the **RATE** of KNOB 1 — 1/8, 1/16, 1/32, 32T, 1/64 — locked to the tempo and the swing, so it always lands in time. On the drum track OCT− / OCT+ make it ghost / hard. While recording, a roll is written as ratchets (a 1/32 roll on a 1/16 track: x2 on each step). Rolls end with their key.
### SEQ — steps (step sequencer)
The 16 white keys are the 16 steps of the page; the lit ones play. The first four black keys (F#3, G#3, A#3, C#4) or **OCT− / OCT+** pick page 1–4 (steps 1–16, 17–32, 33–48, 49–64, up to the track's LENGTH).
- **An empty step:** press its key — it is set at once. Drums: with the sound shown (KNOB 1 picks it, or the last pad you hit); synths: with the note or chord you played last.
- **A set step:** press and let go — it is cleared. Hold it and turn a knob instead — it is edited, and kept: **KNOB 1** sound (drums) / note (synths), **KNOB 2 LEVEL** (ghost, soft, norm, hard), **KNOB 3 RATCHET** (x1–x4). Hold several step keys to edit them together.
- **No step held:** KNOB 1 the sound / note to set · KNOB 2 **DIV** (1/4 … 1/32, triplets) · KNOB 3 **SWING** of the track · KNOB 4 **LENGTH** (1–64 steps; each track loops on its own length, polymeters stay in phase).
### SCL — key and chords
- **Any key** sets the **key of the song**: the root of all three synth tracks (*KEY D*).
- **KNOB 1 CHORD** (selected synth track): OFF, TRIAD, 7TH, 9TH (1-3-7-9, the lo-fi / R&B voicing), SUS4, POWER. With a chord on, **the white keys walk the scale from C4** — C4 is the chord of the key's I, D4 the II, E4 the III… — and one finger plays the whole chord, recorded as a chord. With SCALE on CHR, the chords come from the minor scale.
- **KNOB 2 SCALE** for all synth tracks (16 scales: major, minor, dorian, mixolydian, pentatonics, harmonic, blues…).
- **KNOB 3 KEYS**: OFF (all keys chromatic), SNAP (every key rounded to the scale), WHITE (the white keys walk the scale, the black keys are silent).
- **KNOB 4 TRANSPOSE** the selected track, ±24 semitones.
Changing a sound (PRESETS, a user preset) never changes the key, the chord mode, the pattern or the mix of its track.
### GLO — mix
- White keys **1–4 mute** tracks 1–4 (a muted track fades out in a few ms and plays no new notes; its pattern runs on in time), keys **5–8 solo** them (several solos add up). The tiles show what is heard.
- The last white key (**G5**): **tap tempo** (two taps or more).
- **KNOB 1–4: the levels** of tracks 1–4.
## Undo, clear, save, autosave
- **Undo / redo:** hold EDIT, press OCT− / OCT+. One level: the last recording pass, erase, clear, step or pattern edit; redo takes it back again.
- **Clear a track:** hold REC. After 0.7 s the press is cancelled and a ring fills; keep holding ~1.3 s more and the selected track is cleared (*TRACK 2 CLEARED*). Let go before: nothing. Undo brings it back.
- **Save:** hold SAVE: the ring, then the project is saved into its slot (SAVE → PROJECT: SLOT 1–4, LOAD, SAVE).
- **Autosave:** when the transport is stopped and you have not touched anything for 2.5 s (at most every 20 s), the working project is kept in flash; at power-on SLOOP comes back exactly as you left it.
- **New project:** SAVE → TOOLS → NEW (turn to GO): the four tracks back to their power-on sounds, empty patterns (undoable).
## Master: DUST, DUCK, FILT
On the whole mix, after the tracks' sends (FX + KNOB 1–3, or GLO → MASTER):
- **DUST** 0–100 %: the mix through an old sampler and a record — drive into a soft clip, a lower sample rate (down to ~11 kHz), fewer bits (down to 8), a low-pass closing to ~3 kHz, and while the transport plays a little hiss and crackle (a stopped SLOOP is silent).
- **DUCK** 0–100 %: every kick pumps the synth tracks down and back over an 1/8 note — the sidechain sound, in time at any tempo.
- **FILT**: a DJ filter. Left of centre a low-pass closing, right a high-pass opening, centre OFF. It glides (no zipper noise).
- **ROLL** (GLO → MASTER): the note-repeat rate of ARP + key.
## Punch-in effects
Hold **FX**, then hold a white key — the 16 white keys from the lowest F to the highest G. The effect runs on the whole mix while the key is held and lets go cleanly when you release it. Loops and the gate are locked to the tempo and start on the grid.
| Key | Effect | Key | Effect |
| --- | --- | --- | --- |
| 1 | loop 1/4 | 9 | low-pass sweep |
| 2 | loop 1/8 | 10 | high-pass sweep |
| 3 | loop 1/16 | 11 | phone |
| 4 | loop 1/32 | 12 | bit crush |
| 5 | stutter (1/16 triplets) | 13 | alias (sample-rate drop) |
| 6 | reverse | 14 | gate 1/16 |
| 7 | tape stop | 15 | echo (dotted 1/8) |
| 8 | half speed | 16 | tape wobble |
## Screens
- **TRACKS** (HOME) — the performance view: tempo, swing, transport, bar.beat; each track with its sound, its steps, the playhead, mute / solo / rec badges and its level. Dials: *swing · level · steps · pan* (KNOB 2 on a muted track unmutes it).
- **Layers** — while a layer button is held: 16 tiles (the white keys) and the knobs' dials, in the layer's colour.
- **DRUMS** (EDIT or SEQ tapped on TRACKS with the drum track) — **grid**: the 16 sounds × 16 steps, levels as shades, ratchets as notches; dials *sound · step · hit · level*. **kit**: 16 pads that flash on every hit; dials *kit · level · reverb · pan*. EDIT / SEQ tapped switches grid ↔ kit.
- **REC READY / FREE TAKE** — while REC is armed, and during a free take: the seconds and the loop it makes.
- **Holds** — the ring of REC (clear) and SAVE (save) while held.
- **SONG** — the section chain.
- **Sound pages** (ENV, LFO, FX, SCL, EDIT, ARP, SEQ, GLO, SAVE) — the full synth, colour-coded.
## The sound bank
54 sounds made for hip-hop and drum & bass — boom bap, trap and drill, lo-fi, R&B and soul, jungle. **PRESETS** browses them all on a synth track (the engine follows). SLOOP starts (on a new project) at **90 BPM** with *808 BOOM* on track 1, *RHODES* on track 2, *LOFI FLUTE* on track 3 and the 808 kit on track 4.
| Role | Sounds (engine) |
| --- | --- |
| **808 & sub** | 808 BOOM, 808 DIRTY, SUB BASS (ANALOG) — they slide between held notes (~70 ms) with a punch of pitch on the attack, two octaves under the keys |
| **Basses** | REESE, WOBBLE, FUNK BASS (ANALOG) · FM BASS (DIGITAL) · CZ BASS (PHASE) · FAT BASS (TRIO) · WOW BASS (VOICE) · GB BASS (LOFI) · UP BASS, DEEP BASS (SAMPLE: a real upright) |
| **Keys** | RHODES, DX RHODES, WURLI, CLAV (DIGITAL) · SOFT KEYS (PHASE) · DUSTY PNO, LOFI KEYS (SAMPLE: an old upright piano) |
| **Organ** | SOUL ORGAN, GOSPEL, JAZZ ORGAN, DIRTY B3 (WHEEL) |
| **Bells & plucks** | TRAP BELL, MUSIC BOX, MARIMBA (DIGITAL) · TRAP PLUCK (ANALOG) · RESO PLUCK (PHASE) · VIBES (SAMPLE) |
| **Stabs** | HORN STAB, STRING STB (SAMPLE) · MIN STAB, MIN7 STAB (TRIO) · SYN BRASS (ANALOG) · CZ BRASS (PHASE) |
| **Leads** | G-FUNK LD (ANALOG) · TALKBOX (VOICE) · SYNC LEAD, HOOVER (TRIO) · LOFI FLUTE (SAMPLE) · GAME LEAD, 8BIT ARP (LOFI) |
| **Pads & voices** | WARM PAD, DARK STR, ATMOS PAD (ANALOG) · CZ STRING (PHASE) · CHOIR AAH, SOUL OOH (VOICE) · LOFI CLOUD, VIBE HAZE, FLUTE DUST (GRAIN) |
| **DJ & drums** | SCRATCH — scratch, backspin, rewind across the keys · GM KIT (SAMPLE) |
The sampled sounds (SAMPLE engine, **SET**: DUSTY (piano), BASS, VIBES, HORNS, STRGS, FLUTE, SCRCH, PERC) are free recordings (CC0: Versilian Studios VSCO-2 CE and VCSL, Sonic Pi), retuned and coloured like a record through an old sampler.
## Drum kits
34 kits — **PRESETS** on the drum track, KNOB 1 on the kit page, or the editor. 1–5 are the sampled GM kit and its treatments; 6–34 are synthesised (analogue-style kick, snare, clap, six-oscillator metallic hats and cymbals, toms, congas, rim, cowbell, clave; FM and 8-bit voices for the game kits), so they cost almost no memory.
| # | Kit | Style | # | Kit | Style |
| --- | --- | --- | --- | --- | --- |
| 1 | ORIGINAL | acoustic | 18 | ELECTRO | electro |
| 2 | DEEP | soft | 19 | JUNGLE | drum & bass |
| 3 | TIGHT | punchy | 20 | DUBSTEP | bass music |
| 4 | BRIGHT | bright | 21 | DEMBOW | reggaeton |
| 5 | DUST | dusty | 22 | AFRO | afrobeat |
| 6 | 808 | hip hop | 23 | LATIN | latin |
| 7 | 909 | house | 24 | DISCO | disco |
| 8 | 606 | acid | 25 | SYNTHWV | synthwave |
| 9 | VINTAGE | rhythm box | 26 | CHIP | chiptune |
| 10 | 80S | 80s pop | 27 | 8BIT | handheld |
| 11 | TRAP | trap | 28 | ARCADE | video game |
| 12 | DRILL | UK drill | 29 | GLITCH | glitch |
| 13 | BOOMBAP | hip hop | 30 | INDUSTR | industrial |
| 14 | LO-FI | lo-fi | 31 | TRIBAL | tribal |
| 15 | HOUSE | house | 32 | HYPER | hyperpop |
| 16 | TECHNO | techno | 33 | AMBIENT | ambient |
| 17 | MINIMAL | minimal | 34 | JAZZ | jazz (brushes) |
The kit is saved with projects and song sections. MIDI notes in on the drum channel (10) play the nearest of the 16 sounds.
## Your own samples (USR1–USR3)
Three slots of about 7.4 s each hold your own sounds, played by a synth track: engine **SAMPLE**, **SET** = USR1 / USR2 / USR3. Load them from the web editor, tab **Samples**:
- **Files:** up to 16 WAV per slot (any rate, mono or stereo). The note each one plays at its own speed is in its name (`KEYS_C4.wav`, C4 = 60).
- **CHOP:** open or drop a recording (WAV, MP3, AIFF…) and cut it into up to 16 chops, one per key — live with **TAP** (or the space bar) while it plays (*snap to the hit* puts each tap on its attack), **Find hits**, **Grid** or **Equal parts**; then **Send to USR1/2/3**, or **Download WAVs**.
## Song mode
1. Build a loop, stop, and press **SAVE** on TRACKS: the SONG screen.
2. **KNOB 2** picks section A–D; **REC** stores the four tracks into it (a used section asks for REC again within 3 s).
3. **KNOB 1** picks a step of the chain, **KNOB 3** its length in bars, **KNOB 4** the chain length. **SAVE** stores the chain.
4. **OCT−** switches loop / song, **PLAY** plays the chain to the end; your working loop is back when it stops. **OCT+ twice** (within 3 s) loads a section to edit it.
## The web editor
Open it from the installer page, or with **`OPEN-EDITOR.bat`** (`http://localhost:8766/webapp/editor/`), in Chrome or Edge with the FM-1 on USB, and press **Connect**. It follows the device live (turn a knob on the FM-1, the editor moves).
- **Sound** — every parameter of the selected track, the engines and presets, files.
- **Sequencer** — the pattern settings and the steps. On the **drum track**: a grid of the 16 sounds × the steps, with the **kit**. Choose a **level** (GHOST, SOFT, NORM, HARD) and a **roll** (x1–x4), then click: a hit; click it again (same level and roll): cleared; Shift+click: one level louder.
- **Tracks** — the four channel strips (level, pan, mute; SOLO and REC shown as on the device).
- **Library**, **Samples** (with CHOP), **Projects**, **Settings** (GLOBAL, **MASTER**: DUST, DUCK, FILT, ROLL; DRUMS).
The protocol is documented in [web/EDITOR_PROTOCOL.md](web/EDITOR_PROTOCOL.md) (v5).
## Sound design pages
The full Felucca engine is underneath: nine synthesis engines (analog, 4-op FM, phase distortion, lo-fi chip, sampler, formant voice, three-oscillator, tonewheel organ, granular), envelopes (with a pitch punch for the 808s), LFO, arpeggiator, scales and chords, glide and voice modes, per-track drive and slicer, chorus / delay / reverb sends, 32 user presets, 4 projects.
## Specifications
| | |
| --- | --- |
| Tracks | 3 synth parts (8 voices shared) + drums (16 sounds, 6 voices) |
| Sounds | 54 hip-hop / drum & bass presets on 9 engines, 8 sampled sets (CC0) |
| Sequencer | 64 steps per track, own length and division each; chords with a level and ratchet per note; drums with a level and ratchet per sound; ties, slide; MPC swing 50–75 %; one sample-accurate clock for steps, arp, rolls, slicer and song (no drift) |
| Performance | layers (hold a button: keys and knobs change job): punch-in FX, erase, note repeat, step entry, key / chords, mute / solo / tap tempo |
| Drum kits | 34 (5 sampled, 29 synthesised) |
| Effects | 16 punch-in effects; master DUST, DUCK, DJ filter; per track drive, slicer, chorus / delay / reverb sends; master limiter |
| Recording | live, quantised as heard (latency-compensated), overdub; records at once while playing; free take sets loop length and tempo |
| Memory | undo / redo, 4 projects, 32 user presets, autosave of the working project, song of 4 sections × 16 steps × 1–64 bars |
| Audio | 44.1 kHz, fixed-point DSP |
| MIDI | USB class-compliant in / out; channels 1–3 the synths, 10 the drums |
| Update | over USB from the browser (package SHA-256 and CRC checked) |
## Rescue, going back, credits
- **USB rescue:** hold **OCT−** alone while switching on (*SLOOP USB RESCUE*), then install again.
- **Interrupted install:** the FM-1 stays in update mode; press Install again and it finishes. A damaged package is refused, and the FM-1 keeps waiting for a good one.
- **Back to the official firmware:** M-VAVE's updater, M-UPGRADE, and the FM-1 firmware from m-vave.com.
- **Credits:** SLOOP is based on Felucca by Leo Kuroshita (@kurogedelic), Hügelton Instruments — engines, sequencer, editor and installer. Font: Terminus (SIL OFL 1.1). Samples: Versilian Studios VSCO-2 CE and VCSL (CC0), Hügelton Sample Pack. PHASE: CrispyZebra (GPL). VOICE after klattsch (MIT). Interface ideas after teenage engineering's pocket operators and EP-133, Elektron's step entry and Akai's MPC (swing, note repeat, erase) — SLOOP is not affiliated with any of them.
- **Licence:** GPL-3.0, no warranty. M-VAVE and FM-1 are trademarks of their owners; SLOOP is not affiliated with them. Drum kit names describe styles; they do not refer to any product.
+94
View File
@@ -0,0 +1,94 @@
Terminus Font (ter-u16n.bdf)
Copyright (C) 2020 Dimitar Toshkov Zhekov
Source: https://github.com/retro-vault/font-vault (source/fonts/terminus)
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION AND CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
File diff suppressed because it is too large. Load diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+19
View File
@@ -0,0 +1,19 @@
SLOOP HIP-HOP PACK - free sounds for the user sample slots USR1..USR3
Made by tools/gen_hiphop_pack.py: retuned, cut and processed ("dusty" chain) from:
E.PIANO Wurlitzer EP200 samples by Greg Sullivan (http://www.sullivang.net/),
mapped by kinwie: https://github.com/sfzinstruments/GregSullivan.E-Pianos
Licence: Creative Commons Attribution 3.0 (CC BY 3.0). Credit: Greg Sullivan.
BASS VSCO-2 Community Edition (Versilian Studios), Solo Contrabass pizzicato. CC0 1.0.
HORNS VSCO-2 Community Edition, Trumpet and Tenor Trombone staccato. CC0 1.0.
STRINGS VSCO-2 Community Edition, Violin and Viola sections spiccato. CC0 1.0.
https://github.com/sgossner/VSCO-2-CE
VIBES VCSL (Versilian Community Sample Library), Vibraphone, hard mallets. CC0 1.0.
UPRIGHT VCSL, Upright Piano (Knight). CC0 1.0. https://github.com/sgossner/VCSL
SCRATCH Sonic Pi sample set, CC0 1.0 (freesound.org): vinyl_scratch (hello_flowers),
vinyl_backspin (il112), vinyl_rewind (TasmanianPower), perc_snap (SoundCollectah).
https://github.com/sonic-pi-net/sonic-pi/tree/main/etc/samples
CC0 sounds: no conditions. E.PIANO: keep the credit to Greg Sullivan when you share the
samples themselves; music you make with any of them is yours.
No sound here comes from a commercial record.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+220
View File
@@ -0,0 +1,220 @@
{
"format": "sloop-pack",
"version": 1,
"rate": 22050,
"default": [
"E.PIANO",
"BASS",
"HORNS"
],
"sounds": [
{
"name": "E.PIANO",
"title": "Electric piano (Wurlitzer 200)",
"desc": "Soul chords, the warm bark of a Wurlitzer through a dusty sampler.",
"license": "CC BY 3.0 - Greg Sullivan (Wurlitzer EP200 samples)",
"zones": [
{
"file": "EPIANO/00_A2.wav",
"root": 45
},
{
"file": "EPIANO/01_Ds3.wav",
"root": 51
},
{
"file": "EPIANO/02_Cs4.wav",
"root": 61
},
{
"file": "EPIANO/03_B4.wav",
"root": 71
}
]
},
{
"name": "BASS",
"title": "Upright bass (pizzicato)",
"desc": "A jazz upright bass. Plays two octaves under the keys: F3 on the keyboard is F1.",
"license": "CC0 - VSCO-2 Community Edition (Versilian Studios)",
"zones": [
{
"file": "BASS/00_E1.wav",
"root": 52
},
{
"file": "BASS/01_As1.wav",
"root": 58
},
{
"file": "BASS/02_D2.wav",
"root": 62
},
{
"file": "BASS/03_Fs2.wav",
"root": 66
},
{
"file": "BASS/04_A2.wav",
"root": 69
},
{
"file": "BASS/05_Cs3.wav",
"root": 73
}
]
},
{
"name": "HORNS",
"title": "Horn section stabs",
"desc": "Trumpet and trombone an octave apart: the stab of a funk record.",
"license": "CC0 - VSCO-2 Community Edition (Versilian Studios)",
"zones": [
{
"file": "HORNS/00_F3.wav",
"root": 53
},
{
"file": "HORNS/01_A3.wav",
"root": 57
},
{
"file": "HORNS/02_C4.wav",
"root": 60
},
{
"file": "HORNS/03_Ds4.wav",
"root": 63
},
{
"file": "HORNS/04_G4.wav",
"root": 67
},
{
"file": "HORNS/05_As4.wav",
"root": 70
},
{
"file": "HORNS/06_D5.wav",
"root": 74
}
]
},
{
"name": "STRINGS",
"title": "String stabs",
"desc": "Violins and violas, short and hard: the orchestra stab of '90s rap.",
"license": "CC0 - VSCO-2 Community Edition (Versilian Studios)",
"zones": [
{
"file": "STRINGS/00_G3.wav",
"root": 55
},
{
"file": "STRINGS/01_B3.wav",
"root": 59
},
{
"file": "STRINGS/02_D4.wav",
"root": 62
},
{
"file": "STRINGS/03_Fs4.wav",
"root": 66
},
{
"file": "STRINGS/04_A4.wav",
"root": 69
},
{
"file": "STRINGS/05_C5.wav",
"root": 72
},
{
"file": "STRINGS/06_E5.wav",
"root": 76
}
]
},
{
"name": "VIBES",
"title": "Vibraphone",
"desc": "Hard mallets, jazz-rap vibes.",
"license": "CC0 - VCSL (Versilian Studios)",
"zones": [
{
"file": "VIBES/00_F3.wav",
"root": 53
},
{
"file": "VIBES/01_C4.wav",
"root": 60
},
{
"file": "VIBES/02_G4.wav",
"root": 67
},
{
"file": "VIBES/03_D5.wav",
"root": 74
}
]
},
{
"name": "UPRIGHT",
"title": "Dusty upright piano",
"desc": "An old upright, filtered like a loop off a jazz record.",
"license": "CC0 - VCSL (Versilian Studios)",
"zones": [
{
"file": "UPRIGHT/00_F3.wav",
"root": 53
},
{
"file": "UPRIGHT/01_B3.wav",
"root": 59
},
{
"file": "UPRIGHT/02_F4.wav",
"root": 65
},
{
"file": "UPRIGHT/03_Cs5.wav",
"root": 73
}
]
},
{
"name": "SCRATCH",
"title": "DJ scratches",
"desc": "Scratch, backspin, rewind and a finger snap, each on its own keys.",
"license": "CC0 - Sonic Pi sample set (freesound.org CC0 recordings)",
"zones": [
{
"file": "SCRATCH/00_vinyl_scratch.wav",
"root": 57,
"lo": 0,
"hi": 60
},
{
"file": "SCRATCH/01_vinyl_backspin.wav",
"root": 64,
"lo": 61,
"hi": 67
},
{
"file": "SCRATCH/02_vinyl_rewind.wav",
"root": 70,
"lo": 68,
"hi": 73
},
{
"file": "SCRATCH/03_perc_snap.wav",
"root": 77,
"lo": 74,
"hi": 127
}
]
}
]
}
+92
View File
@@ -0,0 +1,92 @@
{
"cell": 12,
"cols": 16,
"names": [
"generic",
"attack",
"decay",
"sustain",
"release",
"env",
"cutoff",
"reso",
"rate",
"lfo_wave",
"wave",
"pulse",
"shape",
"pitch",
"tune",
"detune",
"transpose",
"octave",
"level",
"pan",
"mute",
"dist",
"drive",
"fold",
"bits",
"chorus",
"delay",
"reverb",
"feedback",
"arp",
"gate",
"swing",
"tempo",
"scale",
"quantize",
"glide",
"slide",
"voice",
"mod",
"noise",
"sub",
"ratio",
"algorithm",
"sample",
"steps",
"accent",
"time",
"phase",
"fade",
"mix",
"keytrack",
"size",
"damp",
"tone",
"sweep",
"vibrato",
"loop",
"hold",
"order",
"prob",
"length",
"division",
"chip",
"midi",
"save",
"load",
"clear",
"w_sin",
"w_tri",
"w_saw",
"w_sqr",
"w_pls",
"w_pwm",
"w_sh",
"w_dsin",
"w_spls",
"w_rsaw",
"w_rtri",
"w_rtrp",
"tape",
"drum",
"mouth",
"trio",
"drawbar",
"slice",
"grain"
]
}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

+10
View File
@@ -0,0 +1,10 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="240" height="240" role="img" aria-label="SLOOP">
<rect width="240" height="240" fill="#000"/>
<path d="M49.29 190.71 A100.00 100.00 0 1 1 190.71 190.71" fill="none" stroke="#F2F2F2" stroke-width="12" stroke-linecap="round"/>
<rect x="85.00" y="36.00" width="10" height="136.00" rx="5" fill="#F2F2F2"/>
<polygon points="101.00,40.00 101.00,40.00 121.34,65.00 101.00,65.00" fill="#287CFF"/>
<polygon points="101.00,71.00 126.22,71.00 146.56,96.00 101.00,96.00" fill="#1ECC70"/>
<polygon points="101.00,102.00 151.44,102.00 171.78,127.00 101.00,127.00" fill="#FFC618"/>
<polygon points="101.00,133.00 176.66,133.00 197.00,158.00 101.00,158.00" fill="#FF621A"/>
<rect x="56.00" y="182.00" width="128" height="12" rx="6" fill="#F2F2F2"/>
</svg>

After

Width:  |  Height:  |  Size: 809 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

+17
View File
@@ -0,0 +1,17 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 260" width="760" height="260" role="img" aria-label="SLOOP">
<rect width="760" height="260" fill="#000"/>
<path d="M59.29 200.71 A100.00 100.00 0 1 1 200.71 200.71" fill="none" stroke="#F2F2F2" stroke-width="12" stroke-linecap="round"/>
<rect x="95.00" y="46.00" width="10" height="136.00" rx="5" fill="#F2F2F2"/>
<polygon points="111.00,50.00 111.00,50.00 131.34,75.00 111.00,75.00" fill="#287CFF"/>
<polygon points="111.00,81.00 136.22,81.00 156.56,106.00 111.00,106.00" fill="#1ECC70"/>
<polygon points="111.00,112.00 161.44,112.00 181.78,137.00 111.00,137.00" fill="#FFC618"/>
<polygon points="111.00,143.00 186.66,143.00 207.00,168.00 111.00,168.00" fill="#FF621A"/>
<rect x="66.00" y="192.00" width="128" height="12" rx="6" fill="#F2F2F2"/>
<path d="M290.88 130.00 A14.88 15.00 0 1 1 304.37 108.66" fill="none" stroke="#F2F2F2" stroke-width="12" stroke-linecap="round"/>
<path d="M290.88 130.00 A14.88 15.00 0 1 1 277.39 151.34" fill="none" stroke="#F2F2F2" stroke-width="12" stroke-linecap="round"/>
<line x1="337.76" y1="68.00" x2="337.76" y2="160.00" stroke="#F2F2F2" stroke-width="12" stroke-linecap="round"/>
<circle cx="399.76" cy="130.00" r="30.00" fill="none" stroke="#F2F2F2" stroke-width="12"/>
<circle cx="489.76" cy="130.00" r="30.00" fill="none" stroke="#F2F2F2" stroke-width="12"/>
<circle cx="579.76" cy="130.00" r="30.00" fill="none" stroke="#F2F2F2" stroke-width="12"/>
<line x1="549.76" y1="130.00" x2="549.76" y2="196.00" stroke="#F2F2F2" stroke-width="12" stroke-linecap="round"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

+38
View File
@@ -0,0 +1,38 @@
SLOOP SAMPLE engine - built-in sets: source material
Licence: CC0 1.0 Universal (public domain dedication)
https://creativecommons.org/publicdomain/zero/1.0/
Sources:
VSCO-2 Community Edition https://github.com/sgossner/VSCO-2-CE (Versilian Studios, CC0-1.0)
VCSL https://github.com/sgossner/VCSL (Versilian Studios, CC0-1.0)
Sonic Pi sample set https://github.com/sonic-pi-net/sonic-pi/tree/main/etc/samples (CC0, freesound.org)
Each file is retuned, cut and coloured (tools/gen_builtin_hiphop.py) from:
DUSTY/00_C3_m48.wav <- sgossner/VCSL/master/Chordophones/Zithers/Upright Piano, Knight/Sustains/Player_vl2_rr1_F2.wav
DUSTY/01_A3_m57.wav <- sgossner/VCSL/master/Chordophones/Zithers/Upright Piano, Knight/Sustains/Player_vl2_rr1_A2.wav
DUSTY/02_Fs4_m66.wav <- sgossner/VCSL/master/Chordophones/Zithers/Upright Piano, Knight/Sustains/Player_vl2_rr1_F3.wav
DUSTY/03_Ds5_m75.wav <- sgossner/VCSL/master/Chordophones/Zithers/Upright Piano, Knight/Sustains/Player_vl2_rr1_D#4.wav
BASS/00_E1_m52.wav <- sgossner/VSCO-2-CE/master/Strings/Solo Contrabass/Pizz/BKCtbss_Pizz_E0_v3_rr1.wav
BASS/01_B1_m59.wav <- sgossner/VSCO-2-CE/master/Strings/Solo Contrabass/Pizz/BKCtbss_Pizz_A#0_v3_rr1.wav
BASS/02_Fs2_m66.wav <- sgossner/VSCO-2-CE/master/Strings/Solo Contrabass/Pizz/BKCtbss_Pizz_F#1_v1_rr1.wav
BASS/03_Cs3_m73.wav <- sgossner/VSCO-2-CE/master/Strings/Solo Contrabass/Pizz/BKCtbss_Pizz_C#2_v1_rr1.wav
VIBES/00_F3_m53.wav <- sgossner/VCSL/master/Idiophones/Struck Idiophones/Vibraphone/Hard Mallets/Vibes_hard_F2_v3_rr1_Main.wav
VIBES/01_D4_m62.wav <- sgossner/VCSL/master/Idiophones/Struck Idiophones/Vibraphone/Hard Mallets/Vibes_hard_C3_v3_rr1_Main.wav
VIBES/02_B4_m71.wav <- sgossner/VCSL/master/Idiophones/Struck Idiophones/Vibraphone/Hard Mallets/Vibes_hard_B3_v3_rr1_Main.wav
HORNS/00_G3_m55.wav <- sgossner/VSCO-2-CE/master/Brass/Trumpet/stac/Sum_SHTrumpet_stac_F2_v3_rr1.wav + sgossner/VSCO-2-CE/master/Brass/Tenor Trombone/stac/tenortbn_stac_F1_v3_rr1.wav
HORNS/01_D4_m62.wav <- sgossner/VSCO-2-CE/master/Brass/Trumpet/stac/Sum_SHTrumpet_stac_D#3_v3_rr1.wav + sgossner/VSCO-2-CE/master/Brass/Tenor Trombone/stac/tenortbn_stac_F2_v3_rr1.wav
HORNS/02_A4_m69.wav <- sgossner/VSCO-2-CE/master/Brass/Trumpet/stac/Sum_SHTrumpet_stac_A#3_v3_rr1.wav + sgossner/VSCO-2-CE/master/Brass/Tenor Trombone/stac/tenortbn_stac_A#2_v3_rr1.wav
HORNS/03_E5_m76.wav <- sgossner/VSCO-2-CE/master/Brass/Trumpet/stac/Sum_SHTrumpet_stac_F4_v3_rr1.wav + sgossner/VSCO-2-CE/master/Brass/Tenor Trombone/stac/tenortbn_stac_F3_v3_rr1.wav
STRGS/00_G3_m55.wav <- sgossner/VSCO-2-CE/master/Strings/Violin Section/Spic/VlnEns_Spic_G2_v2_rr1.wav + sgossner/VSCO-2-CE/master/Strings/Viola Section/spic/Violas_spic_C2_v2_rr1.wav
STRGS/01_E4_m64.wav <- sgossner/VSCO-2-CE/master/Strings/Violin Section/Spic/VlnEns_Spic_D3_v2_rr1.wav + sgossner/VSCO-2-CE/master/Strings/Viola Section/spic/Violas_spic_E2_v2_rr1.wav
STRGS/02_Cs5_m73.wav <- sgossner/VSCO-2-CE/master/Strings/Violin Section/Spic/VlnEns_Spic_C4_v2_rr1.wav + sgossner/VSCO-2-CE/master/Strings/Viola Section/spic/Violas_spic_D3_v2_rr1.wav
SCRCH/00_vinyl_scratch_m57.wav <- sonic-pi-net/sonic-pi/main/etc/samples/vinyl_scratch.flac
SCRCH/01_vinyl_backspin_m65.wav <- sonic-pi-net/sonic-pi/main/etc/samples/vinyl_backspin.flac
SCRCH/02_vinyl_rewind_m72.wav <- sonic-pi-net/sonic-pi/main/etc/samples/vinyl_rewind.flac
FLUTE/00_LDFlute_susvib_C4_v1_1.wav <- sgossner/VSCO-2-CE: Woodwinds/Flute/susvib/LDFlute_susvib_C4_v1_1.wav
FLUTE/01_LDFlute_susvib_C5_v1_1.wav <- sgossner/VSCO-2-CE: Woodwinds/Flute/susvib/LDFlute_susvib_C5_v1_1.wav
FLUTE/02_LDFlute_susvib_C6_v1_1.wav <- sgossner/VSCO-2-CE: Woodwinds/Flute/susvib/LDFlute_susvib_C6_v1_1.wav
KIT/00_Tamb1_Hit_v2_rr1_Mid.wav <- sgossner/VCSL: Idiophones/Struck Idiophones/Tambourine 1/Tamb1_Hit_v2_rr1_Mid.wav
KIT/01_Mid_ShakerDouble_Down_rr1.wav <- sgossner/VCSL: Idiophones/Struck Idiophones/Shaker, Small/Mid_ShakerDouble_Down_rr1.wav
KIT/02_Conga_HitN_v2_rr1_Sum.wav <- sgossner/VCSL: Membranophones/Struck Membranophones/Conga/Conga_HitN_v2_rr1_Sum.wav
KIT/03_Claves1_Hit_v2_rr1_Mid.wav <- sgossner/VCSL: Idiophones/Struck Idiophones/Claves/Claves1_Hit_v2_rr1_Mid.wav
KIT/04_wood_click_mp.wav <- sgossner/VCSL: Idiophones/Struck Idiophones/Woodblock/wood_click_mp.wav
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+15
View File
@@ -0,0 +1,15 @@
Samples in the SAMPLE engine's built-in sets. All CC0 1.0 (public domain).
DUSTY VCSL (Versilian Community Sample Library), Upright Piano (Knight)
VIBES VCSL, Vibraphone (hard mallets) https://github.com/sgossner/VCSL
BASS VSCO-2 Community Edition, Solo Contrabass pizzicato
HORNS VSCO-2 Community Edition, Trumpet + Tenor Trombone staccato
STRGS VSCO-2 Community Edition, Violin + Viola sections spiccato
FLUTE VSCO-2 Community Edition, Flute (susvib) https://github.com/sgossner/VSCO-2-CE
SCRCH Sonic Pi sample set (freesound.org CC0 recordings): vinyl_scratch (hello_flowers),
vinyl_backspin (il112), vinyl_rewind (TasmanianPower)
https://github.com/sonic-pi-net/sonic-pi/tree/main/etc/samples
KIT VCSL hand percussion (tambourine, shaker, conga, claves, woodblock) for the GM kit
Thanks to Versilian Studios / Sam Gossner and to the Sonic Pi project.
Retuned, cut and coloured by tools/gen_builtin_hiphop.py (gen_hiphop_pack.py's chain).
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+21
View File
@@ -0,0 +1,21 @@
# SLOOP: build the firmware, then open the browser installer.
# Needs a WSL distribution with the JieLi toolchain and the SDK files in build/deps/ac79 (BUILDING.md).
$ErrorActionPreference = 'Stop'
Set-Location $PSScriptRoot
$Distro = if ($env:SLOOP_WSL_DISTRO) { $env:SLOOP_WSL_DISTRO } else { 'Ubuntu' }
$Toolchain = if ($env:SLOOP_TOOLCHAIN) { $env:SLOOP_TOOLCHAIN } else { '/root/.jieli/toolchain' }
Write-Host ""
Write-Host " S L O O P 2.0" -ForegroundColor White
Write-Host " ---- ---- ---- ----" -ForegroundColor DarkGray
Write-Host "== Building the firmware (WSL $Distro)" -ForegroundColor Cyan
python tools/build_windows.py --distro $Distro --toolchain $Toolchain --sdk build/deps/ac79
if ($LASTEXITCODE -ne 0) { throw "The build failed" }
Write-Host "== Making the installer site" -ForegroundColor Cyan
python web/make_site.py build/felucca.fwsc 2.0 build/sloop-site
if ($LASTEXITCODE -ne 0) { throw "make_site failed" }
Write-Host ""
Write-Host "Installer: http://localhost:8766/webapp/installer/ (Chrome or Edge, FM-1 on USB)" -ForegroundColor Green
Write-Host "Editor: http://localhost:8766/webapp/editor/" -ForegroundColor Green
Write-Host "Keep this window open during the install. Ctrl+C stops the server."
Start-Process "http://localhost:8766/webapp/installer/"
python -m http.server 8766 --bind 127.0.0.1 --directory build/sloop-site
+20
View File
@@ -0,0 +1,20 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-3.0-only
# Copyright (C) 2026 Leo Kuroshita (@kurogedelic), Hügelton Instruments
# Build Felucca on macOS (see BUILDING.md).
# ./build.sh [--release X.Y]
# JIELI_TOOLCHAIN JieLi Linux toolchain (default: ~/.jieli/toolchain)
# AC79_SDK JieLi AC79 SDK checkout (default: ~/fw-AC79_AIoT_SDK)
set -e
cd "$(dirname "$0")"
export JIELI_TOOLCHAIN="${JIELI_TOOLCHAIN:-$HOME/.jieli/toolchain}"
export AC79_SDK="${AC79_SDK:-$HOME/fw-AC79_AIoT_SDK}"
PY="${PYTHON:-python3}"
"$PY" -c 'import PIL' 2>/dev/null || { echo "build.sh: $PY has no Pillow (pip3 install Pillow)"; exit 1; }
[ -x "$JIELI_TOOLCHAIN/pi32v2/bin/clang" ] || { echo "build.sh: no toolchain in $JIELI_TOOLCHAIN (run tools/get_toolchain.sh)"; exit 1; }
[ -f "$AC79_SDK/cpu/wl82/tools/uboot.boot" ] || { echo "build.sh: no JieLi AC79 SDK in $AC79_SDK"; exit 1; }
if [ "$(uname -s)" != Linux ] || [ "$(uname -m)" != x86_64 ]; then
docker info >/dev/null 2>&1 || { echo "build.sh: Docker is not running"; exit 1; }
fi
exec "$PY" tools/build.py "$@"
+32
View File
@@ -0,0 +1,32 @@
/* SPDX-License-Identifier: GPL-3.0-only
* Copyright (C) 2026 Leo Kuroshita (@kurogedelic), Hügelton Instruments */
/* Felucca memory map.
* Code + constants execute in place from XIP (app.bin offset 0 = 0x02000120).
* 0x01C00000..0x01C06000 holds .ram_text (code that must run while the flash
* is busy: the flash driver); 0x01C06000..0x01C08000 stays for RAM-run debug.
* RAM : .data/.bss (96 KiB)
* POOL : big zero-initialised buffers (FX lines, canvases), section .pool
* STACKS with 256-byte guard bands; NOINIT survives resets and UBOOT entry.
* 0x01C7FD50.. is reserved: boot_info, boot-state mailbox, vector table. */
MEMORY
{
XIP (rx) : ORIGIN = 0x02000120, LENGTH = 0x8DFBC
RAMTEXT (rwx): ORIGIN = 0x01C00000, LENGTH = 0x6000
RAM (rwx) : ORIGIN = 0x01C08000, LENGTH = 96K
POOL (rw) : ORIGIN = 0x01C20000, LENGTH = 0x54000
NOINIT (rw) : ORIGIN = 0x01C7C000, LENGTH = 0x3D50
}
SECTIONS
{
.text : { KEEP(*(.text.crt0)) *(.text*) *(.rodata*) . = ALIGN(4); _etext = .; } > XIP
.ram_text : { _rt_start = .; KEEP(*(.ram_text*)) . = ALIGN(4); _rt_end = .; } > RAMTEXT AT > XIP
_rt_load = LOADADDR(.ram_text);
.data : { . = ALIGN(4); _data_start = .; *(.data*) *(.sdata*) . = ALIGN(4); _data_end = .; } > RAM AT > XIP
_data_load = LOADADDR(.data);
.bss (NOLOAD) : { _bss_start = .; *(.bss*) *(.sbss*) *(COMMON) . = ALIGN(4); _bss_end = .; } > RAM
.pool (NOLOAD) : { _pool_start = .; *(.pool*) . = ALIGN(4); _pool_end = .; } > POOL
.noinit (NOLOAD) : { *(.noinit*) } > NOINIT
_guard0 = 0x01C74000; _ustack_lo = 0x01C74100; _ustack_top = 0x01C7A000;
_guard1 = 0x01C7A000; _sstack_lo = 0x01C7A100; _sstack_top = 0x01C7C000;
/DISCARD/ : { *(.comment) *(.note*) }
}
+26
View File
@@ -0,0 +1,26 @@
/* SPDX-License-Identifier: GPL-3.0-only
* Copyright (C) 2026 Leo Kuroshita (@kurogedelic), Hügelton Instruments */
/* App entry. The SPL maps app.bin at XIP 0x02000120 and jumps to its first
* byte with r0 = boot-parameter block (0x01C7FE08, inside the vector table).
* The SPL expects `goto +4; rts` as the first instruction. The core state
* the SPL left is saved first; then interrupts off and our stacks. */
.section .text.crt0,"ax",@progbits
.globl _start
_start:
goto 1f
rts
1: r1 = icfg
r2 = psr
cli
r3 = 0x1C07F00 /* STATUS (debug area) */
[r3 + 0x20] = r1 /* icfg as handed over */
[r3 + 0x24] = r2 /* psr */
[r3 + 0x28] = r0 /* boot-parameter pointer */
r1 = sp
[r3 + 0x2C] = r1
r1 = ssp
[r3 + 0x30] = r1
sp = _ustack_top
ssp = _sstack_top
call fm1_cstart
goto .
+45
View File
@@ -0,0 +1,45 @@
/* SPDX-License-Identifier: GPL-3.0-only
* Copyright (C) 2026 Leo Kuroshita (@kurogedelic), Hügelton Instruments */
/* FM-1 SARADC: PB6 = MASTER pot (ch4),
* PB1 = battery divider (ch3). Polled, 10 bit, from the main loop.
*
* fm1_adc_init() both pins analog inputs, no pulls
* fm1_adc_read(ch) 0..1023, -1 on timeout
*/
#pragma once
#include <stdint.h>
#include "fm1_gpio.h"
#define FM1_ADC_CON (*(volatile uint32_t *)0x13100u)
#define FM1_ADC_RES (*(volatile uint32_t *)0x13104u)
#define FM1_WLA_CON0 (*(volatile uint32_t *)0x11900u)
enum { FM1_ADC_BATT = 3, FM1_ADC_MASTER = 4 };
/* Both are only ever analog inputs: PB1 held low for 8 s would reset the
* chip (isd_config). */
static void fm1_adc_init(void)
{
uint32_t m = (1u << 6) | (1u << 1);
FM1_PR(FM1_PB, FM1_DIE) &= ~m;
FM1_PR(FM1_PB, FM1_PU) &= ~m;
FM1_PR(FM1_PB, FM1_PD) &= ~m;
FM1_PR(FM1_PB, FM1_DIR) |= m;
}
static int32_t fm1_adc_read(uint32_t ch)
{
uint32_t t, v;
FM1_ADC_CON = 0;
if (FM1_WLA_CON0 & (1u << 14))
FM1_WLA_CON0 &= ~(1u << 14);
FM1_ADC_CON = 0xF04Eu | ((ch & 0xFu) << 8);
FM1_ADC_CON |= 0x10u;
FM1_ADC_CON |= 0x40u;
for (t = 0; t < 20000u; t++)
if (FM1_ADC_CON & 0x80u)
break;
v = FM1_ADC_RES & 0x3FFu;
FM1_ADC_CON = 0x40u;
FM1_ADC_CON = 0;
return t == 20000u ? -1 : (int32_t)v;
}
+89
View File
@@ -0,0 +1,89 @@
/* SPDX-License-Identifier: GPL-3.0-only
* Copyright (C) 2026 Leo Kuroshita (@kurogedelic), Hügelton Instruments */
/* FM-1 audio out: ALNK0 I2S -> external codec, double-buffered DMA
* The application owns the buffer: two halves
* of half_words int32 (L, R, 24-bit left-justified), zeroed before init.
*
* fm1_audio_init(buf, half_words, isr, prio) codec and ALNK0 bring-up;
* isr = asm wrapper (fm1_isr.S) for FM1_IRQ_ALNK0
* in the ISR: p = fm1_audio_pending(); fm1_audio_ack_aux(p);
* if (p & FM1_AUDIO_HALF) { fill fm1_audio_free_half();
* fm1_audio_ack_half(); }
* fm1_audio_stop() DMA off (crash screen, UBOOT): no looping buzz
*/
#pragma once
#include <stdint.h>
#include "fm1_cc.h"
#include "fm1_time.h"
#include "fm1_irq.h"
#include "fm1_gpio.h"
#define FM1_ALNK 0x12E00u
#define FM1_ALNK_CON0 (*(volatile uint16_t *)(FM1_ALNK + 0x00u))
#define FM1_ALNK_CON1 (*(volatile uint16_t *)(FM1_ALNK + 0x04u))
#define FM1_ALNK_CON2 (*(volatile uint8_t *)(FM1_ALNK + 0x08u))
#define FM1_ALNK_CON3 (*(volatile uint8_t *)(FM1_ALNK + 0x0Cu))
#define FM1_ALNK_ADR3 (*(volatile uint32_t *)(FM1_ALNK + 0x1Cu))
#define FM1_ALNK_LEN (*(volatile uint16_t *)(FM1_ALNK + 0x20u))
#define FM1_CLK_CON2 (*(volatile uint32_t *)0x10014u)
#define FM1_IOMAP_CON5 (*(volatile uint32_t *)0x51030u)
#define FM1_AUDIO_HALF 0x80u /* CON2 pending: a half buffer is free */
static void fm1__pc_out(uint32_t bit, int v) /* codec control lines on PC0/1/2/6 */
{
uint32_t m = 1u << bit;
FM1_PR(FM1_PC, FM1_DIE) |= m;
if (v)
FM1_PR(FM1_PC, FM1_OUT) |= m;
else
FM1_PR(FM1_PC, FM1_OUT) &= ~m;
FM1_PR(FM1_PC, FM1_DIR) &= ~m;
}
FM1_INLINE void fm1_audio_init(int32_t *buf, uint32_t half_words, void (*isr)(void), uint32_t prio)
{
fm1__pc_out(6, 0);
fm1_delay_ms(5);
FM1_ALNK_CON0 = 0;
FM1_ALNK_CON1 = 0;
FM1_ALNK_CON2 = 0;
FM1_ALNK_CON3 = 0;
FM1_IOMAP_CON5 &= ~0xC0u;
FM1_ALNK_CON3 |= 3u;
fm1__pc_out(0, 1);
FM1_ALNK_CON0 |= 0x100u;
fm1__pc_out(2, 1);
fm1__pc_out(1, 1);
FM1_ALNK_CON0 |= 0x80u;
FM1_ALNK_CON0 &= ~0x40u;
FM1_ALNK_LEN = half_words;
FM1_ALNK_CON0 &= ~0x400u;
FM1_ALNK_CON0 &= ~0x200u;
FM1_CLK_CON2 &= 0xFFFFF0FFu;
FM1_ALNK_CON3 &= ~0x1Cu;
FM1_ALNK_CON3 = (uint8_t)((FM1_ALNK_CON3 & 0x1Fu) | 0x80u);
FM1_ALNK_CON1 |= 1u << 12;
FM1_ALNK_CON1 |= 1u << 14;
FM1_ALNK_ADR3 = (uint32_t)(uintptr_t)buf;
fm1__pc_out(6, 1);
FM1_ALNK_CON1 &= ~(1u << 15);
FM1_ALNK_CON2 = 0x0Fu;
fm1_irq_attach(FM1_IRQ_ALNK0, isr, prio);
FM1_ALNK_CON0 |= 0x800u;
fm1_delay_ms(5);
fm1__pc_out(6, 1);
}
FM1_INLINE uint8_t fm1_audio_pending(void) { return FM1_ALNK_CON2; }
FM1_INLINE void fm1_audio_ack_aux(uint8_t p) /* the other three pendings */
{
if (p & 0x10u)
FM1_ALNK_CON2 |= 1u;
if (p & 0x20u)
FM1_ALNK_CON2 |= 2u;
if (p & 0x40u)
FM1_ALNK_CON2 |= 4u;
}
FM1_INLINE uint32_t fm1_audio_free_half(void) { return ((FM1_ALNK_CON0 >> 15) & 1u) ^ 1u; } /* 0 / 1 */
FM1_INLINE void fm1_audio_ack_half(void) { FM1_ALNK_CON2 |= 0x08u; }
FM1_INLINE void fm1_audio_stop(void) { FM1_ALNK_CON0 &= ~0x800u; }
+10
View File
@@ -0,0 +1,10 @@
/* SPDX-License-Identifier: GPL-3.0-only
* Copyright (C) 2026 Leo Kuroshita (@kurogedelic), Hügelton Instruments */
/* FM1_INLINE: register helpers that must inline into their caller, so the
* SFR access sequence (and its timing, in ISRs and IRQ-off sections) is the
* one written at the call site; -Os would otherwise out-line a helper with
* several callers. RAM-resident code (.ram_text) may only use these, never
* a called helper (build.py checks .ram_text for calls). */
#pragma once
#define FM1_INLINE static inline __attribute__((always_inline))
+263
View File
@@ -0,0 +1,263 @@
/* SPDX-License-Identifier: GPL-3.0-only
* Copyright (C) 2026 Leo Kuroshita (@kurogedelic), Hügelton Instruments */
/* FM-1 SPI NOR at runtime: erase / program / read. Used only when
* FELUCCA_FLASH is 1.
*
* Everything that executes while the SFC (XIP) is switched off lives in
* .ram_text and touches only SFRs, the stack and RAM buffers: no .rodata, no
* libcalls, no XIP-resident helpers. Call the fl_*_ram() entry points with
* interrupts disabled. Same sequence as the AC79 SDK flash driver
* (enter_spi_code, norflash_erase, norflash_wait_ok, exit_spi_code).
*/
#pragma once
#include <stdint.h>
#include "fm1_xip.h"
#define RAMFN __attribute__((section(".ram_text"), noinline, used))
#define RAMINL static inline __attribute__((always_inline))
/* XIP (0x02xxxxxx) -> RAM (0x01C0xxxx) is beyond the 23-bit call range:
* call RAM code through a pointer the compiler cannot fold back. */
static inline void *fl_far(void *p) { void *volatile q = p; return q; }
#define FL_FAR(fn) ((__typeof__(&fn))fl_far((void *)&fn))
#define REG32(a) (*(volatile uint32_t *)(a))
#define SFC_CON REG32(0x40200u) /* bit31 busy; [11:8] read mode */
#define SFCENC_CON (*(volatile uint8_t *)0x40300u) /* b0 decrypt, b1 plain window */
#define SFCENC_UNENC_H REG32(0x40308u) /* WO, XIP (CPU) address */
#define SFCENC_UNENC_L REG32(0x4030Cu) /* WO, XIP (CPU) address */
#define SPI0_CON REG32(0x11C00u) /* b15 PND, b14 PCLR, b12 DIR=rx */
#define SPI0_BUF REG32(0x11C08u)
#define IOMAP_CON0 REG32(0x5101Cu) /* b5: 1 = SFC owns the flash pins */
#define PORTD_OUT REG32(0x500C0u) /* PD0 = flash CS# */
#define PORTD_DIR REG32(0x500C8u)
#define CACHE_CON REG32(0x1EEE008u) /* b14 = cache idle */
#define T4_CNT REG32(0x10804u) /* TIMER4, 24 MHz free-running */
#define FL_XIP(off) FM1_XIP(off) /* fm1_xip.h */
#define FL_DATA_LO 0x00097000u /* Felucca main store */
#define FL_DATA_HI 0x000E0000u
#define FL_GLOB_LO 0x000FC000u /* Felucca superblock / globals */
#define FL_GLOB_HI 0x000FF000u
#define FL_OTA_LO 0x000E0000u /* M-UPGRADE loader staging, ota.c */
#define FL_OTA_HI 0x000E5000u
/* [off, off + n) inside [lo, hi), without wrapping: off + n can overflow, and
* the 1 MiB part ignores the high address bits, so a wrapped range lands low. */
#define FL_IN(off, n, lo, hi) ((uint32_t)(off) >= (lo) && (uint32_t)(off) <= (hi) && \
(uint32_t)(n) <= (hi) - (uint32_t)(off))
/* Felucca's own store (projects, user samples; settings) */
#define FL_STORE_OK(off, n) (FL_IN(off, n, FL_DATA_LO, FL_DATA_HI) || FL_IN(off, n, FL_GLOB_LO, FL_GLOB_HI))
/* Where the RAM driver may erase / program. The app build allows only its own
* data regions; the update loader (firmware/loader) defines its own window. */
#ifndef FL_RANGE_OK
#define FL_RANGE_OK(off, n) (FL_STORE_OK(off, n) || FL_IN(off, n, FL_OTA_LO, FL_OTA_HI))
#endif
typedef struct { uint32_t sfc_con, spi_con; } fl_saved_t;
RAMINL void fl_csync(void) { __asm__ volatile("csync" ::: "memory"); }
RAMINL void fl_cache_idle(void) { while (!(CACHE_CON & 0x4000u)) ; }
RAMINL void fl_delay(uint32_t n) { volatile uint32_t i = n; while (i--) ; }
RAMINL void fl_cs(int high)
{
PORTD_DIR &= ~1u;
if (high) PORTD_OUT |= 1u; else PORTD_OUT &= ~1u;
fl_delay(10);
}
RAMINL int fl_spi_wait(void)
{
uint32_t n = 50000000u;
fl_csync();
while (!(SPI0_CON & 0x8000u))
if (--n == 0) break;
SPI0_CON |= 0x4000u;
return n ? 0 : -1;
}
RAMINL void fl_tx(uint8_t b)
{
SPI0_CON |= 8u; SPI0_CON &= ~0x1000u;
SPI0_BUF = b; fl_spi_wait();
SPI0_CON &= ~8u;
}
RAMINL uint8_t fl_rx(void)
{
uint8_t v;
SPI0_CON |= 8u; SPI0_CON |= 0x1000u;
SPI0_BUF = 0xFFu; fl_spi_wait();
v = (uint8_t)SPI0_BUF;
SPI0_CON &= ~8u;
return v;
}
RAMINL void fl_addr(uint32_t a) { fl_tx((uint8_t)(a >> 16)); fl_tx((uint8_t)(a >> 8)); fl_tx((uint8_t)a); }
RAMINL uint8_t fl_rdsr(uint8_t cmd) { uint8_t v; fl_cs(0); fl_tx(cmd); v = fl_rx(); fl_cs(1); return v; }
RAMINL void fl_wren(void) { fl_cs(0); fl_tx(0x06); fl_cs(1); }
RAMINL int fl_enter(fl_saved_t *s)
{
uint32_t mode;
fl_cache_idle();
s->sfc_con = SFC_CON;
s->spi_con = SPI0_CON;
mode = (s->sfc_con >> 8) & 0xFu;
if (mode == 6u || mode == 7u) /* continuous-read XIP: not handled here */
return -1;
fl_csync();
while ((int32_t)SFC_CON < 0) ; /* SFC idle */
SFC_CON = 0; /* XIP OFF from here on */
IOMAP_CON0 &= ~0x20u; /* pins -> SPI0 / GPIO */
SPI0_CON = 0;
SPI0_CON = 0x1029u; /* SDK default */
fl_csync();
return 0;
}
RAMINL void fl_exit(const fl_saved_t *s)
{
SPI0_CON = s->spi_con;
IOMAP_CON0 |= 0x20u;
fl_csync();
while ((int32_t)SFC_CON < 0) ;
SFC_CON = s->sfc_con; /* XIP back on */
fl_csync();
}
RAMINL void fl_inval(uint32_t off, uint32_t len)
{
uint32_t a = FL_XIP(off) & ~31u, e = FL_XIP(off) + len;
fl_cache_idle();
for (; a < e; a += 32u) {
fl_csync();
__asm__ volatile("flushinv [%0]" :: "r"(a) : "memory");
fl_csync();
fl_cache_idle();
}
}
RAMINL int fl_wait_ready(uint32_t max_us, uint32_t *took_us)
{
uint32_t t0 = T4_CNT, dt;
for (;;) {
dt = (T4_CNT - t0) / 24u;
if (!(fl_rdsr(0x05) & 1u)) { *took_us = dt; return 0; }
if (dt > max_us) { *took_us = dt; return -4; }
}
}
/* ---- entry points: IRQs OFF, args/buffers in RAM ---- */
static RAMFN uint32_t fl_jedec_ram(void) /* expect 0x856014 */
{
fl_saved_t s; uint32_t id;
if (fl_enter(&s)) return 0;
fl_cs(0); fl_tx(0x9F);
id = (uint32_t)fl_rx() << 16; id |= (uint32_t)fl_rx() << 8; id |= fl_rx();
fl_cs(1);
fl_exit(&s);
return id;
}
static RAMFN uint32_t fl_status_ram(void) /* SR1 | SR2 << 8 */
{
fl_saved_t s; uint32_t v;
if (fl_enter(&s)) return 0xFFFFFFFFu;
v = fl_rdsr(0x05) | ((uint32_t)fl_rdsr(0x35) << 8);
fl_exit(&s);
return v;
}
static RAMFN int fl_erase4k_ram(uint32_t off, uint32_t *took_us)
{
fl_saved_t s; int rc;
if (!FL_RANGE_OK(off, 0x1000u) || (off & 0xFFFu))
return -1;
if (fl_enter(&s)) return -2;
fl_wren();
if (!(fl_rdsr(0x05) & 2u)) rc = -3; /* WEL did not set */
else {
fl_cs(0); fl_tx(0x20); fl_addr(off); fl_cs(1);
fl_inval(off, 4096u);
rc = fl_wait_ready(500000u, took_us); /* generic NOR max 400 ms */
}
fl_exit(&s);
return rc;
}
static RAMFN int fl_prog_ram(uint32_t off, const uint8_t *src, uint32_t n, uint32_t *took_us)
{
fl_saved_t s; int rc; uint32_t i;
if (!FL_RANGE_OK(off, n) ||
n == 0 || n > 256u || ((off & 0xFFu) + n) > 256u) return -1; /* one page, no wrap */
if (fl_enter(&s)) return -2;
fl_wren();
if (!(fl_rdsr(0x05) & 2u)) rc = -3;
else {
fl_cs(0); fl_tx(0x02); fl_addr(off);
for (i = 0; i < n; i++) fl_tx(src[i]);
fl_cs(1);
fl_inval(off, n);
rc = fl_wait_ready(10000u, took_us); /* generic NOR max 3 ms */
}
fl_exit(&s);
return rc;
}
static RAMFN int fl_read_ram(uint32_t off, uint8_t *dst, uint32_t n) /* 0x0B fast read */
{
fl_saved_t s; uint32_t i;
if (fl_enter(&s)) return -2;
fl_cs(0); fl_tx(0x0B); fl_addr(off); fl_tx(0xFF);
for (i = 0; i < n; i++) dst[i] = fl_rx();
fl_cs(1);
fl_exit(&s);
return 0;
}
/* ---- XIP side (normal .text) ---- */
/* Once at boot, before any XIP read of the data region: map the data area
* as an unencrypted XIP window (as the SDK's IOCTL_SET_VM_INFO does). */
static void fl_plain_window_init(void)
{
SFCENC_CON &= (uint8_t)~2u;
SFCENC_UNENC_L = FL_XIP(0x93000u); /* 0x0208F000 */
SFCENC_UNENC_H = 0x07FFFFFFu;
SFCENC_CON |= 2u;
__asm__ volatile("cli" ::: "memory");
fl_inval(0x93000u, 0x100000u - 0x93000u); /* drop any decrypted lines */
__asm__ volatile("csync\n\tsti" ::: "memory");
}
static inline uint32_t irq_save(void) { __asm__ volatile("cli" ::: "memory"); return 0; }
static inline void irq_restore(uint32_t f) { (void)f; __asm__ volatile("csync\n\tsti" ::: "memory"); }
static int fl_erase4k(uint32_t off, uint32_t *took_us)
{
uint32_t f = irq_save();
int rc = FL_FAR(fl_erase4k_ram)(off, took_us);
irq_restore(f);
return rc;
}
static int fl_write(uint32_t off, const uint8_t *src_ram, uint32_t n)
{
uint32_t took;
while (n) {
uint32_t chunk = 256u - (off & 0xFFu);
int rc;
uint32_t f;
if (chunk > n) chunk = n;
f = irq_save();
rc = FL_FAR(fl_prog_ram)(off, src_ram, chunk, &took);
irq_restore(f);
if (rc) return rc;
off += chunk; src_ram += chunk; n -= chunk;
}
return 0;
}
/* Read back through XIP (needs fl_plain_window_init) and compare. */
static int fl_verify_xip(uint32_t off, const uint8_t *ref, uint32_t n)
{
const volatile uint8_t *p = (const volatile uint8_t *)FL_XIP(off);
uint32_t i;
for (i = 0; i < n; i++) if (p[i] != ref[i]) return -(int)(i + 1);
return 0;
}
+13
View File
@@ -0,0 +1,13 @@
/* SPDX-License-Identifier: GPL-3.0-only
* Copyright (C) 2026 Leo Kuroshita (@kurogedelic), Hügelton Instruments */
/* FM-1 GPIO port registers: one 0x40 block per
* port at 0x50000 + p * 0x40. HAL-internal: src/ uses the per-driver
* helpers (fm1_input.h, fm1_audio.h, fm1_adc.h, fm1_lcd_hw.h). */
#pragma once
#include <stdint.h>
#define FM1_PORT(p) (0x50000u + (p) * 0x40u)
#define FM1_PR(p, r) (*(volatile uint32_t *)(FM1_PORT(p) + (r)))
enum { FM1_PA = 0, FM1_PB = 1, FM1_PC = 2, FM1_PH = 7 };
enum { FM1_OUT = 0x00, FM1_IN = 0x04, FM1_DIR = 0x08, FM1_DIE = 0x0C, FM1_PU = 0x10,
FM1_PD = 0x14, FM1_HD0 = 0x18, FM1_HD = 0x1C };
+105
View File
@@ -0,0 +1,105 @@
/* SPDX-License-Identifier: GPL-3.0-only
* Copyright (C) 2026 Leo Kuroshita (@kurogedelic), Hügelton Instruments */
/* FM-1 hardware guards. Every violation raises the CPU exception (vector 1) and
* ends in the fault report of fm1_irq.h, so install that first.
*
* EMU stack limit sp outside [_ustack_lo, _sstack_top] -> EMU_MSG bit 3.
* One window for both stacks: which of EMU_SSP/EMU_USP
* the core applies to our supervisor-mode main loop is
* not known, so both get the same range.
* write limits CPU0 writes into the two 256-byte stack guard bands and
* into 0x01C7FD50..0x01C7FFFF (boot info, mailbox, vectors)
* -> DBG_MSG bit 13. The top window is armed separately
* with fm1_guard_lock_top() once every vector is
* attached; fm1_guard_unlock_top() reopens it.
* bus-invalid fetch/read/write of unmapped space (NULL page, XIP
* writes) -> DBG_MSG bits 4, 5, 16..21.
* PC limit instruction fetch outside [0x02000120, _etext]
* -> DBG_MSG bit 12.
*/
#pragma once
#include <stdint.h>
#include "fm1_irq.h"
#define FM1_X2(off) (*(volatile uint32_t *)(0x1EEE000u + (off)))
#define FM1_WR_LIMIT_H(n) FM1_X2(0x280u + 4u * (n))
#define FM1_WR_LIMIT_L(n) FM1_X2(0x2C0u + 4u * (n))
#define FM1_C0_WR_LIMIT_EN FM1_X2(0x348u)
#define FM1_PC_LIMIT0_H FM1_X2(0x380u)
#define FM1_PC_LIMIT0_L FM1_X2(0x384u)
#define FM1_PC_LIMIT1_H FM1_X2(0x388u)
#define FM1_PC_LIMIT1_L FM1_X2(0x38Cu)
#define FM1_EMU_SSP_H (*(volatile uint32_t *)0x1EEF0D8u)
#define FM1_EMU_SSP_L (*(volatile uint32_t *)0x1EEF0DCu)
#define FM1_EMU_USP_H (*(volatile uint32_t *)0x1EEF0E0u)
#define FM1_EMU_USP_L (*(volatile uint32_t *)0x1EEF0E4u)
extern char _guard0[], _ustack_lo[], _guard1[], _sstack_lo[], _sstack_top[], _etext[];
extern uint32_t _rt_start[], _rt_end[];
enum { FM1_GUARD_STACK = 1, FM1_GUARD_WRITE = 2, FM1_GUARD_BUS = 4, FM1_GUARD_PC = 8 };
static void fm1__dbg_unlock(void)
{
if (!(FM1_DBG_WR_EN & 1u))
FM1_DBG_WR_EN = 0xE7u;
}
static void fm1__dbg_lock(void)
{
if (FM1_DBG_WR_EN & 1u)
FM1_DBG_WR_EN = 0xE7u;
}
static void fm1_guard_enable(uint32_t which)
{
fm1__dbg_unlock();
FM1_DBG_MSG_CLR = 0xFFFFFFFFu;
if (which & FM1_GUARD_STACK) {
FM1_EMU_CON &= ~(1u << 3);
FM1_EMU_SSP_L = (uint32_t)(uintptr_t)_ustack_lo;
FM1_EMU_SSP_H = (uint32_t)(uintptr_t)_sstack_top;
FM1_EMU_USP_L = (uint32_t)(uintptr_t)_ustack_lo;
FM1_EMU_USP_H = (uint32_t)(uintptr_t)_sstack_top;
FM1_EMU_CON |= 1u << 3;
}
if (which & FM1_GUARD_WRITE) {
FM1_WR_LIMIT_L(0) = (uint32_t)(uintptr_t)_guard0;
FM1_WR_LIMIT_H(0) = (uint32_t)(uintptr_t)_ustack_lo - 1u;
FM1_WR_LIMIT_L(1) = (uint32_t)(uintptr_t)_guard1;
FM1_WR_LIMIT_H(1) = (uint32_t)(uintptr_t)_sstack_lo - 1u;
FM1_C0_WR_LIMIT_EN |= 3u;
}
if (which & FM1_GUARD_BUS)
FM1_DBG_EN |= (0x3Fu << 16) | (0x3u << 4);
if (which & FM1_GUARD_PC) {
FM1_PC_LIMIT0_L = 0x02000120u;
FM1_PC_LIMIT0_H = (uint32_t)(uintptr_t)_etext;
{ /* RAM code (.ram_text); with none, repeat the XIP window */
volatile uint32_t rs = (uint32_t)(uintptr_t)_rt_start, re = (uint32_t)(uintptr_t)_rt_end;
FM1_PC_LIMIT1_L = re > rs ? rs : 0x02000120u;
FM1_PC_LIMIT1_H = re > rs ? re - 1u : (uint32_t)(uintptr_t)_etext;
}
}
fm1__dbg_lock();
}
/* write-protect 0x01C7FD50..0x01C7FFFF (boot info, mailbox, vectors):
* call after the last fm1_irq_attach */
static void fm1_guard_lock_top(void)
{
fm1__dbg_unlock();
FM1_DBG_MSG_CLR = 0xFFFFFFFFu;
FM1_WR_LIMIT_L(2) = 0x01C7FD50u;
FM1_WR_LIMIT_H(2) = 0x01C7FFFFu;
FM1_C0_WR_LIMIT_EN |= 4u;
fm1__dbg_lock();
}
/* reopen the reserved top of RAM (mailbox write before a UBOOT reset) */
static void fm1_guard_unlock_top(void)
{
fm1__dbg_unlock();
FM1_C0_WR_LIMIT_EN &= ~4u;
fm1__dbg_lock();
}
+323
View File
@@ -0,0 +1,323 @@
/* SPDX-License-Identifier: GPL-3.0-only
* Copyright (C) 2026 Leo Kuroshita (@kurogedelic), Hügelton Instruments */
/* FM-1 input HAL: key/button/encoder matrix and LEDs.
*
* One 11-column x 6-row diode matrix behind a 2x74HC595 chain (PA4 SER, PA3
* SRCLK, PA1 RCLK), bit-banged and polled; rows PA0, PA5..PA8, PB7 with
* pull-ups (low = closed). LED lines PH6/PH9/PA9/PA10 light the LED on the
* same column, row PA7/PA8/PA5/PA6 respectively.
*
* fm1_input_init();
* polled: for (;;) { fm1_input_scan(); ... }
* IRQ: call fm1_input_tick() from a ~10 kHz timer ISR; it advances one
* column per call (rows are sampled one tick after the column was
* latched, LEDs stay lit in between) and processes a frame every
* FM1_NCOL ticks. The main loop reads fm1_in.notes / buttons and
* takes edges/steps with fm1_input_edges() / fm1_enc_take().
*
* fm1_input_scan() runs one full frame (11 columns, ~0.6 ms) and calls
* FM1_INPUT_IDLE() while it waits.
* Keys/buttons: integrating debounce, asymmetric: a press counts after FM1_PRESS closed
* frames (~3 ms: notes are played in time), a release once the count is back to 0 (up to
* FM1_DEBOUNCE frames), so contact bounce never retriggers.
* Encoders: quadrature decoder (2-sample filter, + = clockwise) with detent
* counting: states an encoder rests in for >= FM1_REST_FRAMES are learned, and
* a step is emitted only on reaching a rest state after >= 2 net transitions.
* One click = one step at any speed, whether a detent is a half or a full
* quadrature cycle. fm1_enc_take() returns the steps.
* LEDs: set fm1_led[col] (packed row bits, bit1 PA5..bit4 PA8); they are lit
* while that column is selected. fm1_led_key/btn helpers address them by id.
*/
#pragma once
#include <stdint.h>
#include "fm1_time.h"
#include "fm1_gpio.h"
#ifndef FM1_INPUT_IDLE
#define FM1_INPUT_IDLE() ((void)0)
#endif
#ifndef FM1_LED_US
#define FM1_LED_US 40u /* LED on-time per column (brightness vs scan rate) */
#endif
#define FM1_DEBOUNCE 8u /* frames (~1.1 ms each in the IRQ scan): a release */
#define FM1_PRESS 3u /* a press: fast (keys are played in time), still 3 frames sure */
#define FM1_SETTLE_US 10u
#define FM1_REST_FRAMES 40u /* ~25 ms still = a detent position */
#define FM1_NCOL 11u
#define FM1_NKEY 41u /* ids: 0..13 buttons, 14..40 note keys */
#define FM1_NENC 7u
/* key id at (physical column, packed row bit), -1 = none */
static const int8_t FM1_KEYMAP[6][FM1_NCOL] = {
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* PA0: encoders */
{ 5, 11, 4, 10, 3, 9, 2, 8, -1, -1, -1}, /* PA5 */
{34, 35, 36, 37, 38, 40, 39, 13, 7, 6, 12}, /* PA6 */
{23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33}, /* PA7 */
{ 0, 1, 15, 14, 17, 16, 19, 18, 20, 21, 22}, /* PA8 */
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* PB7: encoder 6 */
};
/* encoder i: A at (col, row bit), B at (col, row bit) */
static const uint8_t FM1_ENC[FM1_NENC][4] = {
{0, 0, 1, 0}, {2, 0, 3, 0}, {8, 1, 9, 1}, {8, 0, 9, 0}, {6, 0, 7, 0}, {4, 0, 5, 0}, {0, 5, 1, 5},
};
enum { FM1_BTN_OCT_DOWN = 0, FM1_BTN_OCT_UP = 1 };
static const int8_t FM1_LED_PORT[6] = {-1, FM1_PA, FM1_PA, FM1_PH, FM1_PH, -1};
static const uint8_t FM1_LED_BIT[6] = {0, 9, 10, 6, 9, 0};
static volatile struct {
uint32_t notes; /* debounced: bit n = note key n (0 = F3 .. 26 = G5) */
uint32_t buttons; /* debounced: bit i = button i (0..13) */
uint32_t pressed, released; /* button edges since the last fm1_input_edges() */
uint32_t notes_pressed; /* note-key press edges since the last fm1_input_note_edges() */
uint8_t raw[FM1_NCOL]; /* last frame, packed rows, 1 = closed */
uint8_t cnt[FM1_NKEY];
uint8_t enc_prev[FM1_NENC], enc_last[FM1_NENC];
uint8_t enc_rest[FM1_NENC]; /* learned rest (detent) states, bit per state */
uint8_t enc_still[FM1_NENC]; /* frames since the last state change */
int8_t enc_sub[FM1_NENC]; /* net transitions since the last rest state */
int16_t enc_steps[FM1_NENC]; /* + = clockwise */
uint32_t frames;
} fm1_in;
static uint8_t fm1_led[FM1_NCOL];
static void fm1__led_lines(uint32_t rowmask)
{
uint32_t r;
for (r = 1; r < 5u; r++) {
if (rowmask & (1u << r))
FM1_PR(FM1_LED_PORT[r], FM1_OUT) |= 1u << FM1_LED_BIT[r];
else
FM1_PR(FM1_LED_PORT[r], FM1_OUT) &= ~(1u << FM1_LED_BIT[r]);
}
}
static void fm1__sr_word(uint32_t w)
{
uint32_t i;
for (i = 0; i < 16u; i++) {
if (w & (0x8000u >> i))
FM1_PR(FM1_PA, FM1_OUT) |= 1u << 4;
else
FM1_PR(FM1_PA, FM1_OUT) &= ~(1u << 4);
FM1_PR(FM1_PA, FM1_OUT) |= 1u << 3; /* each SFR write is far slower than the 595 needs */
FM1_PR(FM1_PA, FM1_OUT) &= ~(1u << 3);
}
FM1_PR(FM1_PA, FM1_OUT) |= 1u << 1;
FM1_PR(FM1_PA, FM1_OUT) &= ~(1u << 1);
}
static uint32_t fm1__rows(void)
{
uint32_t a = FM1_PR(FM1_PA, FM1_IN), b = FM1_PR(FM1_PB, FM1_IN);
return (~((a & 1u) | ((a >> 4) & 0x1Eu) | ((b >> 2) & 0x20u))) & 0x3Fu;
}
static void fm1__wait(uint32_t us)
{
uint32_t t0 = fm1_ticks(), span = us * FM1_TICKS_PER_US;
while ((uint32_t)(fm1_ticks() - t0) < span)
FM1_INPUT_IDLE();
}
static void fm1_input_init(void)
{
static const uint8_t LEDP[4][2] = {{FM1_PH, 6}, {FM1_PH, 9}, {FM1_PA, 9}, {FM1_PA, 10}};
const uint32_t rows_a = (1u << 0) | (1u << 5) | (1u << 6) | (1u << 7) | (1u << 8);
const uint32_t sr = (1u << 1) | (1u << 3) | (1u << 4), row_b = 1u << 7;
uint32_t i;
for (i = 0; i < 4u; i++) {
uint32_t p = LEDP[i][0], m = 1u << LEDP[i][1];
FM1_PR(p, FM1_DIE) |= m;
FM1_PR(p, FM1_OUT) &= ~m;
FM1_PR(p, FM1_DIR) &= ~m;
FM1_PR(p, FM1_HD0) |= m;
FM1_PR(p, FM1_HD) |= m;
}
FM1_PR(FM1_PA, FM1_DIE) |= rows_a;
FM1_PR(FM1_PA, FM1_DIR) |= rows_a;
FM1_PR(FM1_PA, FM1_PD) &= ~rows_a;
FM1_PR(FM1_PA, FM1_PU) |= rows_a;
FM1_PR(FM1_PB, FM1_DIE) |= row_b;
FM1_PR(FM1_PB, FM1_DIR) |= row_b;
FM1_PR(FM1_PB, FM1_PD) &= ~row_b;
FM1_PR(FM1_PB, FM1_PU) |= row_b;
FM1_PR(FM1_PA, FM1_DIE) |= sr;
FM1_PR(FM1_PA, FM1_PU) &= ~sr;
FM1_PR(FM1_PA, FM1_PD) &= ~sr;
FM1_PR(FM1_PA, FM1_OUT) &= ~sr;
FM1_PR(FM1_PA, FM1_DIR) &= ~sr;
fm1__sr_word(0xFFFFu);
for (i = 0; i < FM1_NENC; i++)
fm1_in.enc_prev[i] = fm1_in.enc_last[i] = 0xFF; /* seeded by the first frame */
}
static void fm1__key(uint32_t id, uint32_t closed)
{
volatile uint8_t *c = &fm1_in.cnt[id];
uint32_t on;
if (closed) {
if (*c < FM1_DEBOUNCE)
(*c)++;
} else if (*c) {
(*c)--;
}
if (closed && *c >= FM1_PRESS)
on = 1;
else if (*c == 0)
on = 0;
else
return;
if (id >= 14u) {
if (on) {
if (!(fm1_in.notes & (1u << (id - 14u))))
fm1_in.notes_pressed |= 1u << (id - 14u);
fm1_in.notes |= 1u << (id - 14u);
}
else
fm1_in.notes &= ~(1u << (id - 14u));
} else if (on != ((fm1_in.buttons >> id) & 1u)) {
fm1_in.buttons ^= 1u << id;
if (on)
fm1_in.pressed |= 1u << id;
else
fm1_in.released |= 1u << id;
}
}
static void fm1__frame(void);
static void fm1_input_scan(void)
{
uint32_t p;
for (p = 0; p < FM1_NCOL; p++) {
fm1__led_lines(0);
fm1__sr_word(0xFFFFu ^ (1u << p) ^ (p < 2u ? 1u << (11u + p) : 0u));
fm1__wait(FM1_SETTLE_US);
fm1_in.raw[p] = (uint8_t)fm1__rows();
fm1__led_lines(fm1_led[p]);
fm1__wait(FM1_LED_US);
}
fm1__led_lines(0);
fm1__frame();
}
static void fm1__frame(void)
{
uint32_t p, r, e;
for (p = 0; p < FM1_NCOL; p++)
for (r = 1; r < 5u; r++)
if (FM1_KEYMAP[r][p] >= 0)
fm1__key((uint32_t)FM1_KEYMAP[r][p], (fm1_in.raw[p] >> r) & 1u);
for (e = 0; e < FM1_NENC; e++) { /* quadrature decoder + detents */
const uint8_t *m = FM1_ENC[e];
uint32_t cur = ((fm1_in.raw[m[0]] >> m[1]) & 1u) << 1 | ((fm1_in.raw[m[2]] >> m[3]) & 1u);
uint32_t idx;
volatile int8_t *sub = &fm1_in.enc_sub[e];
if (cur != fm1_in.enc_last[e]) {
fm1_in.enc_last[e] = (uint8_t)cur;
fm1_in.enc_still[e] = 0;
continue;
}
if (fm1_in.enc_prev[e] == 0xFF) { /* first frame: the knob rests here */
fm1_in.enc_prev[e] = (uint8_t)cur;
fm1_in.enc_rest[e] = (uint8_t)(1u << cur);
}
if (fm1_in.enc_still[e] < 255u && ++fm1_in.enc_still[e] == FM1_REST_FRAMES) {
/* learn detent states: one state, or a complementary pair (00/11 or
* 01/10). Anything else restarts the set; with 3-4 rest states every
* arrival would look like a detent with |sub| < 2. */
uint32_t r = fm1_in.enc_rest[e], bit = 1u << cur, comp = 1u << (cur ^ 3u);
if (!(r & bit))
fm1_in.enc_rest[e] = (uint8_t)(r == comp ? (r | bit) : bit);
}
if (cur == fm1_in.enc_prev[e])
continue;
idx = (uint32_t)fm1_in.enc_prev[e] << 2 | cur;
if ((0x4182u >> idx) & 1u)
(*sub)++;
else if ((0x2814u >> idx) & 1u)
(*sub)--;
fm1_in.enc_prev[e] = (uint8_t)cur;
if ((fm1_in.enc_rest[e] >> cur) & 1u) { /* back on a detent */
if (*sub >= 2)
fm1_in.enc_steps[e]++;
else if (*sub <= -2)
fm1_in.enc_steps[e]--;
*sub = 0;
}
}
fm1_in.frames++;
}
/* one column per call, from a timer ISR (see top) */
static uint8_t fm1__tick_col;
static void fm1_input_tick(void)
{
uint32_t p = fm1__tick_col, n = p + 1u == FM1_NCOL ? 0u : p + 1u;
fm1__led_lines(0);
fm1_in.raw[p] = (uint8_t)fm1__rows(); /* column p has been latched one tick */
fm1__sr_word(0xFFFFu ^ (1u << n) ^ (n < 2u ? 1u << (11u + n) : 0u));
fm1__led_lines(fm1_led[n]);
fm1__tick_col = (uint8_t)n;
if (n == 0u)
fm1__frame();
}
/* main-loop critical section against fm1_input_tick (main loop only: it
* re-enables interrupts unconditionally) */
static inline uint32_t fm1__lock(void)
{
__asm__ volatile("cli" ::: "memory");
return 0;
}
static inline void fm1__unlock(uint32_t v)
{
(void)v;
__asm__ volatile("csync\n\tsti" ::: "memory");
}
/* detent steps turned since the last call, + = clockwise */
static int32_t fm1_enc_take(uint32_t e)
{
uint32_t k = fm1__lock();
int32_t s = fm1_in.enc_steps[e];
fm1_in.enc_steps[e] = 0;
fm1__unlock(k);
return s;
}
static uint32_t fm1_input_edges(uint32_t *released)
{
uint32_t k = fm1__lock();
uint32_t p = fm1_in.pressed;
if (released)
*released = fm1_in.released;
fm1_in.pressed = fm1_in.released = 0;
fm1__unlock(k);
return p;
}
static uint32_t fm1_input_note_edges(void)
{
uint32_t k = fm1__lock();
uint32_t p = fm1_in.notes_pressed;
fm1_in.notes_pressed = 0;
fm1__unlock(k);
return p;
}
/* LED of key id (button 0..13 or note key 14..40) */
static void fm1_led_key(uint32_t id, int on)
{
uint32_t p, r;
for (p = 0; p < FM1_NCOL; p++)
for (r = 1; r < 5u; r++)
if (FM1_KEYMAP[r][p] == (int8_t)id) {
if (on)
fm1_led[p] |= (uint8_t)(1u << r);
else
fm1_led[p] &= (uint8_t)~(1u << r);
}
}
+113
View File
@@ -0,0 +1,113 @@
/* SPDX-License-Identifier: GPL-3.0-only
* Copyright (C) 2026 Leo Kuroshita (@kurogedelic), Hügelton Instruments */
/* FM-1 interrupt / exception HAL.
*
* fm1_irq_init() first thing in cstart: all ICFG off, pendings and
* exception causes cleared, all 128 vectors -> fatal
* stubs (fm1_vec.S), vector 1 (CPU
* exception) enabled at prio 7, div0 trap + ETM on.
* fm1_irq_attach(n, h, prio) h = asm wrapper (fm1_isr.S), prio 0..7
* fm1_irq_enable_all() icfg bit 8 + sti, after every source is set up
*
* The application supplies fm1_fault(const fm1_crash_t *) which reports the
* crash (LCD) and resets; the record survives in .noinit for the next boot.
*/
#pragma once
#include <stdint.h>
#define FM1_VEC ((volatile uint32_t *)0x01C7FE00u)
#define FM1_ICFG(n) (*(volatile uint32_t *)(0x1EEF100u + 4u * ((n) >> 3)))
#define FM1_IPND(i) (*(volatile uint32_t *)(0x1EEF180u + 4u * (i)))
#define FM1_ILAT_SET (*(volatile uint32_t *)0x1EEF1A0u)
#define FM1_ILAT_CLR (*(volatile uint32_t *)0x1EEF1A4u)
#define FM1_EMU_CON (*(volatile uint32_t *)0x1EEF0D0u)
#define FM1_EMU_MSG (*(volatile uint32_t *)0x1EEF0D4u)
#define FM1_ETM_CON (*(volatile uint32_t *)0x1EEF1C0u)
#define FM1_ETM_PC(i) (*(volatile uint32_t *)(0x1EEF1C4u + 4u * (i)))
#define FM1_DBG_WR_EN (*(volatile uint32_t *)0x1EEE240u)
#define FM1_DBG_MSG (*(volatile uint32_t *)0x1EEE244u)
#define FM1_DBG_MSG_CLR (*(volatile uint32_t *)0x1EEE248u)
#define FM1_DBG_EN (*(volatile uint32_t *)0x1EEE340u)
enum { FM1_IRQ_EXCEPTION = 1, FM1_IRQ_ALNK0 = 11, FM1_IRQ_SPI1 = 16, FM1_IRQ_UART1 = 20,
FM1_IRQ_SARADC = 24, FM1_IRQ_SPI2 = 37, FM1_IRQ_TIMER5 = 63, FM1_IRQ_SOFT0 = 120 };
static inline uint32_t fm1_icfg(void) { uint32_t v; __asm__ volatile("%0 = icfg" : "=r"(v)); return v; }
static inline void fm1_icfg_set(uint32_t v) { __asm__ volatile("icfg = %0" ::"r"(v) : "memory"); }
static inline void fm1_irq_off(void) { __asm__ volatile("cli" ::: "memory"); }
static inline void fm1_irq_on(void) { __asm__ volatile("csync\n\tsti" ::: "memory"); }
#define FM1_CRASH_MAGIC 0x43525348u /* "CRSH" */
typedef struct {
uint32_t magic, count, vec, pc, rets, emu, dbg, sp, psr, icfg, uptime_ms;
uint32_t etm[4];
uint32_t early; /* consecutive crashes < 3 s after boot */
} fm1_crash_t;
/* Not static: .noinit holds whatever the last run (or power-on) left, and a
* file-local object would let the compiler assume its zero initial value and
* fold the magic check away. */
fm1_crash_t fm1_crash __attribute__((section(".noinit")));
extern const char fm1_fatal_stubs[];
static void fm1_fault(const fm1_crash_t *c); /* application: report, then reset */
static void fm1_irq_init(void)
{
uint32_t i;
for (i = 0; i < 32u; i++)
*(volatile uint32_t *)(0x1EEF100u + 4u * i) = 0; /* every source off (CPU0 bank) */
FM1_ILAT_CLR = 0xFFu;
FM1_EMU_MSG = 0xFFFFFFFFu;
if (!(FM1_DBG_WR_EN & 1u))
FM1_DBG_WR_EN = 0xE7u; /* unlock */
FM1_DBG_MSG_CLR = 0xFFFFFFFFu;
for (i = 0; i < 128u; i++)
FM1_VEC[i] = (uint32_t)(uintptr_t)(fm1_fatal_stubs + 6u * i);
FM1_ICFG(1) = (FM1_ICFG(1) & ~0xF0u) | 0xF0u; /* exception: enable, prio 7 */
FM1_EMU_CON |= 1u << 2; /* div0 traps */
FM1_ETM_CON |= 1u; /* branch trace for the report */
}
static void fm1_irq_attach(uint32_t n, void (*h)(void), uint32_t prio) /* IRQs off */
{
uint32_t sh = (n & 7u) * 4u;
FM1_VEC[n] = (uint32_t)(uintptr_t)h;
FM1_ICFG(n) = (FM1_ICFG(n) & ~(0xFu << sh)) | ((((prio & 7u) << 1) | 1u) << sh);
}
static void fm1_irq_mask(uint32_t n) { FM1_ICFG(n) &= ~(1u << ((n & 7u) * 4u)); }
static void fm1_irq_enable_all(void)
{
fm1_icfg_set(fm1_icfg() | 0x100u);
fm1_irq_on();
}
/* called from fm1_fatal_common (fm1_vec.S) with the saved frame:
* f[0..15] r0..r15, f[16] reti, f[17] rete, f[18] retx, f[19] stub+6,
* f[20] psr, f[21] icfg, f[22] usp, f[23] ssp, f[24] sp, f[25] interrupted rets */
void fm1_fault_c(uint32_t *f)
{
static volatile uint32_t in_fault;
uint32_t i, count = fm1_crash.magic == FM1_CRASH_MAGIC ? fm1_crash.count : 0;
uint32_t early = fm1_crash.magic == FM1_CRASH_MAGIC ? fm1_crash.early : 0;
fm1_irq_off();
if (in_fault++) /* fault while reporting: reset at once */
*(volatile uint32_t *)0x10000u |= 1u << 4;
fm1_crash.magic = FM1_CRASH_MAGIC;
fm1_crash.count = count + 1u;
fm1_crash.vec = (f[19] - (uint32_t)(uintptr_t)fm1_fatal_stubs) / 6u - 1u;
fm1_crash.pc = f[16];
fm1_crash.rets = f[25];
fm1_crash.emu = FM1_EMU_MSG;
fm1_crash.dbg = FM1_DBG_MSG;
fm1_crash.sp = f[24];
fm1_crash.psr = f[20];
fm1_crash.icfg = f[21];
fm1_crash.uptime_ms = *(volatile uint32_t *)0x10804u / 24000u; /* TIMER4 since boot */
for (i = 0; i < 4u; i++)
fm1_crash.etm[i] = FM1_ETM_PC(i);
fm1_crash.early = fm1_crash.uptime_ms < 3000u ? early + 1u : 0u;
fm1_fault(&fm1_crash);
for (;;)
;
}
Loaded 100 of 221 files, more files were not shown because too many files have changed in this diff. Show more