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 » DIY Hardware and Software » ChucK programming language
Step Sequencer
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
moudi



Joined: Oct 07, 2006
Posts: 63
Location: Bern Switzerland

PostPosted: Wed Nov 01, 2006 3:29 pm    Post subject: Step Sequencer Reply with quote  Mark this post and the followings unread

hi all
i thougt it will be nice to have a stepsequencer Laughing
i tried different ways to implement it.
one idea was to build a new class with an inherited ugen.
but i wasn't really lucky after all.
I ended with this code below:
Code:

0.6::second => dur beat;
65.40639133 => float C3;
130.81278265 => float C4;

Moog m => Echo e => dac;
m.gain(0.6);
e.delay(0.5::beat);
e.max(2::beat);
e.mix(0.3);
[C4,0,C3,0,C4,0,C4,C3,C4,0,C3,0,C3,C4,C3,0] @=> float notes[];

while(true) {
   for ( 0 => int i; i < notes.cap(); i++ ){
      if (notes[i]){
      m.freq(notes[i]);
      Std.rand2f(.1,1) => m.filterQ;
      m.noteOn(1);
      0.25::beat => now;
      m.noteOff(1);
      }
      else {
      0.25::beat => now;
      }
   }
}


has anybody else already wrote a stepsequencer?
or are there other ideas how to do it?

let me know what you think about this...
/moudi

Last edited by moudi on Wed Nov 01, 2006 4:53 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
majutsu



Joined: Jun 18, 2006
Posts: 151
Location: New York
Audio files: 1

PostPosted: Wed Nov 01, 2006 4:30 pm    Post subject: Reply with quote  Mark this post and the followings unread

i don't know if i would call this a step sequencer or not

but this is the most common way to play a string of 16 notes or whatever. this is how i and everyone else seems to do it.

good job

_________________
All phenomena are atoms in association and dissociation.
Back to top
View user's profile Send private message
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Wed Nov 01, 2006 4:51 pm    Post subject: Reply with quote  Mark this post and the followings unread

i'm planning on making a class or function..
to create / modify melody array..

now i'd like to try this idea:

// before this, let N be the number of notes in the melody
int note[N]; dur duration[N]; float amplitude[N];

and we can play the melody by playing each note with note[i]'s midi note value
with the amplitude: amplitude[i]
for duration[i] beats...

and we'll have a simple melody player..

and we can have more functions to mess with the set of data.
for example, transpose, diatonic transpose?, retrograde..
invert, or do some more crazy things..
combining, extending, cutting, pasting different melodies..
and create new set of note, duration, amplitude to play.

i'll tell you all soon after i've got it running
i hope it'd be fun to play with.
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
moudi



Joined: Oct 07, 2006
Posts: 63
Location: Bern Switzerland

PostPosted: Sat Nov 04, 2006 7:47 am    Post subject: Reply with quote  Mark this post and the followings unread

@majutsu
majutsu wrote:
this is the most common way to play a string of 16 notes or whatever. this is how i and everyone else seems to do it.

i'm satisfied that i came to a similar solution.
this means i don't do things the wrong way Laughing

@ kijjaz
sounds interesting... let us know if you get it to run.


thank you both for your replies. i'm just at the beginning to get deeper in ChucK. Some hints are always appreciated.

regards
/moudi
Back to top
View user's profile Send private message Visit poster's website
Kassen
Janitor
Janitor


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

PostPosted: Sat Nov 04, 2006 9:01 am    Post subject: Reply with quote  Mark this post and the followings unread

kijjaz, it gets way more fun if you include realtime controll.

High quality joypads (they all work with the HID stuff!) are cheaper and more fun then budget MIDI controlers.

More notes; What works for me is deviding the structure up into a counter that increases and wraps the number of the beat that's thje curent one, a playback shred that plays depending on what the array(s) hold for the curent step and a record section that records incoming data to the current step's slot in the array(s).

From then on you can do anything to the melody that you can do to arrays but the hard bit is writing functions that make musical sense and preventing mishaps and stck notes once a few functions start manipulating the data as well as keeping it coherent.

It's hard stuff to do well but even for the ideas that fail it's a lot of fun and it forces you to think realy deeply about waht melodies realy are and what operations to them realy mean.

_________________
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: 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


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