Hi all
I know this is a little off topic, but this seems like the best place to ask. I was wondering what the best way to implement a sequencer is. I know that's a big question, but I mean in the most abstract way. I've been experimenting with java and have tried keeping the MIDI notes in a sorted list and have a thread that, after its started, checks the elapsed time (in 1/64th ticks) compared to the first MIDI note's timestamp. If the timestamp matches the current tick then it does something with that note. I've been sending messages to Pure Data and tested the accuracy of the clock with the [timer] object, but sometimes there are audible differences in the timing when trying to output notes at regular intervals.
I hope that paragraph was coherent...my question is what is a good way to implement a sequencer (if anyone has an abstract explanation)? I'd like to be able to record notes on the fly, if possible.
thanks
-brendan
This is a good question! Hopefully Frank's RRadical project, in particular the Memento class of state saving abstractions, will make this easier to deal with. Also the new [list] class of objects should help out with this stuff.
Unfortunately, if you are a newbie, it can be a bit of a pain in the ass to install Memento/RRadical and have it work. This will change, I'm guessing, once Frank updates it to Pd 0.39 standards of graph on parent and list.
In the meantime, you can use things like [textfile] and [qlist] to keep track of notes, velcities, times, and other controller messages.
Anyone with more experience want to offer some expertise?
~Kyle
On 12/2/05, bstine@telus.net bstine@telus.net wrote:
Hi all
I know this is a little off topic, but this seems like the best place to ask. I was wondering what the best way to implement a sequencer is. I know that's a big question, but I mean in the most abstract way. I've been experimenting with java and have tried keeping the MIDI notes in a sorted list and have a thread that, after its started, checks the elapsed time (in 1/64th ticks) compared to the first MIDI note's timestamp. If the timestamp matches the current tick then it does something with that note. I've been sending messages to Pure Data and tested the accuracy of the clock with the [timer] object, but sometimes there are audible differences in the timing when trying to output notes at regular intervals.
I hope that paragraph was coherent...my question is what is a good way to implement a sequencer (if anyone has an abstract explanation)? I'd like to be able to record notes on the fly, if possible.
thanks
-brendan
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- http://perhapsidid.blogspot.com (((())))(()()((((((((()())))()(((((((())()()())()))) (())))))(()))))))))))))(((((((((((()()))))))))((()))) ))(((((((((((())))())))))))))))))))__________ _____())))))(((((((((((((()))))))))))_______ ((((((())))))))))))((((((((000)))oOOOOOO
hey Kyle! I'm definitely interesting in patch state saving, but what i'm looking for is theory for the sequencing mechanism. It's because I'm trying to write a simple sequencer...pretty much just a piano roll.
I figure the "sequencer" is either a callback that's called every X milliseconds or some kind of event queue with timestamps thats checked by a thread. I tried making a callback mechanism in java and it was awful, skipped beats all the time. The event queue seems to work better but I was wondering what other people have done. The [metro] object in PD has perfect timing, if anyone could explain how it works I'd much appreciate it.
thanks
-brendan
Quoting Kyle Klipowicz kyleklip@gmail.com:
This is a good question! Hopefully Frank's RRadical project, in particular the Memento class of state saving abstractions, will make this easier to deal with. Also the new [list] class of objects should help out with this stuff.
Unfortunately, if you are a newbie, it can be a bit of a pain in the ass to install Memento/RRadical and have it work. This will change, I'm guessing, once Frank updates it to Pd 0.39 standards of graph on parent and list.
In the meantime, you can use things like [textfile] and [qlist] to keep track of notes, velcities, times, and other controller messages.
Anyone with more experience want to offer some expertise?
~Kyle
On 12/2/05, bstine@telus.net bstine@telus.net wrote:
Hi all
I know this is a little off topic, but this seems like the best place to
ask. I
was wondering what the best way to implement a sequencer is. I know that's
a
big question, but I mean in the most abstract way. I've been experimenting
with
java and have tried keeping the MIDI notes in a sorted list and have a
thread
that, after its started, checks the elapsed time (in 1/64th ticks) compared
to
the first MIDI note's timestamp. If the timestamp matches the current tick
then
it does something with that note. I've been sending messages to Pure Data
and
tested the accuracy of the clock with the [timer] object, but sometimes
there
are audible differences in the timing when trying to output notes at
regular
intervals.
I hope that paragraph was coherent...my question is what is a good way to implement a sequencer (if anyone has an abstract explanation)? I'd like to
be
able to record notes on the fly, if possible.
thanks
-brendan
PD-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
-- http://perhapsidid.blogspot.com (((())))(()()((((((((()())))()(((((((())()()())()))) (())))))(()))))))))))))(((((((((((()()))))))))((()))) ))(((((((((((())))())))))))))))))))__________ _____())))))(((((((((((((()))))))))))_______ ((((((())))))))))))((((((((000)))oOOOOOO
Oh, well do check out the RRadical sequencer then. It's in the abstractions folder of CVS. It is a piano roll type, so you could probably get a lot out of that.
~Kyle
On 12/2/05, bstine@telus.net bstine@telus.net wrote:
hey Kyle! I'm definitely interesting in patch state saving, but what i'm looking for is theory for the sequencing mechanism. It's because I'm trying to write a simple sequencer...pretty much just a piano roll.
I figure the "sequencer" is either a callback that's called every X milliseconds or some kind of event queue with timestamps thats checked by a thread. I tried making a callback mechanism in java and it was awful, skipped beats all the time. The event queue seems to work better but I was wondering what other people have done. The [metro] object in PD has perfect timing, if anyone could explain how it works I'd much appreciate it.
thanks
-brendan
Quoting Kyle Klipowicz kyleklip@gmail.com:
This is a good question! Hopefully Frank's RRadical project, in particular the Memento class of state saving abstractions, will make this easier to deal with. Also the new [list] class of objects should help out with this stuff.
Unfortunately, if you are a newbie, it can be a bit of a pain in the ass to install Memento/RRadical and have it work. This will change, I'm guessing, once Frank updates it to Pd 0.39 standards of graph on parent and list.
In the meantime, you can use things like [textfile] and [qlist] to keep track of notes, velcities, times, and other controller messages.
Anyone with more experience want to offer some expertise?
~Kyle
On 12/2/05, bstine@telus.net bstine@telus.net wrote:
Hi all
I know this is a little off topic, but this seems like the best place to
ask. I
was wondering what the best way to implement a sequencer is. I know that's
a
big question, but I mean in the most abstract way. I've been experimenting
with
java and have tried keeping the MIDI notes in a sorted list and have a
thread
that, after its started, checks the elapsed time (in 1/64th ticks) compared
to
the first MIDI note's timestamp. If the timestamp matches the current tick
then
it does something with that note. I've been sending messages to Pure Data
and
tested the accuracy of the clock with the [timer] object, but sometimes
there
are audible differences in the timing when trying to output notes at
regular
intervals.
I hope that paragraph was coherent...my question is what is a good way to implement a sequencer (if anyone has an abstract explanation)? I'd like to
be
able to record notes on the fly, if possible.
thanks
-brendan
PD-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
-- http://perhapsidid.blogspot.com (((())))(()()((((((((()())))()(((((((())()()())()))) (())))))(()))))))))))))(((((((((((()()))))))))((()))) ))(((((((((((())))())))))))))))))))__________ _____())))))(((((((((((((()))))))))))_______ ((((((())))))))))))((((((((000)))oOOOOOO
-- http://perhapsidid.blogspot.com (((())))(()()((((((((()())))()(((((((())()()())()))) (())))))(()))))))))))))(((((((((((()()))))))))((()))) ))(((((((((((())))())))))))))))))))__________ _____())))))(((((((((((((()))))))))))_______ ((((((())))))))))))((((((((000)))oOOOOOO
Hallo, bstine@telus.net hat gesagt: // bstine@telus.net wrote:
I know this is a little off topic, but this seems like the best place to ask. I was wondering what the best way to implement a sequencer is. I know that's a big question, but I mean in the most abstract way.
It is indeed a big question. There are several approaches to sequencing in general, some are also used in Miller's Pd docs and of course in his book (http://crca.ucsd.edu/~msp/techniques.htm) in the chapter on control computations. In the RRADical sequencers mentioned here I took a very simple approach, which is limited to pop music in 4/4 and with constant beat dvisions: I just divide a beat into 16 or 32 event slots, which are visited by a counter. If there is an event stored, when the counter hits a specific slot, it is output. Events can be one or two numbers in the current sequencers. This looks like:
slot ev1 ev2
0 60 127
1
2 60 0
3 40 75
...
16 60 127
Then I just use many of these to build real patterns.
Note that this is indeed very limited. A better approach IMO is to introduce a more general notion of an "Event" and then store the time of occurence or the so called Inter-onset Interval. The IOI is more popular in computer music I think, as you can do a lot of fine calculations on it, like scaling the IOI will make a sequence run in a differnet tempo etc.
[qlist] uses IOI times and can be used to record and playback events. However it's hard to get at the data stored inside a qlist to do funkier things. To find out the IOI between two events a
[t b b] | | [timer]
has proven to be very reliable.
Miller's data structure sequencer in the data structure examples is also somehow using IOI internally. The data structure events use x-position as onset times, but then Miller calculates the actual IOIs to drive a [delay] to the next event.
Data structures are really nice to do sequencing. You can put a lot of data, not just note and velocity, into the structure, position it and play it, do transformations by traversing all notes etc.
An example on how to record into a data structure windows is here: http://royalrabbit.goto10.org/svn/goto10/pd-patches/fbar/pipeseq/
Instead of using a data structure window to store a sequence, in other patches I also used the h_list and h_map externals from PDConainter for sequencing. They lack the graphical appearance, but have some other nice features. The basic idea there is to either [timer]-tag rows in a [h_list], then sent the complete list to [pipe], or use a [del]-construction similar to the data structure sequencer which uses IOI times. This is more flexible if you want to to stuff like tempo changes while a sequence is playing - which never happens in techno music so there all this unnecessary anyways.
For reading about this stuff, I can for example recommend Robert Rowe's "Machine Musicianship" at MIT Press, IIRC.
Frank Barknecht _ ______footils.org_ __goto10.org__
Hmm, now that you mention data structures, I build a sequencer of sorts
starting from the data structures example included in Pd. You can
download it here:
Basically, it sequences playing lots of overlapping samples. But its
not your typical sequencer.
.hc
On Dec 3, 2005, at 5:33 AM, Frank Barknecht wrote:
Hallo, bstine@telus.net hat gesagt: // bstine@telus.net wrote:
I know this is a little off topic, but this seems like the best place
to ask. I was wondering what the best way to implement a sequencer is. I know
that's a big question, but I mean in the most abstract way.It is indeed a big question. There are several approaches to sequencing in general, some are also used in Miller's Pd docs and of course in his book (http://crca.ucsd.edu/~msp/techniques.htm) in the chapter on control computations. In the RRADical sequencers mentioned here I took a very simple approach, which is limited to pop music in 4/4 and with constant beat dvisions: I just divide a beat into 16 or 32 event slots, which are visited by a counter. If there is an event stored, when the counter hits a specific slot, it is output. Events can be one or two numbers in the current sequencers. This looks like:
slot ev1 ev2 0 60 127 1 2 60 0 3 40 75 ... 16 60 127
Then I just use many of these to build real patterns.
Note that this is indeed very limited. A better approach IMO is to introduce a more general notion of an "Event" and then store the time of occurence or the so called Inter-onset Interval. The IOI is more popular in computer music I think, as you can do a lot of fine calculations on it, like scaling the IOI will make a sequence run in a differnet tempo etc.
[qlist] uses IOI times and can be used to record and playback events. However it's hard to get at the data stored inside a qlist to do funkier things. To find out the IOI between two events a
[t b b] | | [timer]
has proven to be very reliable.
Miller's data structure sequencer in the data structure examples is also somehow using IOI internally. The data structure events use x-position as onset times, but then Miller calculates the actual IOIs to drive a [delay] to the next event.
Data structures are really nice to do sequencing. You can put a lot of data, not just note and velocity, into the structure, position it and play it, do transformations by traversing all notes etc.
An example on how to record into a data structure windows is here: http://royalrabbit.goto10.org/svn/goto10/pd-patches/fbar/pipeseq/
Instead of using a data structure window to store a sequence, in other patches I also used the h_list and h_map externals from PDConainter for sequencing. They lack the graphical appearance, but have some other nice features. The basic idea there is to either [timer]-tag rows in a [h_list], then sent the complete list to [pipe], or use a [del]-construction similar to the data structure sequencer which uses IOI times. This is more flexible if you want to to stuff like tempo changes while a sequence is playing - which never happens in techno music so there all this unnecessary anyways.
For reading about this stuff, I can for example recommend Robert Rowe's "Machine Musicianship" at MIT Press, IIRC.
Ciao
Frank Barknecht _ ______footils.org_ __goto10.org__
PD-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
"I have the audacity to believe that peoples everywhere can have three
meals a day for their bodies, education and culture for their minds,
and dignity, equality and freedom for their spirits."
- Martin Luther King, Jr.