ladybird/Applications
William McPherson 72cbbd5297 Piano: New timing system and zoomable piano roll
This patch allows roll notes to be of different sizes. This necessitates
a new internal representation of time. BPM and time signatures are
mostly implemented but not exposed.

Roll notes are now sample-accurate and the grid is aligned to 60 BPM
4/4. The roll is divided by the time signature raised to some power of
2, giving the musical divisions of (in the case of 4/4) 16, 32, 64 etc.

Before, our timing was derived from the buffer size and we relied on
that to implement delay. Delay has been rewritten to be sample-granular.
It's now exposed as the proper "divisions of a beat".
Something to be wary of is that the last buffer in the loop is also used
for the start of the next loop. In other words, we loop mid-buffer. This
means we write WAVs with a tiny bit of silence due to breaking the loop
after filling half a buffer.

The data structure for the roll is an array of SinglyLinkedLists of
RollNotes. Separating by pitch (via the array layout) makes insertion
much simpler and faster. Using sorted lists (and thus
SinglyLinkedListIterators) to do lookups is very quick as you know the
sample of the next note and can just compare it to the current sample. I
implemented this with HashMaps and the cost of lookups was abysmal. I
also tried a single SinglyLinkedList and the insertion code got even
more complicated than it already is.
2020-02-27 10:21:13 +01:00
..
About Userspace: Use Core::Object::add() when building interfaces 2020-02-23 11:10:52 +01:00
Browser AK: Make Vector use size_t for its size and capacity 2020-02-25 14:52:35 +01:00
Calculator Userspace: Use Core::Object::add() when building interfaces 2020-02-23 11:10:52 +01:00
ChanViewer Userspace: Use Core::Object::add() when building interfaces 2020-02-23 11:10:52 +01:00
DisplayProperties DisplayProperties: Do not assert on trying to select unset wallpaper 2020-02-27 09:53:11 +01:00
FileManager AK: Make Vector use size_t for its size and capacity 2020-02-25 14:52:35 +01:00
FontEditor LibGUI: Remove parent parameter to GUI::Widget constructor 2020-02-23 12:27:53 +01:00
Help AK: Make Vector use size_t for its size and capacity 2020-02-25 14:52:35 +01:00
HexEditor LibGUI: Remove parent parameter to GUI::Widget constructor 2020-02-23 12:27:53 +01:00
IRCClient AK: Make Vector use size_t for its size and capacity 2020-02-25 14:52:35 +01:00
PaintBrush LibGUI: Make GUI::Frame have the 2px sunken container look by default 2020-02-23 11:10:52 +01:00
Piano Piano: New timing system and zoomable piano roll 2020-02-27 10:21:13 +01:00
QuickShow LibGUI: Remove parent parameter to GUI::Widget constructor 2020-02-23 12:27:53 +01:00
SoundPlayer SoundPlayer: Cast Audio::Sample to float for fabsf() 2020-02-25 15:32:58 +01:00
SystemMenu AK: Make Vector use size_t for its size and capacity 2020-02-25 14:52:35 +01:00
SystemMonitor SystemMonitor: Add pagemap visualization for VM regions 2020-02-25 23:06:40 +01:00
Taskbar Userspace: Use Core::Object::add() when building interfaces 2020-02-23 11:10:52 +01:00
Terminal Terminal: Open settings as a modal window 2020-02-25 19:57:48 +01:00
TextEditor TextEditor: Pledge "thread" since it's needed by GUI::FilePicker 2020-02-24 19:51:22 +01:00
Welcome AK: Make Vector use size_t for its size and capacity 2020-02-25 14:52:35 +01:00
Makefile Build: Only look at SUBDIRS with Makefiles 2020-02-25 19:56:48 +01:00