Forums > MaxMSP

extra bang on note off problem

January 9, 2012 | 3:37 pm

I am brand spanking new to max and I am trying to build a pluggo from some code I rummaged from an old post on this forum of an interesting little one shot sampler. I loaded the exported VST in my DAW and it works fine except that when I release the midi note I get a second bang.

There is probably an easy solution but I wouldn’t know where to look.
Any help would be appreciated.

max v2;
#N vpatcher 97 48 1697 926;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#N plugconfig;
#C useviews 0 1 1 1;
#C numprograms 64;
#C preempt 1;
#C sigvschange 1;
#C sigvsdefault 32;
#C setsize 500 500;
#C defaultview Interface 30 30 0;
#C dragscroll 1;
#C infotext;
#C package ????;
#C uniqueid 128 58 27;
#C initialpgm 1;
#P hidden newobj 300 411 51 9109513 plugconfig;
#P user waveform~ 292 242 200 74 139 9;
#W mode loop;
#W mouseoutput continuous;
#W unit ms;
#W grid 0.;
#W ticks 0;
#W labels 0;
#W vlabels 0;
#W vticks 0;
#W bpm 120. 4.;
#W frgb 53 119 145;
#W brgb 167 185 63;
#W rgb2 0 132 26;
#W rgb3 0 0 0;
#W rgb4 0 0 0;
#W rgb5 190 137 255;
#W rgb6 100 100 100;
#W rgb7 100 100 100;
#P background;
#P newex 115 444 45 9109513 dac~;
#P background;
#P newex 115 417 45 9109513 plugout~;
#P background;
#P newex 48 58 49 9109513 plugmidiin;
#P background;
#P user ezdac~ 203 415 247 448 0;
#P background;
#P comment 108 229 50 9109513 amplitude;
#P background;
#P button 61 163 28 0;
#P background;
#P hidden newex 76 204 117 9109513 t b b;
#P background;
#P message 75 228 33 9109513 clear;
#P background;
#P message 183 228 33 9109513 clear;
#P background;
#P user function 75 242 184 316 1 1 1 0;
#X frgb 82 82 82;
#X brgb 183 214 191;
#X rgb2 85 85 85;
#X rgb3 255 255 255;
#X rgb4 0 0 0;
#X rgb5 0 0 0;
#X add 0. 0. 0;
#X add 10.309278 1. 0;
#X add 53.608246 0.177419 0;
#X add 55.670101 0.451613 0;
#X add 164.948456 0.112903 0;
#X add 167.0103 1. 0;
#X add 189.69072 0.693548 0;
#X add 200. 0. 0;
#X domain 200.;
#X range 0. 1.;
#X done;
#P background;
#P newex 160 378 44 9109513 *~;
#P background;
#P newex 160 332 32 9109513 line~;
#P background;
#P newex 194 332 32 9109513 line~;
#P background;
#P hidden newex 290 190 48 9109513 loadbang;
#P background;
#P hidden message 292 219 50 9109513 set drum;
#P background;
#P message 395 199 43 9109513 replace;
#P background;
#P newex 395 220 97 9109513 buffer~ drum 5000;
#P background;
#P newex 194 351 66 9109513 wave~ drum;
#P background;
#P comment 218 229 45 9109513 playhead;
#P background;
#P user function 183 242 292 316 1 1 1 0;
#X frgb 82 82 82;
#X brgb 183 214 191;
#X rgb2 85 85 85;
#X rgb3 255 255 255;
#X rgb4 0 0 0;
#X rgb5 0 0 0;
#X add 0. 0. 0;
#X add 30.927834 0.435484 0;
#X add 55.670101 0.5 0;
#X add 90.721649 0.145161 0;
#X add 175.257721 0.258065 0;
#X add 191.752579 0.677419 0;
#X add 200. 1. 0;
#X domain 200.;
#X range 0. 1.;
#X done;
#P background;
#P connect 17 0 14 0;
#P hidden connect 12 0 10 0;
#P hidden connect 13 0 10 0;
#P hidden connect 14 0 13 0;
#P connect 9 0 18 0;
#P connect 18 0 19 0;
#P connect 9 0 18 1;
#P connect 18 1 19 1;
#P fasten 10 1 8 0 113 114 165 114;
#P connect 8 0 9 0;
#P hidden connect 11 0 0 0;
#P hidden connect 13 1 0 0;
#P fasten 0 1 7 0 221 205 199 205;
#P connect 7 0 2 0;
#P connect 2 0 9 1;
#P connect 9 0 16 0;
#P fasten 20 2 2 1 373 107 227 107;
#P fasten 9 0 16 1 165 152 242 152;
#P fasten 20 3 2 2 411 116 255 116;
#P hidden connect 6 0 5 0;
#P hidden connect 5 0 20 0;
#P connect 4 0 3 0;
#P pop;


