From bb623a508d44ff96fd5765c19ab4b3be623e97bd Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Sat, 30 Mar 2019 07:02:11 -0400 Subject: [PATCH] Add Core Audio CPU question to FAQ. --- Building.md | 10 +++++----- DSP.md | 2 +- FAQ.md | 15 ++++++++++++--- Migrate1.md | 35 ++++++++++++++++++++++++++++++++++- 4 files changed, 52 insertions(+), 10 deletions(-) diff --git a/Building.md b/Building.md index b0aaefc..d2e9060 100644 --- a/Building.md +++ b/Building.md @@ -10,7 +10,7 @@ However, you need proper tools to build Rack and these dependencies. Install [Xcode](https://developer.apple.com/xcode/). Using [Homebrew](https://brew.sh/), install the build dependencies. -``` +```bash brew install git wget cmake autoconf automake libtool jq ``` @@ -19,23 +19,23 @@ brew install git wget cmake autoconf automake libtool jq If you have an anti-virus program running, disable it. Install [MSYS2](http://www.msys2.org/) and launch the MinGW 64-bit shell from the Start menu, *not the default MSYS shell*. -``` +```bash pacman -Syu ``` Then restart the shell. -``` +```bash pacman -Su git wget make tar unzip zip mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake autoconf automake mingw-w64-x86_64-libtool mingw-w64-x86_64-jq ``` ### Linux On Ubuntu 16.04: -``` +```bash sudo apt install git curl cmake libx11-dev libglu1-mesa-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev zlib1g-dev libasound2-dev libgtk2.0-dev libjack-jackd2-dev jq ``` On Arch Linux: -``` +```bash pacman -S git wget gcc make cmake tar unzip zip curl jq ``` diff --git a/DSP.md b/DSP.md index 9eaa513..7726a57 100644 --- a/DSP.md +++ b/DSP.md @@ -350,7 +350,7 @@ If overhauling the method is not an option (perhaps you are using the best known - Store frequently re-evaluated values in variables so they are evaluated just once. - Move expensive functions to [lookup tables](https://en.wikipedia.org/wiki/Lookup_table). -- Approximate functions with polynomials. +- Approximate functions with polynomials or rational functions, using [Horner's method](https://en.wikipedia.org/wiki/Horner%27s_method), [Estrin's scheme](https://en.wikipedia.org/wiki/Estrin%27s_scheme), and/or [Padé approximants](https://en.wikipedia.org/wiki/Pad%C3%A9_approximant). - Reorder nested `for` loops to "transpose" the algorithm. Remember that it is important to profile your code before and after any change in hopes of improving performance, otherwise it is easy to fool yourself that a particular method is faster. diff --git a/FAQ.md b/FAQ.md index 081a9e3..00c0ddb 100644 --- a/FAQ.md +++ b/FAQ.md @@ -47,7 +47,7 @@ See **Performance** above. ## I found a bug. Search [Rack's issue tracker](https://github.com/VCVRack/Rack/issues?q=is%3Aissue) to check whether someone else has posted a similar issue. -If you believe the problem has never been reported before, [open an issue](https://github.com/VCVRack/Rack/issues/new/choose) on GitHub, or email contact@vcvrack.com if you don't want to register a GitHub account, with a detailed report containing the following information. +If you believe the problem has never been reported before, [open an issue](https://github.com/VCVRack/Rack/issues/new/choose) on GitHub with a detailed report containing the following information. - Your operating system and version - The Rack version @@ -58,7 +58,7 @@ If you believe the problem has never been reported before, [open an issue](https ## I have a feature request. Search [Rack's issue tracker](https://github.com/VCVRack/Rack/issues?q=is%3Aissue) to check whether someone else has posted a similar feature request. -If you believe the feature has never been posted before, [open an issue](https://github.com/VCVRack/Rack/issues/new/choose) on GitHub, or email contact@vcvrack.com if you don't want to register a GitHub account, with a detailed report containing the following information. +If you believe the feature has never been posted before, [open an issue](https://github.com/VCVRack/Rack/issues/new/choose) on GitHub with a detailed report containing the following information. - Your proposal, with consideration for how it fits into Rack's existing features - A possible workflow or diagram (if your request involves multiple steps or UI states, e.g. dragging multiple modules simultaneously). @@ -81,12 +81,21 @@ When running Rack in development mode, it is your current working directory inst ## Will Rack be ported to iOS or Android? It is not planned. There are many issues with such a project. + - Technical: - Tablet and phone users don't normally use mice, so a touch driver would need to be written. If GLFW is still used, [touch support](https://github.com/glfw/glfw/issues/42) would need to be added to the library. - There is no user-managed filesystem on iOS, and forcing users to mess with the filesystem is bad UX on Android, so plugin folders and patch files would need to be managed entirely by Rack itself. - RtAudio and RtMidi don't have iOS Core Audio/MIDI or Android HAL/OpenSL ES backends, so they would need to be added and tested. - Apple does not allow apps distributed through the store to download and execute code, so either all plugins would need to be included in the distributable, or it could only be distributed on jailbroken iOS devices, which is an absurd user requirement. + - Business: - Such a port would be expensive to develop, so it would need to be sold commercially. Some plugins (proprietary, GPL, etc) would need special licensing agreements in order to be included in the package. Some plugins would increase the cost of the product if included in the package. Others would simply be omitted from the third-party plugin collection. - The friction for a developer to build and test their plugins on iOS/Android is significantly higher than the three desktop OS's, which may decrease their willingness to develop Rack plugins. - - When serving an app on the App Store or Google Play, Apple or Google are typically not obligated to continue serving an app and may remove it at will or change policies that can disrupt VCV's business model. This would place VCV's risk in a small number of baskets. + - When serving an app on the App Store or Google Play, Apple and Google are not obligated to continue serving an app and may remove it at will or change policies on a whim that can disrupt VCV's business model. This would place VCV's risk in a small number of baskets. + +## Why does the Audio module from Core consume so much CPU? + +The CPU meter measures the time spent processing each module. +In order for playback timing to be consistent, your audio device, and thus the Audio module, waits until all samples in the current audio buffer are played before moving onto the next audio buffer. +Otherwise, your device's DAC and ADC would play and record at very inconsistent and incorrect sample rates. +While waiting, the engine thread is put to sleep, so no energy is consumed by the thread. diff --git a/Migrate1.md b/Migrate1.md index 0c1e053..7af858e 100644 --- a/Migrate1.md +++ b/Migrate1.md @@ -2,14 +2,47 @@ **This document is a draft. It is not recommended to migrate plugins at this time. If you begin now, you will likely need to follow this guide again when the Rack v1 API is stable.** +## Prerequisites + +Install new build dependencies. + +### Mac + +```bash +brew install python jq +``` + +### Windows + +```bash +pacman -S python mingw-w64-x86_64-jq +``` + +### Linux + +On Ubuntu 16.04: +```bash +sudo apt install jq +``` + +On Arch Linux: +```bash +pacman -S python jq +``` + ## The easy way: using the `rack0.hpp` compatibility header Change `#include "rack.hpp"` to `#include "rack0.hpp"` Create a `plugin.json` manifest file for your plugin using the `helper.py` script included in the Rack SDK. +```bash +python /helper.py createmanifest +``` + +Add a module entry to `plugin.json` for each module in your plugin. When prompted, don't overwrite the module .cpp file. ```bash -python /helper.py createmodule +python /helper.py createmodule ``` Remove `SLUG` and `VERSION` from the `Makefile`, and remove ` p->slug = ...` and `p->version = ...` from your plugin's main `.cpp` file, since they are now defined in `plugin.json`.