max/msp/js

Introduction to javascript and max/msp with javascript


hello world!

Hope you all having a great time here ( :

javascript! why ?

  • easy to understand
  • easy to learn
  • easy to re-use
  • easy to modify
  • easy to use with max/msp
  • easy
  • easy
  • zZzzzZZ
  • zZzzZzZZz...

iz getting more and more powerful

Chrome is an excellent browser also one of the best tools for developing javascript.

Node.js is a plataform to develop js applications, its is built on Chrome's javascript runtime ( open source! )

-- show examples --

  • chrome javascript console
  • node console

~ extras

~ external reference

javascript on max/msp

max brought some sweetners !

code

function bang() {
  outlet( 0, 'bang' );
}

conditional

var inlets    = 1; // set the number of inlets
var outlets   = 1; // set the number of inlets
var autowatch = 1; // automatically compiles file when saved
// Scheduling a function be executed after 100 ms

var start_time;

function test(){	
  start_time = Date.now();

  tsk = new Task( scheduled, this, [ 60 ] );
  tsk.schedule( 100 - 1 ); // compensating 1 ms delay
}

function scheduled( note ) {
  post( ( Date.now() - start_time ) + " ms passed" );
  post();
  post( "got parameter note : " + note );
  post();
}
function list( ) {
	// recommended: transform arguments into array
	var my_list = arrayfromargs( arguments );

	post( "1st : " + my_list[ 0 ] );
	post( "2nd : " + my_list[ 1 ] );
	post( "3rd : " + my_list[ 2 ] );

	post( my_list );
	post();
}
this.patcher.getnamed( 'object_script_name' ).getvalueof()
// creates toggle
box = patcher.newobject( "toggle", x, y, 15, 0 );
// adds to presentation
box.presentation( 1 ); 
-- show creating toggles dynamically example --

~ extras

- more patch examples

~ external references

~ patch examples

Herrmutt Lobby Devices !

Quantize to trigger

- github

Minimun note length

- github

Chord Splitter

- github

FAQ

  • which text editor do you use?
  • Sublime Text

FAQ

  • what's GIT ?
  • Checkout GIT and don't forget to check github

FAQ

  • do you like pizza ?
  • this was supposed to be a stupid joke

~ other resources

javascript

max / msp / javascript

max 4 live

max / msp

thanks !!

Thank you for coming and taking your time to check this out.

Am sure as soon as you start playing with js you'll fall deeply in love.

more thanks

pleased to meet you!


Feel free to get in contact ( :

soundcloud/hems
vimeo.com/hems
github.com/hems
hems.inlet@gmail.com

~ http://hems.io