in the example before I wrote 0.5::sample , but it is 0.5::samp
sorry
On Tue, 11 Feb 2020 at 13:21, Mario Buoninfante
Hi Herman,
In ChucK you can also go sub-sample rate (ie 0.5::sample => now;). I wouldn't worry about the *rate* of the events (how fast they're generated), I think it's slightly more complex than that. 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 *captured* *at* *low level *by ChucK, then you can use it to trigger *now*. 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. 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). 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).
About* now*, this can work with *dur* and* time* data types and *events* (Event, MIDI, HID). About the MIDI use case, your *MidiIn* objects receives a MIDI msg (so ChucK is aware of the msg already) and then triggers *now*. At that point your script/program proceeds and go to the next instruction (ie whatever else in the code comes next).
Cheers, Mario
On Tue, 11 Feb 2020 at 11:56, herman verbaeten
wrote: Thanks Mario,
So once you started the VM to run, time floats at the speed of 44100 times a sec. So the "now" can only see things if they'r fed into it at a frequency less or even a 44100 th time of a second.
Does this mean that i can feed anything into the "now"? Or only things that contain a kind of trigger? But in case of a midi message this trigger "min => now" kind of wakes up chuck to do the nex thing on the list? e.g. read the incoming message?
Cheers,
Herman
------------------------------ *Van:* chuck-users-bounces@lists.cs.princeton.edu < chuck-users-bounces@lists.cs.princeton.edu> namens Mario Buoninfante < mario.buoninfante@gmail.com> *Verzonden:* dinsdag 11 februari 2020 11:07 *Aan:* ChucK Users Mailing List
*Onderwerp:* Re: [chuck-users] => now to be a bit more precise, when you have something like min => now; your program waits for a MIDI event in order to advance, but the ChucK time is still running. Anyway, more info in the link I shared :)
On Tue, 11 Feb 2020 at 11:03, Mario Buoninfante < mario.buoninfante@gmail.com> wrote:
Hi Herman,
You can use Events/MIDI/HID to advance in time. Have a look at this chapter if you want to know more about it https://en.flossmanuals.net/chuck/_full/#events In a nutshell what happens is that a MIDI event is received and that turns into a *trigger*, so your program advances in time. Otherwise it stays there until a MIDI even happens. See it more as a trigger than a *time constant* if that makes sense.
Cheers, Mario
On Tue, 11 Feb 2020 at 10:59, herman verbaeten
wrote: Hi,
I'm trying to understand what's really happening in chuck. I thought i did untill i saw some exemples of midi.
Normaly you can only feed time or duration into now ( e.g. 10::ms => now) But in case you are awaiting a midi-in message you write :
MidiIn min; while (true) { min => now }
So in fact do you assign the message to time? Total confusion! Thanks for your answer.
Herman
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users