[Fuse] Suck Less Audio File Modifier

User avatar
SecondMan
Site Admin
Posts: 2806
Joined: Thu Jul 31, 2014 5:31 pm
Location: Vancouver, Canada
Been thanked: 114 times
Contact:

[Fuse] Suck Less Audio File Modifier

#1

Post by SecondMan » Mon Sep 07, 2015 12:25 pm

Hurray! With Suck Less Audio you can modify parameters in Fusion and Fusion Studio with a 16 bit WAV file!

Please note that a newer version of Suck Less Audio is available on Reactor.


SuckLessAudio_1.2_Screenshot.PNG

Wave File - Loads a WAV file. The format has to be WAV (Microsoft) signed 16-bit PCM. If there is interest (perhaps from the Mac side?) I can look into the AIFF structure as well and see if I can manage to add that. MP3 or the likes will never happen ;)
Reload Sample - Reloads the WAV file from disk. Handy when editing audio on-the-fly (thanks ploveday for the tip!)
Select Channel(s) - Will only show when a stereo sample is loaded. Select left, right or both channels as your input
Sample Start Frame - Starts the File Sampling on this frame (so if you want your audio to start at 1001, put 1001 in here)
Mode - how SLA interpolates the samples:
  • Max: If sample A is +3 and sample B is -4, SLA will return -4 (because 4 is higher than 3)
  • Unsigned Max: If sample A is +3 and sample B is -4, SLA will return +3 (because +3 is higher than -4)
  • Min: If sample A is +3 and sample B is -4, SLA will return +3 (because 3 is less than 4)
  • Unsigned Min: If sample A is +3 and sample B is -4, SLA will return -4 (because -4 is less than +3)
  • Average: If sample A is +3 and sample B is -4, SLA will return -0.5 (because (3-4)/2 = -0.5)
  • Unsigned Average: If sample A is +3 and sample B is -4, SLA will return +3.5 (because (3+4)/2 = 3.5)
  • Median: If sample A is +3, sample B is -4 and sample C is -2, SLA will return sample C (because sorting returns [-4, -2, 3])
  • Unsigned Median: If sample A is +3, sample B is -4 and sample C is -2, SLA will return sample A (because sorting returns [2, 3, 4])
Proxy (for sampling) - A 16 bit WAV files contains a LOT of samples. Typically much more than is needed, so it can put unnecessary strain on processing (a 44100Hz stereo sample contains 3675 samples per frame at 24 fps). So the proxy allows for sampling every [value]th frame, so you can have a nice realtime experience enjoying great results :)
Amplitude Scale - Multiplies the result by this factor.
Amplitude Offset - Offsets the result by this value.
Time Scale - Scales the length of the result. So a value of 2 in here will stretch the result over twice as many frames.

To use, download the file and put it in your Fuses/modifiers directory. Right-click any parameter in Fusion and select Modify With -> Audio (WAV). That's it!

Let me know if there are any issues or wishes. This thing is spanking new, so not that much testing has gone into it. It should work with all bitrates, mono and stereo. I'd like to hear if it works well on the Mac version of Fusion.

Enjoy! :)

Suck Less Audio is free to use. Donations are not required or expected, but if you find the tool useful, they are very much appreciated and can be made here.
You do not have the required permissions to view the files attached to this post.

Tags:

User avatar
Tilt
Global Moderator
Posts: 336
Joined: Sat Aug 02, 2014 4:10 am
Location: Munich, Germany
Been thanked: 1 time
Contact:

Re: [Fuse] Suck Less Audio File Modifier

#2

Post by Tilt » Mon Sep 07, 2015 1:11 pm

wow :shock:

User avatar
Dunn
Moderator
Posts: 468
Joined: Mon Aug 04, 2014 4:27 am
Location: Hamburg, Germany
Been thanked: 16 times
Contact:

Re: [Fuse] Suck Less Audio File Modifier

#3

Post by Dunn » Mon Sep 07, 2015 2:17 pm

This is really cool. :o

Is this Fuse only for Fu8 ?

User avatar
SecondMan
Site Admin
Posts: 2806
Joined: Thu Jul 31, 2014 5:31 pm
Location: Vancouver, Canada
Been thanked: 114 times
Contact:

Re: [Fuse] Suck Less Audio File Modifier

#4

Post by SecondMan » Mon Sep 07, 2015 3:14 pm

@Tilt

Thanks! :)

