<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks again Mario,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I have another question:</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Can you recommend a procedure to address individual samples of a wave-file you read into the SndBuf.&nbsp;</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I discovered a way to play a part of a wave file starting at a certain point using &quot;.pos&quot;.&nbsp;</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I also wonder if there's a way to play it backwards (reverse).</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Cheers,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
herman</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
&nbsp;&nbsp;</div>
<div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Van:</b> chuck-users-bounces@lists.cs.princeton.edu &lt;chuck-users-bounces@lists.cs.princeton.edu&gt; namens Mario Buoninfante &lt;mario.buoninfante@gmail.com&gt;<br>
<b>Verzonden:</b> dinsdag 11 februari 2020 13:22<br>
<b>Aan:</b> ChucK Users Mailing List &lt;chuck-users@lists.cs.princeton.edu&gt;<br>
<b>Onderwerp:</b> Re: [chuck-users] =&gt; now</font>
<div>&nbsp;</div>
</div>
<div>
<div dir="ltr">
<div>in the example before I wrote 0.5::sample , but it is 0.5::samp</div>
<div>sorry<br>
</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Tue, 11 Feb 2020 at 13:21, Mario Buoninfante &lt;<a href="mailto:mario.buoninfante@gmail.com">mario.buoninfante@gmail.com</a>&gt; wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div>Hi Herman,</div>
<div><br>
</div>
<div>In ChucK you can also go sub-sample rate (ie 0.5::sample =&gt; now;). <br>
</div>
<div>I wouldn't worry about the <i>rate</i> of the events (how fast they're generated), I think it's slightly more complex than that.
<br>
</div>
<div>I would assume (and I'd like to ask someone on the list more expert than me to validate this statement) that as long as the event can be
<i>captured</i> <i>at</i> <i>low level </i>by<i> </i>ChucK, then you can use it to trigger
<i>now</i>.</div>
<div>In the case of USB MIDI then, there are also some aspects of the implementation of the various MIDI libraries that help in scenarios where too many msg are sent.</div>
<div>For example, the computer and/or the hardware connected to it, can communicate the fact that they're busy and thus whichever of the 2 is the one that sends the msg, can wait before sending the next one (all this assuming that both implemented USB MIDI
 the same way).</div>
<div>Now, as far as I know this mechanism is not always in place (both in USB MIDI libraries and hardware/software products), and I honestly don't know whether or not ChucK uses it (I suppose it would be the case of having a look at the source code - RtMidi
 and the way ChucK interfaces to it).</div>
<div><br>
</div>
<div>About<i> now</i>, this can work with <i>dur</i> and<i> time</i> data types and
<i>events</i> (Event, MIDI, HID).</div>
<div>About the MIDI use case, your <i>MidiIn</i> objects receives a MIDI msg (so ChucK is aware of the msg already) and then triggers
<i>now</i>.<br>
</div>
<div>At that point your script/program proceeds and go to the next instruction (ie whatever else in the code comes next).</div>
<div><br>
</div>
<div>Cheers,</div>
<div>Mario<br>
</div>
<div><br>
</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Tue, 11 Feb 2020 at 11:56, herman verbaeten &lt;<a href="mailto:hverb54@hotmail.com" target="_blank">hverb54@hotmail.com</a>&gt; wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Thanks Mario,</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
So once you started the VM to run,&nbsp; time floats at the speed of&nbsp; 44100 times&nbsp; a sec. So the &quot;now&quot; can only see things if they'r fed into it at a frequency less or even a 44100 th time of a second.&nbsp; &nbsp;</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Does this mean that i can feed anything into the &quot;now&quot;? Or only things that contain a kind of trigger? But in case of a midi message this trigger&nbsp; &quot;min =&gt; now&quot; kind of wakes up chuck to do the nex thing on the list? e.g. read the incoming message?</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Cheers,</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Herman</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div>
<div id="x_gmail-m_-6777505265998269741gmail-m_3112254726841316931appendonsend"></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr style="display:inline-block; width:98%">
<div id="x_gmail-m_-6777505265998269741gmail-m_3112254726841316931divRplyFwdMsg" dir="ltr">
<font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Van:</b>
<a href="mailto:chuck-users-bounces@lists.cs.princeton.edu" target="_blank">chuck-users-bounces@lists.cs.princeton.edu</a> &lt;<a href="mailto:chuck-users-bounces@lists.cs.princeton.edu" target="_blank">chuck-users-bounces@lists.cs.princeton.edu</a>&gt; namens Mario
 Buoninfante &lt;<a href="mailto:mario.buoninfante@gmail.com" target="_blank">mario.buoninfante@gmail.com</a>&gt;<br>
<b>Verzonden:</b> dinsdag 11 februari 2020 11:07<br>
<b>Aan:</b> ChucK Users Mailing List &lt;<a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank">chuck-users@lists.cs.princeton.edu</a>&gt;<br>
<b>Onderwerp:</b> Re: [chuck-users] =&gt; now</font>
<div>&nbsp;</div>
</div>
<div>
<div dir="ltr">
<div>to be a bit more precise, when you have something like</div>
<div>min =&gt; now;</div>
<div>your program waits for a MIDI event in order to advance, but the ChucK time is still running.</div>
<div>Anyway, more info in the link I shared :)<br>
</div>
</div>
<br>
<div>
<div dir="ltr">On Tue, 11 Feb 2020 at 11:03, Mario Buoninfante &lt;<a href="mailto:mario.buoninfante@gmail.com" target="_blank">mario.buoninfante@gmail.com</a>&gt; wrote:<br>
</div>
<blockquote style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div>Hi Herman,</div>
<div><br>
</div>
<div>You can use Events/MIDI/HID to advance in time.</div>
<div>Have a look at this chapter if you want to know more about it <a href="https://en.flossmanuals.net/chuck/_full/#events" target="_blank">
https://en.flossmanuals.net/chuck/_full/#events</a></div>
<div>In a nutshell what happens is that a MIDI event is received and that turns into a
<i>trigger</i>, so your program advances in time. Otherwise it stays there until a MIDI even happens.</div>
<div>See it more as a trigger than a <i>time constant</i> if that makes sense.<br>
</div>
<div><br>
</div>
<div>Cheers,</div>
<div>Mario<br>
</div>
</div>
<br>
<div>
<div dir="ltr">On Tue, 11 Feb 2020 at 10:59, herman verbaeten &lt;<a href="mailto:hverb54@hotmail.com" target="_blank">hverb54@hotmail.com</a>&gt; wrote:<br>
</div>
<blockquote style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hi,</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
I'm trying to understand what's really&nbsp; happening in chuck.&nbsp;</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
I thought i did untill i saw some exemples of midi.</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Normaly you can only feed time or duration into now ( e.g. 10::ms =&gt; now)</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
But in case you are awaiting a midi-in message you write :</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
MidiIn min;</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
while (true)</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
{</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
min =&gt; now&nbsp; &nbsp;&nbsp;</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
}</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
So in fact do you assign the message to time? Total confusion!</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Thanks for your answer.</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Herman</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
</div>
_______________________________________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank">chuck-users@lists.cs.princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" rel="noreferrer" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
</blockquote>
</div>
</blockquote>
</div>
</div>
</div>
</div>
_______________________________________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank">chuck-users@lists.cs.princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" rel="noreferrer" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
</blockquote>
</div>
</blockquote>
</div>
</div>
</div>
</body>
</html>