sfizz icon indicating copy to clipboard operation
sfizz copied to clipboard

Embedded sample data

Open jpcima opened this issue 4 years ago • 2 comments

Dropzone and Rapture SFZv2 supports embedding of samples.

See: https://github.com/sfzformat/sfzformat.github.io/issues/23

Note that parsing this data is necessarily context-dependent; the parser needs the knowledge that it's handling a binary-valued opcode and treat accordingly.

If it were to handle this case, the current parser would need adapting.

  • open the ifstream with binary mode
  • don't replace all the whitespace with ' ' in advance (would corrupt the coding)
  • don't look at the next = for opcode's end, but rather the $ final marker as indicated in the reference post

jpcima avatar Feb 29 '20 08:02 jpcima

Is the channel sfztool, @rghvdberg has mentioned an idea of a virtual filesystem that can load SFZ files and/or samples. (not sure I got the idea correctly, elaborate as needed)

It's not unlike the sample embedding above, but except this could be extended to SFZ files when you load them by #include.

The target of #include could refer to a pseudo-file that is registered in sfizz's virtual paths, and this can serve as an entry point to inject software-generated SFZ elements into sfizz, dynamically. It's a quick, and maybe a little dirty, way of realizing some custom sfz-based synths.

jpcima avatar Mar 13 '20 19:03 jpcima

So with #1041 base64 data can be read from the sfz file, only missing AIFF. I'm kind of on the fence about the parsing format of Rapture: it's not really practical to have a binary format within a text file.

However, reading zlibbed/gzipped data encoded as base64 could be nice to gain a little efficiency.

paulfd avatar Nov 24 '21 12:11 paulfd