11.4 Questions for the reader#
Exercise 65
Extracting a sample. A recording at \(f_s = 48{,}000\) Hz lasts exactly \(3\) seconds.
How many audio samples \(N\) does it contain?
You want a sample that starts \(1.2\) seconds into the recording and lasts \(250\) ms. What are its offset \(m\) and length \(M\)?
For this length \(M\), what is the largest valid offset \(m\)? How many seconds into the recording does that sample start?
Reveal solution
\(N = 144{,}000\)
\(m = 57{,}600\) and \(M = 12{,}000\)
\(m = 132{,}000\), which starts \(2.75\) seconds into the recording
Exercise 66
Beats and steps. A drum pattern is written on a grid in which each column is a sixteenth note, a quarter of a beat. The pattern plays at a tempo of \(90\) BPM.
How long does each column last, in milliseconds?
Counting columns from \(0\), at what time does a hit in column \(12\) play? Give your answer in beats and in seconds.
Reveal solution
\(\approx 166.7\) ms
\(3\) beats, or \(2\) seconds
Exercise 67
Repitching. You have a \(2\)-second recording of A4 (\(440\) Hz), and you want to shift it up \(3\) steps to C5.
By what factor \(\frac{T_1}{T_2}\) must you speed up its playback?
What is the fundamental frequency of the result?
How long does the result last?
Reveal solution
\(2^{3/12} \approx 1.189\)
\(\approx 523.3\) Hz
\(\approx 1.68\) seconds
Exercise 68
Multisampling. A sampled piano records each of its \(88\) keys at \(4\) different loudness levels. Each recording lasts \(10\) seconds, in stereo, at \(f_s = 48{,}000\) Hz, with \(24\)-bit (\(3\)-byte) audio samples.
How much storage does the library need, in gigabytes?
To save space, you instead record every third key (keys \(1, 4, 7, \ldots, 88\)), and you play each of the other keys by repitching the closest recording. How many keys do you record, how much storage does the library need now, and what is the largest pitch shift \(|k|\), in steps, that you will ever need?
Reveal solution
\(\approx 1.01\) GB
\(30\) keys, \(\approx 0.35\) GB, and \(|k| \leq 1\)
Exercise 69
Counting loops. A recording of a note has a sustain loop spanning \(t_s = 0.15\) to \(t_e = 0.40\) seconds, and its release lasts \(T_R = 0.25\) seconds. How many times must the loop repeat to play a note lasting \(T = 2.4\) seconds?
Reveal solution
\(8\) times
Exercise 70
Choosing loop points. A sustained note with a fundamental frequency of \(f_0 = 440\) Hz is recorded at \(f_s = 44{,}100\) Hz.
How many audio samples long is one cycle of the fundamental?
What is the shortest loop that spans both a whole number of cycles and a whole number of audio samples? Give its length in cycles, in audio samples, and in milliseconds.
Reveal solution
\(\approx 100.23\) audio samples
\(22\) cycles, which is exactly \(2{,}205\) audio samples, or \(50\) ms
Exercise 71
Loudness. Using this chapter’s mapping from a loudness \(\ell \in (0, 1]\) to decibels:
What gain, in decibels and as an amplitude factor, does a note played at \(\ell = 0.75\) receive?
Approximately what loudness \(\ell\) halves the amplitude of a note?
Reveal solution
\(-20\) dB, an amplitude factor of \(0.1\)
\(\ell \approx 0.925\)