File format for data files on RPi
I want to be able to run data-files synced with audio files to trigger light events. I am creating the data-files in MAX. Then load the file that is for the audio file I want to play. What file type is the data files? How do I change data file when I change audio file in the multi buffer?
I'm not sure what you mean by "run data-files", currently the runner only supports loading audio files, but you could interpret that audio however you want in your patcher.
we use libsndfile on the rpi to load audio files for exposed buffer~ and data objects. libsndfile supports quite a few formats but wav and aiff are likely the easiest to deal with.
If you're trying to synchronize audio and other event data using audio files, can you simply create a multi channel audio file where the first few channels represent your audio and others represent events? then you can just load that into a buffer and use groove to play the audio back and the sync out to to drive other objects that read your event channels?
Sorry for the language, I wanted to "load a data-file", which I created in MAX, into the data object on RNBO on RPi.
I gave up on that and now I am creating a sound file instead to load into a buffer~, as you proposed. The data coding went quite advanced with two int digits for addressing devices, the first two decimals the characteristics and then three decimals for value, saved on a sample frame.
Now next step is to build a sequencer for the light events and read it in and out of the buffer~ which I am quite struggling with. This is probably a too advanced project for me.
one thing to consider with using buffers is that currently the runner only saves buffers as 16-bit fixed point wav. If you're trying to build encode and decode specific bits into a single frame, you might end up losing some of that when you save. I hope to add 32-bit floating point saving eventually, just hasn't happened yet.
Feel free to follow up with more questions if you're struggling, ideally creating new topics if that applies.
Well, I construct and save the buffers in MAX. Then I want to play them on RNBO runner, so 32 bit will work? My biggest issue right now is to get the peeks red. Metro 1 was to heavy, and metro 5 seems to give me jumpy values. Maybe something else is wrong, like the coding/recoding of the lists into floating via codebox. It is a difficult problem I believe and I am looking into running midifiles in sync in other software parallell to the RNBO runner instead..
The runner should be able to load Float32 wav files no problem, it just can't create them itself just yet, so if you're authoring the audio files in Max you should be good to load them in RNBO.
RE your peaks, I'm not exactly sure what you're meaning, 1ms light updates seem pretty fast, even 5ms would mean you're updating your lights at 200Hz.
Ok, great
But 32 bit was still to little, so I split the data in one sample with adress, one sample with value, so 16bit can be enough.
The problem is I have ten devices with RGB and some other values, so a colorsweep takes up quite some place when I spread them out, and not adding them together as one value. Which I do fear I will need to do.
If you have 10 devices with RGB + 5 additional points of data, at 200hz that is only 16000 values per second. Maybe you're better off not encoding the audio data in the same file as the sample rate requirements are totally independent, but it doesn't seem like you need to combine data at all, just use different channels for each piece of data.. I'm not sure how much additional data you have but In my scenario this would end up being a 80 channel audio file. I haven't actually tried loading or authoring anything like this but wav should support it?
I use 11-19 as device index, then 11-19 as controller value. Så my first try was getting songpostition, multiply with sample rate and put for instance 12.18127 as a value into 220 samples from the “start sample“ to get a datawindow of 5ms to read from.
And then read the same value with peek during playback and devide the value into device 12 controller 18 value 127.
NOT a perfect system
does your device index values change over time? if not, seems like you don't need to store them in the audio file.
anyways, sounds like you've got something working?