Jump to content

Any C Sequencer examples?


sneakthief

Recommended Posts

I'm in the process of developing a very simple pattern sequencer that supports up to 256-measure long tracks.

I was wondering if anyone here had any C examples of sequencers of any kind that they'd be willing to share? I will document this project and post the code.

My first version will simply play back pre-loaded patterns - so I don't need any pattern-programming capabilities yet.

sneakyseq2a.jpg

(31cmx17cmx10cm)

Here are the specifications:

1. 2 independent sequencers, one of which can be slaved to the other.

2. Each sequencer will be able to load one "song" at a time. A song is chosen by the push-button rotary encoder.

3. 16 sections per song

4. 6 tracks per section that can be muted or unmuted with the track-mute buttons (more than 6 tracks could be implemented, but that's all I need)

5. 256 measures per track  - this is where this really differs from the Midibox Seq

4. Components:

2x Cores

2x AIN

2x DIN

2x DOUT

2x 16x2 PLED - $21 US each http://home.swipnet.se/ridax/connector.htm

pled.jpg

1x case - 14,50 euro  http://www.reichelt.de/?SID=22Qq-CFn8AAAIAADkJaHM6632e15d52ed8ada3ec8c009a7e3b932;ACTION=3;LA=5;GROUP=C712;GROUPID=3354;ARTICLE=21189;START=0;SORT=artnr;OFFSET=16

TEKO363.jpg

20x knobs - $0.35 each http://futurlec.com/SwKnob.shtml

Knob_3.jpg

20x pots - $0.50 each http://futurlec.com/PotRot.shtml

POTa.jpg

52x buttons - 0,35 euro each from http://www.pollin.de/shop/tabelle.php?ts=0&pg=OA==&a=OTU4OTA5OTk=&w=NDk2OTk4

G420460.JPG

2x push-button encoders - 0,75 euro each from Pollin.de

G240313.JPG

The total cost is roughly 180 euro. You can save 20 euro by getting LCD's instead of PLED's.

I've already ordered everything and the hardware should be finished next month. Then comes the hard part :) I'll be posting build pics next month.

cheers,

michel

ps. Thorsten - You'll be happy to know that I changed the pot spacing so there's 3cm between each post!

Link to comment
Share on other sites

Oh I forgot to mention why I'm building this:

I perform live electronic dance music for a living and want something lighter to replace my aging RM1x.

I currently use a Yamaha RM1x to sequence Kontakt 2, which is loaded with 6gb of my home-made loops and samples. The pots control various effects and scripts in Kontakt.

In the top right, you can see my tiny silver PC that weighs only 2kg. When I turn it on, it automatically loads Kontakt with all my samples - so I don't need a monitor, keyboard or mouse!

cork2.jpg

cork1.jpg

(and that lil' red box is my little Midibox Clockbox that syncs up all my sequencers :) )

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Update:

sneakyseq2b.jpg

IMG_1456.JPG

IMG_1458.JPG

IMG_1470.JPG

IMG_1500.JPG

IMG_1501.JPG

IMG_1509.JPG

IMG_1720.JPG

IMG_1721.JPG

IMG_1722.JPG

IMG_1723.JPG

IMG_1725.JPG

IMG_1727.JPG

IMG_1728.JPG

IMG_1730.JPG

IMG_1732.JPG

IMG_1734.JPG

Here's what's left to do:

- install LED's

- finsish panel wiring

- finish software *heheh*

I really wanted to paint the front panel black but I simply don't have time and I have 7 gigs coming up... plus it's really irritating to do a few coats of paints and a clear-coat and then suddenly some holes are too small for pots & buttons.

Link to comment
Share on other sites

i decided the silver was too distracting so i'm going "the extra mile" and painting it black today.

re. knobs - futurlec.com (i posted a link for all my parts at the beginning ;)

re. colourful - you're the second person be pointing that out  ::)

honestly, when you're performing in a dark club, it really improves the user interface if you only have to quickly glance to see what find a button or knob. for example, i've got knobs permanently assigned to things like chorus, flanger, phaser, delay, lo-pass, hi-pass, bit crusher, etc... hence the very specific colour-coding. sorry to get a bit defensive, but i perform live for a living and this particular user-interface design is backed up by 10 years of experience 8)

Link to comment
Share on other sites

Hey sneak, I already checked your links but there is no knobs I see on this picture:

sneakyseq2b.jpg

honestly, when you're performing in a dark club, it really improves the user interface if you only have to quickly glance to see what find a button or knob. for example, i've got knobs permanently assigned to things like chorus, flanger, phaser, delay, lo-pass, hi-pass, bit crusher, etc... hence the very specific colour-coding. sorry to get a bit defensive, but i perform live for a living and this particular user-interface design is backed up by 10 years of experience

Dont you worry about my comment, I am slave of colour minimalism. :P  For club useage color coding makes much more sense.

Link to comment
Share on other sites

ahhh, those knobs! they're for my DIY-modular.

those are RE-AN Softtouch knobs as seen on many Euro-Rack and Frac-Rack modulars. I bought them from http://www.Rapidonline.com for 0.08p each.

This is the direct link:

http://www.rapidonline.com/productinfo.aspx?kw=soft%20touch&tier1=Tools%2c+Fasteners+%26+Production+Equipment&tier2=Fasteners+%26+Fixings&tier3=Knobs&tier4=16mm+soft+touch+knob&moduleno=64710

Link to comment
Share on other sites

update - i'm thick in the middle of programming it... ugh ;)

midi clock is sending, tempo & transport controls are working, buttons respond to section changes and pots transmit midi cc's.

still have to finish implementing song loading, track mutes and reading sequences from arrays.

wish me luck!

blinding.jpg

runway.jpg

uhhh, i think i'm going to have to drop the voltage to the blue led's or do some PWM tricks 8)

