Mixing/merging trigger streams


#1

What is the simplest way to mix/merge two trigger streams (yellow) into one? This is really silly, but I just need to have the "end" trigger of the wave/play object re-trigger the start (i.e. looping the sample), while still maintaining it responsive to manual start.


#2

Logic/or

20 characters


#3

Thank you!

The next issue I'm having is that stop also triggers play.

Is this because stop sends the 'end' trigger, which is one of the re-triggering conditions? If so, how does one avoid that?


#4

probably yes. from looking at the code it seems that the end_outlet is high whenever the p variable which holds the samples is empty. so if nothing is playing end is high. you could try to connect the end via a logic and to the logic or and connect the other input of logic and to a logic/inv that is connected to the stop button. but i'm not sure if that would change things. cannot try atm sorry.


#5

Thank you!

Hmm. I'm getting the same result with that connection.

One very positive observation is that the looping sounds very seamless. I'm really excited to get this working.


#6

looking at the streaming code, end is poorly named ... its basically whenever the stream is not 'active', this includes (among other scenarios) it getting to the end, or being closed (or not opened)

what you need to do is to keep a flag (flipflop) to determine if you are playing or not, then use this, with AND into start. (so your logic is IF playing AND either 'starting' or 'end', then start)

you might later want to consider optionally to do something similar with stop... such that the stop triggered at called at the end of cycle .. i.e you let the sample play to the end, then just don't loop... might sound more natural for some samples than abruptly stopping mid sample.


#7

Cool!

Thank you @thetechnobear!