Kyma Forum
  Tips & Techniques
  detect zero crossings

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   detect zero crossings
flo
Member
posted 03 December 2005 07:53         Edit/Delete Message   Reply w/Quote

Sorgenkind.kym

 
Hi,

you'll find attached a simple sound which detects
zeros in a signal. I used this as a starting point
for translating some of Trevor Wisharts waveset
transformation algorithms in kyma.
But already at this early stage a somewhat (for me)
tricky problem arises: Wishart defines wavesets as going
from one zero crossing to the next one and in order to
make larger wavesets he also uses every 2nd, 3rd, 4th, etc.
zero-crossing as a criteria for subdividing a signal.
How can you accomplish this within my sound-example or within
kyma in general?
Applied to my example that would mean that you would have to
make the equality even more intolerant. Or in other words, be-
cause this a little-bit absurd, how can you make the detector
only 'detect' every 2nd, 3rd, etc. zero, or how can you ensure
that a '1' is only put out at every 2nd, 3rd, etc. crossing?
(there is probably a way to script that every n-th zero should
be left out, ignored?)
Thanks in advance. Best,
Florian

IP: Logged

pete
Member
posted 05 December 2005 13:41         Edit/Delete Message   Reply w/Quote
Hi Flo

The problem with converting zero crossing to a global sound is that global sounds (and hot paramitors) are at control rate, so that if the signal is near 1 Khz you'll start to miss some crossings, and those that it does find will only be acurate to the nearest 1 khz border. To keep the zero crossing timing you will need to do every thing at sample rate and use sounds plugged in sounds to do it. This is one of the reasons I made petes DSP modules as they all work at sample rate. If you put your signal into a Gate to trigger module, you will get a pulse out every time the signal changes from minus to plus. If you wanted to reduce the number of pulses you can put this signal into a toggle module anf then put that into another gate to trigger module, it will miss out every other pulse. If you put that signal into another toggle module and GtoT you will only get every fourth pulse. To get every third is a bit tricky but it is pos.

Hope this helps

Pete

IP: Logged

flo
Member
posted 07 December 2005 06:19         Edit/Delete Message   Reply w/Quote

Sorgenkind.kym

 
Hi Pete,
thanks very much for the explanation.
One thing after the other, first some things regarding the gate/
trigger/toggle-issue:
Where can I find those GtoT modules, somewhere in the library?
Is my conclusion right that with a GtoT module you already leave out certain zero-crossings, those where the signal goes from plus to minus? If so, you're not dealing with the most minimal, elementary wavesets. (not that this would be a drama, I just like to know this precisely)
And regarding the toggling, you'll find attached an earlier attempt (had the idea already) to make a toggle out of a trigger with the 'asToggle' command, but I don't have the impression that it works properly,
at least in this sound example.
But you probably have a better way to implement this?
Thanks in advance.
Best, Florian


IP: Logged

pete
Member
posted 07 December 2005 09:06         Edit/Delete Message   Reply w/Quote
Hi flo

The modules are on the tweeky under Microsounds. http://www.symbolicsound.com/cgi-bin/bin/view/Share/Microsounds
(You have to be logged in for this link to work).
You'll need both the microsound code (source code) and the DSPModules.

Yes your right with a single GtoT (Gate to Trigger) you will get one pulse per cycle (and that pulse will be only one sample wide), not one per half cycle (asuming the signal only crosses zero once in it's cycle). If you wanted a pulse for both the positive going and the negative going edge you would put two GtoTs in to an OR Gate module ( another one of the pete's DSP modules) or just a mixer and feed the signal directly into one of the GtoTs and indirectly to the other GtoT via a mixer with a gain of (- 1.0). This way the pulses will make a signal of twice the input frequency or some other sound if the input signal was not balanced in time.

If on the other hand you wanted non thin pulses i.e. hi when the signal is positive and lo when the signal is negative then just use an "AsLogic" module but I think the thin pulse will be more usefull.

Hope it helps

Pete


IP: Logged

KX
Member
posted 07 December 2005 09:33         Edit/Delete Message   Reply w/Quote
Speaking of logic modules, I think your microsounds (as well as Dave's)should be included
with documentation in the next release of Kyma.

IP: Logged

pete
Member
posted 07 December 2005 10:31         Edit/Delete Message   Reply w/Quote
I think I would need to tidy mine up quite a lot before they are added into the relyable and fully tested kyma code.

IP: Logged

flo
Member
posted 11 December 2005 16:12         Edit/Delete Message   Reply w/Quote
Could somebody briefly instruct me how to integrate the
.asy document to forgo the usound class error from kyma?
(I suppose that's the problem why I can't play the
microsounds right now)
Thanks in advance.
Best, Flo


IP: Logged

pete
Member
posted 13 December 2005 04:48         Edit/Delete Message   Reply w/Quote
Hi flo
First you must import the .asy file from within kyma.
Then you must place it along side the Kyma app if you want it to auto load when kyma boots up. Otherwise you can select "Choose Microsounds" under the file menu in kyma if you want to load it up on a one off basis.

Hope it works

Pete

IP: Logged

flo
Member
posted 16 December 2005 04:00         Edit/Delete Message   Reply w/Quote
Thanks, Pete, it works perfectly well now.


IP: Logged

All times are CT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply

Contact Us | Symbolic Sound Home

This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.


Ultimate Bulletin Board 5.45c