[flocking-users] combining with processingjs? and timing accuracy

enrike altern2 at gmail.com
Fri Apr 11 05:14:43 EDT 2014


Hi

thanks for your answer. I have just integrated some flockingjs code into 
a Processing sketch by importing the flocking scripts with <script> tags 
in the index.html that embeds the Processing pde file. Both the audio 
and the graphics runs simultaneously although it is slow on my android 
phone.

Now the question would be how to connect both. I would like sounds to be 
triggered or modified from certain Processing events like mouseDown for 
instance. But I guess this list is probably now the place to ask this. I 
am not experienced on javacript so I find difficult to picture how to go 
about this.

About the scheduling with the ugens. I see what you mean. I have done 
similar things with PD and Supercollider so thats now a problem for me.

I am yet deciding if I need to use flocking or go for something else for 
my project. Other options are Python + PYO, OpenFrameworks + Maximiliam 
or something like that, and finally just Supercollider. All options have 
good points and drawbacks both from the point of view of what I need and 
my previous experience, so I am a bit dubious. I guess I will have to 
expend some time doing tests with the different options

thanks

enrike

og., 2014.eko apiren 10a 01:55(e)an, Colin Clark(e)k idatzi zuen:
> Hi Enrike,
>
> I haven’t heard of anyone yet who is using Processing.js with Flocking, but I don’t see any reason why it wouldn’t work. Web Audio in general has some risks with very sophisticated visuals because of the fact that the audio processing runs in the same thread as the visuals, but I think there’s lots of room to work with them both.
>
> In terms of the reliability of timing in Flocking, it depends on how you schedule things. At the moment, the asynchronous scheduler is a little bit “drifty,” especially in Firefox. I’m in the midst of planning out a block-accurate scheduler that will have no drift, and I can fast-track that work if it’s a priority for you. In the meantime, I do most of my high priority scheduling within the unit generator graph, by using unit generators like flock.ugen.sequence as well as triggers like flock.ugen.impulse. It’s solid and simple. Here’s an example of a piece I wrote recently that has a very accurate drum pulse in it.
>
> https://github.com/colinbdclark/compositions/blob/master/greenwich-park/js/instruments.js#L4-L60
>
> Colin
>
> On Apr 9, 2014, at 10:00 AM, enrike <altern2 at gmail.com> wrote:
>
>> hi
>>
>> two different questions...
>>
>> has anyone tried to combine Flockingjs with Processingjs?
>> http://processingjs.org/
>>
>> how accurate and reliable is timing using Flocking? I need to work on a percussion system that needs to be quite precise.
>>
>> thanks
>>
>> enrike
>
>




More information about the flocking mailing list