matchOSCAddressPattern

This took me a bit to figure out. I was getting the following error below because some osc messages (mine) were had strings as keys. This is easily fixed by making FluidOSCPatternInversion the following. Though I am the one creating this problem, my OSC messages are otherwise fine within SC, so I think the FOPI just needs to ensure msg[0] is a symbol.

{
	value {|msg, time, addr, recvPort|
		var msgpath = msg[0].asSymbol;
			active.keysValuesDo({|key, func|
				if(msgpath.matchOSCAddressPattern(key), {func.value(msg, time, addr, recvPort);});
			})
	}
}
ERROR: Message 'matchOSCAddressPattern' not understood.
RECEIVER:
Instance of String {    (0x7fcd90e8acc8, gc=1C, fmt=07, flg=00, set=02)
  indexed slots [18]
      0 : /
      1 : C
      2 : o
      3 : n
      4 : t
      5 : a
      6 : i
      7 : n
      8 : e
      9 : r
     10 : /
     11 : F
     12 : a
     13 : d
     14 : e
     15 : r
     16 : /
     17 : x
}
ARGS:
   Symbol '/FluidDataSet/*'
CALL STACK:
	DoesNotUnderstandError:reportError
		arg this = <instance of DoesNotUnderstandError>
	Nil:handleError
		arg this = nil
		arg error = <instance of DoesNotUnderstandError>
	Thread:handleError
		arg this = <instance of Thread>
		arg error = <instance of DoesNotUnderstandError>
	Object:throw
		arg this = <instance of DoesNotUnderstandError>
	Object:doesNotUnderstand
		arg this = "/Container/Fader/x"
		arg selector = 'matchOSCAddressPattern'
		arg args = [*1]
	< FunctionDef in Method FluidOSCPatternInversion:value >
		arg key = '/FluidDataSet/*'
		arg func = <instance of OSCFuncAddrMessageMatcher>
	Dictionary:keysValuesArrayDo
		arg this = <instance of IdentityDictionary>
		arg argArray = [*32]
		arg function = <instance of Function>
		var i = 20
		var j = 1
		var key = nil
		var val = nil
		var arraySize = nil
	Dictionary:keysValuesDo
		arg this = <instance of IdentityDictionary>
		arg function = <instance of Function>
	FluidOSCPatternInversion:value
		arg this = <instance of FluidOSCPatternInversion>
		arg msg = [*2]
		arg time = 470189809.7007
		arg addr = <instance of NetAddr>
		arg recvPort = 57120
		var msgpath = "/Container/Fader/x"
	< FunctionDef in Method Collection:collectInPlace >
		arg item = <instance of FluidOSCPatternInversion>
		arg i = 1
	ArrayedCollection:do
		arg this = [*3]
		arg function = <instance of Function>
		var i = 1
	Collection:collectInPlace
		arg this = [*3]
		arg function = <instance of Function>
	FunctionList:value
		arg this = <instance of FunctionList>
		arg args = [*4]
		var res = nil
	Main:recvOSCmessage
		arg this = <instance of Main>
		arg time = 470189809.7007
		arg replyAddr = <instance of NetAddr>
		arg recvPort = 57120
		arg msg = [*2]
^^ The preceding error dump is for ERROR: Message 'matchOSCAddressPattern' not understood.
RECEIVER: /Container/Fader/x

Yikes. It hadn’t occured to me that this pattern matcher would be exposed to OSC messages from anywhere other than scsynth :laughing: Good find – updated for next release.