Link to comment
Share on other sites

In my case, it makes perfect sense to design the user-interface first because the software can easily be modified to fit my workflow.

Software Description:

Over the last decade, I've written all sorts of material (over 100 different songs, some completely finished, some very raw) on my rm1x and rs7000's in pattern-mode.

Pattern-mode consists of up to 16 sections, each having 16 tracks. This is the basic sequencing paradigm that i wanted to use.

             

For my live performances, I need control over groups of tracks and not each individual track. Look at the following typical example on my rs7000:

Track          Instrument

-----          -----------

1                kick

2                snare

3                hihat

4                claps

5                rides

6                other percussion

7                vocal samples

8

9                bass

10              melody 1

11              melody 2

12              pad

13              sfx 1

14              sfx 2

15              sfx 3

16

Since it's more efficient to control instrument groups, I spent a month recording *all* of my studio synths and samplers and broke down songs into various 1-16 measure loops, so now the typical track looks like this:

Track          Instrument

-----          -----------

1                kick

2                all other drums

3                bass

4                melodies 1+2, pads

5                vocals

6                sfx 1-3

So, this gives me the ability to improvise with song structure, as well as being able mix & match parts of various songs in order to create a spontaneous live performance, albeit with bigger building blocks than your traditional midi sequencer.

However since I also use my rs7000 live, I still have very fine control over midi notes and such with one half of my setup.

The other huge benefit of all the sampling is that I don't have to bring as much gear when I perform, and yet Kontakt's scripting language is very powerful and allows me to retain the expressiveness over how the samples are played back.

The most important aspect is being able to respond to the dancefloor, and this setup accomplishes that nicely. The hardest part is finding a balance between automation and ability to control.

Link to comment
Share on other sites

ok, i'm going to use the sequence as is this weekend and then implement the suggestions posted here next week.

so just for fun, here's the crappy code for my mostly-functional sequencer:

http://www.sneak-thief.com/sneakyseq/sneaky-seq-0.1a.zip

caveat emptor: i'm not sure who else will find this useful because it's really customized to how i trigger loops in kontakt.

cheers,

michel

Link to comment
Share on other sites

Heya bud.

Try these. I've broken that notorious switch statement down so as to make a nice clean jumptable. The app now uses five temp variables instead of 37, and doesn't flip around like it used to. 25-26 should work now :)

This is definitely the way to go with switch statements in SDCC.

Let me know :)

Edit: Does 'i' really need to be an int?

mclock.h

mclock.c

mclock.h

mclock.c

Link to comment
Share on other sites

here's the fully-functional source, complete with all my song data *lol*

http://www.sneak-thief.com/sneakyseq/sneakyseq%20v1.zip

cheers to TK, stryd-one, mess, audiocommander and everyone who helped!

FYI - Timeline:

I planned a rough draft of the algorithm last year, but since then only spent a few hours here and there doing the user interface (which to me is the most important).

I only seriously decided to build it last month, then I sourced all the parts and received them a couple of weeks ago. I spent 8 days building the hardware and another 7 days to get the software to a working state.

I feel like I've been shot through a cannon!! :P

best regards to the midibox cru,

michel

ps. mineral water is fine with me too because i don't drink at gigs :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...