SlideShare una empresa de Scribd logo
1 de 14
Descargar para leer sin conexión
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

Más contenido relacionado

Similar a 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 a 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
 

Más de 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)
 

Último

Último (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

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