• Home
Name Date Size #Lines LOC

..--

src/main/03-May-2024-907625

README.mdD03-May-20241.8 KiB4832

build.gradleD03-May-20241.4 KiB5148

proguard-rules.proD03-May-2024751 2218

soundboard_image.pngD03-May-202438.5 KiB

README.md

1Soundboard
2==========
3Do you want to just jam with some digital tunes? Now you can!
4
5This sample demonstrates how to obtain the lowest latency and optimal computational throughput by:
6
71) Leaving Oboe to choose the best default stream properties for the current device
82) Setting performance mode to LowLatency
93) Setting sharing mode to Exclusive
104) Setting the buffer size to 2 bursts
115) Using the `-Ofast` compiler optimization flag, even when building the `Debug` variant
127) Using a `StabilizedCallback` which aims to spend a fixed percentage of the callback time to avoid CPU frequency scaling ([video explanation](https://www.youtube.com/watch?v=C0BPXZIvG-Q&feature=youtu.be&t=1158))
13
14The [following article explaining how to debug CPU performance problems](https://medium.com/@donturner/debugging-audio-glitches-on-android-ed10782f9c64) may also be useful when looking at this code.
15
16Implementation details
17---
18The stream properties are left to Oboe as such the app must output audio data in a format which matches that of the stream.
19
20Four different formats are supported:
21
22|Channel count|Format|
23|-------------|------|
24|1 - Mono|16-bit int|
25|2 - Stereo|16-bit int|
26|1 - Mono|Float|
27|2 - Stereo|Float|
28
29The signal chain for mono streams is:
30
31    SynthSound->Mixer
32
33For stereo chains a mono to stereo converter is added to the end of the chain:
34
35    SynthSound->Mixer->MonoToStereo
36
37The compiler optimization flag `-Ofast` can be found in [CMakeLists.txt](CMakeLists.txt).
38
39Each SynthSound is a series of 5 Oscillators, creating a pleasant sounding note when combined.
40
41There are 30 notes, corresponding to G3 to C6, moving left to right, top to bottom.
42
43In order to determine whether a note should be played, MusicTileView demonstrates how to keep track of where each finger is.
44
45Images
46-----------
47![soundboard_image](soundboard_image.png)
48