electro-music.org   Dedicated to experimental electro-acoustic
and electronic music
 
 Front Page  |  Radio  |  Forum  |  Media  |  Playlists  |  Wiki
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
sequencing in chuck
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [19 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
Rinko



Joined: Jun 03, 2008
Posts: 38
Location: UK

PostPosted: Mon Aug 25, 2008 10:26 am    Post subject:  sequencing in chuck
Subject description: how do you do it and what do you get out of it?
Reply with quote  Mark this post and the followings unread

hello all!

i have a general question for people, its one i've struggled with and not come up with an answer for but my knowledge of chuck is very limited so i would appreciate the opinions of others:

i can personally see the value of synthesizing sound and manipulating sound in chuck. it seems very powerful and flexible and i can think of 1-2 things that i would like to do in these areas that i could not do any other way (that i'm aware of). however, i cannot yet personally see the value of sequencing with chuck (i am specifically referring to 'traditional' hand crafted sequencing rather than generative approaches) i cannot think of anything i could do with chuck (other than create generative sequences) that i could not do with a DAW such as ableton, for example.

i'll reiterate at this point that my knowledge of chuck is very limited but i have not found any evidence to change my mind yet anywhere.

basically i am wondering:

-how people sequence with chuck

-what benefits (if any) they feel they get from sequencing with chuck as opposed to with a DAW. are there any technical advantages and increased possibilities that chuck offers?

thank you for your time - i look forward to reading any responses!
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: Mon Aug 25, 2008 11:03 am    Post subject: Reply with quote  Mark this post and the followings unread

I can only talk about myself and my own practice; I like Ableton, I bought updates up to version 4 and sometimes still use it.

The reason I do all my sequencing with TR8OR (my sequencer which is written in ChucK) isn't one of features; it's one of interface. What I wanted was a step sequencer that could be programmed fast enough to program it in real time on stage with no pre-stored patterns and without looking at the screen.

Ableton, while nice, won't do this and none of the hardware devices I looked at (and I downloaded manuals for all the big ones) were focussed on this, particularly things like switching between patterns that you just wrote without stopping was a issue, so was sub-menus for setting things like pitch and velocity.

Basically my needs and ideas were quite idiosyncratic and so there was nothing for sale that covered them and I decided to write my own, based on how I experience and think about music. Feature-wise you could do everything it does in Ableton as well, probably, but I write a 6 minute song in 6 minutes on stage, from scratch. That's quite hard with Live. I also get to use arcade style controllers which I find very pleasant to play with and that look a bit more appealing on stage then most off the shelf music gear.

It all depends on what you like and want and how well this lines up with existing products. Do buy something if it suits your needs; it'll save you a LOT of time in development, but if you want to sequence in a unusual way then ChucK may make sense as a way out.

Aside from that I think there are advantages to integrating sequencing into the same system that you use to synthesise in because that way you can share and link parameters far easier, if needed.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
radarsat1



Joined: Mar 14, 2008
Posts: 85
Location: Montreal

PostPosted: Mon Aug 25, 2008 11:04 am    Post subject: Reply with quote  Mark this post and the followings unread

i guess the usual technique is to use arrays, but yeah it's not necessarily a great solution.

something like... (off the top of my head, might not compile)

Code:
[1, 0, 0, 1, 0, 0, 0, 1, 0, 0] => int seq[];
0 => int i;
while (1) {
  100::ms => now;
  if (seq[i%10]>0) spork ~ awesome();
}


however, i think one thing to keep in mind is that a lot of people use Chuck for non-sequenced or generatively sequenced music, so for many users it's not an issue. sometimes Chuck is just used to effect incoming signals, even, where the sound source is a microphone or other instrument, so sequencing isn't necessarily a part of everyone's toolkit.

for myself though, i personally DO like sequenced music. i've definitely toyed with the idea in the past of building a Chuck-based sequencer/tracker type interface.

actually i wrote one kind of interesting interface to play live with Chuck loops:
https://lists.cs.princeton.edu/pipermail/chuck-users/2007-December/002556.html

i really should upload a screenshot of the interface sometime.
but it's only meant to play with pre-made loops in a live context, not for actually doing the sequencing. inside each loop is something like the above code.
Back to top
View user's profile Send private message
radarsat1



Joined: Mar 14, 2008
Posts: 85
Location: Montreal

PostPosted: Mon Aug 25, 2008 11:06 am    Post subject: Re: sequencing in chuck
Subject description: how do you do it and what do you get out of it?
Reply with quote  Mark this post and the followings unread

Rinko wrote:

-what benefits (if any) they feel they get from sequencing with chuck as opposed to with a DAW. are there any technical advantages and increased possibilities that chuck offers?


should also mention that Chuck can receive MIDI so you can totally use it along with a DAW if you want. Check out SEQ24 for a pretty awesome MIDI loop machine.

http://www.filter24.org/seq24/shots.html
Back to top
View user's profile Send private message
Rinko



Joined: Jun 03, 2008
Posts: 38
Location: UK

PostPosted: Mon Aug 25, 2008 2:09 pm    Post subject: Reply with quote  Mark this post and the followings unread

thanks for your thoughts guys!

what other ways are there of sequencing (non-generatively) in chuck apart from with arrays? it's the only way i have seen so far.

@ radarsat1 - could you explain what you mean by non-sequenced music? i cant think of any music that does not involve sounds being planned and ordered in some fashion. do you mean non step-sequenced music?

cheers!
Back to top
View user's profile Send private message
radarsat1



Joined: Mar 14, 2008
Posts: 85
Location: Montreal

PostPosted: Mon Aug 25, 2008 2:27 pm    Post subject: Reply with quote  Mark this post and the followings unread

Rinko wrote:
do you mean non step-sequenced music?


yes.
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: Mon Aug 25, 2008 4:56 pm    Post subject: Reply with quote  Mark this post and the followings unread

radarsat1 wrote:
i guess the usual technique is to use arrays, but yeah it's not necessarily a great solution.


Hmmmm, I don't know. You could use poly dimensional arrays and use one "line" to indicate step length. That way you could record arbitrary keyboard parts, for example, including all timing aspects.

To me writing a sequencer is -in a way- the most confrontational thing you can do in music because unlike anything else it forces you to consider what is and what isn't important to you in music.

I like arrays; they are easily the most versatile way of dealing with larger amounts of data in ChucK in higher level ways, you just need to realise that they have no inherent meaning. There is no need to loop over note values one "beat" at a time if you don't want that. You could write a class called "note" and have a array of those, with the class containing info on how any one note relates to the one before or after it, for example. There is also no need to do the sequencing itself in ChucK; you can easily write a instrument that contains a sequencer as a part of it and play that in real timewith no music defined in ChucK, just behaviour (this is what I do).

I found the hardest question here is knowing what you want; as soon as you know exactly what you want the actual code is quite easy to write but in the case of sequencers that means thinking about how you think about music. This took me a long time but now that it works and I can go out and play it for audiences it's the greatest thing for me and it's all worth it.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kijjaz



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

PostPosted: Mon Aug 25, 2008 11:19 pm    Post subject: Reply with quote  Mark this post and the followings unread

Yes, I often start with some kind on an array also.
Especially, dealing with something quite pop or common rhythm grooves.

One thing I love to play with starting with easy array is the use of manipulating the index.

for example, using a 16-step sequencer with index 'i':


for(int i; i < 16; i++)
{
// do anything with reference to i
}

this is playing in a normal 0 to 15 sequence.

int a;
int b;
// (then initialize a and b)

for(int i; i <16> int startValue; can be anything from 0 to 15
int a;
int b;
// then initialize a and b
for(int i, startValue => int x; i <16> x;
b +=> x;
// then use x as the index instead of i
}
}

this can create some interesting jumps of the index also.
- - -

You can change 16 into any number, i usually make it 'int N'.
Using odd-time is interesting in this also..
for example, prime numbers .. 5, 7, 11, 13 ..
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
radarsat1



Joined: Mar 14, 2008
Posts: 85
Location: Montreal

PostPosted: Tue Aug 26, 2008 9:26 am    Post subject: Reply with quote  Mark this post and the followings unread

Kassen wrote:

To me writing a sequencer is -in a way- the most confrontational thing you can do in music because unlike anything else it forces you to consider what is and what isn't important to you in music.


Nice, I like that sentiment. Wink
It's true, I also find that when I start allocating knobs on my MIDI box I suddenly have to decide what I actually want to be able to manipulate in real-time. And even if I buy another box and add more knobs, it'll never be enough.. and will eventually just be more than I can handle, so at some point you're forced to draw boundaries on what you consider most interesting in a given patch.
Back to top
View user's profile Send private message
Rinko



Joined: Jun 03, 2008
Posts: 38
Location: UK

PostPosted: Tue Aug 26, 2008 11:13 am    Post subject: Reply with quote  Mark this post and the followings unread

i like that sentiment too - challenging!

@ Kassen - sorry to bother but what is a poly-dimensional array? i've not been able to find a defintition anywhere- is it one that controls the parameters of a number of different objects?


cheers.
Back to top
View user's profile Send private message
radarsat1



Joined: Mar 14, 2008
Posts: 85
Location: Montreal

PostPosted: Tue Aug 26, 2008 11:22 am    Post subject: Reply with quote  Mark this post and the followings unread

Rinko wrote:
sorry to bother but what is a poly-dimensional array? i've not been able to find a defintition anywhere- is it one that controls the parameters of a number of different objects?


he means a multi-dimensional array, like:

Code:
[
   [0,1,2],
   [3,4,5]
] => int myarray[][]


and so on. Useful for sequencing several aspects of a synth at a time. I've used it before to have one row do volume and the other row do frequency, for example.
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: Tue Aug 26, 2008 12:25 pm    Post subject: Reply with quote  Mark this post and the followings unread

Yes, sorry, I meant "multi", my Latin isn't that good ;¬).

The largest problem with those arrays for sequencing may be that a array in ChucK can only contain one type of data; you can't mix floats and ints and durations.

What you can do though is creating a "note" class that contains values like "note number", "step duration", "note length", "note volume", "velocity","woblyness", etc. and have a array of those.

What you can also do is have a series of arrays of different types governing these things and use the in parallel. I don't like that solution that much; I'd rather have one array (probably 2 dimensional) for my pattern so I can use a different array (probably 3 dimensions) to store such patterns to and recall them from. There are many choices there and I found that as long as your code reflects this "way you think about music" it will be easier to develop, I also found that new features that fit with these thoughts will also fit with the code. At least in my experience I can say that if a feature would be very hard to add it likely doesn't fit with my older ideas on music either.

About assigning knobs; typically I only use a very small amount of knobs but have them affect a few parameters at once. I might for example have a "staccato v.s. legato" knob that at once affects a few envelope settings, note length and pitch-glide or a "aggression" knob that affects overdrive, and some sort of variable detune. I also tend to keep such knobs at the same spot from song to song. This isn't just because knobs take money, space and weight or because such parameters make more musical sense then "filter resonance modulation by LFO1" but also because I can only keep track of so much while playing, particularly on stage.

CPU time is one thing and for that we get clever at home with our thinking cap on (or under the shower, or while having a walk....) to optimise it so it'll work once the people get in or the recorder starts spinning but cognitive bandwith is another factor. I like to optimise for that as well because sequencing a small band worth of instruments live is hard work; it's harder on me then on my laptop's CPU. If anybody would like to go this way as well; you *will* sweat and you *will* get lost at times, I guarantee you you *are* going to forget where you are at some time (but it's great!), just make the most of you brain's bandwith by giving it a easy time with the controls, whether this is a sequencer or physical model of a shape-changing violin.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kijjaz



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

PostPosted: Wed Aug 27, 2008 9:20 am    Post subject: Reply with quote  Mark this post and the followings unread

I have one idea I haven't tried using it as sequencing:

using Linked List for notes.

for example,
we have note class
and each note has a 'link' to another note.
there might be an 'end' note so that playing until the index reach the end note, the motif stops.
it can also form a loop..
and modifying the links of the notes can create / mess up melody sequence.

What do you think?
Shoud we try something with this idea?
It sounds more DATABASE to me heheeh.
but I've just had this idea a few minutes ago, so let's share more about this heheh.
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
radarsat1



Joined: Mar 14, 2008
Posts: 85
Location: Montreal

PostPosted: Wed Aug 27, 2008 11:11 am    Post subject: Reply with quote  Mark this post and the followings unread

kijjaz wrote:

for example,
we have note class
and each note has a 'link' to another note.
there might be an 'end' note so that playing until the index reach the end note, the motif stops.
it can also form a loop..
and modifying the links of the notes can create / mess up melody sequence.


taking it one step further, you could also use the concept to build a branching tree structure instead of a linear list, or cyclic graphs.

actually now that i think about it, that begins to be similar to Different Strokes, in which you draw lines which, when intersecting other lines, cause them to trigger yet more notes. you can build loops and weird structures graphically using a tablet.

http://www.music.mcgill.ca/~zadel/differentstrokes

although DS tends to use sample playback, i think more interesting sounds could be made with it. some way of dynamically modifying the paths according to algorythms would be interesting too...
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 Aug 27, 2008 1:17 pm    Post subject: Reply with quote  Mark this post and the followings unread

Yes, especially when now we can dynamically add more members to the array,
we can surely grow a complex melody tree ehehe..
- - -

One idea I still haven't tried in ChucK is this, i was inspired by watching the videos of
Al-Jazari in Fluxus programming
http://www.pawfal.org/al-jazari/

The idea that we can adjust is that..
we can start with a 2D-Array, imagine it as the floor,
then, we put parameters in each cell of the floor,
for example: Triggers, Direction Command..

Then we have robot(s) walking on the array.
And a robot adjusts itself to the Command on the cell it arrives,
or produce triggers for notes / melody / etc.

I'd be fun playing around on this idea,
but visualization might be needed for it to be easier to control and show off.
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Antimon



Joined: Jan 18, 2005
Posts: 4145
Location: Sweden
Audio files: 373
G2 patch files: 100

PostPosted: Thu Aug 28, 2008 1:32 pm    Post subject: Reply with quote  Mark this post and the followings unread

My SampleComposer thingy is a kind of sequencer that uses linked lists:

http://www.electro-music.com/forum/topic-27609.html

I made a fairly general LinkedList class (containing instances of subclasses of LinkedListElement) and put it close to the top of sample_runtime.ck, if anyone's interested.

/Stefan

_________________
Antimon's Window
@soundcloud @Flattr home - you can't explain music
Back to top
View user's profile Send private message Visit poster's website
heuermh



Joined: Dec 15, 2006
Posts: 19
Location: minneapolis

PostPosted: Fri Sep 05, 2008 9:10 am    Post subject: Reply with quote  Mark this post and the followings unread

kijjaz wrote:

for example,
we have note class
and each note has a 'link' to another note.
there might be an 'end' note so that playing until the index reach the end note, the motif stops.
it can also form a loop..
and modifying the links of the notes can create / mess up melody sequence.


Yo, I had the same idea some time ago, but with a directed graph data structure instead of a linked list. I intend to rewrite the attached java code in ChucK but haven't quite built up all the necessary data structures yet.

This is what it does:

Define a melody in a directed graph

- Notes are placed on nodes
- Links from one node/note to the next are defined as edges
- Each edge has a weight; e.g. in the following

Code:

  A -- 0.25 --> B
  \
   -- 0.75 --> C


A -> B should be selected about 25% of the time

Play the melody by random walks through the graph

- Randomly select a node to start from
- At each node, randomly select an edge to follow
- Randomly stop walking, pause, and start again


random-walk.zip
 Description:
Source and dependencies for RandomWalk.java.

Download (listen)
 Filename:  random-walk.zip
 Filesize:  152.04 KB
 Downloaded:  299 Time(s)

Back to top
View user's profile Send private message
renderful



Joined: Apr 18, 2007
Posts: 29
Location: Boulder, Co

PostPosted: Sun Sep 07, 2008 12:43 pm    Post subject: Reply with quote  Mark this post and the followings unread

So many absolutely great ideas here. So much information/idea sharing, and code sharing. I have goosebumps, and BRAINFREEZE from all of this wonderful info/community. Thanks everyone!
Back to top
View user's profile Send private message
rogan



Joined: Dec 16, 2007
Posts: 83
Location: Urbana, IL
Audio files: 5

PostPosted: Sun Sep 07, 2008 3:49 pm    Post subject: Reply with quote  Mark this post and the followings unread

I like the random walk idea. I've been toying around with the idea of recording a melody from a MIDI source (the key and the duration between hits, etc), then playing it back with randomness introduced in some form. For example swapping durations or notes, or bending frequencies slightly each loop through the melody. Maybe I'll write this up and post again with some sample code....
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 [19 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
Log in
Username:     Password:      Log me on automatically each visit    


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2026 by electro-music.org