Author |
Message |
ark
Joined: Mar 06, 2008 Posts: 679 Location: New Jersey
Audio files: 13
G2 patch files: 31
|
Posted: Mon Mar 02, 2009 10:22 am Post subject:
How can I emit a pulse whenever a logic signal changes? Subject description: I can do it but feel like there should be a simpler way |
|
|
I have a logic signal that changes from time to time at LFO-ish rates. I want to emit a short pulse each time it changes.
Straightfoward way: Put the signal into a pulse generator, invert the signal and put the output of the inverter into another pulse generator, and "or" the two pulses together.
That takes three modules. Is there an easier way? |
|
Back to top
|
|
|
Antimon
Joined: Jan 18, 2005 Posts: 4145 Location: Sweden
Audio files: 371
G2 patch files: 100
|
Posted: Mon Mar 02, 2009 1:16 pm Post subject:
|
|
|
By "changes" you mean crosses zero? Then I can't think of a more economical signal.
First I though "changes" meant, say, from 63.1 to 63.2. That's a problem I've been scratching my head at over for a couple of years.
/Stefan _________________ Antimon's Window
@soundcloud @Flattr home - you can't explain music |
|
Back to top
|
|
|
ark
Joined: Mar 06, 2008 Posts: 679 Location: New Jersey
Audio files: 13
G2 patch files: 31
|
Posted: Mon Mar 02, 2009 1:22 pm Post subject:
|
|
|
Actually, I meant that it's a logic signal -- i.e. it is either "true" or "false." In fact, it's the output of a level comparison module, which I think is always 64 or 0. |
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Mon Mar 02, 2009 1:23 pm Post subject:
|
|
|
Usually I take a high pass filter followed by a diode module (double rectifying for this case), but there is not much control over the pulse duration this way and it may be less efficient cpu wise.
Detecting changes in pulse duration seems a lot less straight forward _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
ark
Joined: Mar 06, 2008 Posts: 679 Location: New Jersey
Audio files: 13
G2 patch files: 31
|
Posted: Mon Mar 02, 2009 1:43 pm Post subject:
|
|
|
Ah! I didn't realize there was a full-wave rectifier.
As it happens, in this particular case, pulse duration doesn't matter as long as it's not too long.
Here is what I am really trying to do.
I would like to build a note sequencer with MIDI output that gives me the degree of control one finds on synths such as the Radias or Blofeld, in which for each note you can specify pitch, duration, and velocity.
No problem so far -- except I would also like to be able to have a swing rhythm, and I would like the note durations to change automatically as the swing amount changes. This requirement seems to rule out using a clock generator module directly, despite its swing facility, because I don't know how to make the note duration change as swing changes.
So here is how I'm trying to solve the problem. It occurs to me that an LfoShpA module can generate a triangle wave with a variable slope. If I can detect the up and down peaks, I can reverse the polarity of every other segment, and get a triangle wave with two alternating frequencies. Then I can use level comparisons on the triangle waves to decide when to cut off each note. |
|
Back to top
|
|
|
Chet
Joined: Nov 19, 2004 Posts: 231 Location: Lititz,PA,USA
Audio files: 7
G2 patch files: 35
|
Posted: Mon Mar 02, 2009 2:02 pm Post subject:
|
|
|
You could feed the original signal into a short delay and then XOR the delay's output with the original signal. |
|
Back to top
|
|
|
Tim Kleinert
Joined: Mar 12, 2004 Posts: 1148 Location: Zürich, Switzerland
Audio files: 7
G2 patch files: 236
|
|
Back to top
|
|
|
iPassenger
Joined: Jan 27, 2007 Posts: 1067 Location: Sheffield, UK
Audio files: 5
G2 patch files: 78
|
Posted: Tue Mar 03, 2009 4:59 am Post subject:
|
|
|
Chet wrote: | You could feed the original signal into a short delay and then XOR the delay's output with the original signal. |
hehe..
Cunning and then the delay sets the pulse duration, set it too long in relation to the rhythm though and it starts to fall over. Love the solution tho, sorry tim can't see yrs as I'm at work. _________________ iP (Ross)
- http://ipassenger.bandcamp.com
- http://soundcloud.com/ipassenger |
|
Back to top
|
|
|
iPassenger
Joined: Jan 27, 2007 Posts: 1067 Location: Sheffield, UK
Audio files: 5
G2 patch files: 78
|
Posted: Tue Mar 03, 2009 5:09 am Post subject:
|
|
|
ark wrote: |
So here is how I'm trying to solve the problem. It occurs to me that an LfoShpA module can generate a triangle wave with a variable slope. If I can detect the up and down peaks, I can reverse the polarity of every other segment, and get a triangle wave with two alternating frequencies. Then I can use level comparisons on the triangle waves to decide when to cut off each note. |
I'm really struggling to understand this sat at work, please post it if you get it sorted out tho as it sounds great.
Drifting OT: Presumably you could create your own groove template by using a delay line, running the standard clock signal through it, also sending that clock signal to a groove sequencer, the groove sequencer value output goes to the delay mod input and the output of the delay line to trigger your actual sequencers. Positive and negative values of the groove sequencers would push the timing of the notes in either direction.
The down side to this would be that the amount of groove would be dependent on tempo as this wouldn't be taken into account by the delay unit, so perhaps the output of the groove sequencer would need to be scaled to the tempo some how. Furthermore the whole sequence would need to be delayed somewhat in order to allow for negative time shift of the triggered notes. _________________ iP (Ross)
- http://ipassenger.bandcamp.com
- http://soundcloud.com/ipassenger |
|
Back to top
|
|
|
ark
Joined: Mar 06, 2008 Posts: 679 Location: New Jersey
Audio files: 13
G2 patch files: 31
|
|
Back to top
|
|
|
iPassenger
Joined: Jan 27, 2007 Posts: 1067 Location: Sheffield, UK
Audio files: 5
G2 patch files: 78
|
Posted: Tue Mar 03, 2009 8:26 am Post subject:
|
|
|
Ok,
Just had a clumsy idea that might work. What if you use shift register clocked by 392Hz LFOC.
The input to the shift register is the output of your SHPLFO, take the second output (and therefore delayed) of the shift register and plug it into one side of a comparator and the other input gets yr signal straight from the SHPLFO. So now you will be able to tell when the lfo is going in one direction (and therfore when it is going in the other).... It should also remain a yellow rather than orange signal. You could use either logic invertor or another comparator if you needed two logic signals all the time.
Sorry if this duplicates ideas already referenced but am stuck at work so cant really test anything out here. _________________ iP (Ross)
- http://ipassenger.bandcamp.com
- http://soundcloud.com/ipassenger |
|
Back to top
|
|
|
ark
Joined: Mar 06, 2008 Posts: 679 Location: New Jersey
Audio files: 13
G2 patch files: 31
|
|
Back to top
|
|
|
Chet
Joined: Nov 19, 2004 Posts: 231 Location: Lititz,PA,USA
Audio files: 7
G2 patch files: 35
|
Posted: Tue Mar 03, 2009 10:14 am Post subject:
|
|
|
In a 96kHz system, 0.01 ms is about one sample. I wouldn't try to be that precise on a G2. |
|
Back to top
|
|
|
ark
Joined: Mar 06, 2008 Posts: 679 Location: New Jersey
Audio files: 13
G2 patch files: 31
|
Posted: Tue Mar 03, 2009 10:45 am Post subject:
|
|
|
Chet wrote: | In a 96kHz system, 0.01 ms is about one sample. I wouldn't try to be that precise on a G2. | I still do not understand why it should not work--because if the signal level changes, then at some point it should differ from its most recent level. |
|
Back to top
|
|
|
Antimon
Joined: Jan 18, 2005 Posts: 4145 Location: Sweden
Audio files: 371
G2 patch files: 100
|
Posted: Tue Mar 03, 2009 11:01 am Post subject:
|
|
|
The blue and yellow signals are calculated at a quarter (I think) of the frequency of red signals. This might affect the way the compare modules work.
/Stefan _________________ Antimon's Window
@soundcloud @Flattr home - you can't explain music |
|
Back to top
|
|
|
ark
Joined: Mar 06, 2008 Posts: 679 Location: New Jersey
Audio files: 13
G2 patch files: 31
|
Posted: Tue Mar 03, 2009 12:07 pm Post subject:
|
|
|
Ah, so you're thinking that maybe the two signals differ between sampling points and the difference has gone away by the time the next sample request rolls around? |
|
Back to top
|
|
|
Fozzie
Joined: Jun 04, 2004 Posts: 875 Location: Near Wageningen, the Netherlands
Audio files: 8
G2 patch files: 49
|
Posted: Tue Mar 03, 2009 12:21 pm Post subject:
|
|
|
I can't look at any patches right now, but there is a bug in the dlyeight module
Rob wrote
Quote: | The DlyEight module is off by 4 ticks on the scale, the knob positions 0 to 3 simply "do not work" and the input is passed unaltered on all eight outputs, so all delays are zero. At position 4 to 7 the eight delay outputs give delays of 1 to 8 samples. Then at knob position 8 to 11 the delays are from 2 to 16 samples with gaps of a sample. At knob position 12 to 15 they are 3 to 24 samples with gaps of 3 samples. Etc.
So, the display is utterly incorrect, as there are actually only 32 ranges on the knob and not 128 as could be expected from the display.
|
here: http://electro-music.com/forum/post-105724.html#105724
maybe that has something to do with this?? Is this the troublesome module?? _________________ Spinning at ~0.0000115740740741 Hz |
|
Back to top
|
|
|
iPassenger
Joined: Jan 27, 2007 Posts: 1067 Location: Sheffield, UK
Audio files: 5
G2 patch files: 78
|
Posted: Tue Mar 03, 2009 12:22 pm Post subject:
|
|
|
Antimon wrote: | The blue and yellow signals are calculated at a quarter (I think) of the frequency of red signals. This might affect the way the compare modules work.
/Stefan |
Yeah pretty sure that is it, its 24Khz for control level signals. _________________ iP (Ross)
- http://ipassenger.bandcamp.com
- http://soundcloud.com/ipassenger |
|
Back to top
|
|
|
iPassenger
Joined: Jan 27, 2007 Posts: 1067 Location: Sheffield, UK
Audio files: 5
G2 patch files: 78
|
Posted: Tue Mar 03, 2009 12:35 pm Post subject:
|
|
|
How about this:
EDIT : Swapped LFOC for Logic inverter fedback on itself.
Description: |
|
Download |
Filename: |
Test Groove.pch2 |
Filesize: |
1.6 KB |
Downloaded: |
1380 Time(s) |
Description: |
|
Download |
Filename: |
test_groove_2_185[1].pch2 |
Filesize: |
1.63 KB |
Downloaded: |
1387 Time(s) |
_________________ iP (Ross)
- http://ipassenger.bandcamp.com
- http://soundcloud.com/ipassenger Last edited by iPassenger on Tue Mar 03, 2009 12:48 pm; edited 1 time in total |
|
Back to top
|
|
|
Fozzie
Joined: Jun 04, 2004 Posts: 875 Location: Near Wageningen, the Netherlands
Audio files: 8
G2 patch files: 49
|
Posted: Tue Mar 03, 2009 12:40 pm Post subject:
|
|
|
Ah, had a chance now to look at the patch and unfortunately my previous comment was utterly irrelevant _________________ Spinning at ~0.0000115740740741 Hz |
|
Back to top
|
|
|
iPassenger
Joined: Jan 27, 2007 Posts: 1067 Location: Sheffield, UK
Audio files: 5
G2 patch files: 78
|
Posted: Tue Mar 03, 2009 12:43 pm Post subject:
|
|
|
tim wrote: | Yes, I had the delay-XOR idea too. However, this leaves you with a second gate which you might have no any use for.
Here's the most efficient solution -just two blue modules. It's a bit weird to understand , but it works. |
Smart. _________________ iP (Ross)
- http://ipassenger.bandcamp.com
- http://soundcloud.com/ipassenger |
|
Back to top
|
|
|
iPassenger
Joined: Jan 27, 2007 Posts: 1067 Location: Sheffield, UK
Audio files: 5
G2 patch files: 78
|
Posted: Tue Mar 03, 2009 12:45 pm Post subject:
|
|
|
Fozzie wrote: | Ah, had a chance now to look at the patch and unfortunately my previous comment was utterly irrelevant |
I feel a bit like that as my patch is fair bit more processing power..
having said that it does seem to work pretty smoothly, as long as the lfo remains in sync with the on beats. _________________ iP (Ross)
- http://ipassenger.bandcamp.com
- http://soundcloud.com/ipassenger |
|
Back to top
|
|
|
Tim Kleinert
Joined: Mar 12, 2004 Posts: 1148 Location: Zürich, Switzerland
Audio files: 7
G2 patch files: 236
|
|
Back to top
|
|
|
|