Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@ uv sync

## Running

Run the synth with:
Run the synth with the packaged GUI entry script:

```bash
uv run qwertysynth
```

You can also continue using the legacy entry point if you prefer:

```bash
uv run python main.py
Expand All @@ -57,7 +63,7 @@ Then press keys on the keyboard to play or use the GUI controls. Press ESC to qu
## Command line options

```bash
uv run python main.py [OPTIONS]
uv run qwertysynth [OPTIONS]
```

- `--midi FILE` - Load MIDI file on startup
Expand All @@ -66,7 +72,7 @@ uv run python main.py [OPTIONS]

Example:
```bash
uv run python main.py --midi song.mid --play --patch "Bass"
uv run qwertysynth --midi song.mid --play --patch "Bass"
```

## Input methods
Expand Down
31 changes: 4 additions & 27 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,11 @@
"""QWERTY Synth - A simple software synthesizer controlled by your keyboard."""
"""Backward-compatible entry point for running the QWERTY Synth GUI."""

import argparse

from qwerty_synth import gui_qt as gui
from qwerty_synth.entry import main as _launch_gui


def main():
"""Start the QWERTY Synth application."""
parser = argparse.ArgumentParser(description='QWERTY Synth - Software synthesizer')
parser.add_argument('--midi', type=str, help='MIDI file to load on startup')
parser.add_argument('--play', action='store_true', help='Automatically play the MIDI file')
parser.add_argument('--patch', type=str, help='Patch name to load on startup')
args = parser.parse_args()

print('QWERTY Synth: Play keys A-K, W,E,T,Y,U,O,P etc.')
print('Use Z / X to shift octave down / up')
print('Press ESC to quit')

if args.midi:
print(f'MIDI file will be loaded: {args.midi}')
if args.play:
print('Auto-play enabled')

if args.patch:
print(f'Patch will be loaded: {args.patch}')

print('Starting GUI...')

# Start the GUI (which handles audio stream and keyboard input)
gui.start_gui(midi_file=args.midi, auto_play=args.play, patch_name=args.patch)
"""Launch the QWERTY Synth application."""
_launch_gui()


if __name__ == "__main__":
Expand Down
8 changes: 7 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "qwerty-synth"
name = "qwertysynth"
version = "0.1.0"
description = "A minimalist real-time synthesizer with QWERTY keyboard input"
readme = "README.md"
Expand All @@ -20,6 +20,12 @@ dependencies = [
"soundfile>=0.13.1",
]

[project.scripts]
qwertysynth = "qwerty_synth.entry:main"

[tool.uv]
package = true

[dependency-groups]
dev = [
"pytest>=8.3.5",
Expand Down
34 changes: 34 additions & 0 deletions qwerty_synth/entry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""Entry point for launching the QWERTY Synth GUI."""

import argparse

from qwerty_synth import gui_qt as gui


def main():
"""Parse command-line arguments and start the synthesizer GUI."""
parser = argparse.ArgumentParser(description='QWERTY Synth - Software synthesizer')
parser.add_argument('--midi', help='MIDI file to load on startup')
parser.add_argument('--play', action='store_true', help='Automatically play the MIDI file')
parser.add_argument('--patch', help='Patch name to load on startup')
args = parser.parse_args()

print('QWERTY Synth: Play keys A-K, W,E,T,Y,U,O,P etc.')
print('Use Z / X to shift octave down / up')
print('Press ESC to quit')

if args.midi:
print(f'MIDI file will be loaded: {args.midi}')
if args.play:
print('Auto-play enabled')

if args.patch:
print(f'Patch will be loaded: {args.patch}')

print('Starting GUI...')

gui.start_gui(midi_file=args.midi, auto_play=args.play, patch_name=args.patch)


if __name__ == "__main__":
main()
104 changes: 52 additions & 52 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.