electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
Live streaming at radio.electro-music.com

  host / artist show at your time
<on air> Faux Pas Quartet and friends Music From Last Thursday
Please visit the chat
 Forum index » DIY Hardware and Software » ChucK programming language
thanks and adsr as modulator query
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [5 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
frank discourse



Joined: Apr 26, 2010
Posts: 10
Location: sydney

PostPosted: Tue May 31, 2011 4:26 pm    Post subject:  thanks and adsr as modulator query
Subject description: basic advice
Reply with quote  Mark this post and the followings unread

Hey everyone,
Thanks for the direction with the sndbuf question Inventor.
I have been putting in the hours and worked the problem out trial and error.
Recently I have been trying to get the ADSR or Envelope to function as a modulation source for lfo amt but despite reading the manual and looking on the web am still having no luck.
Is there a way to access the env level in a similar way to using lfo.last()
when reading a lfo level?
Back to top
View user's profile Send private message
GrandJu



Joined: Jul 04, 2010
Posts: 32
Location: Rennes France

PostPosted: Fri Jun 03, 2011 7:41 am    Post subject: Reply with quote  Mark this post and the followings unread

Hi Frank,

Theoretically you can use .last() function for all UGen.
I use ADSR to control filters frequency. So it should work for modulation too.

If you want your ADSR to output values don't forget put an input into it.
Like this:

Code:

Step target_freq =>ADSR vcf_adsr => vcf.freq_ctrl;
target_freq.next(59.0);
vcf_adsr.set(50::ms, 0::ms, 1, 100::ms);


Don't hesitate to send the piece of code that doesn't work on your side.

Ju
Back to top
View user's profile Send private message
frank discourse



Joined: Apr 26, 2010
Posts: 10
Location: sydney

PostPosted: Mon Jun 06, 2011 9:32 pm    Post subject: thanks GrandJu Reply with quote  Mark this post and the followings unread

Appreciate the guidance, I think I was omitting the ADSR input as you suggested.I am painfully aware that my training wheels will be on for a while with ChucK but am putting in serious hours and making some headway.
Thanks again frankie_d.
Back to top
View user's profile Send private message
flies



Joined: May 20, 2008
Posts: 29
Location: NJ

PostPosted: Wed Nov 30, 2011 2:25 pm    Post subject: Reply with quote  Mark this post and the followings unread

I can't find a UGen that has a freq_ctrl property. How do you do frequency modulation on a filter? (am noob.)
Back to top
View user's profile Send private message
GrandJu



Joined: Jul 04, 2010
Posts: 32
Location: Rennes France

PostPosted: Fri Dec 02, 2011 9:26 am    Post subject: Reply with quote  Mark this post and the followings unread

Hi flies,

I didn't find it too. But I think there is no way to perform it directly.
I created a class using the freq() function of the filter and udating it each sample to change cutoff frequency.

Code:


public class lpf_vcf_light {
    Gain in;
    Gain out;

    LPF lpf_filter_u;
    lpf_filter_u.freq(300);

    fun UGen connect(UGen @ u)
    {
        int i;
       
        u => in => lpf_filter_u => out;
       
        return out;
    }

   fun void update_freq(UGen @ freq_in) {
   
      while (1) {
         Std.mtof(freq_in.last()) => lpf_filter_u.freq;

           if (lpf_filter_u.freq() <1> now;
      }
   }
   
   fun void update_Q(UGen @ Q_in) {
   
      while (1) {
         Q_in.last()/24 => lpf_filter_u.Q;
         
         1::samp => now;
      }
   }
   
   fun void freq_ctrl (UGen @ freq_in) {
      freq_in => blackhole;
      spork ~ update_freq(freq_in);
   }
   
   fun void Q_ctrl (UGen @ Q_in) {
      Q_in => blackhole;
      spork ~ update_Q(Q_in);
   }
   
   
}

/* Examlpe, please comment when used as public class */
lpf_vcf_light vcf;

SqrOsc s => vcf.connect => dac;
s.gain(0.3);

Phasor p => vcf.freq_ctrl;
p.gain(127);
p.freq(0.5);


Phasor p2 => vcf.Q_ctrl;
p2.gain(127);
p2.freq(0.1);

while(1) {1::ms => now; <<<vcf>>>;}

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [5 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » ChucK programming language
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use