Oscillator troubles

Post Reply
User avatar
PnkMyo
Posts: 4
Joined: Mon Jun 08, 2020 9:41 pm
Contact:

Oscillator troubles

Post by PnkMyo » Mon Jun 08, 2020 9:54 pm

Sorry if this is a dumb question, but I have been trying for days to get this to work.

So, I'm trying to make a simple oscillator module, right ? WELL, I've been having some trouble. The oscillator is way out of tune. I've tried so many methods, so many numbers, so much stuff... I can't get it to sound right now matter what I do. And I've looked a lot of places for answers, even here on the forums, but... Nothing. This stuff doesn't feel very well documented, but, eh, it's fine. Most of it is self-explanatory... EXCEPT for this.

Code: Select all

   if (cvJack.IsConnected()){
      cvValue = cvJack.GetValue() * 131;
   } 
Here's what I have now ^
A friend suggested 131. It didn't work.

Is anyone able to help me with this ? >:
Animator/musician/artist. I sound like a cartoon character.

terrymcg
Posts: 50
Joined: Mon Apr 08, 2019 12:35 am

Re: Oscillator troubles

Post by terrymcg » Mon Jun 08, 2020 10:57 pm

PnkMyo wrote:
Mon Jun 08, 2020 9:54 pm

Code: Select all

   if (cvJack.IsConnected()){
      cvValue = cvJack.GetValue() * 131;
   } 
I think this thread might help: viewtopic.php?f=8&t=974&hilit=volts

You'll find good volts to frequency math in there.

Cheers,
--
Terry McG

User avatar
PnkMyo
Posts: 4
Joined: Mon Jun 08, 2020 9:41 pm
Contact:

Re: Oscillator troubles

Post by PnkMyo » Mon Jun 08, 2020 11:41 pm

Okay, so I've looked through there... And this is what I've got now.
Maybe I'm blind, but it's not working too well.

Code: Select all

   if (cvJack.IsConnected()){
      cvValue = cvJack.GetValue();
   } 
   
   double x = cvJack.GetValue();
   
   if (outputJack.IsConnected()){   
      osc.SetFrequency((55.0*2*(x+0.25))  + coarseValue + fineValue);
      if (sawsineBool == 0){
      outputJack.SetValue(osc.GetSineValue());
      }
      if (sawsineBool == 1){
      outputJack.SetValue(osc.GetTriangleValue());
      }
           osc.AdvanceSample(); 
      }
      

I've already tried ^ in the place of the * between 2 and (...
It just gave me an error.
I dunno, I'm very confused. I also barely slept, so brain no work good :L
Animator/musician/artist. I sound like a cartoon character.

User avatar
PnkMyo
Posts: 4
Joined: Mon Jun 08, 2020 9:41 pm
Contact:

Re: Oscillator troubles

Post by PnkMyo » Tue Jun 09, 2020 2:27 am

I'm getting closer... But I'm still not there yet.

Code: Select all

      osc.SetFrequency((Math.round(55.0 * Math.round(x * (x + .25))))  + coarseValue + fineValue);
^ This was after MANY different iterations... I'm still WAY off, though. It's overly complicated, too >:

By the way, I forgot to say this, but thank you so much for helping me ;-;
Animator/musician/artist. I sound like a cartoon character.

User avatar
PnkMyo
Posts: 4
Joined: Mon Jun 08, 2020 9:41 pm
Contact:

Re: Oscillator troubles

Post by PnkMyo » Tue Jun 09, 2020 3:54 am

SOLVED !!! IT WORKS !!!!!!
My friend helped me with this ! :D
I'm so happy ;u;

Code: Select all

   double x = cvJack.GetValue();
   
   if (outputJack.IsConnected()){   
       osc.SetFrequency(
     55 * Math.pow(2, x)
);
For those who may need it, who are dumb like me...
(It was so OBVIOUS ! I can't believe this ! ...Oh right, lack of sleep.)
Animator/musician/artist. I sound like a cartoon character.

terrymcg
Posts: 50
Joined: Mon Apr 08, 2019 12:35 am

Re: Oscillator troubles

Post by terrymcg » Tue Jun 09, 2020 10:34 pm

Congratulations, and happy freq-ing! ;)

Post Reply