Coder Social home page Coder Social logo

Comments (7)

telephon avatar telephon commented on May 23, 2024

I'll take a look, thanks for reporting.

What branch are you using?

from superdirt.

vivid-synth avatar vivid-synth commented on May 23, 2024

Maybe this is the same issue as we're seeing here? vivid-synth/vivid#3

from superdirt.

telephon avatar telephon commented on May 23, 2024

What branch are you using?

from superdirt.

gilfuser avatar gilfuser commented on May 23, 2024

Hi.
I forgot about this issue, but I tried it again and got the same error. I'm using Tidal 1.0.0 and the most recent version of SuperDirt.

from superdirt.

gilfuser avatar gilfuser commented on May 23, 2024

Here is what I tried so far:

if I evaluate

(
var diversions = ();  // make a dictionary of functions
~diversions = diversions; // make it available out of scope
~diversions[\tlalak] = {
	"hello tlalak".postln;
};
// use the "diversion" key as a hook for playing the synth
~d1.defaultParentEvent[\diversion] = { diversions[~sound].value };
)

I get module 'sound': instrument not found: nil

Then I add it in ~dirt.soundLibrary like this: ~dirt.soundLibrary.addSynth(\tlalak) or this: ~dirt.soundLibrary.addSynth(\tlalak, (instrument: \tlalak))

I get:

ERROR: Message 'flop' not understood.
RECEIVER:
   nil
ARGS:

PROTECTED CALL STACK:
	Meta_MethodError:new	0x55bf74fe4180
		arg this = DoesNotUnderstandError
		arg what = nil
		arg receiver = nil
	Meta_DoesNotUnderstandError:new	0x55bf74fe6140
		arg this = DoesNotUnderstandError
		arg receiver = nil
		arg selector = flop
		arg args = [  ]
	Object:doesNotUnderstand	0x55bf74859bc0
		arg this = nil
		arg selector = flop
		arg args = nil
	DirtEvent:sendSynth	0x55bf74f88a80
		arg this = a DirtEvent
		arg instrument = tlalak
		arg args = nil
		var group = 1129
	DirtModule:value	0x55bf76412100
		arg this = DirtModule('sound')
		arg orbit = a DirtEvent
	ArrayedCollection:do	0x55bf75f8b280
		arg this = [ DirtModule('sound'), DirtModule('vowel'), DirtModule('shape'), DirtModule('hpf'), DirtModule('bpf'), DirtModule('crush'), DirtModule('coarse'), DirtModule('lpf'), DirtModule('pshift'), DirtModule('envelope'), DirtModule('tremolo'), DirtModule('phaser'), DirtModule('waveloss'), DirtModule('squiz') ]
		arg function = a Function
		var i = 0
	a FunctionDef	0x55bf74f8a540
		sourceCode = "<an open Function>"
	a FunctionDef	0x55bf761984c0
		sourceCode = "<an open Function>"
	Function:prTry	0x55bf752d6540
		arg this = a Function
		var result = nil
		var thread = a Thread
		var next = a Function
		var wasInProtectedFunc = true
	Function:try	0x55bf752d6000
		arg this = a Function
		arg handler = a Function
		var result = nil
	Server:makeBundle	0x55bf76198100
		arg this = localhost
		arg time = 0.04104968924139
		arg func = a Function
		arg bundle = nil
	DirtEvent:playSynths	0x55bf74f8a000
		arg this = a DirtEvent
		var cutGroup = nil
	a FunctionDef	0x55bf760bfc80
		sourceCode = "<an open Function>"
	Function:prTry	0x55bf752d6540
		arg this = a Function
		var result = nil
		var thread = a Thread
		var next = nil
		var wasInProtectedFunc = false
	
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>
	Function:protect
		arg this = <instance of Function>
		arg handler = <instance of Function>
		var result = <instance of DoesNotUnderstandError>
	Environment:use
		arg this = <instance of Event>
		arg function = <instance of Function>
		var result = nil
		var saveEnvir = <instance of Environment>
	DirtEvent:play
		arg this = <instance of DirtEvent>
	OSCFuncBothMessageMatcher:value
		arg this = <instance of OSCFuncBothMessageMatcher>
		arg msg = [*9]
		arg time = 3868.3698266062
		arg testAddr = <instance of NetAddr>
		arg testRecvPort = 57120
	OSCMessageDispatcher:value
		arg this = <instance of OSCMessageDispatcher>
		arg msg = [*9]
		arg time = 3868.3698266062
		arg addr = <instance of NetAddr>
		arg recvPort = 57120
	Main:recvOSCmessage
		arg this = <instance of Main>
		arg time = 3868.3698266062
		arg replyAddr = <instance of NetAddr>
		arg recvPort = 57120
		arg msg = [*9]
