I'm trying to put together a simple oscilloscope abstraction that imitates the "trigger" function of a real one, so that the waveform can be seen from its starting point. In other words, a [tabwrite~] would graph on the upward swing of a zero crossing. To do this, I'd like to know if there is an audio object which gives a bang at a zero crossing, or perhaps even only at a crossing from the negative to the positive domain of the signal. I've thought of something with [expr~ $v1 < 0], but what comes out is still in the audio domain and isn't the bang which [tabwrite~] needs.
Other suggestions welcome.
best! Derek
On Wed, 2009-12-09 at 00:40 +0100, Derek Holzer wrote:
I'm trying to put together a simple oscilloscope abstraction that imitates the "trigger" function of a real one, so that the waveform can be seen from its starting point. In other words, a [tabwrite~] would graph on the upward swing of a zero crossing. To do this, I'd like to know if there is an audio object which gives a bang at a zero crossing, or perhaps even only at a crossing from the negative to the positive domain of the signal. I've thought of something with [expr~ $v1 < 0], but what comes out is still in the audio domain and isn't the bang which [tabwrite~] needs.
Other suggestions welcome.
It would be nice to be able to do something like that. Two problems need to be overcome first:
an audio signal. All object classes I can think of convert signal->message either triggered by a message like [vsnapshot~] or triggered by an internal [metro] (like [env~]/[avg~]). We would definitely need an object class, that generates timed messages according to the signal input without requiring any message. I haven't seen such a thing yet.
behaviour in this case _could_ actually be emulated by delaying the signal in a manner, so that the zero-crossing is shifted exactly on block boundaries. However, it would be more straight-forward, if there'd be something like a [vtabwrite~].
Probably I am just uncreative and there actually _is_ a way. If so, I definitely want to learn it!
Roman
[1] by 'timed' I am referring to the mechanism used by [vline~] and co to get accurate timing.
cyclone's [edge~] is useful for converting zero crossing to bangs:
[inlet~] | [expr~ $v1<0] | [edge~]
The only downside is that it quantizes to the end of the block, but then again, so does [tabwrite~]. I actually attempted doing one with edge and posted it on the forum, if you're interested.
http://puredata.hurleur.com/viewtopic.php?pid=14984#p14984
.mmb
Derek Holzer wrote:
I'm trying to put together a simple oscilloscope abstraction that imitates the "trigger" function of a real one, so that the waveform can be seen from its starting point. In other words, a [tabwrite~] would graph on the upward swing of a zero crossing. To do this, I'd like to know if there is an audio object which gives a bang at a zero crossing, or perhaps even only at a crossing from the negative to the positive domain of the signal. I've thought of something with [expr~ $v1 < 0], but what comes out is still in the audio domain and isn't the bang which [tabwrite~] needs.
Other suggestions welcome.
best! Derek
Hi Mike, Roman,
thanks for the input! Of course I thought it would be simpler, but I did keep in mind this block boundary problem. [edge~] is a good suggestion, at least that's the kind of object I was looking for. I'll have a look at your forum patch tomorrow Mike (assuming I can find my login for the forum). The block issue, well that's another story...
best! Derek
Mike Moser-Booth wrote:
cyclone's [edge~] is useful for converting zero crossing to bangs:
[inlet~] | [expr~ $v1<0] | [edge~]
The only downside is that it quantizes to the end of the block, but then again, so does [tabwrite~]. I actually attempted doing one with edge and posted it on the forum, if you're interested.
http://puredata.hurleur.com/viewtopic.php?pid=14984#p14984
.mmb
Derek Holzer wrote:
I'm trying to put together a simple oscilloscope abstraction that imitates the "trigger" function of a real one, so that the waveform can be seen from its starting point. In other words, a [tabwrite~] would graph on the upward swing of a zero crossing. To do this, I'd like to know if there is an audio object which gives a bang at a zero crossing, or perhaps even only at a crossing from the negative to the positive domain of the signal. I've thought of something with [expr~ $v1 < 0], but what comes out is still in the audio domain and isn't the bang which [tabwrite~] needs.
Other suggestions welcome.
best! Derek