Forums > MaxMSP

on "bangs"

June 16, 2009 | 4:35 pm

hey folks.
i have a bang that has a pulse of 16. is there a way to get the bang to hit on every second beat, for a total of 8 hits? i know this may be an easy question, but i have spent hours on it without a solution other than using a tempo object, and making complex wirings. is there a better solution?


June 16, 2009 | 4:39 pm

You may use a counter and test if its value is even with a modulo operator and select.

_
johan


June 16, 2009 | 5:06 pm

i am not on my computer, so i will try what you suggested tomorrow. thank you. Is this the best solution for the problem, or are there alternate methods?
think of it like "muting" the odd numbered bangs. an idea flashed of using matrixctrl, but i would have to try it out to see if it’s viable. any alternative solutions?


June 16, 2009 | 5:28 pm

maybe can be useful.


June 17, 2009 | 8:27 pm

unfortunetally, neither suggestion has worked for me.
any other suggestions?


June 17, 2009 | 8:56 pm

found a solution. use select object, and type in numbers that you want banged. bingo!


June 17, 2009 | 10:32 pm

for repeating patterns, like every 2, every 4, etc., the counter–>modulus–>select 0 is probably the best way, just use the fastest pulse in (like a "16th-note") and this can divide it into longer notes (technically they’re still "short" but with silence after them, but that depends on what you do with them).

For non-repeating patterns, your select method is fine, though you could look into matrixctrl: each row has a pattern of cells you want banged, then with each pulse you do a getrow, then [zl nth] with the current count to grab the cell’s contents in succession. You could have multiple rows for multiple sequencers going at once, or choose which row to use on-the-fly. [preset] the whole matrixctrl for easy recall of complete sets. Lots more flexible than just [select] and it’s more fun too.


June 18, 2009 | 3:34 am

thanks for the insight. what if i want to double up the bang?
ex.- i want it to bang 2x for every one bang.
would modulus work for this as well?


June 18, 2009 | 3:37 am

is modulus a message?


June 18, 2009 | 6:03 pm
Quote:
what if i want to double up the bang?
ex.- i want it to bang 2x for every one bang.
would modulus work for this as well?

try [bangbang] or [b 2] or [trigger b b]

Quote:
is modulus a message?

look at [%] object


June 18, 2009 | 7:24 pm

bangbang would not work for me. I’m not exactly sure how i would use it in this situation.


June 18, 2009 | 7:38 pm

the % (an object) would only allow you to stretch the tempo, not contract it. So if it’s % 1 –> sel 0, it will bang each time, if it’s % 2 –> sel 0, it bangs every other time, etc. Watch the number output to see what’s happening.

For doubling up you’d need to do something else, which implies a faster original metro/clock. (bangbang will send them right after each other rather than in tempo.) You can also look into [transport] which can be sent messages to change the rate and timing divisions of bangs, or have a set of divisors/multipliers for the rate of a main metro.


June 18, 2009 | 8:48 pm

i found a solution for the problem, although i will look into your solution.
I wrote an expr object and split into two floating numbers (so it would count to 32 twice as fast) and used a pipe object to delay one of the floating numbers.
thanks for all of the input!

– Pasted Max Patch, click to expand. –

June 19, 2009 | 3:19 am

what’s your main goal ? to output certain numbers periodically, or do you just need bangs in certain tempo divisions ?

Using pipe and expr seems a little bit inflexible to me, but there are lots of solutions.

You could use two tempo objects, one that provides the original number sequence (such as 0…15), and a second tempo which fires double as fast (0.5), with the same speed (1) or only every other beat (2). But as I said, not sure what you want to accomplish as your final goal….

– Pasted Max Patch, click to expand. –

June 19, 2009 | 5:58 pm

at this point, it is too complicated for me articulate what i want to accomplish without writing an essay. my little expr and pipe trick seems to be working well for me, althoug i have not fully tested the results. i will keep the 2 tempo object stategy into consideration if my system fails. as always, all strategies are appreciated. thanks.,


Viewing 15 posts - 1 through 15 (of 15 total)