<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[onClock and onTransport Sync To Host Issue]]></title><description><![CDATA[<p dir="auto">Hey to all, I'm having some problems getting the onClock, and Transport callback to sync to my host. I'm trying to fire the OnClock after checking to see if the Transport Host was played or stop.</p>
<p dir="auto">For some reason, The below snippet is not triggering the transport callback</p>
<pre><code>    function onTransport(isStart){
            if(isStart){
            Console.print("Start");
            Synth.setClockSpeed(16);
      }

           if(isStart != 1 ){
           Console.print("Stop");
           Synth.setClockSpeed(0);
     }
</code></pre>
<p dir="auto">}</p>
<p dir="auto">I have several samples map to my sampler and the simple sequencer below is not sequencing. it seems as if the onClock callback is not triggering. Any advice? Thanks</p>
<pre><code>     var x = [48,51,55,60,63,67,72,75];
     var index = 0;

    function onClock()
   {
        index = parseInt(Math.ceil(Engine.getPlayHead().ppqPosition*8.0));
        Synth.playNote(x[index%x.length],127);
   }
</code></pre>
]]></description><link>https://forum.hise.audio/topic/375/onclock-and-ontransport-sync-to-host-issue</link><generator>RSS for Node</generator><lastBuildDate>Tue, 06 Oct 2026 10:01:06 GMT</lastBuildDate><atom:link href="https://forum.hise.audio/topic/375.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 25 Aug 2017 02:20:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to onClock and onTransport Sync To Host Issue on Mon, 28 Aug 2017 16:44:33 GMT]]></title><description><![CDATA[<p dir="auto">Thanks, this did work! Got those properties to work very well. I'm creating a very basic sequencer but the timing is way off. The isPlaying property is working, along with all properties, its just onTimer, and the transport tick/metronome is not syncing together properly.  The onTimer should sync with the metronome beat, but its not..  any advice on this??    The  below snippet is what im working on</p>
<pre><code>        const var Tempo = Content.addKnob("Tempo", 0, 0);
    // [JSON Tempo]
       Content.setPropertiesFromJSON("Tempo", {
            "max": 10,
            "mode": "TempoSync",
            "stepSize": 1

      });
     Synth.startTimer(Engine.getMilliSecondsForTempo(Tempo.getValue()) / 1000.0);

     function onTimer(){

    if(Engine.getPlayHead().isPlaying ){
 	     	 	
          if( parseInt(Math.ceil(Engine.getPlayHead().ppqPosition)) == 1){
 		        Synth.playNote(48,127);
            }
 	  if( parseInt(Math.ceil(Engine.getPlayHead().ppqPosition)) == 2){
 	      	        Synth.playNote(48,127);
 	   }
 	   if( parseInt(Math.ceil(Engine.getPlayHead().ppqPosition)) == 3){
 		        Synth.playNote(48,127);
 	   }
 	  if( parseInt(Math.ceil(Engine.getPlayHead().ppqPosition)) == 4){
 		        Synth.playNote(48,127);
 	    }
     Synth.startTimer(Engine.getMilliSecondsForTempo(Tempo.getValue()) / 1000.0);
           
         }	  	 
      }
