[PD] sequencer with microedit

Frank Barknecht fbar at footils.org
Mon Jun 11 11:13:27 CEST 2007

Kuba Szczypek hat gesagt: // Kuba Szczypek wrote:

> Firstly I say about my idea. I would like to build all complette mini 
> setup for compose and play live. Since I have synthesizers I mostly will 
> try to build:
> A. -classic sequencer MIDI with functions: event list, copy tracks, 
> merge tracks, add bars, delete bars, shift tracks by ticks & transpose & 
> volume & pan (of course on the fly or based on "process apply"), track 
> names, mute/solo, loop points, change songs in short time.
> Of course it isn`t important to have compability with SMF, but since I 
> seen seq from Cyclone I know that I must also learn C.  But firstly I 
> would like to do this "sipler" in pd.
> Maybe it is harder i pd than in C, but I not started learn C yet.
> For me it is BIG and complicated project. 

I agree, indeed this sounds like a big project. One thing I would
recommend from a software engineer's point of view is to divide it
into smaller, functional tasks, that you can later combine into bigger

> I decided to use arrays in table for storing all data.

Actually I think, data structures would be much better for this in the
long run. With tables, you would need to use lots of tables and keep
track of the names of all these tables and what kind of function the
various tables have. For example even simple note event has at least
four properties: note, velocity, start time and duration. You would
either need four tables to store many of these or make a table where
you read out numbers in groups of four. But if you later decide to
also include something like instrument number in a note event, then
you need another table or you need to change your whole patch to read
out your event-table in groups of five instead of four!

Data structures make all this much easier. You could start with a
simple structure for note events that would contain the fields for
note, velocity, onset time and duration. This can be extended later to
include instrument number or whatever by just adding a field to the
noteevent structure in one place.

Also passing around these noteevents to the various sequencing objects
e.g. [pipe] is much easier. And of course editing can be simply done
with the mouse.

I believe that data structures aren't that hard to learn and
definitely nothing to be afraid of if you approach them with some
patience until it makes "click" in your head. There is a very good
pdf-introduction to data structures on the puredata.info site, and
there's the simple tutorial in patch format that I wrote for
pd~convention 2004 included in the convention documentation. These
should get you started.

I would recommend trying build a simple data structure note-event
player first. Just create a [struct event float x float y float
duration] where you take "x" for onset-time and "y" for frequency.
Ignore velocity for now. To paint it, just use a simple [drawnumber x]
at first. [drawnumber] is much easier to use at first compared to
[drawpolyon] etc. 

Then learn how to add many of these events to a subpatch. See the help
for [append] and [struct]. After that, learn how to walk through the
events in your patch, first manually, then sequenced automatically.
Attached patch contains an example for all this.

 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
A non-text attachment was scrubbed...
Name: simple-seq-ds.pd
Type: application/puredata
Size: 3434 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20070611/b12bb05e/attachment.bin>

More information about the Pd-list mailing list