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:


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


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


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:

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: