Quotile

Home  |  download  |  Perl  |  media  |  documentation  |  clo...@gmail.com
 
TABLE OF CONTENTS

Getting Started


Using Quotile

You can send OSC commands to Quotile on port 12000 using the format "/quotile [command]", where command is any Quotile command. Here's a small Processing program that sends the command help to Quotile using OSC when you click the mouse:

	import oscP5.*;
	import netP5.*;
	
	OscP5 oscP5;
	NetAddress myRemoteLocation;
	
	void setup() {
	  size(400,400);
	  frameRate(25);
	
	  oscP5 = new OscP5(this,12001);
	  myRemoteLocation = new NetAddress("127.0.0.1",12000);
	}
	
	void draw() {
	  background(0);  
	}
	
	
	void mousePressed() {
	  OscMessage myMessage = new OscMessage("/quotile");  
	  myMessage.add("help");
	
	  NetAddress location = new NetAddress("127.0.0.1",12000);  
	  
	  oscP5.send(myMessage, location); 
	}
	


In order to understand the rest of this section, you must have read Mapping rows to commands. Quotile doesn't make any assumptions about how you'd like to communicate with OSC (Open Sound Control) compatible programs. It's up to you to make it happen by writing a custom command or finding one that already exists, then mapping rows to that custom command.

Quotile does offer some help by injecting an "osc" object into all custom commands. The osc object has methods for sending out generic OSC messages.

I've written one custom command, "reaktor", to illustrate this technique. Here's the code:

	signature = "int,int,string,int";
	
	documentation = "Sends an OSC message to Reaktor";
	syntax = "reaktor [action] [value] [address] [port]";
	example = "reaktor 0 14 127.0.0.1 10000";
	
	run()
	{
	  action = arg1;
	  value = arg2;
	  address = arg3;
	  port = arg4;
	
	  osc.set_net_address(address,port);
	  osc.create_message("/reaktor");
	  osc.message.add(new int[] {action,value});
	  osc.send_message(); 
	}
Reaktor is picky about its OSC messages. An OSC message sent to Reaktor must have a single integer array as its payload.

The osc object that's available from within a custom command is based on oscP5. Here is the implementation of the osc object:

	import oscP5.*;
	import netP5.*;
	
	class Osc
	{
	  
	  NetAddress myRemoteLocation = null;
	  OscMessage message = null;
	  
	  void Osc()
	  {
	  }
	  
	  void set_net_address(String ip_address,int port)
	  {  
	    this.myRemoteLocation = new NetAddress(ip_address,port);
	  }
	  
	  void create_message(String address) // such as "/test"
	  {
	    message = new OscMessage(address);
	  }
	  
	  void send_message()
	  {
	    oscP5.send(this.message, this.myRemoteLocation);
	  }
	}