3.1 Using the plugin

Using the plugin is really simple since there are only two functions that can do all the magic: soundfx.Process() and soundfx.Generate(). soundfx.Process() can be used to apply one or multiple sound effects to a Hollywood sample and soundfx.Generate() can be used to synthesize new audio tones from a given description.

soundfx.Process() basically takes a number of effects in a table and applies them to the Hollywood sample(s) passed to it. Note that it will never modify existing samples but always create new samples that contain the desired modifications. For example, here's how to reduce the volume of sample 1 by 50% and store the result as sample 2:

 
soundfx.Process(1, 2, {{"vol", "0.5"}})

It's also possible to pass multiple samples to soundfx.Process(). Here's how to reduce the volume of samples 1 and 2 by 50% and store the result as sample 3:

 
soundfx.Process({{ID=1},{ID=2}}, 3, {{"vol", "0.5"}})

The call above will also join samples 1 and 2. If you want to mix samples 1 and 2 instead of joining them, you need to set the Mode parameter to #SOUNDFX_MIX like this:

 
soundfx.Process({{ID=1},{ID=2}},3,{{"vol","0.5"},Mode = #SOUNDFX_MIX})

When passing multiple samples to soundfx.Process() it's also possible to adjust the volume of the individual samples. Here's a call that mixes samples 1 and 2 into a new sample 3. The volume of sample 1 will be reduced to just 20% of the original volume:

 
soundfx.Process({{ID=1, Volume=0.2}, {ID=2}}, 3, Mode = #SOUNDFX_MIX})

You can also apply multiple effects to samples. Here's how to apply the flanger and norm effects to sample 1 and store the result in sample 2:

 
soundfx.Process(1, 2, {{"flanger"}, {"norm"}})

You can also use soundfx.Process() to convert samples into new audio formats. For example, if sample 1 is in 8-bit mono format you can use this call to convert it to 16-bit stereo and store the result as sample 2:

 
soundfx.Process(1, 2, {Bits = 16, Channels = 2})

If you want to synthesize new sound tones, use the soundfx.Generate() function. For example, this call creates a synthesised A minor seventh chord with a pipe-organ sound and stores it as sample 1:

 
soundfx.Generate(1, {{"synth", "sin", "%-12", "sin", "%-9","sin","%-5",
          "sin","%-2"},{"fade", "h", "0.1", "1", "0.1"}, Channels = 1})

The code above uses the synth and fade effects to generate and process the audio data. As you can see, different parameters are passed to each effect. See the next chapter to learn how to pass parameters to effects.


Show TOC