Author |
Message |
moudi
Joined: Oct 07, 2006 Posts: 63 Location: Bern Switzerland
|
Posted: Wed Nov 01, 2006 3:29 pm Post subject:
Step Sequencer |
|
|
hi all
i thougt it will be nice to have a stepsequencer
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
|
|
|
majutsu
Joined: Jun 18, 2006 Posts: 151 Location: New York
Audio files: 1
|
Posted: Wed Nov 01, 2006 4:30 pm Post subject:
|
|
|
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
|
|
|
kijjaz
Joined: Sep 20, 2004 Posts: 765 Location: bangkok, thailand
Audio files: 4
|
Posted: Wed Nov 01, 2006 4:51 pm Post subject:
|
|
|
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
|
|
|
moudi
Joined: Oct 07, 2006 Posts: 63 Location: Bern Switzerland
|
Posted: Sat Nov 04, 2006 7:47 am Post subject:
|
|
|
@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
@ 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
|
|
|
Kassen
Janitor
Joined: Jul 06, 2004 Posts: 7678 Location: The Hague, NL
G2 patch files: 3
|
Posted: Sat Nov 04, 2006 9:01 am Post subject:
|
|
|
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
|
|
|
|