I learned a LOT making this. I'll do a Fuse Box writeup of the internal workings later, there's some really fun stuff in there.

@Dunn

Thank you, too! :)

Nope, definitely works for Fu7, too and I can't think of a reason why it wouldn't work for earlier versions.

(One thing that I seemed to perceive while making this is that the UI feedback (viewer, slider anims refresh) in Fu8 is slightly faster than Fu7.)

MilosL
Posts: 46
Joined: Thu Feb 12, 2015 10:53 pm
Location: Cologne, Germany
Contact:

Re: [Fuse] Suck Less Audio File Modifier

#5

Post by MilosL » Tue Sep 08, 2015 2:25 am

Thanks! Works great in Fusion 7.5 / Win7 64bit.

I tried to animate some Text+ parameters - all works perfectly as expected. The only thing - with motion blur drops processing speed/frame rate dramatically.
It would be wonderful to have some frequency filters as additional outputs - something like low pass, high pass... with adjustable frequencies...

User avatar
Dunn
Moderator
Posts: 468
Joined: Mon Aug 04, 2014 4:27 am
Location: Hamburg, Germany
Been thanked: 16 times
Contact:

Re: [Fuse] Suck Less Audio File Modifier

#6

Post by Dunn » Tue Sep 08, 2015 2:39 am

Just Found out why its not showing up on Fu6.4 ..
You might wanna change the name here ---> FuRegisterClass("TimeMachine", CT_Modifier, { <----- ;)

User avatar
SecondMan
Site Admin
Posts: 2806
Joined: Thu Jul 31, 2014 5:31 pm
Location: Vancouver, Canada
Been thanked: 114 times
Contact:

Re: [Fuse] Suck Less Audio File Modifier

#7

Post by SecondMan » Tue Sep 08, 2015 9:09 am

Dunn wrote:Just Found out why its not showing up on Fu6.4 ..
You might wanna change the name here ---> FuRegisterClass("TimeMachine", CT_Modifier, { <----- ;)
Oooh - haha, totally missed that. :D

Thanks a lot for reporting, v1.01 is now available for download. :)

User avatar
SecondMan
Site Admin
Posts: 2806
Joined: Thu Jul 31, 2014 5:31 pm
Location: Vancouver, Canada
Been thanked: 114 times
Contact:

Re: [Fuse] Suck Less Audio File Modifier

#8

Post by SecondMan » Tue Sep 08, 2015 10:03 am

MilosL wrote:Thanks! Works great in Fusion 7.5 / Win7 64bit.

I tried to animate some Text+ parameters - all works perfectly as expected. The only thing - with motion blur drops processing speed/frame rate dramatically.
It would be wonderful to have some frequency filters as additional outputs - something like low pass, high pass... with adjustable frequencies...
Thanks MilosL! :)

When using motion blur, I highly recommend baking the animation spline for now. I was testing your comment and it turns out that motion blur is calculated differently between modifier and bake because (I think) the Fuse returns valid values inbetween frames. You can see what I mean when you actually look at the spline editor to the tool using SLA and zooming in.

In fact the Wave Modifier Fuse exhibits the same issue. I don't yet know how to make sure only one value per actual frame exists, or if that's even possible. This could potentially be a performance boost, too.

Other than that, selecting motion blur does require that tools are calculated multiple times per frame. Even a setting of 4 means about 9 times the rendertimes for SLA, plus rendering the actual tool 9 times on top of that.

What frequency filters are concerned, I have been thinking about doing some small modifier Fuses that act like high pass and low pass filters (and others) for parameter values, rather than incorporating those into tools themselves because they can be very useful for other modifiers, too, like Shake or Wave.

Just imagine how powerful this system could be if Modifiers were nodes :idea:

However, that still won't mean that you could say things like "get me the volume readings for all low tones" because frequency data isn't stored in the sample. You have to extract that using fourier transforms, which I'd love to learn at some point. I do suspect your render time concerns would then increase pretty substantially ;)

User avatar
Chad
Fusionator
Posts: 1296
Joined: Fri Aug 08, 2014 1:11 pm
Been thanked: 21 times

Re: [Fuse] Suck Less Audio File Modifier

#9

Post by Chad » Tue Sep 08, 2015 12:19 pm

If you floor the req.time, you can make a "motion blur proof" output. That's how say, TimeSpeed works. Of course you may not always want that, so probably should be a "discretize time" checkbox. I made a MaterialTimeDiscretizer Fuse that did that. Sometimes you want it, sometimes you don't.

