sfz / sfz.github.io

SFZ Format documentation website
https://sfzformat.com
Creative Commons Zero v1.0 Universal
30 stars 33 forks source link

Path file coherency in #include directive and sample opcode #72

Closed jjceresa closed 1 year ago

jjceresa commented 2 years ago

Both #include directive and sample opcode syntax specifies a file path like this

include "header.sfz"

... sample=sample.wav

In the example on page https://sfzformat.com/opcodes/include, the include file path syntax seems different as the file path is surrounded by double quote character "

Please, does this double quote character is part of the sfz language syntax ?.

For coherency, I hope that this double quote isn't part of the sfz syntax. Also this would simplify parser implementation.

The #include directive is an ARIA extension. Does anyone could make a try on ARIA player using include file path without double quote character ?

Many thanks by advance for your time.

DSmolken commented 2 years ago

Yes, the double quotes are required for things to work. Just tested that on an instrument, and removing the double quotes results in no errors, but the instrument behaving as if nothing was included there.

I suppose if we're missing "quotes" on some page with include, they should be "added", but if they're currently there they definitely need to be there, and I'll add a clarification that they are required.

redtide commented 2 years ago

The #include macro/directive opcode might be taken from C language, so if anything, the incoherence is in the sample opcode value instead.

DSmolken commented 2 years ago

Apparently works the same way in Cakewalk stuff, too. So, yes, it is not very coherent with sample, but we've checked and it really is like this.

jjceresa commented 2 years ago

Yes, the double quotes are required for things to work. I suppose if we're missing "quotes" on some page with include, they should be "added", but if they're currently there they definitely need to be there, and I'll add a clarification that they are required.

Thanks you for your try. I'm fine with your confirmation. So if you intend to add a clarification it will be sufficient to add that "the double quote character is required and part of the syntax".

Apparently works the same way in Cakewalk stuff, too. So, yes, it is not very coherent with sample, but we've checked and it really is like this

Ok, thanks again. So #include directive works also in Cakewalk. This could be added in the #include page.

The #include macro/directive opcode might be taken from C language, so if anything, the incoherence is in the sample opcode value instead.

Please, in both ARIA an Cakewalk engine, could you make a try in the sample opcode with the file path surrounded by double quote ? . Many thanks for your help.

DSmolken commented 2 years ago

Updated the include opcode, need to try quotes in a sample path and then update sample accordingly.

jjceresa commented 2 years ago

Updated the include opcode. Thanks.

need to try quotes in a sample path and then update sample accordingly. I forgot to mention that default_path opcode (https://sfzformat.com/opcodes/default_path) syntax is the same that sample opcode.