^^ The preceding error dump is for ERROR: Message 'flop' not understood.
RECEIVER: nil

Then I thought that maybe the out argument is mandatory and changed the first part like this:

(
var diversions = ();  // make a dictionary of functions
~diversions = diversions; // make it available out of scope
~diversions[\tlalak] = { |out|
	"hello tlalak".postln;
};
// use the "diversion" key as a hook for playing the synth
~d1.defaultParentEvent[\diversion] = { diversions[~sound].value };
)

...and got: *** ERROR: SynthDef bla not found FAILURE IN SERVER /s_new SynthDef not found

this looks better. At least is a shorter error post.
Now i did (I'm following vivid-synth issue mentioned above to see what I can learn from it ):
SynthDef(\tlalak,{|out|}).send
And re-evaluated the block above and the addSynth part.

Now I get no errors but "hello tlalak" is not being posted.It makes sense, the SynthDef is doing nothing, and SynthDefs are not for posting things. So, I'm clearly lost here.

Any thoughts @telephon? @vivid-synth?

from superdirt.

bgold-cosmos avatar bgold-cosmos commented on May 23, 2024

If I change the ~sound to ~s I can at least get the postln working.

I'm not sure what you're trying to do with addSynth

from superdirt.

gilfuser avatar gilfuser commented on May 23, 2024

Nice! Thanks @bgold-cosmos.
With addSynth I thought SC would recognise the existence of a "tlalak" Synth and not give me a not found post. But I didn't know if that would make sense.

This suggestion works for my needs, but I'm leaving this opened because someone might want the following to work and it won't:

// execute arbitrary sc code
// you can livecode this
(
~diversions[\tlalak]  = { | out=0 pan=0 sustain=1 amp=1 |
	Pfindur(~sustain,
		Pbind(
			\dur, 0.04,
			\note, Pbrown(-15, 15 ! 5, 0.3, inf) + 16,
			\out, ~out, \pan, ~pan, \amp, ~amp * 0.1
		)
	).play
};
)

It gives me this post:

-> ( 'tlalak': a Function )
ERROR: binary operator '>=' failed.
RECEIVER:
   nil
ARGS:
   Float 0.040000   47AE147B 3FA47AE1
   nil
CALL STACK:
	DoesNotUnderstandError:reportError
		arg this = <instance of BinaryOpFailureError>
	Nil:handleError
		arg this = nil
		arg error = <instance of BinaryOpFailureError>
	Thread:handleError
		arg this = <instance of Thread>
		arg error = <instance of BinaryOpFailureError>
	Thread:handleError
		arg this = <instance of Routine>
		arg error = <instance of BinaryOpFailureError>
	Thread:handleError
		arg this = <instance of Routine>
		arg error = <instance of BinaryOpFailureError>
	Object:throw
		arg this = <instance of BinaryOpFailureError>
	Object:performBinaryOpOnSomething
		arg this = nil
		arg aSelector = '>='
		arg thing = 0.04
		arg adverb = nil
	Pfindur:embedInStream
		arg this = <instance of Pfindur>
		arg event = <instance of Event>
		var item = nil
		var delta = 0.04
		var elapsed = 0.0
		var nextElapsed = 0.04
		var inevent = <instance of Event>
		var localdur = nil
		var stream = <instance of Routine>
		var cleanup = <instance of EventStreamCleanup>
	Routine:prStart
		arg this = <instance of Routine>
		arg inval = <instance of Event>
^^ The preceding error dump is for ERROR: binary operator '>=' failed.
RECEIVER: nil

from superdirt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.