public void run() { if (currentFeedbackSettings != null) { currentFeedbackSettings.updateFeedback(); if (oscForwarder != null) { OSCBundle bundle = new OSCBundle(); for (int c = 0; c < numChannels; c++) { for (int b = 0; b < bins; b++) { OSCMessage msg = new OSCMessage(textSerialPort.getText() + "/" + binLabels[b] + "/" + c); Object argument = new Object(); argument = new Double(currentFeedbackSettings.getRewardFFTBins()[b][c]); // argument=new Float(meanFFTBins[b][c]); msg.addArgument(argument); bundle.addPacket(msg); oscForwarder.forwardMessage(msg); } } } } this.frame.repaint(); // oscForwarder.forwardBundle(bundle); // focusOMeter.setCurrentFeedback(currentFeedback); } }
msg.addArgument(argument); bundle.addPacket(msg);
public void sendMulticueMessage(final int toneFrequency, final int toneDurationMs, final int color, final int vibrationDurationMs) { if (toneFrequency < 0 || toneFrequency > 20000) { throw new IllegalArgumentException("tone frequency is out of range: " + vibrationDurationMs); } if (toneDurationMs < 0 || toneDurationMs > 60000) { throw new IllegalArgumentException("tone duration is out of range: " + toneDurationMs); } if (vibrationDurationMs < 0 || vibrationDurationMs > 60000) { throw new IllegalArgumentException("vibration duration is out of range: " + vibrationDurationMs); } OSCMessage m = new OSCMessage(absoluteAddress(OSC_MULTI)); m.addArgument(toneFrequency); m.addArgument(toneDurationMs); m.addArgument(color); m.addArgument(vibrationDurationMs); send(m); } }
public void sendPingMessage() { OSCMessage message = new OSCMessage(absoluteAddress(OSC_PING)); latestPing = System.currentTimeMillis(); message.addArgument(latestPing); send(message); }
/** * @param time the duration of the signal in milliseconds (valid values range from 1 to 60000) */ public void sendVibroMessage(final int time) { if (time < 0 || time > 60000) { throw new IllegalArgumentException("vibration interval too short or too long: " + time); } OSCMessage m = new OSCMessage(absoluteAddress(OSC_VIBRO)); m.addArgument(time); send(m); }
/** * Converts the byte array to a simple message. * Assumes that the byte array is a message. * @return a message containing the data specified in the byte stream */ private OSCMessage convertMessage(final Input rawInput) { final OSCMessage message = new OSCMessage(); message.setAddress(readString(rawInput)); final CharSequence types = readTypes(rawInput); for (int ti = 0; ti < types.length(); ++ti) { if ('[' == types.charAt(ti)) { // we're looking at an array -- read it in message.addArgument(readArray(rawInput, types, ++ti)); // then increment i to the end of the array while (types.charAt(ti) != ']') { ti++; } } else { message.addArgument(readArgument(rawInput, types.charAt(ti))); } } return message; }
public void sendMorseMessage(final String text) { OSCMessage m = new OSCMessage(absoluteAddress(OSC_MORSE)); m.addArgument(text); send(m); }
public void apply(RippleList stack, final Sink<RippleList> solutions, final ModelConnection mc) throws RippleException { Object first = stack.getFirst(); Note n = toNote(first, 0, true); if (null == n) { logger.warning("can't give non-atom: " + first); } else { IRI iri = iriOf(n); // value is informational; it is used only for development/debugging purposes String value = n.getTitle(); logger.log(Level.INFO, "preparing to give " + iri + " (" + value + ")"); OSCMessage m = new OSCMessage(SmSnActivityOntology.EXO_ACTIVITY_GIVE); m.addArgument(typeatron.getAgent().getAgentIri().stringValue()); m.addArgument(iri.stringValue()); //m.addArgument(value); typeatron.getAgent().sendOSCMessageToCoordinator(m); // keep the stack unchanged solutions.accept(stack); } } }