SlideShare a Scribd company logo
Yet Another
 Max/MSP - Cocoa
    Integration
cocoa-send / cocoa-receive external objects

                Nao Tokui




                                              1
Why Integrate?

• Max/MSP
 ○ Useful for Audio / MIDI / Images .... !!
    Scalability
  × Hard to manage big data set.



                                              2
Why Integrate?
• Cocoa - Native OS X Environment
 ○ Lots of useful frameworks and easy-to-use
   tools for them.
   • Frameworks - CoreData, Bonjour, QuartzComposer...
   • Tool - Xcode, InterfaceBuilder...
 ×  Audio / MIDI API is very very complicated.
   • Core Audio / Core MIDI / Quick Time


                                                         3
Max/MSP                Cocoa

             Bonjour
    Audio

              CoreData
     MIDI

            OpenGL




                               4
Conventional Ways

• MIDI?
 • CoreMIDI - Simply Overkill!
• Open Sound Control
 • Very flexible, but clumsy implementation
 • Not easy to use in Cocoa

                                             5
NE
                       W


cocoa_send / receive
   external object


                           6
Features
○ Simple to implement and Just works!
○ No need to “connect” explicitly (Always
  Connected!!)
× Limited to local use
       OK                                      NG!
                                                                   Cocoa
     Max   Cocoa
                          Max


                         http://commons.wikimedia.org/w/index.php?title=Image:MacBook_Pro_transparency.png


                                                                                                             7
Technical Details

• cocoa_send/receive use OS X’s Inter-
  Application Communication called
  “Distributed Notifications”
 • eg.) Preference Pane
 •   http://developer.apple.com/documentation/UserExperience/Conceptual/
     PreferencePanes/Tasks/Communication.html




                                                                           8
How to Use #1
1. Download cocoa_send/receive objects and
   sample application from www.naotokui.com
2. Set “Channel Names”
   •   These names will be used to identify
       communication channels. They must be shared
       between Max objects and Cocoa project.



                             Max ← Cocoa
       Max → Cocoa

                                                     9
How to Use #2
3. Open Cocoa_SR_Test folder
   and include Cocoa_SR_Test.h/
   m in your own Cocoa Project.
4. Set the same Channel Names
    #define CH_NAME_FROM_COCOA

 @quot;FROM_Cocoaquot;
    #define CH_NAME_TO_COCOA

 @quot;TO_Cocoaquot;


5. Use -sendString: -sendFloat:/-
   sendInteger methods to send.




                                                 10
Sending from Cocoa
•   Use -send**: methods.
      - (void) sendString: (NSString *) str;

      - (void) sendFloat: (float) number;

      - (void) sendInteger: (int) number;




                                               11
Receiving in Cocoa
• Customize callbackWithNotification:
            a callback function:
  - (void)
