electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
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 
 Forum index » How-tos » Micro Tuning
Microtuning and ChucK
Post new topic   Reply to topic Moderators: seraph
Page 1 of 1 [3 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
seraph
Editor
Editor


Joined: Jun 21, 2003
Posts: 12398
Location: Firenze, Italy
Audio files: 33
G2 patch files: 2

PostPosted: Tue Apr 10, 2007 4:17 am    Post subject: Microtuning and ChucK Reply with quote  Mark this post and the followings unread

arrow http://electro-music.com/forum/topic-17327.html
_________________
homepage - blog - forum - youtube

Quote:
Don't die with your music still in you - Wayne Dyer
Back to top
View user's profile Send private message Visit poster's website
udderbot



Joined: Jul 15, 2007
Posts: 6
Location: suburbia
Audio files: 1

PostPosted: Sun Jul 15, 2007 9:20 pm    Post subject: Reply with quote  Mark this post and the followings unread

I saw this subject and knew I would eventually get around to having some microtonal ChucK examples.

Basically, this makes an equal-tempered mandolin play slowly drifting moment-of-symmetry-esque rhythms. Play with the initial variables a bit. You might even consider it educationally valuable!

Code:

//rhythm mos explorer
// manifestation 0: equal-tuned mando-handbells

//period (tempo)
.56::second => dur p;

//generator (initial value, fraction of 1)
1. => float g;

//number of notes patterning (also tones per octave)
7 => int e;

//the change to g and/or p each iteration of period
fun void delta()
{
   0.01 +=> g;
}

//each boop sporked plays one multiplier (m) of the period...
// only activates notes (no noteOff)
//  queries global variables g and p each time anew
fun void boop( float m, float freq, StkInstrument v)
{
   //Std.fabs(m)*p => now;
   v => dac;
   
   freq => v.freq;
   dur begin;

   while ( true )
   {
      if ( m <0> begin;
      } else {
         if ( m == 0 )
         { 0::second => begin; }
         else {
         g*m%1 * p => begin; } }
      begin => now;
      v.noteOn(0.6);
      p - begin => now;
   }
}

// make a Mandolin with random timbre, chuck to dac
fun StkInstrument mandome()
{
   Mandolin m;
   Std.rand2f( 0, 1 ) => m.bodySize;
    Std.rand2f( 0, 1 ) => m.pluckPos;
   0.3 => m.stringDamping;
   m => dac;
   return m;
}

// iterative version.
fun void multispork(int n)
{
   for(0=>int i; i < n; i++)
{
  spork ~ boop( i-(n/2), Std.mtof(57.+(12.*i/n)), mandome());
}
}

// sequence-of-notes version (make sure size is the same as n!)
[ 57., 59., 61., 57., 59., 57., 53. ]@=> float arr[];
fun void multispork2(int n)
{
   for(0=>int i; i < n; i++)
{
  spork ~ boop( i-(n/2), Std.mtof(arr[i]), mandome());
}
}

multispork(e);

while (true)
{
 delta();
 p => now; }

// a favorite: g-delta = 2/9., eq5


On my music-dedicated 333-Mhz I am limited to 7 notes before garbage synthesis; on my 1 Ghz iMac (running 11 other programs at the same time) it seems able to handle up to 18.

More (and less) at http://scalesmith.blogspot.com

Tell me what you do with it! I plan on doing all sorts of things...

edit: un-mangled by disabling HTML. Thanks Kassen!

Last edited by udderbot on Mon Jul 16, 2007 10:07 am; edited 1 time in total
Back to top
View user's profile Send private message
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Sun Jul 15, 2007 9:39 pm    Post subject: Reply with quote  Mark this post and the followings unread

Welcome, udderbot!

Looks very interesting, could you perhaps repost this while turning the "disable HTML" flag on? It's below the text field when you make a new post. You can also edit all your own posts.

Sadly the board will try to render HTML even within "CODE" blocks which messes up ChucK code because of the triangular brackets we use.

We (well, realy I personally but it works) recomend ChucKists to disable HTML when posting altogether in their profile.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: seraph
Page 1 of 1 [3 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » How-tos » Micro Tuning
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


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