[chuck-users] Strange Behavior

Spencer Salazar ssalazar at CS.Princeton.EDU
Fri Apr 13 03:29:54 EDT 2007


Hi Piero,
Thanks for your feedback on this.  I've been looking into your crash  
report from earlier and while I can see where the crash is occurring,  
I can't quite figure out why it is occurring.  So I don't really have  
anything helpful to say at the moment, except that Im looking a  
little deeper into ChucK's MIDI implementation.

Also, while it doesn't explain the crashing, this code of yours seems  
a little suspect:

> public void Distortion() {
>     while(knob_0.value()) {
>             knob_0.value() => float value;
>         value * 39 => f.pfreq;
> //            value => i.next;
>     }
>     min => now;
> }

As far as I can tell, this will hang all audio processing until  
knob_0.value() is 0--is that the desired result?

spencer

On Apr 12, 2007, at 9:46 PM, Piero B. Contezini wrote:

> Hello,
>
> I don't know if this is the right place to put this on but, this  
> code is crashing randomly on my tests:
>
> MAUI_View window;
> MAUI_Slider knob_0;
>
> window.size(300,300);
> window.name("Test");
> window.position(0,100);
>
> knob_0.range(0,127);
> knob_0.size(150,knob_0.height());
> //cut_knob_0.position(0,0);
> knob_0.name("Knob 0");
> knob_0.displayFormat(MAUI_Slider.integerFormat);
> // impulse to filter to dac
>
> Impulse i => BiQuad f => Pan2 p => dac;
> // set the filter's pole radius
> .99 => f.prad;
> // set equal gain zeros
> 1 => f.eqzs;
> // set filter gain
> .5 => f.gain;
>
>
> window.addElement (knob_0);
>
> window.display();
>
> 1 => int device;
>
> MidiIn min;
> MidiMsg msg;
>
> if( !min.open( device ) ) {
>         <<< "erro ao iniciar device:" , device >>> ;
> } else {
>         <<< "device inicializado:" , min.num() , " -> " , min.name 
> () >>>;
> }
>
> public void controlKnob_0() {
>     while(true) {
>         while ( min.recv(msg) ) {
>                 msg.data1 => int msg_1;
>                 msg.data2 => int msg_2;
>                 msg.data3 => int msg_3;
>
>                 if(msg_2 == 3) {
>                         knob_0.value(msg_3);
>                 }
>         }
>         min => now;
>     }
> }
>
> public void Distortion() {
>     while(knob_0.value()) {
>             knob_0.value() => float value;
>         value * 39 => f.pfreq;
> //            value => i.next;
>     }
>     min => now;
> }
>
>
>
> spork ~ controlKnob_0();
> spork ~ Distortion();
>
>
> while ( true ) {
>     1.0 => i.next;
> //    Std.rand2f ( 250, 5000 ) => f.pfreq;
>     Std.rand2f( -1, 1 ) => p.pan;
>     100::ms => now;
> }
>
>
> What i'm doing is mapping one knob of my bcd2000 to a MAUI Slider,  
> to see on the screen the position of the knob, as i've posted here  
> before, the midi itself is hanging up using this controller, but I  
> think it might be something i'm doing wrong, anyone can point me  
> out a clue on what could be it?
>
> Thanks
>
> Piero
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users



More information about the chuck-users mailing list