- (void) callbackWithNotification:(NSNotification *)myNotification
{

 NSDictionary *dict = [myNotification userInfo];


  // a string value received
 
 NSString *string = [dict valueForKey:SHARED_DICTIONARY_KEY_FOR_ANYTHING];

 if (string) {
       // Do something
  } .....




    • Dictionary Keys:
                                 SHARED_DICTIONARY_KEY_FOR_FLOAT
                                 SHARED_DICTIONARY_KEY_FOR_INT
                                 SHARED_DICTIONARY_KEY_FOR_ANYTHING


                                                                               12
Usage Cases
• Phonethica Rondo / VoiceCosmos


  http://www.ntticc.or.jp/Archive/2006/Openspace/network/phonethica_j.html




• Matarisama Binary 1.2 (by N.Nagano)
                                                                             13
Links


• Download
 • www.naotokui.com/home/Downloads.html


                                          14

More Related Content

Similar to Yet Another Max/MSP-Cocoa Communication

nokia and opensource n800
nokia and opensource n800nokia and opensource n800
nokia and opensource n800
winsopc
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
Fabien Potencier
 

Similar to Yet Another Max/MSP-Cocoa Communication (20)

iPhone Development For .Net Dev
iPhone Development For .Net DeviPhone Development For .Net Dev
iPhone Development For .Net Dev
 
Between Cocoa and Cocoa Touch: A Comparative Introduction
Between Cocoa and Cocoa Touch: A Comparative IntroductionBetween Cocoa and Cocoa Touch: A Comparative Introduction
Between Cocoa and Cocoa Touch: A Comparative Introduction
 
Iphone Dev
Iphone DevIphone Dev
Iphone Dev
 
Pronounced S-pro-ut-Co-re (Introduction to SproutCore)
Pronounced S-pro-ut-Co-re (Introduction to SproutCore)Pronounced S-pro-ut-Co-re (Introduction to SproutCore)
Pronounced S-pro-ut-Co-re (Introduction to SproutCore)
 
X Means Y
X Means YX Means Y
X Means Y
 
Absolute Beginners Guide to iPhone dev
Absolute Beginners Guide to iPhone devAbsolute Beginners Guide to iPhone dev
Absolute Beginners Guide to iPhone dev
 
How to Use OpenMP on Native Activity
How to Use OpenMP on Native ActivityHow to Use OpenMP on Native Activity
How to Use OpenMP on Native Activity
 
Getting started with open mobile development on the Openmoko platform
Getting started with open mobile development on the Openmoko platformGetting started with open mobile development on the Openmoko platform
Getting started with open mobile development on the Openmoko platform
 
JavaFX Uni Parthenope
JavaFX Uni ParthenopeJavaFX Uni Parthenope
JavaFX Uni Parthenope
 
Import golang; struct microservice
Import golang; struct microserviceImport golang; struct microservice
Import golang; struct microservice
 
Quickstart: Qt for Windows, Symbian and Maemo / Meego v2.0.8 (January 10th, 2...
Quickstart: Qt for Windows, Symbian and Maemo / Meego v2.0.8 (January 10th, 2...Quickstart: Qt for Windows, Symbian and Maemo / Meego v2.0.8 (January 10th, 2...
Quickstart: Qt for Windows, Symbian and Maemo / Meego v2.0.8 (January 10th, 2...
 
Разработка cloud-native Java-приложений для Kubernetes, Егор Волков,Senior Ja...
Разработка cloud-native Java-приложений для Kubernetes, Егор Волков,Senior Ja...Разработка cloud-native Java-приложений для Kubernetes, Егор Волков,Senior Ja...
Разработка cloud-native Java-приложений для Kubernetes, Егор Волков,Senior Ja...
 
Scaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container ServiceScaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container Service
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopment
 
nokia and opensource n800
nokia and opensource n800nokia and opensource n800
nokia and opensource n800
 
Monorepo: React Web & React Native
Monorepo: React Web & React NativeMonorepo: React Web & React Native
Monorepo: React Web & React Native
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
 
Nagios Conference 2012 - Eric Loyd - Nagios Implementation Case Eastman Kodak...
Nagios Conference 2012 - Eric Loyd - Nagios Implementation Case Eastman Kodak...Nagios Conference 2012 - Eric Loyd - Nagios Implementation Case Eastman Kodak...
Nagios Conference 2012 - Eric Loyd - Nagios Implementation Case Eastman Kodak...
 
Scaling Django
Scaling DjangoScaling Django
Scaling Django
 
mekentosj.com - building Papers
mekentosj.com - building Papersmekentosj.com - building Papers
mekentosj.com - building Papers
 

More from Nao Tokui (13)

massh - 2008
massh - 2008massh - 2008
massh - 2008
 
FITC Tokyo 2014
FITC Tokyo 2014FITC Tokyo 2014
FITC Tokyo 2014
 
コミュニケーションツールの未来 - 2013.12.1 at IMPACT HUB Tokyo
コミュニケーションツールの未来 - 2013.12.1 at IMPACT HUB Tokyoコミュニケーションツールの未来 - 2013.12.1 at IMPACT HUB Tokyo
コミュニケーションツールの未来 - 2013.12.1 at IMPACT HUB Tokyo
 
Techcrunch hackathon 2013
Techcrunch hackathon 2013Techcrunch hackathon 2013
Techcrunch hackathon 2013
 
Tokyo Niche プレゼンテーション
Tokyo Niche プレゼンテーションTokyo Niche プレゼンテーション
Tokyo Niche プレゼンテーション
 
Design Strategy Tokuil
Design Strategy TokuilDesign Strategy Tokuil
Design Strategy Tokuil
 
Audible Realities活動報告
Audible Realities活動報告Audible Realities活動報告
Audible Realities活動報告
 
サウンドプログラミング演習 '08 5/29
サウンドプログラミング演習 '08 5/29サウンドプログラミング演習 '08 5/29
サウンドプログラミング演習 '08 5/29
 
サウンドプログラミング演習 '08 5/8
サウンドプログラミング演習 '08 5/8サウンドプログラミング演習 '08 5/8
サウンドプログラミング演習 '08 5/8
 
'Sound Programming '08 5/1
'Sound Programming '08 5/1'Sound Programming '08 5/1
'Sound Programming '08 5/1
 
デジタルコンテンツ研究会
デジタルコンテンツ研究会デジタルコンテンツ研究会
デジタルコンテンツ研究会
 
Technology and Music - Designing Music Part 2 (in Japanese)
Technology and Music - Designing Music Part 2 (in Japanese)Technology and Music - Designing Music Part 2 (in Japanese)
Technology and Music - Designing Music Part 2 (in Japanese)
 
Technology and Music - Designing Music (in Japanese)
Technology and Music - Designing Music (in Japanese)Technology and Music - Designing Music (in Japanese)
Technology and Music - Designing Music (in Japanese)
 

Recently uploaded

Recently uploaded (20)

"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 

Yet Another Max/MSP-Cocoa Communication

  • 1. Yet Another Max/MSP - Cocoa Integration cocoa-send / cocoa-receive external objects Nao Tokui 1
  • 2. Why Integrate? • Max/MSP ○ Useful for Audio / MIDI / Images .... !! Scalability × Hard to manage big data set. 2
  • 3. Why Integrate? • Cocoa - Native OS X Environment ○ Lots of useful frameworks and easy-to-use tools for them. • Frameworks - CoreData, Bonjour, QuartzComposer... • Tool - Xcode, InterfaceBuilder... × Audio / MIDI API is very very complicated. • Core Audio / Core MIDI / Quick Time 3
  • 4. Max/MSP Cocoa Bonjour Audio CoreData MIDI OpenGL 4
  • 5. Conventional Ways • MIDI? • CoreMIDI - Simply Overkill! • Open Sound Control • Very flexible, but clumsy implementation • Not easy to use in Cocoa 5
  • 6. NE W cocoa_send / receive external object 6
  • 7. Features ○ Simple to implement and Just works! ○ No need to “connect” explicitly (Always Connected!!) × Limited to local use OK NG! Cocoa Max Cocoa Max http://commons.wikimedia.org/w/index.php?title=Image:MacBook_Pro_transparency.png 7
  • 8. Technical Details • cocoa_send/receive use OS X’s Inter- Application Communication called “Distributed Notifications” • eg.) Preference Pane • http://developer.apple.com/documentation/UserExperience/Conceptual/ PreferencePanes/Tasks/Communication.html 8
  • 9. How to Use #1 1. Download cocoa_send/receive objects and sample application from www.naotokui.com 2. Set “Channel Names” • These names will be used to identify communication channels. They must be shared between Max objects and Cocoa project. Max ← Cocoa Max → Cocoa 9
  • 10. How to Use #2 3. Open Cocoa_SR_Test folder and include Cocoa_SR_Test.h/ m in your own Cocoa Project. 4. Set the same Channel Names #define CH_NAME_FROM_COCOA @quot;FROM_Cocoaquot; #define CH_NAME_TO_COCOA @quot;TO_Cocoaquot; 5. Use -sendString: -sendFloat:/- sendInteger methods to send. 10
  • 11. Sending from Cocoa • Use -send**: methods. - (void) sendString: (NSString *) str; - (void) sendFloat: (float) number; - (void) sendInteger: (int) number; 11
  • 12. Receiving in Cocoa • Customize callbackWithNotification: a callback function: - (void) - (void) callbackWithNotification:(NSNotification *)myNotification { NSDictionary *dict = [myNotification userInfo]; // a string value received NSString *string = [dict valueForKey:SHARED_DICTIONARY_KEY_FOR_ANYTHING]; if (string) { // Do something } ..... • Dictionary Keys: SHARED_DICTIONARY_KEY_FOR_FLOAT SHARED_DICTIONARY_KEY_FOR_INT SHARED_DICTIONARY_KEY_FOR_ANYTHING 12
  • 13. Usage Cases • Phonethica Rondo / VoiceCosmos http://www.ntticc.or.jp/Archive/2006/Openspace/network/phonethica_j.html • Matarisama Binary 1.2 (by N.Nagano) 13
  • 14. Links • Download • www.naotokui.com/home/Downloads.html 14