Of course, making a "Request Discretizer (Number)" Fuse would make sense too, and would be only a few lines long, something like...

Code: Select all

function Process(req)
	local Enabled = (InDiscretize:GetValue(req).Value > 0.5)
	local input	

	if Enabled then 
		input = InNumber:GetSource(math.floor(req.Time+0.5), req:GetFlags())
	else
		input = InNumber:GetSource(req.Time, req:GetFlags())
	end
	
	Out:Set(req, input)
end
You just insert it into the modifier stack.

But of course, this would also work well as a slightly smaller node in the flow. :geek:

User avatar
PeterLoveday
Fusioneer
Posts: 128
Joined: Sun Sep 14, 2014 6:09 pm
Been thanked: 13 times

Re: [Fuse] Suck Less Audio File Modifier

#10

Post by PeterLoveday » Tue Sep 08, 2015 5:13 pm

I wouldn't worry too much about processing time... You might find the speed would improve somewhat if you don't reload the whole WAV file every Process() (and therefore every motion blur step).

Perhaps try loading it once when it's selected. NotifyChanged is your friend.

- Peter

User avatar
SecondMan
Site Admin
Posts: 2806
Joined: Thu Jul 31, 2014 5:31 pm
Location: Vancouver, Canada
Been thanked: 114 times
Contact:

Re: [Fuse] Suck Less Audio File Modifier

#11

Post by SecondMan » Tue Sep 08, 2015 6:17 pm

ploveday wrote:I wouldn't worry too much about processing time... You might find the speed would improve somewhat if you don't reload the whole WAV file every Process() (and therefore every motion blur step).

Perhaps try loading it once when it's selected. NotifyChanged is your friend.

- Peter
Ahhhh awesome! I had been wondering about how to do that but hadn't thought of NotifyChanged :)

Thanks Peter!

User avatar
SecondMan
Site Admin
Posts: 2806
Joined: Thu Jul 31, 2014 5:31 pm
Location: Vancouver, Canada
Been thanked: 114 times
Contact:

Re: [Fuse] Suck Less Audio File Modifier

#12

Post by SecondMan » Tue Sep 08, 2015 10:16 pm

Chad wrote:If you floor the req.time, you can make a "motion blur proof" output.
:idea:

Moved that idea to the Fuse Box (I'm having some issues with it):

https://www.steakunderwater.com/wesuckle ... ?f=6&t=500

User avatar
Dunn
Moderator
Posts: 468
Joined: Mon Aug 04, 2014 4:27 am
Location: Hamburg, Germany
Been thanked: 16 times
Contact:

Re: [Fuse] Suck Less Audio File Modifier

#13

Post by Dunn » Wed Sep 09, 2015 5:48 am

Now what would it be cool, if we could get to hear the sound. :) Thinking about a custom script the would updated the selected sound on the timeline. But i have not found out what script does that "speaker" button call. Would be cool thou. :oops:
sound.jpg
You do not have the required permissions to view the files attached to this post.

User avatar
SecondMan
Site Admin
Posts: 2806
Joined: Thu Jul 31, 2014 5:31 pm
Location: Vancouver, Canada
Been thanked: 114 times
Contact:

Re: [Fuse] Suck Less Audio File Modifier

#14

Post by SecondMan » Wed Sep 09, 2015 10:36 am

That would be neat indeed. And we could then probably add a button to the Fuse that launches that script, so you could have plenty of samples in Modifiers that can be switched at the press of a button.

So far I've just been using a Saver with the sample in there. Very sloppy. ;)

User avatar
SecondMan
Site Admin
Posts: 2806
Joined: Thu Jul 31, 2014 5:31 pm
Location: Vancouver, Canada
Been thanked: 114 times
Contact:

Re: [Fuse] Suck Less Audio File Modifier

#15

Post by SecondMan » Wed Sep 09, 2015 1:46 pm

ploveday wrote:NotifyChanged is your friend.
Right now it's more of a vague acquaintance.

I've tried but so far no luck. How can I pass variables from the NotifyChange "area" into the Process "area"?

This, for example:

Code: Select all

function NotifyChanged(inp, param, time)
	if inp == InFile then
		audiofilechanged = "hello!"
		print (audiofilechanged)
	end
end
works, but as soon as I put

Code: Select all

print (audiofilechanged)
into Process(req), it returns nil.

I tried following https://www.steakunderwater.com/VFXPedia ... ifyChanged

Any help please?