Storing data as a sample?


#1

I got to thinking, has anyone tried storing data in the form of an Audio signal or the likes ?

Something like if a K Rate square wave, and the value is represented by the peak of the signal for example.
You may have 20 values to load for whatever reason, you play the square file that contains 20 square cycles with the peak level of each cycle representing the value you need and so on. Or maybe it could be stopped at the cycle you want the value from..
Or likely many other ways of using it I haven't thought of yet.

You could have 100's of values recalled within seconds maybe !

You would just need a way of creating the sample of values in the first place.


#2

im not really sure what you are driving at....
data is data... the sample data is read as raw data, its just interpreted as audio....

take my wavetables, they are stored as 'samples', and then i interpret this data as waves.
(they are read with table/load as raw data)
... basically you and then use table/read (no interp is useful if you consider each value as unrelated), which is 'random access' , you don't have to read it sequentially.

so , I guess my 'thinking' is flipped, its not about interpreting a sample as data, but a sample is data.

thinking like this, means you get 48000 data points per second, not 100's :slight_smile:

of course on the computer, then if you used a 'wave editor' to edit the data, then I guess there you might treat the 'data' as a sample BUT its unlikely the wave editor is going to be useful in that scenario. unless the underlying data is still a wave (eg. you can do this for wavetables)

but...as I said at the beginning, I could be completely misunderstanding what you mean


#3

I am also trying to understand what you want to do.

From what I understand, you are trying to save data, so it is possible to recall it?

Is this data audio or do you mean you want to save values of for example a parameter and save it to a table for later recall?

You can save any data to sd card, but it will take a little learning to do it. You could take a look at Tim Vets suggestion for anon5189335(my old profile). That give you the ability to save random numbers to sd card... If yu want not random you will probably need to take another apporach, but Tims patch will give you some inside knowledgde om how to save save data and recall it :slight_smile:

Good luck

Tims Suggestion:


#4

Oh !! :sob: I have probably confused myself and everyone in the process, sorry.

I guess to explain myself a little clearer and try to use the idea of presets (lets say 20 presets for 20 different parameters) as one possible use, the idea is to create a square wave with 20 cycles, one cycle per preset, and the peak level for that cycle will represent the preset value. If you want to upload a preset value for all 20 parameters, you could have a 20 part mux, as the wave passes zero each time triggers through the parameters for the next preset to be applied and so on until all 20 values have been passed.

I just thought, being new to the synth side of things, and in addition the DSP learning video I am doing showing the simple use of some values to create waves, why not go the other way around, LFO's are already being used to apply values through the patch, why not use recorded ones to pass values to parameters and others etc..

Thanks for your time trying to understand...:confused:


#5

of course its possible...

fundamentally, the thing about a wave/sample is you have time as one axis, and data on the other... and they are 'played' back at a given rate. (lfo in your example) ... its efficient since you don't need to store 'time', just data values. so if you want to store a 'stream' of data its cool.
(if the data doesn't change on most 'ticks' though, its often more efficient to store time and data pairs, to reduce the data size ... if thats important!)

but hey, messing with data to produce sound can produce some interesting results... its why generate music from weather or stock data. or go the other way, take a sample and use it for something else... (say at control rate)

axoloti is good for this kind of 'messing' about, and find novel ways to do things.


#6

Well I think I am going to have to give this a go.
I will create a single cycle of a square wave in Octave, -1, -1, 1, 1, -1, maybe 20hz, save it as a WAV file, convert it to raw, save on SD card, and see if I can get it to play and switch on a toggle based on its peak value of 1.
Guess I have to start somewhere.!


#7

I did some objects (working at control rate) that store data to tables and put it out correctly when you re-load it from SD:

Maybe thats helpful here


#8

Thanks @rbrt
Sound pretty cool, will likely be giving it a go.
I guess the main goal here, is to use the DSP concept, so storing values within the sound wave itself, and calling them as you would a sound sample, but to extract values instead of Audio.
It just somehow seems cool that I could maybe store patch setup values or something in simple wav files, and have a whole list of them to call upon.