I’m making an Audacity plugin that simulates what I remember my AtGames Arcade Portable (the one described at http://segaretro.org/Arcade_Portable) sounding like, using the music track “Explorer” from Columns III, a game for the Genesis/Mega Drive that features on the AtGames Arcade Portable, even the Blaze-branded or Tectoy-branded versions, for reference. The only problem with that plugin now is the error “Distortion: Could not use settings below. Default settings will be used.” comes up when it’s run. Both effects are successfully applied, though. Here’s the plugin’s code, in case that’ll help:
;nyquist plug-in
;version 1
;type process
;name “Arcade Portablefy”
(aud-do “ChangePitch: Percentage=-22, SBSMS=0”)
(aud-do “Distortion: Type=Hard Overdrive, DC Block=False, Threshold dB=-6, Noise Floor=-70, Parameter 1=50, Parameter 2=50, Repeats=1”)
There are several errors in this line:
(aud-do "Distortion: Type=Hard Overdrive, DC Block=False, Threshold dB=-6, Noise Floor=-70, Parameter 1=50, Parameter 2=50, Repeats=1")
It should be:
(aud-do "Distortion: Type=\"Hard Overdrive\" , DC_Block=0, Threshold_dB=-6, Noise_Floor=-70, Parameter_1=50, Parameter_2=50, Repeats=1")
Things to note:
- In true/false must be entered as 0 (false) or 1 (true).
- Command parameter names can’t have spaces.
- When parameter values are strings (text), they should be quoted, but because we are quoting within a quoted string, the quotes must be “escaped” with back-slashes. Hence: Type="Hard Overdrive" ,
I did reference the Scripting Reference section of the Audacity manual (http://wit.audacityteam.org/scroller-contents/scripting_reference.html) when trying to fix that error. But I didn’t think to put 0 for False or 1 for True, or to put backwards slash speech marks between Hard Overdrive. I did try doing some messing around with the “Distortion” aud-do statement in my code, but none of that fixed that error. As it doesn’t say so in that part of the manual, I think that part of the manual should be modified to say False is 0, True is 1 and strings as parameters need to have a " on each side wherever necessary so it’s hopefully easier to learn how to use the scripting commands documented in that part of the manual.
This is a very new feature and is still being actively developed. Most of the documentation for Scripting is by the developer that wrote the feature. Given the technical nature of Scripting, it’s good that the developer provided documentation - software developers are notorious for not providing docs. In due course, the documentation will be improved and extended.
The manual does actually say that, but only once, so easy to miss. In the yellow box at the top of this page https://manual.audacityteam.org/man/scripting_reference.html
- Boolean values must be given as 0 or 1, NOT true or false.
A little “trick” that I find useful when working out Scripting commands, is to test the commands in a Macro, then look in the Macro file to see how Audacity has written the command. Macros are stored as text files in a “Macro” folder inside Audacity’s settings folder (see here for the location: https://manual.audacityteam.org/man/preferences.html#stored)
But I read
- Boolean values must be given as 0 or 1, NOT true or false.
to imply that 0 = true & 1 = false (just down to the ordering in the sentence).
Should we be changing that sentence order - or should we, as childishbeat suggests, explicitly state “False is 0, True is 1” ? Or both ?
Peter.
Should we be changing that sentence order - or should we, as childishbeat suggests, explicitly state “False is 0, True is 1” ? Or both ?
I’ve updated it in the alpha manual to:
- Boolean values must be given as > 1 > (true) or > 0 > (false).
I’ll email you (waxcylinder) to discus other improvements we can make.
I think that it’ll be a lot easier when we have more good, well explained examples.