Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the actual spec on comments? Not what it says... #60

Open
squinkylabs opened this issue Jun 28, 2021 · 7 comments
Open

What is the actual spec on comments? Not what it says... #60

squinkylabs opened this issue Jun 28, 2021 · 7 comments

Comments

@squinkylabs
Copy link

the spec says when you hit / a comment begins, and lasts until the end of the line.

So what does sample=foo/bar.wav mean? clearly / does not always start a comment.

Now look at this!

/*
// **********************************************************************
// Converted with SF22SFZ Converter v1.929
// Copyright Jun 17 2019 , Plogue Art et Technologie, Inc
// **********************************************************************
// Conversion Date: Mon Jun 15 22:56:07 2020
// **********************************************************************
// Parent file    : F:/Recording/Petit Italien sf2/Petit Italien.sf2
// Soundfont      : 2.1
// Internal Name  : User Bank
// Optimised for  : SF SW Engine
// Intendend for  : SBAWE32
// Editor Used    : SFEDT v1.36:
// Sound Engineer : Vienna Master
// Comments       : Comments Not Present
// Creation Date  : Nov 13, 2005
// Copyright      : Copyright Information Not Present
*/

Apparently Sforzando thinks multi line comments like C++ are a thing. Do Either multi-line comments are a thing, or else */ on a line by itself means "ignore:.

@jpcima
Copy link
Contributor

jpcima commented Jun 28, 2021

So what does sample=foo/bar.wav mean? clearly / does not always start a comment.

Under some older software, it would indeed signify a comment.
If aiming to maximize the compatibility of the SFZ instrument, one would instead use a \ separator.
Although this Cakewalk software is dated and it's possibly not worth supporting by the modern standards.
Sforzando and sfizz have // and /* styles only, not /.

@squinkylabs
Copy link
Author

squinkylabs commented Jun 28, 2021

And what does /* mean? It isn't mentioned in the the spec. Is it a multi line comments that only ends when */ is found? If so, how is the the content process after the comment end? for example:

/* multi line comment
  second line */ <region>    // should that region heading get processed or ignored?

@squinkylabs
Copy link
Author

so, again, the multi-line comment (shown above) would not be a comment, according to the published spec, here. Yet I suspect that since sforzando actually will output this that the spec is incorrect? Not trying to be difficult here - just trying to make a player that will work right. But, lacking an answer I've implemented multi line comments according to the c++ spec.

@jjceresa
Copy link

the spec says when you hit / a comment begins, and lasts until the end of the line.
So what does sample=foo/bar.wav mean? clearly / does not always start a comment.

In the player I am making, I prefer respect the spec for backward compatibility. So when a / character is part of an opcode value this character is considered part of the file name not as the start of a comment.

Sforzando and sfizz have // and /* styles only, not /.

This is strange. I don't understand why those player doesn't not respect '/' style comment ?

@jjceresa
Copy link

If aiming to maximize the compatibility of the SFZ instrument, one would instead use a \ separator.

/' or ` separator works for players running on Windows. Not sure that \ in file path will work on linux. In this case a sfz file edited on Windows will not be accepted on a sfz player running on linux.

@jjceresa
Copy link

Sorry for the bad formatting

If aiming to maximize the compatibility of the SFZ instrument, one would instead use a \ separator.

/ or \ separator works for players running on Windows. Not sure that \ in file path will work on linux. In this case a sfz file edited on Windows will not be accepted on a sfz player running on linux.

@redtide
Copy link
Contributor

redtide commented Feb 11, 2023

About line comments, looking in the test suite and in the original documentation, despite the statement, 2 forward slashes was used.
Thinking also about #include and #define opcodes it's clear where they comes from, so it looks strange to me what was the choice for the original syntax.

Apparently Sforzando thinks multi line comments like C++ are a thing

Also sfz 2 (Cakewalk Synthesizers 2nd edition, p334), including the 2 forward slashes for single lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants