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 
go to the radio page Live at electro-music.com radio 1 Please visit the chat
poster
 Forum index » DIY Hardware and Software » ChucK programming language
Command Line Sequencer
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 2 [28 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: 1, 2 Next
Author Message
Antimon



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

PostPosted: Sun Oct 28, 2007 1:24 pm    Post subject: Command Line Sequencer Reply with quote  Mark this post and the followings unread

Tinkered with this while spending a large part of my summer vacation at my parent's house. It's a kind of stop, slight turn and reverse gear into the history of command line editing text on a computer.

It's a combined exploration of grains (which I still don't completely grasp exactly what it means) and sequencing using keyed commands rather than using dedicated pads and knobs. I was thinking about how programmers who use vi or emacs (or even ed, that my crazy workplace neighbor likes so much) are able to work at least as fast as those who are skilled with those modern IDEs, with clever context help and simple clickable things and all.

I've always typed like a play the piano - I place my fingers on the appropriate keys, and let them fall in the correct order as quickly as I can, moving one hand over the next word as the other finishes typing the last. Why shouldn't one be able to train up a similar intuitive way to improvise by quickly typing complex commands?

It would be great to hear what you think of this. Is it usable at all? Has it been done before (maybe you ChucKists do this all the time - I just haven't been paying attention)? Any tweaks or new commands? I hope my code is readable enough.

I wrote a short "manual" at the top:

Code:
// This ChucK patch implements a set of 64 slot sequencers, each
// consisting of 8 major slots, and 8 minor slots in between. The
// major slots trigger at regular intervals, while the pace for
// minor slots can be varied. The sequencers are edited by entering
// commands on the command line that started the ChucK program:
 
// Command:
// (<major>[<minor>][<effects>]<sample>|<state>)
// <major> = (1-8)
// <minor> = (1-8)
// <effects> = (<reverse>|<fade>|<fade>|<pitch>|<pitch>|<omit>|<join>|<minor>
//            |<start>|<start>)+
// <sample> = z|x|c|v|b|n|m|<space>
 
// <reverse> = r
//      will cause repeats to start from the target slot and iterate backwards
//      in the sequence - fades will "fade in" etc.
// <fade> = fg<n>[1-9]|fh<n>[1-9]
//      fg - fade out from this slot, using <n> slots with <n> slots spacing
//      fh - fade in to this slot, using <n> slots with <n> slots spacing
// <fade> = F[0-9]
//      sets the volume. 0 is very low, 9 is full volume.
// <pitch> = p[0-9]
//      change the sample rate for every repeat from the target slot. 0 causes a
//      drastic fall in pitch, 5 a gentle fall, 6 a gentle rise and 9 a drastic rise.
// <pitch> = P[(1-9)|(a,w,s,e,d,f,t,g,y,h,u,j,k,o,l)[0-9]]
//      set the sample rate for within a slot. P may be followed by either a preset
//      pitch (1 causes a hich pitch, 5 causes a pitch slight higher than default, 6
//      a slighly lower and 9 a drastically lower pitch), or a "piano key" with
//      optional octave transpose (0-4 transposes down, 6-9 up), 4 is default. E is
//      the reference note, e.g. if a recording of an instrument playing an E
//      is used, 1Pax will play a C-1, and 5Pu6c will play an A#+1.
// <omit> = o[1-9]
//      when the slot is to be played, the sequencer will only do so every nth time,
//      the first time being immediately after this command has been executed. This
//      command is sequencer-processed, meaning that sequencer slots are occupied
//      as if nothing was omitted, and the sequencer decides which of these slots
//      that cause an actual sample to be played.
// <join> = j
//      join this slot with the previously stored sequencer-processed slot. E.g. if
//      the previous command was 1o2z, the 5jb will cause samples z and b (slots 1
//      and 5, respectively) to be played alternatively: sequence 1: only z,
//      sequence 2: only b, sequence 3: none, sequence 4: only z, and so on.
// <minor> = i[(1-9)|(a,w,s,e,d,f,t,g,y,h,u,j,k,o,l)[0-9]]
//      set the minor pace, i.e. the duration between this slot and the next.
//      The CLI sequencer changes sequencer positions in two steps - the major pace
//      moves ahead 8 slots at a time, the minor pace moves ahead 1 slot at a time.
//      If the minor pace reaches the next major slot before the major pace has
//       advanced, the sequencer moves back 8 slots, looping between two major slots
//      until the next major advance. The allows Formant-like tones to be generated
//      from samples. Default is that 8 minor slots will run perfectly until the
//      next major advance.
//
//      i may be followed by either a set rate fraction (1 causes a very high rate,
//      5 causes a slightly higher rate, 6 a slighly lower and 9 a drastically lower
//      rate), or a "piano key" with optional octave transpose (0-4 transposes down,
//      6-9 up), 4 is default. E.g. 1iax will play a C-1, and 5iu6c will play an A#+1.
//
// <start> = s[0-9]
//      change the sample's start point. 0 moves is swiftly towards the start of the
//      sample, 5 slowly towards the start, 6 slowly towards the end, 9 swiftly
//      towards the end.
//
// <state> = (<toggle>|<sequencer>)
//
// <toogle> = l
//      toggle whether set slots should be kept after played (lock on), or removed.
//
// <sequencer> = s[0-9]
//      select which sequencer to edit. All sequencers keep playing constantly, but
//      only one can be edited at a time.


/Stefan


cli_sequencer.ck
 Description:

Download
 Filename:  cli_sequencer.ck
 Filesize:  31.91 KB
 Downloaded:  510 Time(s)


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



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

PostPosted: Sun Oct 28, 2007 1:34 pm    Post subject: Reply with quote  Mark this post and the followings unread

By the way, I experience a problem with this if I try to use minor pace to play a three note chord (two is okay). Possibly the patch uses too much resources. If someone would try this and post the result it would be great:

type: 1iazq11idz

That's a nice two-note chord, right? Now add this:

q21igz

That breaks it up on my Macbook Pro - it should have been a third note to a major chord.

Thanks.

Also, I realise that you might not want to figure out how to add samples, I'm attaching an archive with some samples I made through my built in mic.

Some other things to try, for fun: Very Happy

1b3c5n7n2fx4p7b
q14p6m5pb
q27v74v8v

/Stefan


Arkiv.zip
 Description:

Download
 Filename:  Arkiv.zip
 Filesize:  345.4 KB
 Downloaded:  436 Time(s)


_________________
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
Kassen
Janitor
Janitor


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

PostPosted: Sun Oct 28, 2007 2:14 pm    Post subject: Reply with quote  Mark this post and the followings unread

Wow.

I think you are definitely on to something here, even if it's not immediately intuitively clear to me how everything works.

If I understand what's going on correctly you should be able to save some CPU by replacing SndBufs that hold identical samples with a single LiSa with that many voices, that might save some CPU?

Anyway, I'm very interested in the whole idea of using a sequencer as a realtime instrument instead of as a compositional tool and way of presentation and I think it's a very interesting approach to use just the laptop, including for source-sound recordings. Do keep this up! perform live using it! It's a huge thrill, here is my own last attempt;
http://bottomfeeder.ca/top/vinger.3gp
(save file as, many browsers try to load it as a text file, then run into issues as it's 11 or so MB). It's a extremely intense but rewarding thing to do.

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



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

PostPosted: Mon Oct 29, 2007 4:23 am    Post subject: Reply with quote  Mark this post and the followings unread

Thanks. Smile This is partly inspired by your advocacy for different performance interfaces. Will check out your video.

I'll give the LiSa tip a go - haven't checked out how LiSa works yet.

/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
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Mon Oct 29, 2007 11:00 am    Post subject: Reply with quote  Mark this post and the followings unread

This looks really cool to me, but at first attempt I cannot figure out how to make it work. I tried to RTFM but didn't get it. Can you start me off with some very simple commands, sort of take baby-steps? Then I'll probably catch on after that. I see the commands involve selecting a a sample, when to play it, and what effects to apply, or something like that. Let's start with just playing a sample with no effects at some regular interval - how do I do that? Keep in mind my music background is limited, which may be part of the problem. It looks like a great program for doing improvisational music!
Back to top
View user's profile Send private message Send e-mail
Kassen
Janitor
Janitor


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

PostPosted: Mon Oct 29, 2007 11:42 am    Post subject: Reply with quote  Mark this post and the followings unread

Antimon; Happy to have inspired someone and yes, I think interfaces are very important and underappreceated after all they are the language you use to talk to the instrument so the language needs to match the topic of conversation.

I think you are very much on the right track, for one thing right here you have the first step-sequencer I've ever heard of with facilities to very quickly (potentially faster then realtime) input chords. IMHO that's no mean feat, in fact it's quite spectacular to me, even if it has it's rough edges in this early stage.

LiSa is great and Dan Trueman is continually improving her (it's a "her", you see ;¬) ) if you like versatile and open ended ways of working with recorded material it's the Ugen for you.

As for a manual; I think I would recommend trying to explain not just the commands to Inventor and me but also explain a little more about the underlying philosophy of how you go from txt editor commands to sequencers. Not just because I'd very much like to be able to play yours and perhaps borrow from your ideas (I will of course share about what I borrow, how and why!) but also because I find that trying to explain something to outsiders is a great help in getting more clarity about it for yourself. For me I know that anything I find hard to explain is likely a weak-spot. Assuming you have the time, and desire of course.

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



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

PostPosted: Mon Oct 29, 2007 2:30 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ok, I realise that my "manual" isn't very clear on the basics. Smile Here's the principle:

Start by thinking about it as a 8-step sequencer. To play a sample at one of the steps, first you select which slot (I like to say slot instead of step), and then which sample is to be played at that slot. You select slots using the numbers 1-8, and a sample by pressing one of the characters at the lower row of the keyboard (which is z, x, c, v, b, n, or m on my swedish keyboard. Some keyboard layouts my differ from this - e.g. german keyboards, I think - you can find the assignments from keys to commands at the top of the ChucK source code).

Example: play sample z at the first slot:

Code:
1z


alternate between playing samples x and v:
Code:
1x3x5x7x2v4v6v8v


In addition to this I've added 7 minor slots between each of the major slots. If you want to place a sample at a minor slot you first type the major then the minor like this:

Quote:
25n


This will place sample n in the middle between the second and third major slot.

Quote:
2n21m


This will put sample n and m adjacent to each other at major slot two. Since they play in quick succession, they will kind of merge together, forming a new sound.

Moving on, I've added "commands", which are tweaks and macro-like things that you can specify for the sample that you want to add. For instance, the fade command will place two or more instances of the selected sample in succession in the sequencer, each having less volume than the one before:

Code:
6fv


places eight v samples adjacent to each other between major slot 6 and 7. Eight is the default for fading, but you can change it:

Quote:
6f3v


will use only three minor slots (61, 62 and 63), and:

Quote:
1f75b


Will place seven b samples with a gap of 5 minor slots in between.

Similarly, you can add a bunch of samples with modulated start point (i.e., at each minor slot, the sample will start playing at a different position than the one before):

Quote:
4s7x


The number after s specifies how the start point moves; values less than 6 move backwards, greater than 5 moves forward. Again, after s7, you can add number and spacing, if you want (default is eight samples with no space):

Quote:
4s743x


You can also change pitch (sample playback rate):

Quote:
3pm


And you can set a specific pitch using "piano keys", using capital P:

Quote:
1Pa3Pd5Pg


The keys start at a, with two black keys at w and e, and three black keys at t, y and u. I think that if an E has been sampled, a will play a C, but I haven't tested it.

Now to something I've had a lot of fun (and trouble) with. You can set the "minor pace", which decides the length in time between playing two minor slots. This will cause a Formant-like tone to be played, as the sample repeats at different speeds. Try this:

Quote:
1iav


i means set minor pace (m and p were occupied). The same kind of piano keys as for pitch is used, or you can use a number for arbitrary low or high pitches. To make this work (and keep the same length in time between major slots), if the sequencer reaches a ninth minor slot before it is time to play the next major, it will start over at the first minor slot, and keep playing round and round until the time is up for this major slot. If you add other effects (e.g. fade) while changing the minor pace, you will get strange wabbling effects, since the minor sequence will restart at full volume before you reach the next major. I could have done it so that only the first minor repeated over and over, but well... I didn't Smile I'm thinking about implementing sequencer-processed versions of fade etc, like in omit:

Quote:
1087o4c


This will cause sample o to be positioned at every major slot in the sequencer, but the "o4" means that only every fifth will be played (4 are silent). By using this you can make sequences seem longer than eight slots, and create syncopation. you can divide this up between several samples by using the join command:

Quote:
1o2c3jn6jx8jz


will cause samples at major slots 1, 3, 6 and 8 to be connected in a loop that plays one, skips two, plays one, skips two, and so on. Join means that the samples "joins in" on the previous commands omit counter.

There are also more than on sequencer:

Quote:
q2


means that you from now on are editing sequencer two. There are ten sequencers (0-9).

Phew! Maybe I missed some, but with this on your feet you might have a better understanding of the syntax description I've written in the ChucK file. I was hoping that the code would be readable enough that whoever was interested could add new commands fairly easily, but I realise that it's a bit of a monster patch... once I had the basic principle implemented, adding new commands went really fast. Writing this post made me realise that.

One things you should be able to do easily is change the samples - search for "sampleInfos" in the patch, and scroll down. You'll find filenames, start positions etc. I've only used really short samples so far, but you can change how long they'll play there.

Groove on! Gotta check that Lisa. afro

/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
Antimon



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

PostPosted: Mon Oct 29, 2007 2:38 pm    Post subject: Reply with quote  Mark this post and the followings unread

Oh yeah, if you want to erase a slot, use space:

Code:
1f<space>


will remove samples from all of the first eight minor slots (f really means fade, I use it just to get the default repeat 8 with zero gap behaviour - you can use p or s as well).

/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
Kassen
Janitor
Janitor


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

PostPosted: Mon Oct 29, 2007 3:10 pm    Post subject: Reply with quote  Mark this post and the followings unread

Aha! So it's heavily influenced by this trick people use in trackers to do time-stretching and so on. Cool!

It does seem to me that the method for removing data from the sequence is a bit primitive compared to the methods for getting it in there, or am I misunderstanding something? I think I'd also like a way to remove all instances of a certain sample or to turn off/ overwrite a certain specific note. Especially for changes that would have a equivalent in txt editors (search&replace). I could also imagine doing something like turning off every other instance of a regularly used sound off, for breakdowns and so on, that would be musically sensible and fit with the rest of your system as I understand it?

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


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Mon Oct 29, 2007 11:20 pm    Post subject: Reply with quote  Mark this post and the followings unread

OK, Antimon, thanks for the baby-steps tutorial. I understand now that I can place a sample anywhere in a 64-position time space by specifying a major and a minor time position, each 1-8. I also understand that I can select from samples using the lower row of the keyboard, cool! There are also effects like fade that fill in multiples of samples that I do not understand yet. Already I have two suggestions:

1. You could put more information in the printout. Right now it just shows an "x" where you have positioned a sample. Could you put perhaps the sample number there? That would be helpful.

2. Let's combine the Boolean sequencing with your concept. I propose adding new characters: &, |, and ^. If I type in 1&2 I place the note at positions where the Boolean AND of bits 1 and 2 are true. If I type 4^3^2^1 I place notes at the XOR of those bits. That would allow us to create nice note sequences according to Boolean algebra. What do you think of that?

Just some ideas, I really like your program!
Back to top
View user's profile Send private message Send e-mail
Antimon



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

PostPosted: Tue Oct 30, 2007 11:07 am    Post subject: Reply with quote  Mark this post and the followings unread

Thanks for your comments - greatly appreciated. Very Happy I was a bit afraid that this would pass by silently, people shaking there heads muttering "what is this guy on?". Laughing

Re: removing stuff - you can use modifiers like when you add stuff:

Code:
1<space>


erases the single first minor slot

Code:
1f3<space>


erases the first three minor slots

Code:
23f63<space>


erases six slots, starting at major slot 2 minor 3, and erasing every fourth minor slot from there. The f (as I mentioned) is just a kind of surrogate command that does nothing, mostly because it meant I didn't have to do any major exception in the parser. If it is too confusing I might consider removing it... but I think that some kind of syntactical barrier between the slot selection, the repeat/step info and the end of the command is needed.

You can also turn of "lock" (which I forgot to mention) by typing "l". This will make everything you add play only once, and then be removed from the sequence, until you type "l" again.

I've been thinking about implementing mute for individual sequencers. Applying a modifiction on all instances of a sample over the whole sequence is an interesting idea...

Re: boolean algebra - interesting idea, but I don't understand completely. Could you tell me in which slots you'd expect samples to appear if you typed 1&2 or 4^3^2^1?

Re: uninformative sequence printouts - you're completely right. I've been thinking about printing the sample as you say, but unfortunately I tend to be lazy and apathetic during most of my time off work. I'll try to shape up and implement those of your suggestions that are easy enough to do quickly though, soon.


Oh: another thing i forgot. Escape is supported, so if you've started typing a command, and change your mind, pressing <esc> will cancel it and allow you to start over.

/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
Kassen
Janitor
Janitor


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

PostPosted: Tue Oct 30, 2007 11:29 am    Post subject: Reply with quote  Mark this post and the followings unread

Antimon wrote:
"what is this guy on?"


Yeah, that's what I thought! Then I thought I wanted some of it too, they are planning to ban mushrooms here already so better send some fast before it's illegal.

I think this is some choice stuff, certainly deserving of a WiKi page. Frankly I find it quite strange that I never heard of anyone doing something similar before, it's basically like a prototype of a tracker for live usage.

The way you print the pattern (merging strings) leaks memory, by the way, but I'd leave it be if this doesn't cause issues as the alternative is quite ugly and we should have garbage collection soon-ish.

I also think some performance could be gained using "else if" in that parser function instead of a huge train of plain if's, the gains may be small but I'd like to save CPU so the amount of sounds used could go up.

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



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

PostPosted: Tue Oct 30, 2007 11:39 am    Post subject: Reply with quote  Mark this post and the followings unread

Kassen wrote:
Frankly I find it quite strange that I never heard of anyone doing something similar before, it's basically like a prototype of a tracker for live usage.


Actually I was thinking while I was working on it on my parent's porch that there has to be some linux (or other Unix) sequencer implemented that does this, maybe generating MIDI commands (which I'm planning to add) instead of sample playback. It seems the obvious approach if you are used to working on a command line.

/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
Kassen
Janitor
Janitor


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

PostPosted: Tue Oct 30, 2007 11:57 am    Post subject: Reply with quote  Mark this post and the followings unread

The closest thing in that sense that I can think of is this by Alex McLean
http://yaxu.org/rave.avi

Which comes from this page;
http://doc.gold.ac.uk/~ma503am/alex/asciirave/

That's from just a few months ago though.

You may also be interested in http://toplap.org/ if you didn't look at it yet, for one thing I got that video from a link on the Toplap mailing list. What you are doing seems related to some of the stuff that's going on there.

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



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

PostPosted: Wed Oct 31, 2007 11:12 am    Post subject: Reply with quote  Mark this post and the followings unread

Kassen wrote:
It's a huge thrill, here is my own last attempt;
http://bottomfeeder.ca/top/vinger.3gp


Finally got around to listening to this. Nice! Deep and tonal. Would have loved to feel those bass tones on something stronger than my monitors.

/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
Kassen
Janitor
Janitor


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

PostPosted: Wed Oct 31, 2007 2:21 pm    Post subject: Reply with quote  Mark this post and the followings unread

Blame little mobile phone mics....

The whole PA was quite modest and not well tuned, before the material you heard I tried to play some more atmospheric pieces but being very subtle was no option there.

What I really need next time is a small spot on my hands. That would be good to put more emphasis on the actual manual performance but also because this is the second video that was meant to demonstrate what I'm doing to forgein friends (and potential bookers as well....) that ends up looking like a documentary about five black cats in a dark room. Maybe I'll just press-gang a friend with a proper camera because despite my GF's best intentions and efforts those little phones can't really work with situations like that.

But... That point is that live sequencing can be done given a interface dedicated to it and I'd love to see/ hear your take on it once you& your system are ready for it. It's fun in a nerve-wrecking way and audiences do appreciate it.

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



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

PostPosted: Sat Nov 03, 2007 10:04 am    Post subject: Reply with quote  Mark this post and the followings unread

Added a few new features for manipulating the sequences:

Instead of selecting a slot at the start of a slot, you can instead type '0'. This will select all slots in the sequence. If you add another digit right after the zero, there will be a gap between the sample edits, and another digit specifies an offset at the start of the sequence. For example:

Code:
0c


fills the entire sequence with c samples

Code:
07n


places an n sample at every major position

Code:
042x


places an x sample at every fifth minor slot, starting at the third

Code:
0<space>


erases the entire sequence.

You can choose to modify the existing sample command at a slot with ',':

Code:
1fv
1p8,


first adds eights slots of faded v samples at the start, and then adds pitch glide to the same samples.

You can choose to keep the effects at a slot, while changing the sample using '.':

Code:
1fv
1.7b


first adds eight slots of faded v samples at the start, and then changes it to eight faded slots of b samples. Default amount of steps for . is 1, so you need to explicitly type 7 (singifying 7+1 slots to fill), or you'd just change the first minor slot.

I've also changed the sequencer printout so it shows which samples are where (cheers, Inventor Smile ).

/Stefan


cli_sequencer.ck
 Description:

Download
 Filename:  cli_sequencer.ck
 Filesize:  38.23 KB
 Downloaded:  383 Time(s)


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



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

PostPosted: Sat Nov 03, 2007 10:09 am    Post subject: Reply with quote  Mark this post and the followings unread

My personal most immediate todo list for this:

    Midi playback
    Randomization
    Temporary muting (sequences/samples)
    LFO modulation
    Fading/pitch gliding etc on a higher level, to prevent unlinear jumps when changing minor pace
    OSC (monome) support


/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
Antimon



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

PostPosted: Sun Nov 04, 2007 9:11 am    Post subject: Reply with quote  Mark this post and the followings unread

Added the MIDI effect 'w':

Code:
// <midi> = w[0-9]
//      means that the slot will be set to send a MIDI note command when executed.
//      The digit following 'w' indicates which MIDI device to use (if you only have
//      one MIDI devices the default setting 0 will suffice). The default MIDI command
//      is note 64 at full velocity. Pitch effects (<pitch> or <pitch>) will
//      change the note number, and fade effects (<fade> or <fade>) changes the
//      velocity. Some effects (such as start point) will not affect the command if
//      <midi> is selected.


As Kassen noticed, the sequencer will allow you to program chords. The MIDI effect will allow you to make use of polyphony in the receiving end - here's a major chord sent to MIDI channel 1 on the first device:

Code:
1w1Paz
q11w1Pdz
q21w1Pgz


One drawback is that you will probably want to extend gating on the MIDI device itself - I'm thinking about being able to glue several slots together, but I don't know if it will be practical in the code. Also, I had to increase the delay between note on and note off (check out the MIDI_DELAY constant at the top), because I lost the occasional note in my long thru chain. You might be able to set this to something smaller (20::ms was my first try, which fits into the rest of the sequence tempo).

/Stefan


cli_sequencer.ck
 Description:
v0.3

Download
 Filename:  cli_sequencer.ck
 Filesize:  41.63 KB
 Downloaded:  393 Time(s)


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



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

PostPosted: Sun Nov 04, 2007 9:15 am    Post subject: Reply with quote  Mark this post and the followings unread

Forgot to mention: which "sample" key you type decides the MIDI channel, so z corresponds to channel 1, x to channel 2 and so on. This means that, as of now, you can only use channels 1 - 7, but you can add your own mapping function in the voicePlayer shred (lines 424-433 in this version).

/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
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Sun Nov 04, 2007 11:37 am    Post subject: Reply with quote  Mark this post and the followings unread

Antimon wrote:
Re: boolean algebra - interesting idea, but I don't understand completely. Could you tell me in which slots you'd expect samples to appear if you typed 1&2 or 4^3^2^1?

/Stefan



Sorry I didn't get back to you right away, I missed that part of your message when I skimmed it over... OK, you have 8x8 slots, so in the Boolean sequencing technique that is a six bit binary counter, from 0 to 63. So you would have only numbers 0 through 5 to play with, which is fine. If you typed 0&1, that would be true whenever the zeroth bit and the first bit are both one, or in each minor slot that corresponds to binary 3, which you have labeled minor slot 4. If you typed 0^1, you would get the sample in each minor slot that corresponds to binary 1 and 2, or in your notation minor slots 2 and 3.

It would have been more consistent if you had labeled the slots 0 thru 7 instead of 1 thru 8 but that's OK.

If you receive a command with a !, &, |, or ^ then you do a six-bit count with nested for loops, test the expression, then put the sample in the slots that test true.

You may not want to add this feature, as you are probably able to build up such sequences manually without too much trouble using the commands you have already. If you had more than 64 slots, say 512 or so, then you would definitely want something like this because adding individual samples would get too tedious. At any rate, the beats you get by doing something like 0&1 | 2&3 are quite nice to hear.

One thing you could do is manually put in a sequence like 0&1 | 2&3 and then listen to how it sounds. Then you would have motivation to either add the feature or not add the feature. I hope its not a lot of work. The sequence of 0&1 | 2&3 is:

00010001 00011111 00010001 00011111 00010001 00011111 00010001 00011111

That's the same sequence repeated four times because I only used the lower four bits, but the expressions get more funky when you mix upper and lower bits like 5&0 | 4&1 | 3&2, that's a good one.
Back to top
View user's profile Send private message Send e-mail
Antimon



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

PostPosted: Sun Nov 04, 2007 1:47 pm    Post subject: Reply with quote  Mark this post and the followings unread

OK, now I get it. Very Happy Actually, with the new multi-slot selector, this might be a clever addition. I have some other things I think I will do first, but somewhere down the line I think I will try this out. Thanks!

/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
ixemul



Joined: Jul 29, 2008
Posts: 4
Location: Waterloo,ON

PostPosted: Tue Jul 29, 2008 6:41 am    Post subject: Reply with quote  Mark this post and the followings unread

just stumbled across this for the first time and it is amazing!

Thanks for posting this, it is really a treasure.

Have you made any further updates?

Thanks!
Back to top
View user's profile Send private message
Antimon



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

PostPosted: Thu Jul 31, 2008 6:48 am    Post subject: Reply with quote  Mark this post and the followings unread

ixemul wrote:
just stumbled across this for the first time and it is amazing!

Thanks for posting this, it is really a treasure.

Have you made any further updates?

Thanks!


Thanks, glad you like it! Very Happy

My concentration got diverted, so I haven't worked with this one for a while. I was planning making some other effects, tracing some bugs (the sequences behave mysteriously at times, some samples don't get played) and maybe integrating the monome as a control surface. Maybe add MIDI sends as alternatives to samples.

Another issue is that to get to the really clever things you may want to type long sequences, and its a bit hard to keep track on the command line - so I was thinking about some kind of graphical feedback (though you still type everything as commands).

By the way, welcome to electro-music.com!

/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
ixemul



Joined: Jul 29, 2008
Posts: 4
Location: Waterloo,ON

PostPosted: Thu Jul 31, 2008 7:55 am    Post subject: Reply with quote  Mark this post and the followings unread

Sounds like good ideas, and if I make any significant changes I'll be sure to let you know.

I should also tell you that I'm highly jealous of your monome. If you ever get sick of it... Wink

Thanks for the welcome; I've been poking around for a few months now but this was my first post.
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 2 [28 Posts]
View unread posts
View new posts in the last week
Goto page: 1, 2 Next
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