Pandereta is a native Android application developed using Jetpack Compose that simulates a virtual tambourine. It plays realistic tambourine sounds triggered either by tapping on the screen or by shaking the device.
- Shake-to-Play: Utilizes the accelerometer sensor to calculate 3D motion magnitude with software gravity filtration for precise shaking audio response in any orientation.
- Low-Latency Audio: Employs Android
SoundPoolfor optimized, instant sound rendering. - Visual Feedback: Responsive tambourine illustration rotates smoothly in response to device tilts using a low-pass smoothing filter.
- Modern Jetpack Compose UI: Material Design 3 styling, Edge-to-Edge display, and dynamic dark mode color scheme.
- MVVM Architecture: Clean, decoupled design separating sensor streams, audio layers, and Composable views.
graph TD
UI[MainActivity/TambourineScreen] -->|observes| VM[TambourineViewModel]
VM -->|calls| AP[AudioPlayer]
VM -->|collects| SR[SensorRepository]
SR -->|wraps| SM[Android SensorManager]
AP -->|wraps| SP[Android SoundPool]
- SensorRepository: Encapsulates the
SensorEventListenerand stream-emits raw values via KotlinFlowcallbackFlow. - AudioPlayer: Coordinates loading audio assets and managing standard
SoundPoolstream playback. - TambourineViewModel: Performs gravity filter calculation, shake threshold validations, and exposes rotation and load status states.
- Android Studio Jellyfish (2023.3.1) or newer.
- JDK 17 installed and configured in your environment.
- Android SDK API level 24 (Android 7.0 Nougat) or higher.
- Clone the repository:
git clone https://github.com/yourusername/Pandereta.git cd Pandereta - Open the project in Android Studio.
- Let Gradle sync and download required dependencies.
- Run the application on your physical device or emulator using Android Studio run button or CLI:
./gradlew installDebug
The project is configured out-of-the-box. Local properties can be specified in local.properties.
Refer to local.properties.example and .env.example templates to configure release signing parameters or custom API keys without committing actual secrets.
- Tap to play: Tap the tambourine icon on the screen to play a membrana/drum hit sound.
- Shake to play: Shake your phone in any direction. The app evaluates linear acceleration and plays shake jingle sound effects matching your shaking strength.
- Tilt for orientation: Tilt your device left or right to see the tambourine icon tilt responsively.
Distributed under the MIT License. See LICENSE for more information.
