====== iOS Piano Thoughts (& other info) ====== From an [[https://forum.audiob.us/discussion/32463/velocity-mapping-for-ios-pianos-and-other-cool-info#latest|AB Forum Knowledge Base article]] posted to the Knowledge base by @LinearLineman. Original author unknown. Posted here by @Paulinko ===== Technical Details ===== ==== Layers and Velocity Mapping ==== Here's what I know about velocity. The midi spec ties a velocity value from 0-127 to every note. So a keyboard app would map some ranges it detects to values between 0-127. A velocity map in the App would align these input velocity numbers with 2 things: a sample from a specific layer (softest to hardest) layer 1 - velocities from 1-10 layer 2 - velocites from 11-20 etc. then output that sample with an adjustment in volume to smooth out the jumps from 10 to 21 for example. The layers allow the tone of the piano at various volumes to come through increasing the realism BUT they increase the overall sample size (13GB Clossus with 24 layers). ==== Sampling Fidelity ==== * Samples can be captured in 16, 24 or 32 bits and at 41K, 44K or 96Khz. Colossus is 24-bit at 96Khz. It's a better recording essentially. ==== CPU, RAM Resources and Disk Streaming ==== Larger samples at 96Khz consume a lot more CPU to process. To be processed the sample must be in RAM. Disk streaming means the application loads up enough sound to start any note at any volume. After a note it invoked the additional portion of that sample is brought up from the disk. Somewhere in the IOS hardware there's a buffer getting filled with sound to be played. Miss the update to that buffer for any reason and the audio gets a jump from some value to zero. That is a speaker that is effectively being asked to relocate at the speed of light... not gonna happen. It's going to make an ugly crackle while the buffer starts sending out smoother numeric sequences again that sound like music repeating at some set of combined frequencies. Colossus Piano[🏪](https://itunes.apple.com/us/app/colossus-piano/id1122637899?mt=8) set it's specs on the most difficult set of attributes: 24-bits at 96Khz with 24 layers. It's using all the capabilities of the IOS platform and obviously does disk streaming to pull it off with a 13GB sample set. I also noticed that Colussus doesn't report all the RAM used in the IOS Storage report. The only way to see what it really uses since that report doesn't factor in a lot of app data is to delete the App and look at total RAM usage anf re-install which is an over night process and then check storage use to see the real amounts used. That's the 13GB number as I recall but I now have 6 Colussus IAP's so I ain't gonna check this again thanks. **AU support**. An AU may not work correctly with a DAW controlling the CPU and the AU App being coded to function as a standalone App. The devloper's will make sure the standalone app doesn't crackle but all bets are off with an AU getting the CPU's attention to load more sound before that buffer runs dry. NOTE: [[https://itunes.apple.com/us/app/auria-pro-music-production/id1016291290?mt=8|Auria Pro]] has a sampler (Lyra) that provides disk streaming and can load SF2, SFZ and ESX24 sample sets. There are wonderful, really large sample sets out there to add to this product. So, glad I bought it for sale at $25 and waited to add Cubasis for $25. They have unique capabilities. Auria Pro owns the buffer and the sampler working well together to keep the output buffer happy and users away from expensive bug reports. **Korg**. People want Korg and others to just slap an AU interface on their products and support the users satisfaction. Big companies usually won't take the risk of explaining that all AU's won't work all the time in all cases. It's not their fault. Supplying an AU must factor in the consequence of handing control to another App that's scheduling resources and keeping that output buffer full with wonderful planned sounds. ==== Polyphony and Latency ==== We only have 10 fingers so 10 notes at a time should do it right? Wrong. Enter the missing "sustain pedal". Sustain lets the piano string resonate until that pedal is lifted. So, great piano apps can offer over 100 notes played in a stereo image (bass on the left and treble notes to the right) for additional realism. Most top end Piano Apps have MIDI Players in the product so a piano can play along with another piano with another piano... to the max polyphony. Some of the entrants in the Piano Poll were just throwing away NOTE events due to limited CPU resources or a lack of polyphony in the MIDI file player. The MIDI Clock never rests for the App to catch up. It just tells the app to make a specific note the next note using time stamps on every note. Miss a note's time stamp and just drop the event. No crackles... just missing chord tones or worse the melody. Still not sure what changed some G#'s to G natural on Contestant #19 (BeatHawk[🏪](https://itunes.apple.com/us/app/beathawk/id839563064?mt=8) Acoustic) sample_instrument SFZ tips_and_tricks}}