14 March 2011

Max/MSP Javascript: Dollar Function - Returns a reference to a Max Object in a patch/subpatch

I started using Max this month and was simultaneously impressed with its power and simplicity and frustrated by it's cumbersome interface. I quickly checked out it's javascript capabilities and became much more comfortable. JS allows you do simple operations quite quickly that would take a tonne of parsing objects which use up space and lead to a messy patch.

That said, JS in Max is really a slightly ugly cousin of browser based javascript. Calls to objects are long winded and basically everything is a bit head wrecking!

So here we go: the first in my "Making Max JS less crap" series... The infamous dollar function! All you need to do to access a max object is give the object a scripting name in the inspector* and then use: $('scriptingname')

Please see right hand pane before copying my code>>

function $(stringref){
    stringref=stringref.replace(/parent/gi, "parentpatcher")
    var path=stringref.split('.')
    var obj=this.patcher
    for(i in path){
        if(path[i]=='parentpatcher'){ //up 1 level:
            if(i!=path.length-1){ //down 1 level:

$("myButton").message('set','new text!') //access 'myButton' object in current patcher
$("parent.myButton").message('set','new text!') //access 'myButton' object in parent patcher
$("myPatcher.myButton").message('set','new text!') //access 'myButton' object in child patcher
$("parent.myPatcher.myButton").message('set','new text!') //access 'myButton' object in sibling patcher

* If you're not bothered giving every patcher a unique scripting name in the inspector, try my lazy dollar function instead.

A good way to use this function is to use Luke Hall's include script. Save his script into your jsexternals folder, save my functions into your project folder as basefunctions.js (or something similar) and then you can simply use include(this,"basefunctions.js") at the top of every JS file you use. Thanks Luke - this is awesome!


Anonymous said...

Just a quick mention of the "jsextensions" folder in the Max search path. It's the best home for these types of utility functions as you can then use them in any other javascripts you write.

Unknown said...

BUG: After some testing it turns out there are some problems calling this function in a for/while loop. Max seems to be mildly retarded when it comes to JS and the speed of the for loop is too fast for the function (wtf?!) and the program crashes like a big bastard.

Anonymous said...

This was helpful. I have prototypes on my array objects so I needed to change the loop invariant to explicitly run for the length of the split path.

Unknown said...

cheap jordans
louis vuitton handbags
cheap nfl jerseys
supra for sale
christian louboutin shoes
fitflops sale clearance
michael kors outlet
toms shoes
lebron james shoes

spencermeyer said...

In the long run, a bag tackk.com/ can have a zillion bells as well as Check This Out whistles however if it doesn't swallow you up like Leading 8 Finest Blender For Smoothies Or Food Processor Mixer Combos your preferred down comforter if it does not keep.

julieazevedo said...

Cordless as well as electric sites.google.com/ blowers will commonly clear up Title to six to ten inches of snow, yet you may have to work to get Snow Blower Buying Guide 2017 them through much heavier snowfalls.

Adiba Alam said...

With this adjustment in the market, the Web Developers should take up appropriate preparing to keep them refreshed and sparkle in the Web Development field. css

mary Brown said...

Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Front end developer learn from Javascript Training in Chennai . or learn thru JavaScript Online Training in India. Nowadays JavaScript has tons of job opportunities on various vertical industry. JavaScript Training in Chennai

Unknown said...

christian louboutin
oakley sunglasses wholesale
kd 10 elite
ray ban sunglasses outlet
pandora charms
true religion jeans sale
ralph lauren outlet
canada goose jackets
ugg boots on sale
chloe sunglassess

chenlili said...

jordan 8
balenciaga triple s
givenchy handbags
parajumpers jackets
ralph lauren
new balance shoes
nike air max 1
visconti pens
lebron soldier 11
giuseppe zanotti

chenmeinv0 said...

adidas superstar
longchamp handbags
true religion
abercrombie and fitch
converse outlet store
coach outlet
seahawks jerseys
salomon shoes
ai max
ray ban sunglasses

Unknown said...

Superb. I really enjoyed very much with this article here. Really it is an amazing article I had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent article. thank you for sharing such a great blog with us.
Java training in Chennai

Java training in Bangalore

sathish said...

I appreciate that you produced this wonderful article to help us get more knowledge about this topic.
I know, it is not an easy task to write such a big article in one day, I've tried that and I've failed. But, here you are, trying the big task and finishing it off and getting good comments and ratings. That is one hell of a job done!

Selenium training in bangalore
Selenium training in Chennai
Selenium training in Bangalore
Selenium training in Pune
Selenium Online training

jorick228 said...

Played on BGAOC with big wins? NOT? Come to us as soon as possible and win with us. perfect all slots casino Come get your chance to win.

service care said...

I am obliged to you for sharing this piece of information here and updating us with your resourceful guidance. Hope this might benefit many learners. Keep sharing this gainful articles and continue updating for us.
oneplus service centre chennai
oneplus service centre
oneplus mobile service center in chennai

Chris Hemsworth said...

The article is so informative. This is more helpful for our
software testing training courses
selenium testing training
software testing training institute
Thanks for sharing.

Christoper stalin said...

This article is very helpful.
web designing training and placement
php training with placement in chennai
magento training in chennai

Naveen S said...

great work!!!
Learn Digital Marketing Course Training and Placement Institute in Chennai

Chris Hemsworth said...

The article is so informative. This is more helpful for our
Learn best software testing online certification course class in chennai with placement
Best selenium testing online course training in chennai
Best online software testing training course institute in chennai with placement
Thanks for sharing.

Aruna Ram said...

Lovely post! This is a very fruitful post and I am impressed with the effort you have so obviously put into this content. Thanks for sharing.

Oracle Training in Chennai
Oracle Training
Social Media Marketing Courses in Chennai
Tableau Training in Chennai
Primavera Training in Chennai
Unix Training in Chennai
Pega Training in Chennai
Oracle DBA Training in Chennai
Power BI Training in Chennai
Oracle Training in Velachery

sanjandevan said...

Valuable one...thanks for sharing...
javascript training in chennai
javascript training in velachery
javascript training courses
javascript training classes
javascript course fees
javascript training in chennai
core java training in chennai
Photoshop Classes in Chennai
Manual Testing Training in Chennai
Drupal Training in Chennai

Durai Raj said...

Fantastic blog!!! Thanks for sharing with us, Waiting for your upcoming data.
Digital Marketing Course in Chennai
Digital Marketing Course
digital marketing institute in chennai
Digital Marketing Training in Chennai
Digital marketing course in Tnagar
Digital marketing course in Thiruvanmiyur
Big data training in chennai
Software testing training in chennai
Selenium Training in Chennai
JAVA Training in Chennai

Anbarasan14 said...

I believe that your blog would help the readers by giving them a useful information. Waiting for more updates from this admin.
Spoken English Classes in Coimbatore
Best Spoken English Classes in Coimbatore
Spoken English Class in Coimbatore
Spoken English in Coimbatore
Spoken English Classes in Chennai
IELTS Coaching in Chennai
English Speaking Classes in Mumbai
IELTS Classes in Mumbai
Spoken English Class in Anna Nagar
IELTS Coaching in Tambaram

divi said...

thanks for your information really good and very nice web design company in velachery

monicka said...

Qbigpro is the best web designing company in chennai.we are doing web designing and developing website creation website maintenance graphic designing google ads logo creation in our company.web design company in velachery.

shivam said...

Flying Shift - Packers & Movers in Bhopal

Tech Guy said...

For Data Science training in Bangalore, Visit:
Data Science training in Bangalore

Tech Guy said...

For Blockchain training in Bangalore, Visit:
Blockchain training in Bangalore

virgoacp said...

Aluminium Composite Panel or ACP Sheet is used for building exteriors, interior applications, and signage. They are durable, easy to maintain & cost-effective with different colour variants.

Raj Sharma said...

Awesome post. Good Post. I like your blog. You Post is very informative. Thanks for Sharing.
Hadoop Training in Noida
Informatica Training in Noida
R Programming Training in Noida

Shop Sous Vide said...

Nice post shared.
tree trimmers palm beach county

Clark said...

I believe that your blog would help the readers.
san diego remodeling contractors

Shop Sous Vide said...

Nice Post.
residential tree services fort lauderdale

Columbus Ga Tree Removal said...

Nice Post. Check out this site for tree pruning

Clark said...

Great post.
tile reglazing minneapolis

Shop Sous Vide said...

Superbly written article.
commercial solar panel installation fort lauderdale

Clark said...

Nice post.
concrete driveway contractors minneapolis

Shop Sous Vide said...

Perfect post shared.concrete driveway contractors miami

Clark said...

Thanks for sharing.
concrete driveway contractors port st lucie

Shop Sous Vide said...

Awesome blog.
patio resurfacing minneapolis

Shop Sous Vide said...

Thanks for one marvelous posting!
patio resurfacing port st lucie

Bloxico said...

Superb. I really enjoyed very much with this article here.
kandol lake

Unknown said...

wonderful post .
crypto airdrop

Unknown said...

This article very helpful.
ico rating

Unknown said...

Great!! just awesome blog.
123 movie

maya said...

I like the helpful info you provide in your articles.

maya said...

Hi, Thanks for sharing this information.
123 movies

online idea lab said...
This comment has been removed by the author.
online idea lab said...
This comment has been removed by the author.
online idea lab said...

thanks for sharing this such types of topics.
AWS Solutions Architect Training in Bangalore.

online idea lab said...

thanks for informing us about this articles.
AWS Certification course.

Customer relationship management said...

Excellent information with unique content and it is very useful to know about the information.angular 7 training in bangalore

Customer relationship management said...

This Information which you provided is very much useful for Agile Training Learners. Thank You for Sharing Valuable Information.sap s4 hana simple finance training in bangalore

Customer relationship management said...

Awesome post with lots of data and I have bookmarked this page for my reference. Share more ideas frequently.javascript training in bangalore

Customer relationship management said...

I must appreciate you for providing such a valuable content for us. This is one amazing piece of article.Helped a lot in increasing my knowledge.sap hr training in bangalore

Customer relationship management said...

Wow it is really wonderful and awesome thus it is veWow, it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot.html training in bangalore

watson said...

Great post!I am actually getting ready to across this information,i am very happy to this commands.Also great blog here with all of the valuable information you have.Well done,its a great knowledge. Amazon web services Training in Bangalore

watson said...

Thanks for one marvelous posting! I enjoyed reading it; you are a great author. I will make sure to bookmark your blog and may come back someday. I want to encourage that you continue your great posts.devops training

watson said...

Thank you for your post. This is excellent information. It is amazing and wonderful to visit your site. sap s4 hana training in bangalore

watson said...

Awesome,Thank you so much for sharing such an awesome blog. sap fico training in bangalore

watson said...

Thanks for sharing this blog. This very important and informative blog. Python Training in Bangalore

Helena Merry said...

Wow, marvelous blog layout! How long have you been blogging
for? you made blogging look easy. The overall look of your web site is excellent, let alone the


Softgen Infotech said...

Really very happy to say, your post is very interesting to read. I never stop myself to say something about it. You’re doing a great job. Keep it up…

Learn SAP Training from the Industry Experts we bridge the gap between the need of the industry. Softgen Infotech provide the Best SAP ABAP Training in Bangalore with 100% Placement Assistance. Book a Free Demo Today.

eTechno Soft Solutions said...

Thank you for sharing such a nice post!

Get SAP ABAP Training in Bangalore from Real Time Industry Experts with 100% Placement Assistance in MNC Companies. Book your Free Demo with eTechno Soft Solutions.

The Gabay Group said...

מעולה. תודה על הכתיבה היצירתית.
קבוצת גבאי אלי גבאי

Cinema furniture said...
This comment has been removed by the author.
Unknown said...

Such a nice article.
שערי אלומיניום

Aleena said...

סגנון כתיבה מרענן, תודה על השיתוף.
טבעות יהלומים

Dafmatok Hosting Trays said...

פוסט מרענן במיוחד. לגמרי משתף
מגשי אירוח לאירועים קטנים

Cinema furniture said...

תמשיכו בפרסום פוסטים מעניינים כמו זה. תודה
פינת אוכל עגולה

Comfi furniture said...

כל הכבוד על הפוסט. אהבתי
פינות אוכל מעוצבות

Tuhin said...

keep up the good work. this is an Assam post. this to helpful, i have reading here all post. i am impressed. thank you. this is our digital marketing training center. This is an online certificate course
digital marketing training in bangalore | https://www.excelr.com/digital-marketing-training-in-bangalore

Unknown said...

I really appreciate such a post.
רמקולים רצפתיים

Helena Merry said...

As we look back upon 2015, we would like to acknowledge those who have helped us shape our business. Thanks for a great year, and we wish you all the best as you embark on 2016.

Planner Productions said...

פוסט מעניין, משתף עם העוקבים שלי. תודה.
אטרקציות לחתונות

123movies said...

"I am actually glad to glance at this website posts which carries lots of helpful data,
thanks for providing these data.


fmovies said...

It’s in fact very difficult in this busy life to listen news on TV, thus I only use the web for that purpose,and take the latest news.

yesmovies said...

Hi, of course this paragraph is truly pleasant and I have learned lot of things fromit on the topic of blogging. thanks.

solarmovies said...

I truly enjoy looking at on this web site , it contains superb blog posts. Heavierthanair flying machines are impossible. by Lord Kelvin.

shalini said...

This blog is very helpful for us...I got some important information from this blog..
DevOps Training in Chennai
DevOps Training in Bangalore
DevOps Training in Coimbatore
aws training in bangalore
Data Science Courses in Bangalore
DOT NET Training in Bangalore
DevOps certification in Chennai
Best DevOps Training in Bangalore
DevOps course in Chennai
DevOps Course in Bangalore

Babiesmall said...

תמשיכו בפרסום פוסטים מעניינים כמו זה. תודה.

brokertome said...

פוסט נחמד. חייב לשתף עם העוקבים שלי.
נכס מניב

Unknown said...

awsome post.

פרסום באאוטבריין

gemcreature said...

Excellent information Providing by your Article. Thanks
animal themed jewelry

Bloxi said...

סופסוף מישהו שתואם לדעותיי בנושא. תודה.
בלוק תמונה

Unknown said...

Thank you for sharing very nice.

Wound electrical stimulation

Reshma said...

Wonderful post and more informative!keep sharing Like this!
Tally Course in Chennai
Tally Course in Hyderabad
Tally training coimbatore
Tally Course in Coimbatore
Tally course in madurai
Tally Training in Chennai
Tally Institute in Chennai
Tally Classes in Bangalore
Best tally training institute in bangalore
Ethical hacking course in bangalore

alasksecurity said...

סופסוף מישהו שתואם לדעותיי בנושא. תודה.
מצלמות אבטחה אלחוטיות

Reputation management said...

כתיבה מעולה, אהבתי. אשתף עם העוקבים שלי.
ניהול מוניטין ברשת

Unknown said...

I definitely appreciate your blog. Check Tender Drawings here also Excellent work!

South Coast Entertainment said...

The blog article very surprised to me! Your writing is good. In this I learned a lot! Thank you! I am sharing wedding DJ services South Coast this information here.

sasi said...

Very nice post with lots of information. Thanks for sharing these updates.
Angular Training in hyderabad
Angularjs Training in Bangalore
angular training in bangalore
Angularjs course in Chennai
angular course in bangalore
angularjs training institute in bangalore
salesforce course in bangalore
Big Data Training in Coimbatore
best angularjs training in bangalore
angularjs training in marathahalli

Unknown said...

Nice ideas shared.
global asset management seoul

Sitelinx said...

אין ספק שזה אחד הנושאים המעניינים. תודה על השיתוף.
חברת שיווק באינטרנט

w3webschool said...

I really appreciate your method to explaining, I hope to see more posts from your blog. thank you!
Digital Marketing Course In Kolkata
Web Design Course In Kolkata
SEO Course In Kolkata

Unknown said...

סופסוף מישהו שתואם לדעותיי בנושא. תודה.
מתנה ליולדת

Unknown said...

פוסט מעניין, משתף עם העוקבים שלי. תודה.
נכסים מניבים

Dogma said...

רציתי רק לשאול, אפשר לשתף את הפוסט בבלוג שלי?
בניית אפליקציה

How To Asset Manage said...

I appreciate that you produced this wonderful article
global asset management seoul

Global Asset Management Udemy said...

Excellent information.
global asset management

Bindhu Lata said...

Nice post I have been searching for a useful post like this on salesforce course details, it is highly helpful for me and I have a great experience with this   
Salesforce Training India 

Nick569 said...

Great post! I am actually getting ready to across this information, It’s very helpful for this blog. Also great with all of the valuable information you have Keep up the good work you are doing well.
CRS Info Solutions Salesforce Training   

Marry07 said...

If you are looking for a job oriented practical based workday course syllabus curriculum at Workday training institutes in India then you are arrived at the right place called Workday training institutes in ameerpet because this institute is quite popular for this wonderful course not just in Workday training institutes in Jaipur and also proving job assistance for Workday training institutes in Pune

Aadhya said...

Myself so glad to establish your blog entry since it's actually quite instructive. If it's not too much trouble continue composing this sort of web journals and I normally visit this blog. Examine my administrations.  
Read these Salesforce Admin Certification Topics which are really helpful. I read these Salesforce Admin and Developer Certification Dumps and very much useful for me. I recommend this Salesforce Developer Training and Certification Course for you.

Anonymous said...

solarmovie watch the latest movies in your home.

saran said...

Really nice post. Thank you for sharing amazing information.
Digital Marketing Training Course in Chennai | Digital Marketing Training Course in Anna Nagar | Digital Marketing Training Course in OMR | Digital Marketing Training Course in Porur | Digital Marketing Training Course in Tambaram | Digital Marketing Training Course in Velachery

사설토토 said...

תמשיכו בפרסום פוסטים מעניינים כמו זה. תודה.
הדפסה על קנבס

Clark said...

awesome post.
מצלמות אבטחה במבצע

intercom4u said...

Fantastic blog
אינטרקום סקיוריטי

Anonymous said...

123movies. when you can watch the latest movies in your home.

subha said...

Right now, there are an assortment of Stanford-Binet intelligence scales (fourth Version, Fifth Release, and whatnot.). The target of the Stanford-Binet intelligence scale is more often than not to assess the intelligence and scholarly capacities thanks
Ai & Artificial Intelligence Course in Chennai
PHP Training in Chennai
Ethical Hacking Course in Chennai Blue Prism Training in Chennai
UiPath Training in Chennai

CloudLearn ERP said...

Your article is very informative. It's a welcome change from other supposed informational content. Your points are unique and original in my opinion. I agree with many of your points.
Best Data Science training in Mumbai

Data Science training in Mumbai

Clark said...

global asset management

Fixadoor said...

The article is so informative.
Garage door repair Mississauga

Clark said...

thanks for sharing.
Global asset management Korea

Anirban Ghosh said...

The content that I normally see is nothing like what you have written. This is very well-thought out and well-planned. You are a unique thinker and bring up great individualized points. Please continue your work.
SAP training in Kolkata
SAP training Kolkata
Best SAP training in Kolkata
SAP course in Kolkata
SAP training institute Kolkata

latchu kannan said...

It is an wonderful site to learn so many things to learn so many ideas.

AngularJS training in chennai | AngularJS training in anna nagar | AngularJS training in omr | AngularJS training in porur | AngularJS training in tambaram | AngularJS training in velachery

Post a Comment

Cron Design Studio: Dublin based web design & software development