HISE Logo Forum
    • Categories
    • Register
    • Login

    Engine.getPlayHead() Examples?

    Scheduled Pinned Locked Moved General Questions
    12 Posts 4 Posters 569 Views
    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.
    • NatanN
      Natan
      last edited by

      Hey folks
      Hope all are doing well

      I Just searched the forum, But there is not Much information About how to use
      Engine.getPlayHead() In A Script.

      I'm trying to add this to A Plugin To Stop Some of the modules, once DAW Stopped.

      Any help is much appreciated
      Thanks

      1 Reply Last reply Reply Quote 0
      • NatanN
        Natan
        last edited by

        Okey i Found this

        @dustbro said in The things we all want to see in HISE 3.0:

        @d-healey said in The things we all want to see in HISE 3.0:

        I'd also like to be able to get some feedback from the DAW about start/stop transport state.

        You can do this right now if you don't want to wait for v3.0.
        in HISE source code hi_core/MainController.cpp, un-comment the features you need.

        void MainController::storePlayheadIntoDynamicObject(AudioPlayHead::CurrentPositionInfo &/*newPosition*/)
        {
        	//static const Identifier bpmId("bpm");
        	//static const Identifier timeSigNumerator("timeSigNumerator");
        	//static const Identifier timeSigDenominator("timeSigDenominator");
        	//static const Identifier timeInSamples("timeInSamples");
        	//static const Identifier timeInSeconds("timeInSeconds");
        	//static const Identifier editOriginTime("editOriginTime");
        	//static const Identifier ppqPosition("ppqPosition");
        	//static const Identifier ppqPositionOfLastBarStart("ppqPositionOfLastBarStart");
        	//static const Identifier frameRate("frameRate");
        	//static const Identifier isPlaying("isPlaying");
        	//static const Identifier isRecording("isRecording");
        	//static const Identifier ppqLoopStart("ppqLoopStart");
        	//static const Identifier ppqLoopEnd("ppqLoopEnd");
        	//static const Identifier isLooping("isLooping");
        
        	//ScopedLock sl(getLock());
        
        	//hostInfo->setProperty(bpmId, newPosition.bpm);
        	//hostInfo->setProperty(timeSigNumerator, newPosition.timeSigNumerator);
        	//hostInfo->setProperty(timeSigDenominator, newPosition.timeSigDenominator);
        	//hostInfo->setProperty(timeInSamples, newPosition.timeInSamples);
        	//hostInfo->setProperty(timeInSeconds, newPosition.timeInSeconds);
        	//hostInfo->setProperty(editOriginTime, newPosition.editOriginTime);
        	//hostInfo->setProperty(ppqPosition, newPosition.ppqPosition);
        	//hostInfo->setProperty(ppqPositionOfLastBarStart, newPosition.ppqPositionOfLastBarStart);
        	//hostInfo->setProperty(frameRate, newPosition.frameRate);
        	//hostInfo->setProperty(isPlaying, newPosition.isPlaying);
        	//hostInfo->setProperty(isRecording, newPosition.isRecording);
        	//hostInfo->setProperty(ppqLoopStart, newPosition.ppqLoopStart);
        	//hostInfo->setProperty(ppqLoopEnd, newPosition.ppqLoopEnd);
        	//hostInfo->setProperty(isLooping, newPosition.isLooping);
        }
        

        These extend the Playhed functionality. For instance:

        Engine.getPlayHead().isPlaying
        

        So I need to comment out Some of the lines in Source code to Make this Working Right?

        Can someone Help with The lines that I Need to Make the plugin Look At The Playing Transport Of Host, and And once It Stopped What I Could I Supposed to Use?

        Thank You

        1 Reply Last reply Reply Quote 1
        • NatanN
          Natan
          last edited by

          Okay I'm Uncommented These Lines:

          /*newPosition*/
          //static const Identifier isPlaying("isPlaying");
          //ScopedLock sl(getLock());
          //hostInfo->setProperty(isPlaying, newPosition.isPlaying);
          

          Compiled Succefully.
          And...

          Is This the Way I Can Recall The Playhead?
          Example:

          if(Engine.getPlayHead().isPlaying )
          {
          // Some Codes Here  	 
                }
          

          Thanks

          1 Reply Last reply Reply Quote 0
          • NatanN
            Natan
            last edited by

            Okey, I Connected The Play Head to A Simple Gain Module To Check If It Works Correctly:

            But Not Sure No Idea if This is Correct Or Not:

                if(Engine.getPlayHead().isPlaying )
                    {
                    PlayHead.setBypassed(1);
                    }
                    else
                    {
                    PlayHead.setBypassed(0); 
                    }
            

            Any Help Is such Appreciated

            1 Reply Last reply Reply Quote 0
            • Christoph HartC
              Christoph Hart
              last edited by

              Use the TransportHandler I've added a few hours ago.

              Link Preview Image
              HISE | Docs

              favicon

              (docs.hise.audio)

              NatanN 2 Replies Last reply Reply Quote 1
              • NatanN
                Natan @Christoph Hart
                last edited by

                @Christoph-Hart Thank you Christoph :) God bless you man
                Recompiling Now :)

                1 Reply Last reply Reply Quote 0
                • NatanN
                  Natan @Christoph Hart
                  last edited by

                  @Christoph-Hart said in Engine.getPlayHead() Examples?:

                  e the TransportHandler I've added a few hours ago

                  Christoph, Do you have a minimal Example Of How to Enable/Disable A Module Based on DAW TransportHandler?
                  Thank in advance

                  1 Reply Last reply Reply Quote 0
                  • NatanN
                    Natan
                    last edited by

                    @Christoph-Hart
                    Excellent job :) I Found how :)

                    alt text

                    1 Reply Last reply Reply Quote 0
                    • NatanN
                      Natan
                      last edited by

                      @Christoph-Hart
                      alt text

                      DanHD 1 Reply Last reply Reply Quote 0
                      • Y
                        yall
                        last edited by

                        @Christoph-Hart Can we now use the gain modulator without latency or mess problem? to create a sidechain effect for example?

                        1 Reply Last reply Reply Quote 2
                        • DanHD
                          DanH @Natan
                          last edited by

                          @Natan Can we use this to get LFOs in sync with FX Plugins?

                          DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                          https://dhplugins.com/ | https://dcbreaks.com/
                          London, UK

                          NatanN 1 Reply Last reply Reply Quote 0
                          • NatanN
                            Natan @DanH
                            last edited by

                            @DanH I Used this for My Graphic Ideas
                            Not Sure if this can help to sync The LFO Latency :/
                            @Christoph-Hart

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

                            50

                            Online

                            1.7k

                            Users

                            11.7k

                            Topics

                            101.9k

                            Posts