-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
Thiago Fernando Rech edited this page Jun 30, 2025
·
2 revisions
ToneForge uses a modular architecture with native C++ audio processing and Java UI components.
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β AudioRecord βββββΆβ Audio Engine βββββΆβ AudioTrack β
β (Input) β β (C++/JNI) β β (Output) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
-
Capture:
AudioRecordcaptures audio from microphone -
Processing: Buffer sent to
audio_engine.cppvia JNI - Effects: Sequential application according to configured order
-
Playback:
AudioTrackplays processed audio
app/src/main/
βββ cpp/
β βββ audio_engine.h # Audio engine header
β βββ audio_engine.cpp # Effect implementations
β βββ native-lib.cpp # JNI methods
β βββ CMakeLists.txt # Build configuration
βββ java/
β βββ com/thiagofernendorech/toneforge/
β βββ MainActivity.java # Main interface and navigation
β βββ AudioEngine.java # Real-time audio pipeline
β βββ EffectsFragment.java # Effects interface and presets
β βββ EffectOrderAdapter.java # Effect order adapter
β βββ HomeFragment.java # Home screen
β βββ TunerFragment.java # Real-time tuner
β βββ MetronomeFragment.java # Metronome
β βββ LooperFragment.java # Loop recorder
β βββ RecorderFragment.java # Audio recorder
β βββ LearningFragment.java # Learning screen
β βββ SettingsFragment.java # Settings
β βββ AudioBackgroundService.java # Background audio service
β βββ AudioStateManager.java # Effect state management
β βββ PipelineManager.java # Audio pipeline management
β βββ PermissionManager.java # Permission management
β βββ StateRecoveryManager.java # State recovery
β βββ PresetManager.java # Preset management
β βββ FavoritesManager.java # Favorites management
β βββ TooltipManager.java # Tooltip management
β βββ FavoritePresetAdapter.java # Favorite presets adapter
βββ res/
β βββ layout/
β β βββ activity_main.xml # Main layout
β β βββ fragment_effects.xml # Effects interface
β β βββ fragment_home.xml # Home screen
β β βββ fragment_tuner.xml # Tuner
β β βββ fragment_metronome.xml # Metronome
β β βββ fragment_looper.xml # Looper
β β βββ fragment_recorder.xml # Recorder
β β βββ fragment_learning.xml # Learning
β β βββ fragment_settings.xml # Settings
β βββ drawable/
β β βββ ic_*.xml # Interface icons
β β βββ bg_gradient.xml # Background gradient
β β βββ button_background.xml # Button styles
β β βββ round_button.xml # Rounded buttons
β βββ navigation/
β β βββ nav_graph.xml # Screen navigation
β βββ anim/
β β βββ slide_in_*.xml # Entry animations
β β βββ slide_out_*.xml # Exit animations
β βββ values/
β β βββ colors.xml # Theme colors
β β βββ strings.xml # Localized strings
β β βββ arrays.xml # Arrays (distortion types)
β β βββ themes.xml # App themes
β βββ values-night/
β β βββ themes.xml # Dark theme
β βββ mipmap-*/ # App icons (different densities)
β βββ xml/
β βββ backup_rules.xml # Backup rules
β βββ data_extraction_rules.xml # Data extraction rules
βββ AndroidManifest.xml # App configuration
- Gradle: Build system
- CMake: Native code build
- JNI: Java-C++ interface
- AudioRecord/AudioTrack: Android audio API
- Fragments: Multi-screen navigation
- RecyclerView: Drag-and-drop interface
- SharedPreferences: Data persistence
- ForegroundService: Keeps audio processing active with screen off
- Persistent notification: Shows audio status and quick controls
- Activation control: Switch in settings to enable/disable
- Pipeline management: Automatic recovery from errors
- Automatic saving: State saved when app goes to background
- Smart restoration: Settings restored when returning
- Recovery of: Pipeline, presets, oversampling, active effects
- Synchronization: Interface updated with real state
- Required permissions: Microphone, notifications, storage
- Optional permissions: Overlay, battery optimization
- Automatic verification: Permission requests on startup
- Compatibility: Support for different Android versions
See Development for setup and build instructions.
Transform your Android into a professional pedalboard with real-time audio processing!
- Documentation: This Wiki
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: [thiagorech.1997@gmail.com]
Built with β€οΈ by Thiago Fernando Rech
- Architecture
- MVP Architecture π
- Testing Strategy π
- Layout Guidelines π
- Development
- Refactoring Summary π
- Documentation Updates
Quick Links: