[Csnd] Step Sequencer problem
Date | 2010-12-02 17:34 |
From | Ed Costello |
Subject | [Csnd] Step Sequencer problem |
Hi, I'm trying to create a step sequencer type instrument, this uses to instruments with one triggering the other when a table value of 1 is read, unfortunately I'm getting a weird high pitched noise when I run the patch and can't figure out why its happening,
<CsoundSynthesizer> <CsOptions> </CsOptions> <CsInstruments> 0dbfs = 1 nchnls = 2 instr clock
k_clock phasor 1/2 gk_clock = k_clock
endin instr 1 ilength = 16 ktamp table gk_clock * ilength, p4, 0, 0, 1 if ktamp == 1 then event "i",2, 0, .1 endif
endin instr 2 a1 oscili .2, 100, 1 outs a1,a1 endin </CsInstruments> <CsScore> f 1 0 1024 10 1 f100 0 16 2 1 0 0 1 0 0 1 0 0 1 0 1 0 1 0 1 i"clock" 0 90 i1 0 2 100 </CsScore> </CsoundSynthesizer>
Anyone any ideas? Thanks Ed |
Date | 2010-12-02 17:57 |
From | Rory Walsh |
Subject | [Csnd] Re: Step Sequencer problem |
You're instrument is being triggered over and over again. The easiest albeit limited way to create a step sequencer is like this: |
Date | 2010-12-02 18:36 |
From | Ed Costello |
Subject | [Csnd] Re: Re: Step Sequencer problem |
Hey thanks for the reply, I wouldn't mind looking at the table version actually, I have other instruments in a score that use tables in a step sequencer way but the table is only being used to change the pitch, I ran into trouble with this because I'm now trying to make percussion instruments and you can't just have one long note playing with them.
On 2 December 2010 17:57, Rory Walsh <rorywalsh@ear.ie> wrote: You're instrument is being triggered over and over again. The easiest |
Date | 2010-12-02 18:47 |
From | Rory Walsh |
Subject | [Csnd] Re: Re: Re: Step Sequencer problem |
Here you go. I choose to write a special UDO that outputs a trigger pulse whenever it comes across a 1 in a function table. Let me know if it works ok. |
Date | 2010-12-02 19:09 |
From | Ed Costello |
Subject | [Csnd] Re: Re: Re: Re: Step Sequencer problem |
Fantastic! That works perfectly, I was able to slot that in with what I had already no problem, Thanks Rory On 2 December 2010 18:47, Rory Walsh <rorywalsh@ear.ie> wrote: Here you go. I choose to write a special UDO that outputs a trigger |
Date | 2010-12-02 19:21 |
From | Rory Walsh |
Subject | [Csnd] Re: Re: Re: Re: Re: Step Sequencer problem |
I'm glad it worked. I'm sure others could probably propose better ways of doing this, and perhaps easier ways too.. On 2 December 2010 19:09, Ed Costello |
Date | 2010-12-02 20:42 |
From | Victor Lazzarini |
Subject | [Csnd] Re: Re: Step Sequencer problem |
Easiest, but not that elegant! If Ed changes his code to this: instr 1 ktampold init 0 ilength = 16 ktamp table gk_clock * ilength, p4, 0, 0, 1 if ktamp == 1 && ktamp != ktampold then event "i",2, 0, .5 endif ktampold = ktamp endin He has a more general step sequencer without all those ifs and elses Victor On 2 Dec 2010, at 17:57, Rory Walsh wrote: > You're instrument is being triggered over and over again. The easiest > albeit limited way to create a step sequencer is like this: > > |
Date | 2010-12-03 17:21 |
From | Aidan Collins |
Subject | [Csnd] Re: Re: Re: Step Sequencer problem |
Another option would be using the reinit opcodes. I don't have an example with me here that I can post (I could dig one up later), but I've had some success using a table to store pitch values and another to store the time value for the "timout" portion of the reinit cycle. Or if you want to use a constant step size, you could just store amplitudes and pitches in the tables. Either way, reinit could let you avoid needing all the if statements. On Thu, Dec 2, 2010 at 3:42 PM, Victor Lazzarini |
Date | 2010-12-03 19:44 |
From | Rory Walsh |
Subject | [Csnd] Re: Re: Re: Re: Step Sequencer problem |
I'd like to see a version using reinit if you have it. Great. On 3 December 2010 17:21, Aidan Collins |
Date | 2010-12-03 20:47 |
From | joachim heintz |
Subject | [Csnd] Re: Re: Re: Re: Re: Step Sequencer problem |
one suggestion: |
Date | 2010-12-04 22:01 |
From | Aidan Collins |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Step Sequencer problem |
Attachments | Reinit_Sequencer.csd |
Here's that sequencer I made a while back using the timout and reinit opcodes. I think there's a lot more that can be done with this method, now that I'm looking at it again. Right now it's using a phasor to read through the sequence tables at the same speed, I had been using another table for a while that would store values for the timing parameter of the reinit loop, but that was a little difficult to keep in sync with the values for notes and dynamics. I think if it would use a counter variable and increment it in each reinit loop that would make it easier to keep place while changing the durations of each note cycle. Anyway, let me know what you think. Aidan On Fri, Dec 3, 2010 at 3:47 PM, joachim heintz |
Date | 2010-12-05 11:59 |
From | joachim heintz |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Re: Step Sequencer problem |
yes i think a phasor is not needed, and everything could be done with increments. if you use tab_i instead of table, you can use tables of any length. this, for instance, repeats a sequence of 13 notes in a sequence of 11 durations: |