public class HB
extends java.lang.Object
HBAction
's HBAction.action(HB)
method, where users can play sounds, create network listeners, send network messages, and perform other actions.Modifier and Type | Class and Description |
---|---|
static class |
HB.AccessMode |
static class |
HB.DeviceType
The Type of Hardware that this instance of HappyBrackets is running on
|
static interface |
HB.StatusChangedListener |
Modifier and Type | Field and Description |
---|---|
net.beadsproject.beads.core.AudioContext |
ac
The
AudioContext used by HappyBrackets. |
static BroadcastManager |
broadcast
The
BroadcastManager object used to communicate with other devices using 1-many broadcasts. |
net.beadsproject.beads.ugens.Clock |
clock
The
Clock used by HappyBrackets. |
net.beadsproject.beads.ugens.Envelope |
clockInterval
The
Envelope that controls the clock interval. |
NetworkCommunication |
controller
The
NetworkCommunication object used to communicate with the controller. |
static HB |
HBInstance |
net.beadsproject.beads.ugens.Envelope |
masterGainEnv
The
Envelope used to control the master gain. |
net.beadsproject.beads.ugens.PolyLimit |
pl
The
PolyLimit that controls polyphony. |
java.util.Random |
rng
A random number generator for general use.
|
java.util.Hashtable<java.lang.Class<? extends Sensor>,Sensor> |
sensors
A
Hashtable to store sensors. |
java.util.Hashtable<java.lang.String,java.lang.Object> |
share
A
Hashtable to store generic objects. |
Synchronizer |
synch
The
Synchronizer object used to manage time synch between devices. |
Constructor and Description |
---|
HB(net.beadsproject.beads.core.AudioContext _ac)
Creates the HB.
|
HB(net.beadsproject.beads.core.AudioContext _ac,
HB.AccessMode _am)
Creates the HB.
|
HB(net.beadsproject.beads.core.AudioContext _ac,
HB.AccessMode _am,
boolean start_network)
Creates the HB.
|
Modifier and Type | Method and Description |
---|---|
void |
addBroadcastListener(de.sciss.net.OSCListener listener)
Add a new
OSCListener , listening to broadcasts. |
void |
addControllerListener(de.sciss.net.OSCListener listener)
Add a new
OSCListener , listening to incoming messages from the controller. |
boolean |
addDeviceAddress(java.lang.String name,
java.net.InetAddress address)
Associate a device name with an
InetAddress |
void |
addDeviceConnectedEventListener(DeviceConnectedEventListener listener)
Add a
DeviceConnectedEventListener to be informed when a new device is detected on the network |
void |
addStatusChangedListener(HB.StatusChangedListener listener)
Add Listeners for status change event
|
static void |
adjustScheduleTime(double amount,
long duration)
Adjust the
HBScheduler scheduler time |
void |
attemptHBActionFromClassName(java.lang.String class_name)
Attempts to load the given class as an
HBAction . |
void |
broadcast(java.lang.String string,
java.lang.Object... args)
Broadcast an
OSCMessage msg over the multicast group. |
void |
clearRegisteredVariable(java.lang.String name)
Erases @
Object with the given name from the registered memory store. |
void |
clearSound()
Clears all of the audio that is currently playing (connected to output).
|
static Clock |
createClock(double interval)
Create a new Clock using HappyBrackets scheduler
|
static DynamicControl |
createControlBuddyPair(java.lang.Object parent_sketch,
ControlType control_type,
java.lang.String name,
java.lang.Object initial_value,
java.lang.Object min_value,
java.lang.Object max_value)
A dynamic control pair that can be accessed from outside
it is created with the sketch object that contains it along with the type
only a single dynamic control is returned becasue the buddy is a mirror
|
static DynamicControl |
createDynamicControl(ControlType control_type,
java.lang.String name)
A dynamic control that can be accessed from outside
it is created with the sketch object that contains it along with the type
|
static DynamicControl |
createDynamicControl(ControlType control_type,
java.lang.String name,
java.lang.Object initial_value)
A dynamic control that can be accessed from outside
it is created with the sketch object that contains it along with the type
|
static DynamicControl |
createDynamicControl(ControlType control_type,
java.lang.String name,
java.lang.Object initial_value,
java.lang.Object min_value,
java.lang.Object max_value)
A dynamic control that can be accessed from outside
it is created with the sketch object that contains it along with the type
|
static DynamicControl |
createDynamicControl(java.lang.Object parent_sketch,
ControlType control_type,
java.lang.String name)
A dynamic control that can be accessed from outside
it is created with the sketch object that contains it along with the type
|
static DynamicControl |
createDynamicControl(java.lang.Object parent_sketch,
ControlType control_type,
java.lang.String name,
java.lang.Object initial_value)
A dynamic control that can be accessed from outside
it is created with the sketch object that contains it along with the type
|
static DynamicControl |
createDynamicControl(java.lang.Object parent_sketch,
ControlType control_type,
java.lang.String name,
java.lang.Object initial_value,
java.lang.Object min_value,
java.lang.Object max_value)
A dynamic control that can be accessed from outside
it is created with the sketch object that contains it along with the type
|
static de.sciss.net.OSCMessage |
createOSCMessage(java.lang.String name,
java.lang.Object... args)
Creates a valid OSC message.
|
static HB.DeviceType |
detectDeviceType()
Detect the type of device we are running by reading specific files through filesystem
If detected, the new
HB.DeviceType is stored |
void |
doAtTime(java.lang.Runnable runnable,
long time)
Causes an action to be implemented at the given, synchronized time.
|
void |
fadeOutClearSound(float fadeTime)
Like
clearSound() but with a fade out of the specified duration before clearing. |
void |
fadeOutReset(float fadeTime)
Like
reset() but with a fade out of the specified duration before clearing. |
Sensor |
findSensor(java.lang.Class sensorClass) |
static void |
flashLed(int num_blinks,
int interval)
FLash the onboard LED
|
java.lang.String |
friendlyName()
Returns a freindly name for the device.
|
java.lang.Object |
get(java.lang.String s)
Gets an @
Object with the given name from the global memory store. |
static net.beadsproject.beads.core.UGen |
getAccelerometer_X()
Return a UGen that is mapped to Accelerometer X value
|
static net.beadsproject.beads.core.UGen |
getAccelerometer_X(double scale_min,
double scale_max)
Return a UGen that is mapped to Accelerometer X value
|
static net.beadsproject.beads.core.UGen |
getAccelerometer_Y()
Return a UGen that is mapped to Accelerometer Y value
|
static net.beadsproject.beads.core.UGen |
getAccelerometer_Y(double scale_min,
double scale_max)
Return a UGen that is mapped to Accelerometer Y value
|
static net.beadsproject.beads.core.UGen |
getAccelerometer_Z()
Return a UGen that is mapped to Accelerometer Z value
|
static net.beadsproject.beads.core.UGen |
getAccelerometer_Z(double scale_min,
double scale_max)
Return a UGen that is mapped to Accelerometer Z value
|
static net.beadsproject.beads.core.UGen |
getAudioOutput()
Get the default HappyBrackets audio output as a UGen
|
net.beadsproject.beads.core.Bead |
getBead(java.lang.String s)
Gets an object of type @
Bead from the global memory store. |
java.net.InetAddress |
getDeviceAddress(java.lang.String name)
Return the
InetAddress associated with this device name that we can address that device with
If the device is this, then it will return the loopback address |
static HB.DeviceType |
getDeviceType()
The Type of Device this instance of HappyBrackets is running on
|
float |
getFloat(java.lang.String s)
Gets an object of type float from the global memory store.
|
float |
getFloatArg(de.sciss.net.OSCMessage m,
int index)
Gets a float arg from an
OSCMessage . |
static double |
getFutureSchedulerTime(double milliseconds)
Get a scheduler time in the future from
getSchedulerTime() . |
float |
getGain()
Get the current gain of the device
|
static net.beadsproject.beads.core.UGen |
getGyroscopePitch()
Return a UGen that is mapped to Gyroscope Pitch value
|
static net.beadsproject.beads.core.UGen |
getGyroscopeRoll()
Return a UGen that is mapped to Gyroscope Roll value
|
static net.beadsproject.beads.core.UGen |
getGyroscopeYaw()
Return a UGen that is mapped to Gyroscope Yaw value
|
int |
getInt(java.lang.String s)
Gets an object of type int from the global memory store.
|
java.util.Collection<java.lang.String> |
getKnownDeviceNames()
Get the names of the devices that we know are on the network.
|
MuteControl |
getMuteControl()
Return the Mute Control
|
static int |
getNumOutChannels()
Get the number of audio channels on the default HappyBrackets audio output
This parameter is dependant upon the configuration of the device |
java.lang.Object |
getRegisteredVariable(java.lang.String name)
Gets an @
Object with the given name from the registered memory store. |
static HBScheduler |
getScheduler()
Get the global
HBScheduler |
static double |
getSchedulerTime()
Get the amount of time elapsed since we set reference time in
HBScheduler |
java.net.InetAddress |
getSendingController(java.lang.Object classObject)
Get the
InetAddress of the controller that sent the class
If the class was loaded on startup it will be null |
Sensor |
getSensor(java.lang.Class sensorClass)
Gets the sensor with the given sensor ID.
|
java.lang.String |
getStatus()
Returns the current status @
String of the device. |
java.lang.String |
getString(java.lang.String s)
Gets an object of type @
String from the global memory store. |
long |
getSynchTime()
Returns the system time adjusted according to the result of any device synch attempts.
|
net.beadsproject.beads.core.UGen |
getUGen(java.lang.String s)
Gets an object of type @
UGen from the global memory store. |
boolean |
hasClassesLoaded()
Determine if we have any classes Loaded
|
static boolean |
isEnableSimulators()
Return whether we will displaysimulator sensors if no hardware sensor is found
|
static boolean |
isOurAddress(java.net.InetAddress address)
Detect whether this
InetAddress is actually this device |
boolean |
messageIs(de.sciss.net.OSCMessage m,
java.lang.String match)
Checks for an exact match to a string.
|
boolean |
muteAudio(boolean mute)
Perform a mute or Unmute of Output
|
int |
myConnectPort() |
int |
myIndex()
Returns the assigned ID of the current device.
|
java.lang.String |
pattern(net.beadsproject.beads.core.Bead pattern)
Adds a new pattern
Bead object to the Clock . |
java.lang.Object |
perm(java.lang.String id,
java.lang.Object o)
Stores an object in the global memory store.
|
void |
pullConfigFileFromController()
Notifies the device that it should try to pull the device config file from the controller.
|
void |
put(java.lang.String s,
java.lang.Object o)
Puts an
Object into the global memory store with a given name. |
static void |
rebootDevice()
Reboots the device immediately.
|
void |
registerVariable(java.lang.String name,
java.lang.Object value)
Puts an
Object into the global memory store with a given name. |
void |
reset() |
void |
resetLeaveSounding()
Like
reset() except that any sounds currently playing are kept. |
static boolean |
runDebug(java.lang.Class<?> action_class)
Run HB in a debug mode so we can debug sample code in INtelliJ
run the command like this: HB.runDebug(MethodHandles.lookup().lookupClass());
|
static boolean |
sendScheduleChange(double amount,
long duration,
java.util.Collection<java.lang.String> targets)
Send a schedule adjustment message to one or more devices.
|
static boolean |
sendScheduleSetTime(double new_time,
java.util.Collection<java.lang.String> targets)
Send a Schedule Set time to one or more targets
|
static void |
sendStatus(java.lang.String status)
Static version of
sendStatus(String) . |
void |
sendToController(java.lang.String string,
java.lang.Object... args)
Send an
OSCMessage to the controller. |
static boolean |
setDeviceLedValue(boolean on)
Return the Integer value required to turn the onboard LED on or off based on stored
HB.DeviceType |
static void |
setEnableSimulators(boolean enableSimulators)
Set whether we will displaysimulator sensors if no hardware sensor is found
|
void |
setFriendlyName(java.lang.String name)
We will set the friendly of the device here.
|
void |
setGain(float new_gain,
float millseconds)
Set the output gain of the device in an envelope.
|
void |
setMyIndex(int val)
We will set the index of the device here.
|
static void |
setScheduleTime(double new_time)
Set the global
HBScheduler scheduled time to this time |
void |
setStatus(java.lang.String s)
Sets the status @
String of this device. |
void |
setTCPServerPort(int tcpServerPort)
Set the TCP Osc Port given to us by operating system
We will pass it to the controller so it knows how to connect to us
|
void |
setUseEncryption(boolean enable)
Whether we will use encryption in transferring class data
|
static void |
shutdownDevice() |
java.lang.String |
sound(net.beadsproject.beads.core.UGen snd)
Adds a sound to the audio output.
|
void |
startAudio()
Causes audio processing to start.
|
void |
sychronisedBleep(double schedule_time)
Perform a bleep at the network scheduled time.
|
void |
syncAudioStart(int intervalForSyncAction)
Causes the audio to start at a given synchronised time on all devices.
|
static double |
synchroniseClocks()
Synchronise
HBScheduler timer with the system time on next tick |
static double |
synchroniseClocks(long slew_time)
Synchronise global
HBScheduler timer with the system time |
void |
testBleep()
Produces a single short test bleep on the device.
|
void |
testBleep3()
Produces a short series of 3 bleeps on the device.
|
void |
testBleep6()
Produces a short series of 6 bleeps on the device to indicate an error.
|
public static HB HBInstance
public final net.beadsproject.beads.core.AudioContext ac
AudioContext
used by HappyBrackets. This is autorun by default from the start script, but that can be controlled by a commandline flag.public final net.beadsproject.beads.ugens.Clock clock
Clock
used by HappyBrackets. This is up and running, with a default interval of 500ms and default "ticks per beat" of 16.public final net.beadsproject.beads.ugens.Envelope clockInterval
Envelope
that controls the clock interval. Default value is 500ms.public final net.beadsproject.beads.ugens.PolyLimit pl
PolyLimit
that controls polyphony. This is used for sounds added with the sound(UGen)
method. Default number of voices is 4.public final net.beadsproject.beads.ugens.Envelope masterGainEnv
Envelope
used to control the master gain. Default value is 1.public final java.util.Hashtable<java.lang.Class<? extends Sensor>,Sensor> sensors
Hashtable
to store sensors.public final java.util.Hashtable<java.lang.String,java.lang.Object> share
Hashtable
to store generic objects.public final java.util.Random rng
public final NetworkCommunication controller
NetworkCommunication
object used to communicate with the controller. The important methods are provided directly from HB
, e.g., sendToController(String, Object...)
and addControllerListener(OSCListener)
.public static BroadcastManager broadcast
BroadcastManager
object used to communicate with other devices using 1-many broadcasts. The important methods are provided directly from HB
, e.g., broadcast(String, Object...)
and addBroadcastListener(OSCListener)
.public final Synchronizer synch
Synchronizer
object used to manage time synch between devices. The important methods are provided directly from HB
, e.g., doAtTime(Runnable, long)
and getSynchTime()
.public HB(net.beadsproject.beads.core.AudioContext _ac) throws java.io.IOException
_ac
- the AudioContext
for audio.java.io.IOException
- if any of the core network set up fails. Could happen if port is already in use, or if setting up multicast fails.public HB(net.beadsproject.beads.core.AudioContext _ac, HB.AccessMode _am) throws java.io.IOException
_ac
- the AudioContext
for audio._am
- The access mode.java.io.IOException
- if any of the core network set up fails. Could happen if port is already in use, or if setting up multicast fails.public HB(net.beadsproject.beads.core.AudioContext _ac, HB.AccessMode _am, boolean start_network) throws java.io.IOException
_ac
- the AudioContext
for audio._am
- The access mode.start_network
- true if we are to start networkingjava.io.IOException
- if any of the core network set up fails. Could happen if port is already in use, or if setting up multicast fails.public MuteControl getMuteControl()
public static boolean isEnableSimulators()
public static void setEnableSimulators(boolean enableSimulators)
enableSimulators
- true if we want to display simulator controlspublic void setTCPServerPort(int tcpServerPort)
tcpServerPort
- the Port we need to connect to TCP serverpublic void setUseEncryption(boolean enable)
enable
- true if we want to use encryptionpublic java.net.InetAddress getSendingController(java.lang.Object classObject)
InetAddress
of the controller that sent the class
If the class was loaded on startup it will be nullclassObject
- the class that was sent by the controllerpublic boolean hasClassesLoaded()
public void addStatusChangedListener(HB.StatusChangedListener listener)
listener
- The listener to addpublic static boolean setDeviceLedValue(boolean on)
HB.DeviceType
on
- true if turning LED on, false if Turning Offpublic static HB.DeviceType getDeviceType()
public static HB.DeviceType detectDeviceType()
HB.DeviceType
is storedpublic boolean muteAudio(boolean mute)
mute
- true if we want to mutepublic static boolean runDebug(java.lang.Class<?> action_class) throws java.lang.Exception
action_class
- The class that we are debugging. use MethodHandles.lookup().lookupClass()java.io.IOException
- if there is a problem with the debugjava.lang.Exception
public void broadcast(java.lang.String string, java.lang.Object... args)
OSCMessage
msg over the multicast group.string
- the message string to send.args
- the args to the message.public static de.sciss.net.OSCMessage createOSCMessage(java.lang.String name, java.lang.Object... args)
name
- OSC Message nameargs
- argumentspublic void sendToController(java.lang.String string, java.lang.Object... args)
OSCMessage
to the controller. The controller already responds to certain OSCMessages that are already generated automatically. Best not to interefere with these. This function is only really useful if you are going to modify your controller program.string
- the message string to send.args
- the args of the message.public void addBroadcastListener(de.sciss.net.OSCListener listener)
OSCListener
, listening to broadcasts.listener
- the new OSCListener
.public void addControllerListener(de.sciss.net.OSCListener listener)
OSCListener
, listening to incoming messages from the controller.listener
- the new listener.public void syncAudioStart(int intervalForSyncAction)
intervalForSyncAction
- time at which to sync, according to the agreed clock timepublic long getSynchTime()
public void doAtTime(java.lang.Runnable runnable, long time)
runnable
- the action to perform.time
- the time at which to perform the action, in millseconds since 1st Jan 1970.public void startAudio()
DeviceMain
.public void pullConfigFileFromController() throws java.io.IOException
java.io.IOException
- if the HTTP connection fails.public boolean messageIs(de.sciss.net.OSCMessage m, java.lang.String match)
m
- the message to check.match
- the string to check for.public float getFloatArg(de.sciss.net.OSCMessage m, int index)
OSCMessage
. Accesses the arg as a float even if the arg is type int.m
- the message.index
- the index of the argument.public void sychronisedBleep(double schedule_time)
schedule_time
- the time on the global HBScheduler
to action messagepublic void testBleep()
public static void flashLed(int num_blinks, int interval)
num_blinks
- the number of times the LED wil blink on and Offinterval
- The interval between blinkspublic void testBleep3()
public void testBleep6()
public void attemptHBActionFromClassName(java.lang.String class_name)
HBAction
. If an HBAction
can be found matching the fully qualified Java classname then this is loaded and its HBAction.action(HB)
method is run.class_name
- The class namepublic Sensor getSensor(java.lang.Class sensorClass)
findSensor(java.lang.Class)
instead.public Sensor findSensor(java.lang.Class sensorClass) throws SensorNotFoundException
sensorClass
- the class of the Sensor
you want returnedSensor
SensorNotFoundException
- if sensor type not foundpublic void put(java.lang.String s, java.lang.Object o)
Object
into the global memory store with a given name. This overwrites any object that was previously stored with the given name.s
- String
name to store the object with.o
- Object
to store.public void registerVariable(java.lang.String name, java.lang.Object value)
Object
into the global memory store with a given name. This overwrites any object that was previously stored with the given name.
Values does not get reset, however, is still volatilename
- String
name to store the object with.value
- Object
to store.public java.lang.Object getRegisteredVariable(java.lang.String name)
Object
with the given name from the registered memory store. Returns null if there is no object with this name.name
- String
name object is mapped asObject
or null if there is no object.public void clearRegisteredVariable(java.lang.String name)
Object
with the given name from the registered memory store.name
- String
name object is mapped aspublic java.lang.Object get(java.lang.String s)
Object
with the given name from the global memory store. Returns null if there is no object with this name.s
- the name of the object.Object
or null if there is no object.public int getInt(java.lang.String s)
s
- the name of the int.java.lang.ClassCastException
- if the stored object is not an int.public float getFloat(java.lang.String s)
s
- the name of the float.java.lang.ClassCastException
- if the stored object is not a float.public java.lang.String getString(java.lang.String s)
String
from the global memory store.s
- the name of the @String
.String
, or null if there is no object.java.lang.ClassCastException
- if the stored object is not a @String
.public net.beadsproject.beads.core.UGen getUGen(java.lang.String s)
UGen
from the global memory store.s
- the name of the @UGen
.UGen
, or null if there is no object.java.lang.ClassCastException
- if the stored object is not a @UGen
.public net.beadsproject.beads.core.Bead getBead(java.lang.String s)
Bead
from the global memory store.s
- the name of the @Bead
.Bead
, or null if there is no object.java.lang.ClassCastException
- if the stored object is not a @Bead
.public java.lang.Object perm(java.lang.String id, java.lang.Object o)
id
- ID String
of the object to store.o
- the object.public java.lang.String pattern(net.beadsproject.beads.core.Bead pattern)
Bead
object to the Clock
. This will be removed using reset()
or resetLeaveSounding()
, or can be specifically removed by killing the Bead
.pattern
- to play.public java.lang.String sound(net.beadsproject.beads.core.UGen snd)
UGen
, is played immediately. It can be killed by calling reset()
, or by manually destroying the sound with a Bead.kill()
message. Note that the system automatically limits the number of sounds added using a @PolyLimit
object.snd
- the sound to play.public void clearSound()
reset()
and if you want to clear everything except the sound, use resetLeaveSounding()
.public void reset()
public void resetLeaveSounding()
reset()
except that any sounds currently playing are kept. This includes everything that is in the global memory store, all patterns, all dependents, all sensor behaviours and all controller listener behaviours.public static net.beadsproject.beads.core.UGen getAudioOutput()
public static int getNumOutChannels()
public void fadeOutClearSound(float fadeTime)
clearSound()
but with a fade out of the specified duration before clearing.fadeTime
- the fade out time in milliseconds.public void fadeOutReset(float fadeTime)
reset()
but with a fade out of the specified duration before clearing.fadeTime
- the fade out time in milliseconds.public int myIndex()
public int myConnectPort()
public void setMyIndex(int val)
val
- new valuepublic java.lang.String friendlyName()
public void setFriendlyName(java.lang.String name)
name
- the friendly namepublic static void rebootDevice()
public static void shutdownDevice()
public static void sendStatus(java.lang.String status)
sendStatus(String)
.status
- the status message we are sendingpublic void setStatus(java.lang.String s)
String
of this device. The status string is sent to the controller and is reported in the device's list item. Note that certain application behaviours automatically set the device status, such as when the device has been assigned and ID, or when a new @HBAction
has been loaded onto the device.s
- the status of the device.public void setGain(float new_gain, float millseconds)
new_gain
- the new target gain to set device tomillseconds
- the duration of the segment to reach the new gain in millisecondspublic float getGain()
public java.lang.String getStatus()
String
of the device.public static DynamicControl createDynamicControl(java.lang.Object parent_sketch, ControlType control_type, java.lang.String name, java.lang.Object initial_value)
parent_sketch
- the object calling - typically thiscontrol_type
- The type of control you want to createname
- The name we will give to differentiate between different controls in this classinitial_value
- The initial value of the controlpublic static DynamicControl createDynamicControl(java.lang.Object parent_sketch, ControlType control_type, java.lang.String name)
parent_sketch
- the object calling - typically thiscontrol_type
- The type of control you want to createname
- The name we will give to differentiate between different controls in this classpublic static DynamicControl createDynamicControl(java.lang.Object parent_sketch, ControlType control_type, java.lang.String name, java.lang.Object initial_value, java.lang.Object min_value, java.lang.Object max_value)
parent_sketch
- the object calling - typically thiscontrol_type
- The type of control you want to createname
- The name we will give to differentiate between different controls in this classinitial_value
- The initial value of the controlmin_value
- The minimum value of the controlmax_value
- The maximum value of the controlpublic static DynamicControl createDynamicControl(ControlType control_type, java.lang.String name, java.lang.Object initial_value, java.lang.Object min_value, java.lang.Object max_value)
control_type
- The type of control you want to createname
- The name we will give to differentiate between different controls in this classinitial_value
- The initial value of the controlmin_value
- The minimum value of the controlmax_value
- The maximum value of the controlpublic static DynamicControl createDynamicControl(ControlType control_type, java.lang.String name, java.lang.Object initial_value)
control_type
- The type of control you want to createname
- The name we will give to differentiate between different controls in this classinitial_value
- The initial value of the controlpublic static DynamicControl createDynamicControl(ControlType control_type, java.lang.String name)
control_type
- The type of control you want to createname
- The name we will give to differentiate between different controls in this classpublic static DynamicControl createControlBuddyPair(java.lang.Object parent_sketch, ControlType control_type, java.lang.String name, java.lang.Object initial_value, java.lang.Object min_value, java.lang.Object max_value)
parent_sketch
- the object calling - typically thiscontrol_type
- The type of control you want to createname
- The name we will give to differentiate between different controls in this classinitial_value
- The initial value of the controlmin_value
- The minimum value of the controlmax_value
- The maximum value of the controlpublic static Clock createClock(double interval)
interval
- int6erval in milliseconds. Can use fractions of a millisecondpublic static net.beadsproject.beads.core.UGen getAccelerometer_X()
public static net.beadsproject.beads.core.UGen getAccelerometer_X(double scale_min, double scale_max)
scale_min
- the value for axis pointing to groundscale_max
- the value for axis pointing to skypublic static net.beadsproject.beads.core.UGen getAccelerometer_Y()
public static net.beadsproject.beads.core.UGen getAccelerometer_Y(double scale_min, double scale_max)
scale_min
- the value for axis pointing to groundscale_max
- the value for axis pointing to skypublic static net.beadsproject.beads.core.UGen getAccelerometer_Z()
public static net.beadsproject.beads.core.UGen getAccelerometer_Z(double scale_min, double scale_max)
scale_min
- the value for axis pointing to groundscale_max
- the value for axis pointing to skypublic static net.beadsproject.beads.core.UGen getGyroscopeYaw()
public static net.beadsproject.beads.core.UGen getGyroscopePitch()
public static net.beadsproject.beads.core.UGen getGyroscopeRoll()
public java.net.InetAddress getDeviceAddress(java.lang.String name)
InetAddress
associated with this device name that we can address that device with
If the device is this, then it will return the loopback addressname
- The name of the device we require the address ofpublic java.util.Collection<java.lang.String> getKnownDeviceNames()
ControlScope.TARGET
using the device name.
If you require the InetAddress
of the device, for example, if you want to use OpenSoundControl,
then use the device name in the function getDeviceAddress(String)
public void addDeviceConnectedEventListener(DeviceConnectedEventListener listener)
DeviceConnectedEventListener
to be informed when a new device is detected on the networklistener
- the listener that will be notified when a device is connectedpublic boolean addDeviceAddress(java.lang.String name, java.net.InetAddress address)
InetAddress
name
- The device name to use as a keyaddress
- the InetAddress
to associate with the namepublic static boolean isOurAddress(java.net.InetAddress address)
InetAddress
is actually this deviceaddress
- the address we are testing forpublic static HBScheduler getScheduler()
HBScheduler
public static double getSchedulerTime()
HBScheduler
public static double getFutureSchedulerTime(double milliseconds)
getSchedulerTime()
.milliseconds
- the number of milliseconds into the future we want the time forgetSchedulerTime()
+ millisecondspublic static void setScheduleTime(double new_time)
HBScheduler
scheduled time to this timenew_time
- the new timepublic static void adjustScheduleTime(double amount, long duration)
HBScheduler
scheduler timeamount
- the amount of milliseconds we need to adjust our time by. A positive amount will advance the schedulerduration
- the number of milliseconds over which we want this change to occur so we don't just get a jumppublic static double synchroniseClocks()
HBScheduler
timer with the system time on next tickpublic static double synchroniseClocks(long slew_time)
HBScheduler
timer with the system timeslew_time
- the amount of milliseconds that we want to take to complete itpublic static boolean sendScheduleChange(double amount, long duration, java.util.Collection<java.lang.String> targets)
HBScheduler
on that deviceamount
- the amount of milliseconds we need to adjust our time by. A positive amount will advance the schedulerduration
- the number of milliseconds over which we want this change to occur so we don't just get a jumptargets
- The names of HB devices. If this is null, will send a broadcastpublic static boolean sendScheduleSetTime(double new_time, java.util.Collection<java.lang.String> targets)
new_time
- the new time to set our device scheduler totargets
- The names of HB devices. If this is null, will send a broadcast