how to switch between data stream intermittently?

Stephen Connolly's icon

Hi,

Im wondering if any one can help with this?

I have two constructs that out put midi information, I want to connect them to the same sound source but via an object or something that can switch between them.

I am trying to find away to switch between the two intermittently. So I have one construct that is on most the time. then when a bang or something happens, the note from the 2nd construct is played. then it should switch back to the first stream.

I tried using the switch and gate objects, but could not get them to do what im looking for.

please could someone suggest something suitable ?

Thanks in. advance

TFL's icon

Feel free to share the relevant part of your patch showing your struggle.
[switch] is probably what you need. You can also try [gswitch] which does almost the same but in a more visual way (and you can click on it to change the input).

Stephen Connolly's icon

probably as easy to attach the full patch.

the idea is that when the counter in the 'notes in order' part gets to five it triggers the random note generator, and that random note should play instead of the notes in order.

this will hopefully be a proof on concept for a thing im trying to make.

I have put a switch in. it is opening when it should do. need to find a a way to make it close straight after, but can't see why the random note is not being played...

Insert Random-01.maxpat
Max Patch

TFL's icon

You're over-engineering your problem, you don't need a switch at all, your [sel 5] can already act as a kind of switch, providing a bang from its left outlet, or any other number it receives from its right outlet.

Max Patch
Copy patch and select New From Clipboard in Max.

But for answering your question about an auto-closing [gate] or [switch], I suggest you to learn the [trigger] object.

Max Patch
Copy patch and select New From Clipboard in Max.

Stephen Connolly's icon

nice one, thanks for the pointers. I will study those. yes defiantly guilty of over thinking.

I find I latch onto an idea and try to make it work. but probably need to start simpler and then apply it to my idea......

Stephen Connolly's icon

hi,

Im still playing around with routing data. I have tried using the switch to switch between data paths. the help says it will pass the data from the selected port out of the outlet.

I either get nothing out the output, or it outputs what dumber is being fed into the 1st port.

im wondering the issue is because my data uses numbers and symbols, but the example uses both so im not. sure. any help will be appreciated.

Max Patch
Copy patch and select New From Clipboard in Max.

double_UG's icon

the right inlet of message is cold and doesnt output anything.

Max Patch
Copy patch and select New From Clipboard in Max.

Roman Thilenius's icon

1) there is an error in subpatch #1

2) the lower messagebox is only "set" to its content, but does not send out anything to the select this way.

Stephen Connolly's icon

nice one thanks both. I guess im still struggling with the concept of hot and cold inputs, but it's starting to make sense.

Roman Thilenius's icon

here´s my approach, using [zl nth] (the smallest database in the world) and showing off how to work with [t ].

you could also use a [coll] to store and recall the symbols, then you can reduce the whole thing to 5 objects.

Stephen Connolly's icon

cool thanks roman, that look a tidy solution. I will study that in detail for sure.

Stephen Connolly's icon

nice one that 'zl nth' thingy was just what I needed for my idea. I reckon my prototype is ready for the big build now.

The idea is that the test boxes will become sequencers that have their own patterns and the the zl nth part will be a sequence for the sequencers.

anyway this is what I have (thanks for the pointers):

Max Patch
Copy patch and select New From Clipboard in Max.

onto the big build :D ........