diff options
author | David Runge <dave@sleepmap.de> | 2016-06-29 21:02:14 +0200 |
---|---|---|
committer | David Runge <dave@sleepmap.de> | 2016-06-29 21:02:14 +0200 |
commit | fa90a9232880c77ecc759751ce9828878cab243d (patch) | |
tree | 2ad8fa67032383db58acb956bfde09688c55931d /BowelyzerOSCHub.sc | |
parent | 427d4b6384681a56add5e5ad01e319464db26ef9 (diff) | |
download | bowelyzer-fa90a9232880c77ecc759751ce9828878cab243d.tar.gz bowelyzer-fa90a9232880c77ecc759751ce9828878cab243d.tar.bz2 bowelyzer-fa90a9232880c77ecc759751ce9828878cab243d.tar.xz bowelyzer-fa90a9232880c77ecc759751ce9828878cab243d.zip |
BowelyzerOSCHub.sc: Adding the the indicator messaging to the forward function. Properly checking if there's actually any audio coming in on the specified channel. If not, don't send any OSC messages.
Diffstat (limited to 'BowelyzerOSCHub.sc')
-rw-r--r-- | BowelyzerOSCHub.sc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/BowelyzerOSCHub.sc b/BowelyzerOSCHub.sc index 14ec940..ba3a9c9 100644 --- a/BowelyzerOSCHub.sc +++ b/BowelyzerOSCHub.sc @@ -41,7 +41,6 @@ BowelyzerOSCHub{ OSCdef.newMatching( name, {|msg, time, addr, recvPort| - local.sendMsg("/indicate", msg[0].asString.replace("/","").asSymbol); this.forwardToNetAddress(msg, time); }, name, @@ -73,10 +72,13 @@ BowelyzerOSCHub{ pitch = msg[4], hasPitch = msg[5], onsetDetect = msg[7]; - if(forward.isLocal && (forward.port == NetAddr.langPort), { - postln(msg[0]++" (amplitude: "++amplitude++"; pitch: "++pitch++"; has pitch: "++hasPitch); - },{ - forward.sendMsg(name,"/amplitude", amplitude, "/pitch", pitch, "/hasPitch", hasPitch, "/detect", onsetDetect); + if(amplitude != 0,{ + local.sendMsg("/indicate", msg[0].asString.replace("/","").asSymbol); + if(forward.isLocal && (forward.port == NetAddr.langPort), { + postln(msg[0]++" (amplitude: "++amplitude++"; pitch: "++pitch++"; has pitch: "++hasPitch); + },{ + forward.sendMsg(name,"/amplitude", amplitude, "/pitch", pitch, "/hasPitch", hasPitch, "/detect", onsetDetect); + }); }); } |