Page 1 of 1

Ruby/DSP Selectable Curve Crossfader

Posted: Sun Jan 25, 2015 10:35 am
by glitchcpt
Hi Guys,

So I'm working on trying to construct a realistic sounding crossfader schematic,
And I can't seem to wrap my head around the ruby behind it, I have worked out most of the maths functions, but the if statements aren't firing correctly, I don't even know if that is the right method to use here haha :lol:

anyway, here it is so far

:edit:

I think I got the if statements firing off correctly, just need to figure out the last 2 equations :)

Re: Ruby/DSP Selectable Curve Crossfader

Posted: Tue Jul 05, 2016 8:47 pm
by Walter Sommerfeld
Just had a little time 4 this...

here a simple solution for the last Type:

Code: Select all

##Fast Cut BUG?  # after sun mod O.K.
if @index==5
   if @x <=0.1
   then
   self.output 2, @x*10.5
   else
   self.output 2, 1 # sun mod
   end
   if @x >=0.9
   then
   self.output 3, (1-@x)*10.5
   else
   self.output 3, 1 # sun mod
   end
end

[using ur indentation]

but none 4 the 'Slow Fade'

Keep on doing!
Walter

Re: Ruby/DSP Selectable Curve Crossfader

Posted: Tue Jul 05, 2016 9:46 pm
by adamszabo
I would use a min and max functions instead of the last if statements

Re: Ruby/DSP Selectable Curve Crossfader

Posted: Wed Jul 06, 2016 1:27 pm
by Walter Sommerfeld
Good idea adam...

like this:

a = @fader >= 0.9 ? (1-@fader)*10.5:1
output 3, a
watch 'a',a

b = @fader <= 0.1 ? @fader*10.5:1
output 2, b
watch 'b',b