# Sounds into sequences?

This project suggests the question

What can we say about the totality of all sounds that could be generated from sequences in this way?

Certainly not all sounds are possible, since the sounds are all pulse trains, and so cannot represent "smooth" sounds (e.g., sine waves), at least not very well.

To investigate this question, we might endeavor to "reverse engineer" a sequence from a sound file.

Given a sound file, we might create a sequence in the following way: if the amplitude of the j-th sample is positive, then j is in the sequence; otherwise, j is not in the sequence.

Here is an example.

Here is a short sound file of a few notes played on an acoustic guitar:

guitar01sub2.wav

Following the above procedure, we use the file to create a sequence of positive integers. The sequence begins:

0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,90,91,92,93,115,116,117,118,119,120,...

Converting this sequence into a sound using the standard method of this project yields this sound:

output1.wav

This sound has a lot in common with the original sound, though we can hear that it is louder, noisier, and distorted (in the conventional audio sense of the word).

In an attempt to achieve a sound that perhaps is less distorted, we might consider a modification of the procedure above.

Suppose now, for each sample j of the input sound file, we generate a random number z between 0 and 1, and compare it to the amplitude of the sample. If z is less than the amplitude, then j is included in the sequence; otherwise it is not. (Many other approaches are possible here: generally, we might compare z to any increasing function of the amplitude; each will have a different result).

One application of this method resulted in a sequence that began:

304,305,319,340,352,360,476,479,495,496,497,499,500,513,528,530,532,533,534,538,539,543,544,545,652,660,661,663,665,...
and, converting the sequence into sound using our usual procedure yields this: output2.wav

Though very noisy, some aspects of the original sound come through as less distorted, to my ears anyway.

More experimentation can be done!

Python code for creating the two sequences above: