Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
c1f6d48
Fix: Remove unused variable, fix formatting in server.py
Chocapikk Apr 18, 2026
f84a5e8
Fix: Replace wildcard import, bare excepts, remove unused var in star…
Chocapikk Apr 18, 2026
fb28881
Fix: Replace wildcard import, bare excepts, remove unused var in star…
Chocapikk Apr 18, 2026
20f51d1
Feat: Add ruff config to ignore FoxDot/Renardo runtime globals
Chocapikk Apr 18, 2026
a3ff502
Refactor: Merge FoxDot and Renardo startup into single file
Chocapikk Apr 18, 2026
7d1323e
Refactor: Remove startup-renardo.py, now handled by startup.py
Chocapikk Apr 18, 2026
731b2fd
Docs: Update README for unified startup file
Chocapikk Apr 18, 2026
0907f63
Refactor: Clean up server.py structure and extract constants
Chocapikk Apr 18, 2026
08d1d85
Fix: Flatten nested if, store asyncio task reference
Chocapikk Apr 18, 2026
5f85683
Fix: Remove stale startup-renardo.py reference from ruff config
Chocapikk Apr 18, 2026
e8c583d
Refactor: Clean up startup.py, deduplicate periodic senders, snake_case
Chocapikk Apr 18, 2026
38736eb
Feat: Add resolve_python() to auto-detect python executable
Chocapikk Apr 18, 2026
3435a12
Docs: Update config sample with auto-detected python
Chocapikk Apr 18, 2026
88f4d09
Docs: Mark python vs python3 as resolved in TODO
Chocapikk Apr 18, 2026
77d7d0b
Feat: Add error detection and color in log output, capture stderr
Chocapikk Apr 18, 2026
8b3337c
Docs: Mark log output fix as resolved in TODO
Chocapikk Apr 18, 2026
be649a9
Fix: Align log color handling with server labels, fix this.logs refer…
Chocapikk Apr 18, 2026
6e0cef2
Feat: Add CSS styles for prompt and input log entries
Chocapikk Apr 18, 2026
2ab62ae
Fix: Add WebSocket origin check to prevent cross-origin code injection
Chocapikk Apr 18, 2026
518b2b7
Feat: Add static synth and fx descriptions for autocomplete
Chocapikk Apr 18, 2026
062c020
Feat: Include synth/fx descriptions in autocomplete data
Chocapikk Apr 18, 2026
aaa01ca
Feat: Render synth/fx descriptions in autocomplete dropdown
Chocapikk Apr 18, 2026
f7d9191
Feat: Add CSS for autocomplete hint descriptions
Chocapikk Apr 18, 2026
c9203ff
Docs: Mark autocomplete definitions as resolved in TODO
Chocapikk Apr 18, 2026
45e18ad
Fix: Correct findIndex falsy check in formatErrorMessage
Chocapikk Apr 18, 2026
fa717d5
Fix: Update resetChrono to match renamed Python variables
Chocapikk Apr 18, 2026
8352531
Fix: Add WebSocket auto-reconnect, log parse errors
Chocapikk Apr 18, 2026
4ef9f8d
Fix: Add WebSocket auto-reconnect to panel
Chocapikk Apr 18, 2026
6c452e8
Fix: Prevent XSS via innerHTML in player list, add JSON parse guard
Chocapikk Apr 18, 2026
1f972e7
Fix: Replace onclick overrides with addEventListener, use strict equa…
Chocapikk Apr 18, 2026
9eb82e3
Fix: Use isNaN for safer parseInt check in incrementValue
Chocapikk Apr 18, 2026
92654d7
Feat: Implement line markers, add WS readyState guard, remove dead code
Chocapikk Apr 18, 2026
a687213
Refactor: Centralize WS sends through sendToServer, cleanup dead code
Chocapikk Apr 18, 2026
015edb5
Refactor: Remove WS-dependent functions moved to main.js
Chocapikk Apr 18, 2026
95589ef
Feat: Add eslint configuration
Chocapikk Apr 18, 2026
dc21ecb
Fix: Resolve all eslint errors and warnings
Chocapikk Apr 18, 2026
c22126e
Feat: Implement green-orange-red duration color transition
Chocapikk Apr 18, 2026
ff519b9
Docs: Update README with new features, shortcuts table, and roadmap
Chocapikk Apr 18, 2026
86a7bcf
Feat: Add clear console button
Chocapikk Apr 18, 2026
a1d87e9
Docs: Mark clear console button as done in roadmap
Chocapikk Apr 18, 2026
ee459db
Docs: Update copyright year
Chocapikk Apr 18, 2026
5f884b5
Docs: Add linting instructions for ruff and eslint
Chocapikk Apr 18, 2026
c063e36
Fix: Add ruff cache to gitignore
Chocapikk Apr 18, 2026
9e172c0
Docs: Add synth_definitions.py to installation instructions
Chocapikk Apr 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/node_modules
config.py
config.js
*.pyc
*.pyc
.ruff_cache/
114 changes: 77 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,22 @@ We know that there are already some people using IDEs like Pulsar or Vim with Fo
- the websocket package for Python (install it with `pip install websockets`)

