• Products
    • Isadora
    • Get It
    • ADD-ONS
    • IzzyCast
    • Get It
  • Forum
  • Help
  • Werkstatt
  • Newsletter
  • Impressum
  • Dsgvo
  • Press
  • Isadora
  • Get It
  • ADD-ONS
  • IzzyCast
  • Get It
  • Press
  • Dsgvo
  • Impressum

Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags

    [ANSWERED] Reverse Direction of a Wave Generator?

    How To... ?
    wave generator reverse
    7
    18
    1520
    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 last edited by Woland

      Is there any way to reverse the direction of a wave generator? I have a patch where I'm reversing the playback of some videos on demand, and it would be helpful to also be able to reverse some of the modulation I'm doing at the same time. This might be more of a feature request, but I wanted to pick the community's brain and see if it was possible through some combination of actors first. Thanks in advance!

      JP

      dbini J Paz D 4 Replies Last reply Reply Quote 0
      • dbini
        dbini @jpg.wav last edited by

        @jpg-wav

        i've done this before like this: 

        the issue is when the direction changes, the value jumps, unless you change direction exactly at '50'.

        John Collingswood
        taikabox.com
        2019 MBPT 2.6GHZ i7 OSX15.3.2 16GB
        plus an old iMac and assorted Mac Minis for installations

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

          @dbini Thank you for the response! That's what I've landed on for now as well, but ran into that same issue. I'm trying to have it be more of a smooth rewind and avoid the jumping effect. I feel like there has to be some combination of math and storing previous values that can do it but I can't wrap my brain around it. I appreciate the help anyway.

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

            @jpg-wav

            Hi, 

            You can use the "Limit-Scale Value" actor by changing the output (out min- out max). I hope this helps.
            Best

            MBP M2 Max 32 GB. MacOS 13.7.3 Isadora 3.2.6 - 4.0.7

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

              @jandraka Thank you for the response! I believe this has the same issue with the value jump that I'm running into with my other methods. What I want is for the direction of the wave generated to reverse. Think of it like the wave is on a timeline and I'm trying to hit the rewind button. So if I have a sine wave going 80 - 90 - 100 and I hit my reverse trigger it should start from the same value that I hit the trigger on and go 100 - 90 - 80 from there. Let me know if I can clarify further!

              1 Reply Last reply Reply Quote 0
              • Paz
                Paz Beta Tester @jpg.wav last edited by

                @jpg-wav possibly use the Envelope Generator ++ Actor with trig mode set to one/ind, in conjunction with a Trigger Value Actor you can control when each segment of the wave shape progress forward and hence changes the playback speed of the movie. This way you can design your wave / timeline. What do you think?

                Best wishes, Simon

                Simon Powell: Researching Emerging Technologies in Live Performance at University of the Arts London.
                Running: Mac Studio M1 Max 32GB, 512GB SSD, macOS 15.1 | MacBook Pro M2 Pro 16GB, 512GB SSD, macOS 15.1 / Izzy v4.09 /// UK

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

                  This post is deleted!
                  1 Reply Last reply Reply Quote 0
                  • J
                    jpg.wav last edited by jpg.wav

                    @Paz Thank you for your response!

                    I really appreciate everyone's help and patience, I feel like I might be causing confusion by overexplaining myself while attempting to clarify what I want. Reversing video already works fine in my patch, just using a selector and some math. What I'm looking for is a way to smoothly reverse the values coming from, say, a sine wave generator. So that if I have, for example, a sine wave generator hooked up to translate a shape along the X axis, I can reverse that motion at an arbitrary point in time and have not have that object jump across the stage. I'm visualizing it like the playback head on the wave generator actor moving in the opposite direction, but from what I understand that functionality doesn't exist in the actor as it stands.

                    I'll make another reply in a moment with a gif to help visualize what I mean. Again I appreciate everyone's suggestions and creativity, the community support for this program is one of the things I really love and value about Isadora.

                    J 1 Reply Last reply Reply Quote 0
                    • 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.

                      jfg 1 Reply Last reply Reply Quote 1
                      • jfg
                        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
                        - MacBook Pro M1 Max 16" 64GB RAM, Mac OS 15.3.2 Sequoia
                        - Mac Pro 5.1 middle 2012 (3,33 GHz 6-Core Intel Xeon, 32GB RAM, Radeon RX 580 8 GB ),
                        Mac OS 10.14.6 (Mojave)
                        - Mac mini Pro M4, Mac OS 15.3.2 Sequoia

                        • A range of deployable older Macs
                          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.

                          Woland 1 Reply Last reply Reply Quote 0
                          • Woland
                            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: https://support.troikatronix.com/support/tickets/new
                            Support Policy: https://support.troikatronix.com/support/solutions/articles/13000064762
                            Add-Ons: https://troikatronix.com/add-ons/ & https://troikatronix.com/add-ons/?u=woland
                            Professional Services: https://support.troikatronix.com/support/solutions/articles/13000109444

                            | Isadora Version: all of them | 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.

                              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.

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

                                  @dillthekraut

                                  Brilliant!

                                  TroikaTronix Technical Support
                                  New Support Ticket: https://support.troikatronix.com/support/tickets/new
                                  Support Policy: https://support.troikatronix.com/support/solutions/articles/13000064762
                                  Add-Ons: https://troikatronix.com/add-ons/ & https://troikatronix.com/add-ons/?u=woland
                                  Professional Services: https://support.troikatronix.com/support/solutions/articles/13000109444

                                  | Isadora Version: all of them | 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
                                  • Woland
                                    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: https://support.troikatronix.com/support/tickets/new
                                    Support Policy: https://support.troikatronix.com/support/solutions/articles/13000064762
                                    Add-Ons: https://troikatronix.com/add-ons/ & https://troikatronix.com/add-ons/?u=woland
                                    Professional Services: https://support.troikatronix.com/support/solutions/articles/13000109444

                                    | Isadora Version: all of them | 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.


                                      Woland 1 Reply Last reply Reply Quote 1
                                      • Woland
                                        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: https://support.troikatronix.com/support/tickets/new
                                        Support Policy: https://support.troikatronix.com/support/solutions/articles/13000064762
                                        Add-Ons: https://troikatronix.com/add-ons/ & https://troikatronix.com/add-ons/?u=woland
                                        Professional Services: https://support.troikatronix.com/support/solutions/articles/13000109444

                                        | Isadora Version: all of them | 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