• Isadora
  • Get it
  • Forum
  • Help
  • ADD-ONS
  • Newsletter
  • Impressum
  • Dsgvo
  • Impressum
Forum
    • Categories
    • Recent
    • Popular
    • Tags
    • Register
    • Login

    [ANSWERED] Reverse Direction of a Wave Generator?

    How To... ?
    wave generator reverse
    7
    18
    485
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jpg.wav @jpg.wav
      last edited by jpg.wav

      @jpg-wav Alright I made a quick animation in Blender to hopefully clarify what I'm looking for

      pretend the wave on the left is controlling the X translation of the cube on the right. at frame 40 there would be a trigger, and the wave generator reverses direction, and as a result the cube changes the direction in which it's oscillating.

      I understand what I'm looking for might not be currently possible, if this is the case I'll make a feature request for it in the appropriate section.

      2018 Macbook Pro - 2.6Ghz i7 - Radeon 560X - 16GB RAM - 4GB VRAM - 10.15 Catalina
      any pronouns

      jfgJ 1 Reply Last reply Reply Quote 1
      • jfgJ
        jfg @jpg.wav
        last edited by jfg

        @jpg-wav

        this works as you want. If you need finer values take the Float counter actor.


        best regards

        Jean-François 

        • Izzy 3.2.6, Mac OS 14.1 Sonoma:
        - MacBook Pro M1 Max 16" 64GB RAM
        • Izzy 3.2.6, Mac OS 10.14.6 (Mojave):
        - Mac Pro 5.1 middle 2012 (3,33 GHz 6-Core Intel Xeon, 32GB RAM, Radeon RX 580 8 GB )
        - MacBook Pro 2015 (16GB RAM) 2,8 GHz Intel Core i7;

        Located in Bremen, Germany

        J 1 Reply Last reply Reply Quote 0
        • J
          jpg.wav @jfg
          last edited by

          @jfg Thank you for your reply, this is certainly the closest! The patch you've provided only produces a ramping value, but I feel like I should be able to use this principle to create at least a triangle wave as well. Not quite a sine but it will do for now. Thank you to everyone for all of your input and patience. I'll update this thread with my reversible triangle wave patch once it's complete.

          2018 Macbook Pro - 2.6Ghz i7 - Radeon 560X - 16GB RAM - 4GB VRAM - 10.15 Catalina
          any pronouns

          WolandW 1 Reply Last reply Reply Quote 0
          • WolandW
            Woland Tech Staff @jpg.wav
            last edited by

            @jpg-wav

            I asked ChatGPT for some Javascript Math to help and it gave me this:

            function invertWave(time, frequency, waveType) {
                  // Calculate the current phase of the wave
                  const phase = 2 * Math.PI * frequency * time;
                  // Generate the wave based on the selected type
                  let currentVal;
                  if (waveType === 'sine') {
                    currentVal = 50 * (1 + Math.sin(phase));
                  } else if (waveType === 'sawtooth') {
                    currentVal = 50 * (1 - 2 * (phase % (2 * Math.PI)) / (2 * Math.PI));
                  } else if (waveType === 'square') {
                    currentVal = 50 * (Math.sin(phase) > 0 ? 1 : -1);
                  } else {
                    throw new Error('Invalid wave type. Choose "sine", "sawtooth", or "square"');
                  }
                  // Determine when to invert the wave
                  const invertedVal = currentVal >= 50 ? 100 - currentVal : currentVal;
                  return invertedVal;
                }
                // Example usage
                const frequency = 1;  // 1Hz frequency
                const time = 0.25;  // Example time value (between 0 and 1)
                // Invert the values for a sine wave
                const invertedSineValue = invertWave(time, frequency, 'sine');
                console.log('Inverted Sine Value:', invertedSineValue);
                // Invert the values for a sawtooth wave
                const invertedSawtoothValue = invertWave(time, frequency, 'sawtooth');
                console.log('Inverted Sawtooth Value:', invertedSawtoothValue);
                // Invert the values for a square wave
                const invertedSquareValue = invertWave(time, frequency, 'square');
                console.log('Inverted Square Value:', invertedSquareValue);

            Haven't had time to test it yet, but my gut feeling that it wouldn't be as simple as just inverting the direction of the Wave Generator seems to be correct.

            E.g. If you're using a sawtooth wave and you get to 25% of the way through a phase, you'll be outputting 25 (25% of the way from 0 to 100). If you then inverted the wave with a switch on the Wave Generator actor (if there was one) you'd be switched to 25% of the way through the inverse wave, which would mean you'd immediately be outputting the value 75 (25% of the way from 100 to 0). This is why all these methods are creating jumps; you need to do more than just invert the direction of the Wave Generator.

            TroikaTronix Technical Support
            New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
            TroikaTronix Support Policy: https://support.troikatronix.com/support/solutions/articles/13000064762
            TroikaTronix Add-Ons Page: https://troikatronix.com/add-ons/

            | Isadora 3.2.6 | Mac Pro (Late 2013), macOS 10.14.6, 3.5GHz 6-core, 1TB SSD, 64GB RAM, Dual AMD FirePro D700s |

            J 1 Reply Last reply Reply Quote 0
            • J
              jpg.wav @Woland
              last edited by

              @woland said:

              This is why all these methods are creating jumps; you need to do more than just invert the direction of the Wave Generator.

               For sure! It's more of a matter of reversing the stream of values coming from the wave generator. I have no idea how they work under the hood in Isadora, but since they all have predictable behavior (excluding the random of course) it seems like it would be something that could be done as an addition to the actor. Of course I'm also no software engineer, and I know that things that often seem quite simple to the end user can be quite an undertaking to implement. But I won't take up any more of this forum's time with this topic, my feature request was logged so I'm happy :). I appreciate everyone humoring my request and hearing me out.

              2018 Macbook Pro - 2.6Ghz i7 - Radeon 560X - 16GB RAM - 4GB VRAM - 10.15 Catalina
              any pronouns

              1 Reply Last reply Reply Quote 0
              • D
                DillTheKraut @jpg.wav
                last edited by DillTheKraut

                @jpg-wav

                Maybe some unorthodox workaround:


                instead of going with the Hz self generating timer in the wave generator, you can push the 'phase'. Set the 'hz' to 0 and let some other generator move the phase to generate the output value.
                I just tried it with a movie player and some simple video. 

                To get the value output from 0 to 100, you need to set the min / max properties of the 'phase' value at 22.1 and 72 (maybe it needs to be something around these numbers +/- to be absolute accurate), or use a limit scale value actor. I actually don't know the reason for it, to be like that. The length of the video will determine the wave speed (in combination with the movie playback speed). To change the speed easily, you can change the play length in combination with the limit scale value actor. With putting the loop mode to palindrome, you'll get an endless waveform and switching playback speed from 1 to -1 will reverse the sine/sawtooth/triangle etc. at any point.

                WolandW 2 Replies Last reply Reply Quote 4
                • WolandW
                  Woland Tech Staff @DillTheKraut
                  last edited by

                  @dillthekraut

                  Brilliant!

                  TroikaTronix Technical Support
                  New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
                  TroikaTronix Support Policy: https://support.troikatronix.com/support/solutions/articles/13000064762
                  TroikaTronix Add-Ons Page: https://troikatronix.com/add-ons/

                  | Isadora 3.2.6 | Mac Pro (Late 2013), macOS 10.14.6, 3.5GHz 6-core, 1TB SSD, 64GB RAM, Dual AMD FirePro D700s |

                  1 Reply Last reply Reply Quote 1
                  • WolandW
                    Woland Tech Staff @DillTheKraut
                    last edited by Woland

                    @dillthekraut

                    Your solution gave me this idea:

                    Gif: http://recordit.co/ucyw5nXFK0

                    File: invertable-wave-generator-2024-01-08-3.2.6.izz

                    @jpg-wav This solution works for all the wave types. The main limitation is that to have a smooth output, you want a low increment amount and a high increment rate, but the increment rate maxes out at 999Hz, so you can't use this for simulating a Wave Generator actor with a high frequency without making the increment amount larger and losing some granularity (though perhaps this could be solved with a Smoother actor).

                    TroikaTronix Technical Support
                    New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
                    TroikaTronix Support Policy: https://support.troikatronix.com/support/solutions/articles/13000064762
                    TroikaTronix Add-Ons Page: https://troikatronix.com/add-ons/

                    | Isadora 3.2.6 | Mac Pro (Late 2013), macOS 10.14.6, 3.5GHz 6-core, 1TB SSD, 64GB RAM, Dual AMD FirePro D700s |

                    J 1 Reply Last reply Reply Quote 3
                    • J
                      jpg.wav @Woland
                      last edited by

                      @woland Amazing! I would have never been able to put this all together!

                      Thank you so much!

                      And thank you to @DillTheKraut too for inspiring the mad genius. This community never ceases to amaze me.


                      2018 Macbook Pro - 2.6Ghz i7 - Radeon 560X - 16GB RAM - 4GB VRAM - 10.15 Catalina
                      any pronouns

                      WolandW 1 Reply Last reply Reply Quote 1
                      • WolandW
                        Woland Tech Staff @jpg.wav
                        last edited by

                        @jpg-wav said:

                        I would have never been able to put this all together!

                         I needed help from chatGPT to find the right equation 😉

                        TroikaTronix Technical Support
                        New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
                        TroikaTronix Support Policy: https://support.troikatronix.com/support/solutions/articles/13000064762
                        TroikaTronix Add-Ons Page: https://troikatronix.com/add-ons/

                        | Isadora 3.2.6 | Mac Pro (Late 2013), macOS 10.14.6, 3.5GHz 6-core, 1TB SSD, 64GB RAM, Dual AMD FirePro D700s |

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post