Skip to content

Commit 0daa64b

Browse files
committed
nyan
1 parent c24b1c4 commit 0daa64b

File tree

9 files changed

+407
-149
lines changed

9 files changed

+407
-149
lines changed

README.md

Lines changed: 88 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -3,167 +3,131 @@
33

44
# Patchrome
55

6-
A powerful Chrome extension for real-time audio manipulation on web pages. Process any audio playing in your browser with a modular effects chain using visual node-based routing.
6+
**🎛️ Real-time audio effects for any website**
7+
8+
Transform your browser into a powerful audio processor. Add reverb to YouTube videos, pitch-shift podcasts, or create unique soundscapes from any web audio.
9+
10+
[![Version](https://img.shields.io/badge/version-1.0.0-blue.svg)](https://github.com/jumang4423/patchrome-ext/releases)
11+
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
712
</div>
813

9-
## Overview
10-
11-
Patchrome is a Chrome extension that intercepts and processes audio from web pages in real-time. It provides a visual node-based interface where you can build custom audio effect chains by connecting various audio processing nodes together.
12-
13-
### Key Features
14+
## 🚀 Quick Start
1415

15-
- **Visual Node Editor**: Drag-and-drop interface for building audio effect chains
16-
- **Real-time Processing**: All effects are applied in real-time with minimal latency
17-
- **Multiple Effect Types**:
18-
- **Input/Output**: Audio source with speed control and destination nodes
19-
- **Effects**: Reverb, Delay, Distortion, Phaser, Flanger, Equalizer (with multiple filter types), Bitcrusher
20-
- **Utilities**: Gain/Pan control with phase inversion, Limiter
21-
- **Generators**: Tone Generator (sine, triangle, sawtooth, square waves)
22-
- **Spectral Effects**: Spectral Gate, Spectral Compressor, Spectral Pitch Shifter
23-
- **Per-site Compatibility**: Works on most websites with HTML5 audio/video
24-
- **Persistent Settings**: Your effect chains are saved per session
16+
### Install from GitHub Release
2517

26-
## Usage Tips
27-
28-
### Quick Actions
29-
30-
- **Right-click on empty space** → Opens the "Add Effect" menu instantly
31-
- **Double-click on any slider** → Enter precise values manually
32-
- **Drag nodes** → Rearrange your effect chain visually
33-
- **Click the power button** → Enable/disable all effects globally
18+
1. Download the latest `patchrome-ext.zip` from [Releases](https://github.com/jumang4423/patchrome-ext/releases)
19+
2. Unzip the file
20+
3. Open Chrome and go to `chrome://extensions/`
21+
4. Enable "Developer mode" (top right)
22+
5. Click "Load unpacked" and select the unzipped folder
23+
6. Click the extension icon in your toolbar to start!
3424

35-
### Effect Parameters
25+
### How to Use
3626

37-
#### Speed Control (Input Node)
38-
- Adjust playback speed from 0.5x to 1.5x
39-
- Preserves pitch automatically
27+
1. **Open any website** with audio/video (YouTube, SoundCloud, etc.)
28+
2. **Click the Patchrome icon** in your toolbar
29+
3. **Right-click in the panel** to add effects
30+
4. **Connect nodes** by dragging from output to input
31+
5. **Adjust parameters** with sliders or double-click for precise values
4032

41-
#### Reverb
42-
- **Mix**: Dry/wet balance (0-100%)
43-
- **Size**: Room size simulation (0-100%)
44-
- **Decay**: Reverb tail length in milliseconds
33+
## ✨ Features
34+
35+
<div align="center">
36+
<img src="https://github.com/jumang4423/patchrome-ext/assets/demo.gif" alt="Demo" width="600"/>
37+
</div>
4538

46-
#### Delay
47-
- **Delay Time**: Echo delay in milliseconds (0-2000ms)
48-
- **Feedback**: Echo repetitions (0-100%)
49-
- **Mix**: Dry/wet balance (0-100%)
39+
### 🎵 Audio Effects
40+
- **Reverb** - Add space and ambience
41+
- **Delay** - Create echoes and rhythmic patterns
42+
- **Distortion** - Add grit and warmth
43+
- **EQ** - Shape your sound with filters
44+
- **Phaser/Flanger** - Classic modulation effects
45+
- **Bitcrusher** - Lo-fi digital destruction
46+
- **Spectral Effects** - Advanced frequency manipulation
5047

51-
#### Utility
52-
- **Volume**: Gain control in dB (-60 to +12 dB)
53-
- **Pan**: Stereo positioning (-100 to +100)
54-
- **Phase Reverse**: Invert right channel phase
48+
### 🎛️ Visual Node Editor
49+
- Drag & drop interface
50+
- Real-time parameter control
51+
- Save effect chains per session
52+
- Visual signal flow
5553

56-
#### Distortion
57-
- **Drive**: Distortion amount (0-100)
58-
- **Mix**: Dry/wet balance (0-100%)
54+
### ⚡ Performance
55+
- Low-latency processing
56+
- Minimal CPU usage
57+
- Works with all HTML5 audio/video
5958

60-
#### Equalizer
61-
- **Filter Type**: Choose from lowpass, highpass, bandpass, or notch filters
62-
- **Frequency**: Adjustable from 20 Hz to 7777 Hz
63-
- **Q Factor**: Filter resonance/width (0.1-30)
59+
## 🎮 Keyboard Shortcuts
6460

65-
#### Limiter
66-
- **Threshold**: Limiting threshold in dB (-60 to 0 dB)
61+
- `Space` - Toggle global bypass
62+
- `Delete` - Remove selected node
63+
- `Ctrl+Z` - Undo last action
6764

68-
#### Phaser
69-
- **Rate**: LFO speed (0.1-10 Hz)
70-
- **Depth**: Modulation depth (0-100%)
71-
- **Feedback**: Resonance amount (0-100%)
72-
- **Mix**: Dry/wet balance (0-100%)
65+
## 🌟 Examples
7366

74-
#### Flanger
75-
- **Rate**: LFO speed (0.1-10 Hz)
76-
- **Depth**: Modulation depth (0-100%)
77-
- **Feedback**: Resonance amount (-100 to +100%)
78-
- **Delay**: Base delay time (1-20ms)
79-
- **Mix**: Dry/wet balance (0-100%)
67+
### YouTube Enhancement
68+
```
69+
Input → EQ (boost bass) → Reverb (small room) → Output
70+
```
8071

81-
#### Tone Generator
82-
- **Waveform**: Sine, triangle, sawtooth, or square wave
83-
- **Frequency**: 20-20000 Hz
84-
- **Volume**: Output level (-60 to 0 dB)
72+
### Podcast Production
73+
```
74+
Input → EQ (voice enhance) → Limiter → Output
75+
```
8576

86-
#### Bitcrusher
87-
- **Mix**: Dry/wet balance (0-100%)
88-
- **Sample Rate**: Reduce sample rate (2000-40000 Hz)
89-
- **Bit Depth**: Reduce bit resolution (1-16 bits)
77+
### Creative Sound Design
78+
```
79+
Input → Pitch Shift → Delay → Phaser → Reverb → Output
80+
```
9081

91-
#### Spectral Gate
92-
- **Cutoff**: Frequency magnitude threshold (-60 to +24 dB)
82+
## 🤝 Contributing
9383

94-
#### Spectral Compressor
95-
- **Threshold**: Compression threshold (-60 to 0 dB)
96-
- **Ratio**: Compression ratio (0.5-1.5)
97-
- **Attack**: Attack time (0.1-100ms)
98-
- **Release**: Release time (1-500ms)
99-
- **Input Gain**: Pre-compression gain (-24 to +24 dB)
84+
We welcome contributions! Feel free to:
85+
- Report bugs
86+
- Suggest new effects
87+
- Submit pull requests
88+
- Share your effect presets
10089

101-
#### Spectral Pitch Shifter
102-
- **Pitch**: Pitch shift in cents (-1200 to +1200, ±1 octave)
103-
- **Mix**: Dry/wet balance (0-100%)
90+
## 📝 Development
10491

105-
## Performance Notes
92+
### Building from Source
10693

107-
The extension uses Web Audio API for processing, which means:
108-
- Effects are applied at the browser level
109-
- CPU usage scales with effect complexity
110-
- Some effects (especially spectral processing) may be CPU-intensive
111-
112-
## Known Issues & TODO
113-
114-
### Platform-Specific Issues
115-
116-
- **YouTube**: Heavy CPU usage when multiple effects are chained, especially with spectral effects. Consider using simpler effect chains for better performance.
117-
- **Twitter/X**: Video players may experience higher latency with complex effect chains due to the platform's audio handling.
118-
- **SoundCloud**: Works well with most effects. The extension has special handling for SoundCloud's audio system.
119-
120-
### TODO List
121-
122-
- [ ] Implement preset system for saving/loading effect chains
123-
- [ ] Add visualization (spectrum analyzer, waveform display)
124-
- [ ] Optimize performance for complex effect chains
125-
- [ ] Create effect chain templates for common use cases
126-
- [ ] Add A/B comparison feature
127-
- [ ] Implement effect automation/LFO modulation
128-
- [ ] Add more modulation effects (Chorus, Tremolo, Ring Modulator)
129-
- [ ] Implement sidechain compression
130-
- [ ] Add frequency analyzer node for visual feedback
131-
132-
## Development
133-
134-
### Setup
13594
```bash
95+
# Clone the repository
96+
git clone https://github.com/jumang4423/patchrome-ext.git
97+
cd patchrome-ext
98+
99+
# Install dependencies
136100
npm install
137-
npm run dev # Watch mode for development
138-
npm run build # Production build
101+
102+
# Development build (with watch mode)
103+
npm run dev
104+
105+
# Production build
106+
npm run build
139107
```
140108

141109
### Project Structure
142110
```
143111
patchrome-ext/
144112
├── src/
145-
│ ├── background.ts # Extension background script
146-
│ ├── content.ts # Content script injected into pages
147-
│ ├── inject.js # Main audio processing logic
148-
│ ├── sidepanel/ # React-based side panel UI
149-
│ │ ├── App.tsx
150-
│ │ └── components/ # UI components
113+
│ ├── inject.js # Core audio processing
114+
│ ├── sidepanel/ # React UI
151115
│ ├── worklets/ # Audio worklet processors
152116
│ └── types/ # TypeScript definitions
153-
├── manifest.json # Chrome extension manifest
117+
├── manifest.json # Extension manifest
154118
└── webpack.config.js # Build configuration
155119
```
156120

157121
### Adding New Effects
158122

159-
See [ADD_EFFECT_INSTRUCTIONS.md](ADD_EFFECT_INSTRUCTIONS.md) for detailed instructions on adding new effects.
123+
See [ADD_EFFECT_INSTRUCTIONS.md](ADD_EFFECT_INSTRUCTIONS.md) for detailed instructions.
160124

161-
For audio worklet-based effects, see [ADD_AUDIO_WORKLET_CUSTOM_EFFECT_INSTRUCTIONS.md](ADD_AUDIO_WORKLET_CUSTOM_EFFECT_INSTRUCTIONS.md).
125+
## 📄 License
162126

163-
## License
127+
MIT License - feel free to use in your own projects!
164128

165-
This project is open source. Feel free to use and modify as needed.
129+
---
166130

167-
## Contributing
168-
169-
Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.
131+
<div align="center">
132+
Made with ❤️ by <a href="https://github.com/jumang4423">jumang4423</a>
133+
</div>

RELEASE.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# GitHub Release Guide
2+
3+
## Creating a Release
4+
5+
### 1. Build the Extension
6+
7+
```bash
8+
# Make sure you have a clean build
9+
npm run build
10+
```
11+
12+
### 2. Create Distribution Package
13+
14+
```bash
15+
# Create a zip file containing the built extension
16+
zip -r patchrome-ext.zip dist/ manifest.json icon*.png logo.png
17+
```
18+
19+
### 3. Create GitHub Release
20+
21+
1. Go to your repository on GitHub
22+
2. Click on "Releases" → "Create a new release"
23+
3. Choose a tag (e.g., `v1.0.0`)
24+
4. Fill in release details:
25+
- **Release title**: `Patchrome v1.0.0`
26+
- **Description**: Include changelog and features
27+
5. Upload `patchrome-ext.zip` as a release asset
28+
6. Publish release
29+
30+
### 4. Update README
31+
32+
Update the version badge in README.md to match the new release version.
33+
34+
## Release Checklist
35+
36+
- [ ] Update version in `manifest.json`
37+
- [ ] Update version in `package.json`
38+
- [ ] Test the extension thoroughly
39+
- [ ] Build production version (`npm run build`)
40+
- [ ] Create zip file
41+
- [ ] Create GitHub release
42+
- [ ] Upload zip file to release
43+
- [ ] Update README version badge
44+
- [ ] Announce release (optional)
45+
46+
## Version Naming
47+
48+
Follow semantic versioning:
49+
- `MAJOR.MINOR.PATCH` (e.g., 1.0.0)
50+
- MAJOR: Breaking changes
51+
- MINOR: New features
52+
- PATCH: Bug fixes
53+
54+
## Example Release Description
55+
56+
```markdown
57+
## 🎉 Patchrome v1.0.0
58+
59+
First public release of Patchrome - Real-time audio effects for any website!
60+
61+
### ✨ Features
62+
- Visual node-based audio routing
63+
- 15+ audio effects including reverb, delay, distortion, and more
64+
- Real-time processing with minimal latency
65+
- Per-site effect chains
66+
- Works with YouTube, SoundCloud, and any HTML5 audio/video
67+
68+
### 📦 Installation
69+
1. Download `patchrome-ext.zip` from the assets below
70+
2. Unzip the file
71+
3. Open `chrome://extensions/`
72+
4. Enable "Developer mode"
73+
5. Click "Load unpacked" and select the folder
74+
75+
Enjoy transforming your browser audio! 🎵
76+
```

main.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import anyio
2+
from claude_code_sdk import query, Config, CLINotFoundError
3+
import sys
4+
5+
6+
async def main():
7+
try:
8+
# Simple example - ask Claude a question
9+
print("Asking Claude: What is 2 + 2?")
10+
print("-" * 40)
11+
12+
async for message in query(prompt="What is 2 + 2?"):
13+
print(message, end="", flush=True)
14+
15+
print("\n" + "-" * 40)
16+
17+
# More complex example with configuration
18+
config = Config(
19+
system_prompt="You are a helpful Python programming assistant.",
20+
max_conversation_turns=3,
21+
allowed_tools=["Read", "Write", "Bash"],
22+
working_directory="."
23+
)
24+
25+
print("\nAsking Claude to help with Python:")
26+
print("-" * 40)
27+
28+
async for message in query(
29+
prompt="Create a simple hello world function in Python and explain it",
30+
config=config
31+
):
32+
print(message, end="", flush=True)
33+
34+
print("\n" + "-" * 40)
35+
36+
except CLINotFoundError:
37+
print("Error: Claude Code CLI not found. Please install it with:")
38+
print("npm install -g @anthropic-ai/claude-code")
39+
sys.exit(1)
40+
except Exception as e:
41+
print(f"Error: {e}")
42+
sys.exit(1)
43+
44+
45+
if __name__ == "__main__":
46+
anyio.run(main)

0 commit comments

Comments
 (0)