electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » Clavia Nord Modular » Nord Modular G2 Discussion
How can I emit a pulse whenever a logic signal changes?
Post new topic   Reply to topic Moderators: Nord Modular Editors
Page 1 of 1 [23 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
ark



Joined: Mar 06, 2008
Posts: 679
Location: New Jersey
Audio files: 13
G2 patch files: 31

PostPosted: 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
Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
Antimon



Joined: Jan 18, 2005
Posts: 4145
Location: Sweden
Audio files: 371
G2 patch files: 100

PostPosted: Mon Mar 02, 2009 1:16 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
ark



Joined: Mar 06, 2008
Posts: 679
Location: New Jersey
Audio files: 13
G2 patch files: 31

PostPosted: Mon Mar 02, 2009 1:22 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Mon Mar 02, 2009 1:23 pm    Post subject: Reply with quote  Mark this post and the followings unread

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 thinking

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
ark



Joined: Mar 06, 2008
Posts: 679
Location: New Jersey
Audio files: 13
G2 patch files: 31

PostPosted: Mon Mar 02, 2009 1:43 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
Chet



Joined: Nov 19, 2004
Posts: 231
Location: Lititz,PA,USA
Audio files: 7
G2 patch files: 35

PostPosted: Mon Mar 02, 2009 2:02 pm    Post subject: Reply with quote  Mark this post and the followings unread

You could feed the original signal into a short delay and then XOR the delay's output with the original signal.
Back to top
View user's profile Send private message
Tim Kleinert



Joined: Mar 12, 2004
Posts: 1148
Location: Zürich, Switzerland
Audio files: 7
G2 patch files: 236

PostPosted: Mon Mar 02, 2009 2:27 pm    Post subject: Reply with quote  Mark this post and the followings unread

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 Laughing, but it works.


bipolartriggerTK.pch2
 Description:
Emits a trigger whenever zero goes 64, or 64 goes zero. efficient (2 modules).

Download
 Filename:  bipolartriggerTK.pch2
 Filesize:  1.05 KB
 Downloaded:  1380 Time(s)

Back to top
View user's profile Send private message
iPassenger



Joined: Jan 27, 2007
Posts: 1067
Location: Sheffield, UK
Audio files: 5
G2 patch files: 78

PostPosted: Tue Mar 03, 2009 4:59 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
iPassenger



Joined: Jan 27, 2007
Posts: 1067
Location: Sheffield, UK
Audio files: 5
G2 patch files: 78

PostPosted: Tue Mar 03, 2009 5:09 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
ark



Joined: Mar 06, 2008
Posts: 679
Location: New Jersey
Audio files: 13
G2 patch files: 31

PostPosted: Tue Mar 03, 2009 8:03 am    Post subject: Reply with quote  Mark this post and the followings unread

iPassenger wrote:
I'm really struggling to understand this sat at work, please post it if you get it sorted out tho as it sounds great.

OK, what I have so far is attached. Turn the "Shape" dial on the LFO in the upper left corner to change the amount of swing.

Right now I am using a low-pass filter to detect the inflection points of the triangle wave that the LFO generates. I don't like this because (1) it seems to be unreliable, and (2) its output is an orange signal, which consumes more cpu than needed.

It seems to me that there must be a simple way to find out deterministically when a triangle wave changes direction.


Swing sequencer example.pch2
 Description:

Download
 Filename:  Swing sequencer example.pch2
 Filesize:  2.15 KB
 Downloaded:  1564 Time(s)

Back to top
View user's profile Send private message Visit poster's website
iPassenger



Joined: Jan 27, 2007
Posts: 1067
Location: Sheffield, UK
Audio files: 5
G2 patch files: 78

PostPosted: Tue Mar 03, 2009 8:26 am    Post subject: Reply with quote  Mark this post and the followings unread

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. Smile

_________________
iP (Ross)
- http://ipassenger.bandcamp.com
- http://soundcloud.com/ipassenger
Back to top
View user's profile Send private message Visit poster's website
ark



Joined: Mar 06, 2008
Posts: 679
Location: New Jersey
Audio files: 13
G2 patch files: 31

PostPosted: Tue Mar 03, 2009 9:51 am    Post subject: Reply with quote  Mark this post and the followings unread

I just tried out your suggestion and there is something I don't understand: When I set the delay to 0.01ms, it stops working. This behavior makes no sense to me, as I would think that there would have to be a difference in level over some 0.01ms period after the direction change.

I similarly tried Tim's trick of using a Mix-1 module to introduce the smallest possible delay, and again the levels appear to compare equal all the time with such a short delay. Makes no sense to me -- can someone explain?


Direction change detector.pch2
 Description:

Download
 Filename:  Direction change detector.pch2
 Filesize:  998 Bytes
 Downloaded:  1340 Time(s)

Back to top
View user's profile Send private message Visit poster's website
Chet



Joined: Nov 19, 2004
Posts: 231
Location: Lititz,PA,USA
Audio files: 7
G2 patch files: 35

PostPosted: Tue Mar 03, 2009 10:14 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message
ark



Joined: Mar 06, 2008
Posts: 679
Location: New Jersey
Audio files: 13
G2 patch files: 31

PostPosted: Tue Mar 03, 2009 10:45 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
Antimon



Joined: Jan 18, 2005
Posts: 4145
Location: Sweden
Audio files: 371
G2 patch files: 100

PostPosted: Tue Mar 03, 2009 11:01 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
ark



Joined: Mar 06, 2008
Posts: 679
Location: New Jersey
Audio files: 13
G2 patch files: 31

PostPosted: Tue Mar 03, 2009 12:07 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
Fozzie



Joined: Jun 04, 2004
Posts: 875
Location: Near Wageningen, the Netherlands
Audio files: 8
G2 patch files: 49

PostPosted: Tue Mar 03, 2009 12:21 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message
iPassenger



Joined: Jan 27, 2007
Posts: 1067
Location: Sheffield, UK
Audio files: 5
G2 patch files: 78

PostPosted: Tue Mar 03, 2009 12:22 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
iPassenger



Joined: Jan 27, 2007
Posts: 1067
Location: Sheffield, UK
Audio files: 5
G2 patch files: 78

PostPosted: Tue Mar 03, 2009 12:35 pm    Post subject: Reply with quote  Mark this post and the followings unread

How about this:

EDIT : Swapped LFOC for Logic inverter fedback on itself.


Test Groove.pch2
 Description:

Download
 Filename:  Test Groove.pch2
 Filesize:  1.6 KB
 Downloaded:  1380 Time(s)


test_groove_2_185[1].pch2
 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
View user's profile Send private message Visit poster's website
Fozzie



Joined: Jun 04, 2004
Posts: 875
Location: Near Wageningen, the Netherlands
Audio files: 8
G2 patch files: 49

PostPosted: Tue Mar 03, 2009 12:40 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ah, had a chance now to look at the patch and unfortunately my previous comment was utterly irrelevant Embarassed Laughing
_________________
Spinning at ~0.0000115740740741 Hz
Back to top
View user's profile Send private message
iPassenger



Joined: Jan 27, 2007
Posts: 1067
Location: Sheffield, UK
Audio files: 5
G2 patch files: 78

PostPosted: Tue Mar 03, 2009 12:43 pm    Post subject: Reply with quote  Mark this post and the followings unread

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 Laughing, but it works.


Smart. Smile

_________________
iP (Ross)
- http://ipassenger.bandcamp.com
- http://soundcloud.com/ipassenger
Back to top
View user's profile Send private message Visit poster's website
iPassenger



Joined: Jan 27, 2007
Posts: 1067
Location: Sheffield, UK
Audio files: 5
G2 patch files: 78

PostPosted: Tue Mar 03, 2009 12:45 pm    Post subject: Reply with quote  Mark this post and the followings unread

Fozzie wrote:
Ah, had a chance now to look at the patch and unfortunately my previous comment was utterly irrelevant Embarassed Laughing


I feel a bit like that as my patch is fair bit more processing power..
Rolling Eyes
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
View user's profile Send private message Visit poster's website
Tim Kleinert



Joined: Mar 12, 2004
Posts: 1148
Location: Zürich, Switzerland
Audio files: 7
G2 patch files: 236

PostPosted: Wed Mar 04, 2009 3:08 am    Post subject: Reply with quote  Mark this post and the followings unread

The reliability issues are caused by tweaking swing (LFO shape) and length parameters continuously, as the comparators are doing their thing -which can whack things out of alignment. Adding control modules for these S/H'ing them with the LFO Sync output removes all problems.

Attached is a 100% bulletproof version, which also keeps check of minimum/maximum note lengths, so the sequencer triggering is always reliable.

cheers,
tim


LFOSwing16 TK.pch2
 Description:
using a shape LFO as a seq clock with swing and length control (idea by ark)

Download
 Filename:  LFOSwing16 TK.pch2
 Filesize:  1.86 KB
 Downloaded:  1374 Time(s)

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: Nord Modular Editors
Page 1 of 1 [23 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » Clavia Nord Modular » Nord Modular G2 Discussion
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use