< Back to IRCAM Forum

Clear() is not a function for javascript mubu objects

Hi again,

I want to be able to clear a mubu buffer after I set the number of matrix columns (this seems to be necessary).

When I call this bit of code in Max:

	if (mubu === null) {
		post('mubu object not bound')
	} else {
		mubu.clear();
	}

I get the error:

js: mb.static.js: Javascript TypeError: mubu.clear is not a function, line 83

How does one call clear?

Hi, you can clear a buffer content with the “clearbuffer index” message to the mubu object. “clear” is just on a single track.
Best

ps: if you look in the mubu.javascript help patch you can find the complete (I hope) mubujs API.

As in:

mubu.message("clear")

?