</code></pre>
]]></description><link>https://forum.hise.audio/post/2387</link><guid isPermaLink="true">https://forum.hise.audio/post/2387</guid><dc:creator><![CDATA[tshoats]]></dc:creator><pubDate>Mon, 28 Aug 2017 16:44:33 GMT</pubDate></item><item><title><![CDATA[Reply to onClock and onTransport Sync To Host Issue on Sat, 26 Aug 2017 08:37:48 GMT]]></title><description><![CDATA[<p dir="auto">Taken from the HISE source code <a href="https://github.com/christophhart/HISE/blob/master/hi_core/hi_core/MainController.cpp" rel="nofollow ugc">hi_core/MainController.cpp</a>:</p>
<pre><code class="language-cpp">void MainController::storePlayheadIntoDynamicObject(AudioPlayHead::CurrentPositionInfo &amp;/*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-&gt;setProperty(bpmId, newPosition.bpm);
	//hostInfo-&gt;setProperty(timeSigNumerator, newPosition.timeSigNumerator);
	//hostInfo-&gt;setProperty(timeSigDenominator, newPosition.timeSigDenominator);
	//hostInfo-&gt;setProperty(timeInSamples, newPosition.timeInSamples);
	//hostInfo-&gt;setProperty(timeInSeconds, newPosition.timeInSeconds);
	//hostInfo-&gt;setProperty(editOriginTime, newPosition.editOriginTime);
	//hostInfo-&gt;setProperty(ppqPosition, newPosition.ppqPosition);
	//hostInfo-&gt;setProperty(ppqPositionOfLastBarStart, newPosition.ppqPositionOfLastBarStart);
	//hostInfo-&gt;setProperty(frameRate, newPosition.frameRate);
	//hostInfo-&gt;setProperty(isPlaying, newPosition.isPlaying);
	//hostInfo-&gt;setProperty(isRecording, newPosition.isRecording);
	//hostInfo-&gt;setProperty(ppqLoopStart, newPosition.ppqLoopStart);
	//hostInfo-&gt;setProperty(ppqLoopEnd, newPosition.ppqLoopEnd);
	//hostInfo-&gt;setProperty(isLooping, newPosition.isLooping);
}
</code></pre>
<p dir="auto">As you can see, it's just commented out - you can try to remove the comments for every property that you need and check if it passes down the info to the scripting call (I think it should work). Eg for enabling just the transport, try this:</p>
<pre><code class="language-cpp">MainController::storePlayheadIntoDynamicObject(AudioPlayHead::CurrentPositionInfo &amp;/*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-&gt;setProperty(bpmId, newPosition.bpm);
	//hostInfo-&gt;setProperty(timeSigNumerator, newPosition.timeSigNumerator);
	//hostInfo-&gt;setProperty(timeSigDenominator, newPosition.timeSigDenominator);
	//hostInfo-&gt;setProperty(timeInSamples, newPosition.timeInSamples);
	//hostInfo-&gt;setProperty(timeInSeconds, newPosition.timeInSeconds);
	//hostInfo-&gt;setProperty(editOriginTime, newPosition.editOriginTime);
	//hostInfo-&gt;setProperty(ppqPosition, newPosition.ppqPosition);
	//hostInfo-&gt;setProperty(ppqPositionOfLastBarStart, newPosition.ppqPositionOfLastBarStart);
	//hostInfo-&gt;setProperty(frameRate, newPosition.frameRate);
	hostInfo-&gt;setProperty(isPlaying, newPosition.isPlaying);
	//hostInfo-&gt;setProperty(isRecording, newPosition.isRecording);
	//hostInfo-&gt;setProperty(ppqLoopStart, newPosition.ppqLoopStart);
	//hostInfo-&gt;setProperty(ppqLoopEnd, newPosition.ppqLoopEnd);
	//hostInfo-&gt;setProperty(isLooping, newPosition.isLooping);
}
</code></pre>
<p dir="auto">Obviously, you need to rebuild HISE for this :)</p>
]]></description><link>https://forum.hise.audio/post/2356</link><guid isPermaLink="true">https://forum.hise.audio/post/2356</guid><dc:creator><![CDATA[Christoph Hart]]></dc:creator><pubDate>Sat, 26 Aug 2017 08:37:48 GMT</pubDate></item><item><title><![CDATA[Reply to onClock and onTransport Sync To Host Issue on Sat, 26 Aug 2017 00:33:43 GMT]]></title><description><![CDATA[<p dir="auto">Ok when my host is playing, I'm getting a 0 value when using Engine.getPlayHead() within my onTimer:</p>
<pre><code>         Console.print(Math.ceil(Engine.getPlayHead().ppqPosition));
</code></pre>
<p dir="auto">If I can somehow get the play position at any given moment, I can listen when the Transport has been played or stop at any given time.  Is this method still working?</p>
]]></description><link>https://forum.hise.audio/post/2355</link><guid isPermaLink="true">https://forum.hise.audio/post/2355</guid><dc:creator><![CDATA[tshoats]]></dc:creator><pubDate>Sat, 26 Aug 2017 00:33:43 GMT</pubDate></item><item><title><![CDATA[Reply to onClock and onTransport Sync To Host Issue on Sat, 26 Aug 2017 00:00:02 GMT]]></title><description><![CDATA[<p dir="auto">Ok ,thanks for the heads up. I actually got the onTimer to work perfectly with syncing to the tempo using Tempo.getValue(), and Engine.getMilliSecondsForTempo() . I like the Time Signature feature built in such as below!! Sweet</p>
<pre><code>     const var Tempo = Content.addKnob("Tempo", 0, 0);
     // [JSON Tempo]
    Content.setPropertiesFromJSON("Tempo", {
       "max": 10,
       "mode": "TempoSync",
       "stepSize": 1
     });
</code></pre>
<p dir="auto">Quick question, your right about the onTransport, its not working in Abelton. Is there any other method to listen for when the Transport, play and stop buttons are pressed?</p>
<p dir="auto">And lastly, Is there any api docs explaing the 1st, and 2nd object parameter in  Content.setPropertiesFromJSON? I'm wondering in detail about what mode, max , stepSize etc..  (Please keep this feature :)</p>
]]></description><link>https://forum.hise.audio/post/2350</link><guid isPermaLink="true">https://forum.hise.audio/post/2350</guid><dc:creator><![CDATA[tshoats]]></dc:creator><pubDate>Sat, 26 Aug 2017 00:00:02 GMT</pubDate></item><item><title><![CDATA[Reply to onClock and onTransport Sync To Host Issue on Fri, 25 Aug 2017 11:44:09 GMT]]></title><description><![CDATA[<p dir="auto">Whoops, this is indeed not implemented anymore. The reason was that I added these methods a long time ago, but never actually used them so they were removed when I spotted those things lurking around when profiling.</p>
<p dir="auto">Do you really need this? Actually the reason that this is abandoned is that I could do all time related things with the timer callback and to be honest the support for stuff like transport notification varies between hosts so you can't expect this to work 100% on every DAW.</p>
<p dir="auto">But I'll update the docs and remove those :)</p>
]]></description><link>https://forum.hise.audio/post/2335</link><guid isPermaLink="true">https://forum.hise.audio/post/2335</guid><dc:creator><![CDATA[Christoph Hart]]></dc:creator><pubDate>Fri, 25 Aug 2017 11:44:09 GMT</pubDate></item></channel></rss>