Is it possible to play any soundtrack just by modifying the volume&playbackspeed of a monotone sound?

Yea like have a 1 second or 6 minute long sound of one note uploaded to roblox that just loops and every 1/60 seconds you change the playbackspeed(affects pitch) and the volume of the sound
Would this work to play any soundtrack or is there something besides these that is necessary/is roblox pitch too clamped/is 60hz not fast enough?

Thanks

2 Likes

You would surely have to give up some tones and depth of your song, but it should be achievable to have a somewhat identifiable representation of any song. A good example to look into would be the countless of MIDI music players that exist on Roblox already, as they used to do this before we could upload our own songs.

8 Likes

Thank you; I will take a look at the MIDI players
What would limit the ‘tones and depths’?

As an example, the sampling frequency of audio CDs is 44100Hz. I don’t think you’re going to be able to play “any soundtrack” in any recognisable way by downsampling to 60Hz.

1 Like

I was thinking of that but isnt it the sampling rate (necessary to catch the high pitches) but can the human ear really tell if such as a high pitch is played for such a little period of time? So maybe is it better phrased to ask about the point of ‘retina’ for ears?(apple retina display xd)

You can hear the difference:

44kHz | 5kHz

I don’t know that much about this kind of thing though. I’d suggest you give it a shot and see what your results are like.

Do these mean that the output audio pitch is being (or has the capability to be) modified 5k/44k times a second?

Also I can’t really listen to audios right now : /

The length of the sound has nothing to do with its sampling frequency. Sampling frequency is the number of samples that digital audio data has in one second. Samples are individual points in the sound that (assuming I have my information correct) determine the displacement of the medium used to play the sound, which would normally be your speakers.

Keep in mind, sound is just vibrations (over a surface), and vibrations are just oscillations of particles. These vibrations cause changes in air pressure, which trigger hair cells in our ears, which causes signals to be sent to our brain, thus making us hear sound!

Making a sound 1 second or 6 minutes does not change the amount of samples per second it has. If you wanted to accurately play any audio file using Sound objects in Roblox, you would probably need to start by processing the signal represented by the audio data, decomposing it into sine waves which you could play via the Sound objects. Doing this would require access to the raw audio data, however, and I do not know if that is possible. Also, you might have to modify these Sound objects more than 60 times per second, which might make this solution undesirable.

So a MIDI framework would be a more viable approach at the moment. In order to actualize such a framework, it would probably be good to have a bunch of short sound samples which loop, and just play them at different frequencies as they are denoted by the MIDI data. And yes, there are MIDI frameworks already available on Roblox. Those are great resources to peruse.

For one example of a MIDI framework, this was featured in a blog post by Roblox a few years ago.

4 Likes