electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
Live streaming at radio.electro-music.com

  host / artist show at your time
  mosc Chez Mosc - Tonite, Twyndyllyngs Live
Please visit the chat
 Forum index » Clavia Nord Modular » G2 Performances - Experimental
G2 Prf => Chrome
Post new topic   Reply to topic Moderators: Nord Modular Editors
Page 1 of 1 [3 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
ian-s



Joined: Apr 01, 2004
Posts: 2597
Location: Auckland, New Zealand
Audio files: 42
G2 patch files: 613

PostPosted: Fri Nov 14, 2014 5:51 pm    Post subject: G2 Prf => Chrome
Subject description: Simple test of controlling javascript browser app from Nord G2
Reply with quote  Mark this post and the followings unread

Chrome now has experimental support for web midi.

If you have a G2 connected via MIDI to a PC running an up to date copy of the chrome browser and want to hear/see this demo...

go to chrome://flags/#enable-web-midi, enable it, and restart your Chrome browser.

Download the (old but modified) G2 prf attached here and navigate to this page.


If everything works,

    the rotating ball's hue should change with the drone harmonic content.
    The ball should kick into a random rotation direction/speed in sync with the kick drum sound.
    The balls diameter should expand in sync with the air escaping sound.

The code is horrible, just an ancient 3d random dots to surface of a sphere test with the following code dumped in. It is hard coded for midi input #1 if you have more than one midi in port connected to your PC you might need to change the index on the line inp = m.input()[n].


Code:

navigator.requestMIDIAccess().then(function (m) {
   outp = m.outputs()[1];
   inp = m.inputs()[0];
   inp.onmidimessage = function (event) {
      if (event.data[0] == 0xB0 && event.data[1] == 7)
         mHue = event.data[2]*2;
      if (event.data[0] == 0xB0 && event.data[1] == 12)
         fov = (340-(event.data[2]*.75));
      if (event.data[0] == 0x90)
         speed = Math.random()*.04, speedy = Math.random()*.04;
   }
}, alert);


The MIDI output works as well, so it is possible to add code to control the G2 from the browser.


Normon-mid.prf2
 Description:
Patch to control browser app

Download
 Filename:  Normon-mid.prf2
 Filesize:  15.89 KB
 Downloaded:  252 Time(s)

Back to top
View user's profile Send private message
Electromagnetic Wave



Joined: Apr 28, 2013
Posts: 110
Location: Kebek
G2 patch files: 17

PostPosted: Sun Nov 23, 2014 2:23 am    Post subject: Reply with quote  Mark this post and the followings unread

very interesting ! Thanks for this ian-s. Soon I will be able to play with the cosmos from my G2! Shocked

(picture from Prometheus movie)


harmonie.jpeg
 Description:
 Filesize:  226.4 KB
 Viewed:  36 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

harmonie.jpeg


Back to top
View user's profile Send private message
ian-s



Joined: Apr 01, 2004
Posts: 2597
Location: Auckland, New Zealand
Audio files: 42
G2 patch files: 613

PostPosted: Tue Nov 25, 2014 1:41 am    Post subject: Reply with quote  Mark this post and the followings unread

Apologies to anyone who tried this and didn't get it working.

In the short time since posting the implementation has changed a little and getting the input port is now m.input.get(n) not m.input()[n]

Code is fixed now.

I'm sure in the near future some nice things will be possible graphically. I hear native SIMD is coming to the browser soon.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: Nord Modular Editors
Page 1 of 1 [3 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » Clavia Nord Modular » G2 Performances - Experimental
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use