January 9, 2012 | 3:55 pm

If the problem is how to filter out bangs more than one/two…
I have a multi-purpose solution I writed in Javascript
which let you pass trough only one or more elements of lists, numbers or bangs.

Unzip the file and put it into the max folder, so that you can use the JS code
and open the .maxpat file.

Hope it can help you.

Attachments:
  1. supafilter.zip

January 9, 2012 | 4:03 pm

Thanks for trying to help but I am using max 4.


January 9, 2012 | 4:13 pm

I don’t know if max4 has the JS object.
If yes, you can use the code anyway…


January 9, 2012 | 4:19 pm

I am looking for a native solution to preventing a bang on note off in this patch example I posted. I am brand new to max as of last night.


January 9, 2012 | 4:20 pm

js should work OK in Max4, and the functions it has sound useful. But in this particular case it’s probably not needed…hook up "print" to the inlets coming from your MIDI object and you’ll probably see the noteoff messages (same pitch, velocity zero). Use [stripnote] if you want to filter out the second message (noteoff).

If you do want filtering for multiple events, [change] and [onebang] can help.


January 9, 2012 | 4:30 pm

Hi
I added a [> 0] to the note velocity output of [midiparse], this should work; if not, look at [onebang] as seejay suggests:

– Pasted Max Patch, click to expand. –

Brendan


January 9, 2012 | 4:40 pm

Thanks guys. I am struggling to understand how to implement all these suggestions. So far I can’t get [stripnote] or [onebang] to work though it sounds like they should work. No matter what I do I get a second bang the second I release my midi key.


January 9, 2012 | 4:51 pm

Post this new patch…..?


January 9, 2012 | 4:54 pm

I posted it in my first post. The problem does not become apparent until the patch is exported as a plugo and loaded into the host (I am using AudioMulch)


January 9, 2012 | 4:57 pm

I meant show us how you’ve added [onebang] or [stripnote] or my suggestion.

:)


January 9, 2012 | 5:03 pm

Well so far I have been trying about a dozen or more variations using the help files from those suggested objects with no luck. I am at a loss.

It would help if someone with max 4 would test this issue in a VST host with the patch in my original post.


January 9, 2012 | 5:24 pm

Does this not work:

[attachment=181531,3179]

Attachments:
  1. strip.jpg

January 9, 2012 | 5:35 pm

I’m afraid not. Maybe this is a pluggo specific problem or something.


January 9, 2012 | 6:35 pm

How about this:

[attachment=181542,3180]

Attachments:
  1. midiinStripnote.jpg

January 9, 2012 | 6:44 pm

Rock’N'Roll!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Thanks, it works.


January 9, 2012 | 8:32 pm

Hey saladfork (and Chris)
I hang my head in shame. Schoolboy error.

Anon.

(not Brendan)


January 10, 2012 | 1:51 am

Wow! Talk about synchronicity! I was tearing my hair out for hours yesterday trying to solve exactly the same problem – I can hardly wait to try this out! Max is the most amazing and mind blowing program I have ever seen or bought in my life but the learning curve is pretty darn steep despite my best intentions! It is really fantastic to have all you Max brainers and zen masters out there in this forum to help us noobies out! Much appreciated people. I love the creativity and spirit of these forums! Back to my dreams of visual music…..

Thank you thank you thank you.


January 10, 2012 | 4:04 am

Take a look at stripnote (and its cousin makenote). Your solution works, but looking at stripnote might help you understand the concept – and its use with makenote can be helpful in some contexts.


January 10, 2012 | 5:06 am

Yeah, you could replace the [> 0] and [gate] with [stripnote]. I kept the [> 0] structure because that was what had been floated earlier in the thread.


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