SF18 Build 21 scripting bug Solution Reminder

Unsounded wrote on 9/29/2024, 12:00 AM

The following script works to normalize sound in the data window:

using System;
using System.IO;
using System.Windows.Forms;
using SoundForge;

public class EntryPoint {
public void Begin(IScriptableApp app) {
	app.CurrentFile.DoEffect("Normalize", "[Sys] Normalize RMS to -16 dB (music)", app.ActiveWindow.EditRegion, EffectOptions.EffectOnly);
	app.CurrentFile.WaitForDoneOrCancel();
	app.DoMenuAndWait("File.Save", false);
}

public void FromSoundForge(IScriptableApp app) {
	ForgeApp = app; //execution begins here
	app.SetStatusText(String.Format("Script '{0}' is running.", Script.Name));
	Begin(app);
	app.SetStatusText(String.Format("Script '{0}' is done.", Script.Name));
}
public static IScriptableApp ForgeApp = null;
} 

I can use other built in presets marked as [Sys]. The problem was I couldn't use my own presets. That was until I remembered the post by SP from two years ago:

... This has to be some kind of bug. So I made the following changes.

  • I deleted the custom preset and I changed EffectOptions.EffectOnly to EffectOptions.DialogFirst.
  • Then I ran the script. The Volume-Dialog opened. I created the preset and saved it under a name.
  • Then I canceled the process.
  • Then I changed EffectOptions.DialogFirst back to EffectOptions.EffectOnly.

It now works every time without problems. Even after restarting the application.

SP's method worked with the Normalize dialogue as well. This is an extremely annoying bug as it makes making changes to scripts tedious. Moreover, I've had my volume scripts stop working on occasion and I have to go through the whole process of making each one manual and then auto again. I hope this is fixed in some future update.

Comments

john_barr wrote on 9/29/2024, 7:03 AM

@Unsounded

Please send an email to infoservice@magix.net and report this behavior.
I sent an email to support and they said that Sound Forge development is not very active.
Maybe, it might take a long time to fix the issues. Or it may never be fixed.

SP. wrote on 9/29/2024, 1:12 PM

Yeah, I still use mostly Sound Forge 12 because of all the bugs that were introduced in later versions.

john_barr wrote on 9/30/2024, 6:50 AM

@SP.

You are right. And the forum moderators got angry when I said that Magix damaged Sound Forge.