## ✨ Features
- a code editor with syntax highlighting
- a beautiful and responsive interface with resizable panel and console logs
- change font family, code font size and interface font size
- change the code theme with dozens of themes available
- a console log to see the output of FoxDot with the last item appended at the top
- a panel to see all relevant information (Bpm, Scale, Root, Cpu usage, Timer, the current beat modulo, a list of active players and a list of available Loops, Synths, and Fx)
- show the list of active players with their id, name of synth or loop, time of activity (with color based on elapsed time).
- the ability to stop a player by clicking on the list.
- show the solo players with a different color
- a piano roll based on the actual scale and root and the ability to insert note in the editor by clicking on it (`Alt-P` or click on `Root` to enable/disable the piano roll)
- a auto-completion feature with the ability to insert new random player, list of synth, list of fx, list of loop and a lot more.
- comment and stop/start a player with just `Alt-x`
- and a lot more to come...
- Code editor with Python syntax highlighting
- Responsive interface with resizable panel and console logs
- Customizable font family, code font size and interface font size
- Dozens of code themes and interface themes available
- Console log with color-coded output (errors in red, prompts in green, input in blue)
- Info panel showing BPM, Scale, Root, CPU usage, Timer, beat modulo, active players, and available Loops/Synths/Fx
- Active player list with synth name, duration (color transitions from green to orange to red), and click-to-stop
- Solo players highlighted
- Piano roll based on current scale and root with click-to-insert notes (`Alt-P` or click `Root`)
- Auto-completion with synth/fx descriptions shown in the dropdown
- Line markers for visual annotation (Alt+1/2/3 for Red/Green/Blue, Alt+4 to reset)
- Comment and stop/start a player with `Alt-x`
- WebSocket auto-reconnect on connection loss
- WebSocket origin check to prevent cross-origin code injection
- Unified startup file supporting both FoxDot and Renardo
- Auto-detection of Python executable (python3/python)


## 🐍 Installation with Python
Expand All @@ -61,15 +64,19 @@ nano config.py
Change the FOXDOT_PATH to your foxdot path
```

### Copy the content of this startup.py file to your FoxDot startup file:
### Copy `startup.py` and `synth_definitions.py` to your FoxDot startup directory:
```text
Your startup file is located in the FoxDot directory:
/FoxDot/lib/Custom/startup.py
Your startup directory is located in the FoxDot directory:
/FoxDot/lib/Custom/

Copy both files:
- startup.py
- synth_definitions.py (required for autocomplete descriptions)
```

### Start SuperCollider as usual

### Run Foxdot with a server:
### Run FoxDot with a server:
```python
python server.py
```
Expand Down Expand Up @@ -132,10 +139,14 @@ nano config.js
Change the FOXDOT_PATH to your foxdot path. Not yet fully compatible with Renardo, you have to change the spawn in `server.js` to the correct command.
```

### Copy the content of this startup.py file to your FoxDot startup file:
### Copy `startup.py` and `synth_definitions.py` to your FoxDot startup directory:
```text
Your startup file is located in the FoxDot directory:
/FoxDot/lib/Custom/startup.py
Your startup directory is located in the FoxDot directory:
/FoxDot/lib/Custom/

Copy both files:
- startup.py
- synth_definitions.py (required for autocomplete descriptions)
```

### Start SuperCollider as usual
Expand Down Expand Up @@ -171,39 +182,68 @@ Inject the websocket package dependency in the Renardo code:
pipx inject renardo websockets
```

Copy the content of startup-renardo.py to your Renardo startup file:
Copy `startup.py` and `synth_definitions.py` to your Renardo startup directory (the same `startup.py` now supports both FoxDot and Renardo):
```bash
This should be located in the Renardo directory, something like:
~/.local/pipx/venvs/renardo/lib/python3.13/site-packages/renardo_lib/Custom/startup.py
~/.local/pipx/venvs/renardo/lib/python3.13/site-packages/renardo_lib/Custom/

