mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 01:09:25 +00:00
This commit adds basic support for importing, viewing and playing WAV samples at different pitches. Naming issues: - We are using the Sample struct from Music.h, but also the Sample struct from LibAudio (Audio::Sample). This is a little confusing. set_recorded_sample() finds the peak sample and then divides all the samples by that peak to get a guaranteed min/max of -1/1. This is nice because our other waves are also bound between these values and we can just do the same stuff. This is why we're using Audio::Sample, because it uses floats, whereas Music.h's Sample uses i16s. It's a little annoying that we have to use a mixture of floats and doubles though. For playback at lower frequencies, we're calculating in-between samples, rather than just playing samples multiple times. Basically, you get the current sample and add the difference between the current sample and the next sample multiplied by the distance from the current sample. This is like drawing the hypotenuse of a right-angled triangle.
16 lines
256 B
Makefile
16 lines
256 B
Makefile
OBJS = \
|
|
AudioEngine.o \
|
|
MainWidget.o \
|
|
WaveWidget.o \
|
|
RollWidget.o \
|
|
SamplerWidget.o \
|
|
KeysWidget.o \
|
|
KnobsWidget.o \
|
|
main.o
|
|
|
|
PROGRAM = Piano
|
|
|
|
LIB_DEPS = GUI Gfx Audio IPC Thread Pthread Core
|
|
|
|
include ../../Makefile.common
|