The mystery of spaces around an equal sign (opcode = value)

Discussion on the SFZ implementation and opcodes available in the ARIA engine.

Moderators: eric_telemaque, davidv

sig-ex
Posts: 5
Joined: Sun Jan 31, 2016 7:08 pm
Contact:

The mystery of spaces around an equal sign (opcode = value)

Postby sig-ex » Thu Feb 11, 2016 12:32 pm

Hi,

Just wanted to share some not very well known behavior after spending time figuring out what's wrong with my sfz code. I've been getting "<region> cleaning opcode () failed" error which was not very helpful in telling me what's wrong. As it turns out, it was the spaces around my equal sign that was causing the error (typing habit from my technical background :lol: ). At first I thought it was because of incompatible ASCII encodings since I worked with different OS's.

To clarify with an example:

Code: Select all

// this will fail
sample = elephant-G3.wav
pitch_keycenter = g3

// this is ok
sample=elephant-G3.wav
pitch_keycenter=g3


Even weirder is that spaces are fine if it is just for the first opcode in a region.

Code: Select all

// this will work
<region>
sample = elephant-G3.wav
pitch_keycenter=g3

// this will fail
<region>
sample=elephant-G3.wav
pitch_keycenter = g3


I also tried out with Cakewalk Dimension LE to see if this is some type of less documented standard. It also gives an error (even in the second case that would work for sforzando). So now, I believe, it's not really a problem and I should just stick to no spaces around equal signs. It is just rather enigmatic when it happens, and the cause is quite subtle. I hope this will save you all some time. :)
The signal experimentalist
http://sig-ex.com/

pljones
Posts: 100
Joined: Wed Oct 15, 2014 2:05 pm

Re: The mystery of spaces around an equal sign (opcode = value)

Postby pljones » Fri Feb 12, 2016 2:18 am

René's original expression of this was that the "=" is part of the opecode and the opcode value is everything until the next space (except for sample=, which eats everything to end of line). The "<region>" etc headers complicate the parsing a bit.

davidv
Site Admin
Posts: 1567
Joined: Tue Mar 02, 2004 7:23 pm
Contact:

Re: The mystery of spaces around an equal sign (opcode = value)

Postby davidv » Fri Feb 12, 2016 10:24 am

There shouldn't be any spaces around the = sign.
The fact that it works sometimes is really a side effect of different parsing methods in different players and are totally implementation dependent.

We are "Magically trimming" some space and all ASCII characters under "space" (decimal 32). But again, the exact behavior may vary as everyone is open to implement his parser his own way.
David Viens,
Plogue Art et Technologie Inc. Montreal.
http://www.plogue.com

sig-ex
Posts: 5
Joined: Sun Jan 31, 2016 7:08 pm
Contact:

Re: The mystery of spaces around an equal sign (opcode = value)

Postby sig-ex » Sun Feb 14, 2016 5:06 pm

Thank you both for clarifying pljones and David.

It's an easy search and replace fix anyway, once you know the rule. Of course, I'll consistently obey this rule from now on regardless of whether it works sometimes. :wink:
The signal experimentalist
http://sig-ex.com/


Return to “SFZ Programming”

Who is online

Users browsing this forum: No registered users and 1 guest