Copy both files:
- startup.py
- synth_definitions.py (required for autocomplete descriptions)
```


## 🚀 Usage
All things that work in FoxDot or Renardo will work in WebFoxDot.

- evaluate a line of code with `Ctrl-Enter`
- evaluate a block of code with `Ctrl-Alt-Enter`
- stop all players with `Ctrl-;`
- auto-completion with `Ctrl-Space`
- comment a line and stop a player with `Alt-x`
- you can comment and stop a block with `Ctrl-Alt-x`
- show the piano roll with `Alt-P`
- solo a player with `Alt-S`
- unsolo all players with `Ctrl-Alt-S`
- increment a value with `Alt-=`
- decrement a value with `Ctrl-Alt-=`
| Shortcut | Action |
| --------------------------- | ---------------------------------- |
| `Ctrl-Enter` | Evaluate line |
| `Ctrl-Alt-Enter` | Evaluate block |
| `Ctrl-;` | Stop all players |
| `Ctrl-Space` | Auto-completion |
| `Alt-X` | Comment line and stop player |
| `Ctrl-Alt-X` | Comment block and stop players |
| `Alt-P` | Toggle piano roll |
| `Alt-S` | Solo player |
| `Ctrl-Alt-S` | Unsolo all players |
| `Alt-=` | Increment value under cursor |
| `Ctrl-Alt-=` | Decrement value under cursor |
| `Alt-1` / `Alt-2` / `Alt-3` | Set Red / Green / Blue line marker |
| `Alt-4` | Reset all line markers |
| `Alt-F` | Open search |
| `Ctrl-G` | Find next |
| `Ctrl-S` | Save code to file |

A full list of shortcuts is available in the config panel.

## 🧹 Linting

**Python** (requires [ruff](https://docs.astral.sh/ruff/)):
```bash
ruff check .
ruff format .
```

And many more to discover, a full list of shortcuts is available in the config panel.
**JavaScript** (requires npm dependencies):
```bash
npm install
npx eslint src/js/
```

## 🗺️ Roadmap
- [ ] Add more interface themes
- [x] Add a vim mode
- [ ] a clear console button
- [X] renardo compatibility
- [x] Clear console button
- [x] Renardo compatibility (unified startup.py)
- [x] Error detection and colored log output
- [x] Auto-detection of python executable
- [x] Synth/Fx descriptions in autocomplete
- [x] Line markers (Alt+1/2/3/4)

## 📝 License

Copyright © 2025 [CrashServer](https://github.com/CrashServer).
Copyright © 2025-2026 [CrashServer](https://github.com/CrashServer).

This project is MIT licensed.

6 changes: 3 additions & 3 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
- [X] autocomplete

# log
- [ ] fix better output (on error and color)
- [X] fix better output (on error and color) - errors detected via pattern matching, stderr captured

## Server
- [ ] python vs python3
- [X] python vs python3 (auto-detected via `resolve_python()`)

## Autocomplete
- [X] fix automatic retrieve
- [X] fix end of line with .
- [ ] add definition
- [X] add definition (synth/fx descriptions in autocomplete tooltips)

## editor
- [X] fix python syntax highlight
18 changes: 10 additions & 8 deletions config.py.sample
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
# Configuration file when running the server with python server.py
#
# IMPORTANT: Please uncomment the PROGRAM_PATH AND PROGRAM_CMD lines that corresponds to the program you are using and fill the correct path when using a Github clone of FoxDot.
# Also make sure to set the correct python executable (python3 or python).
#
# 1. I'm using FoxDot installed with pip
# IMPORTANT: Uncomment the PROGRAM_PATH and PROGRAM_CMD that matches your setup.
# The python executable is auto-detected (python3 or python), so you don't need
# to worry about which one to use.
#
# 1. FoxDot installed with pip
#
# PROGRAM_PATH = "/"
# PROGRAM_CMD = ['FoxDot', '-p']
#
#
# 2. I'm using the FoxDot library cloned from GitHub
# 2. FoxDot cloned from GitHub (python is auto-resolved at runtime)
#
# from server import resolve_python
# PROGRAM_PATH = "/my/path/to/FoxDot"
# PROGRAM_CMD = ['python', '-m', 'FoxDot', '-p']
# PROGRAM_CMD = [resolve_python(), '-m', 'FoxDot', '-p']
#
#
# 3. I'm using Renardo installed with pipx
# 3. Renardo installed with pipx
#
# PROGRAM_PATH = "/"
# PROGRAM_CMD = ["renardo", '-p']
# PROGRAM_CMD = ["renardo", '-p']
20 changes: 20 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import js from "@eslint/js";
import globals from "globals";

export default [
js.configs.recommended,
{
languageOptions: {
globals: {
...globals.browser,
CodeMirror: "readonly",
},
},
rules: {
"no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
eqeqeq: "error",
"no-var": "error",
"prefer-const": "warn",
},
},
];
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ <h1>WebFoxDot</h1>
<div class="logPanel" id="logPanel">
<div class="logSeparator" id="logSeparator"></div>
<div class="logs" id="logs"></div>
<button id="clearLogsBtn" title="Clear console">&#x2715;</button>
</div>
<button id="configButton"><img src="/src/images/gear.svg"></button>
<div id="configPanel" class="config-panel">
Expand Down
Loading