Giter Site home page Giter Site logo

sc-tx81z's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sc-tx81z's Issues

New version don't compile/run

The 0c9eb32 commit that fixed the envelope behavior (thank you!) breaks the UGen.

Which i think is related to the lines at 407 and 408 (as it ran fine if i uncommented those):

 // we calculate the max. release time to schedule a doneAction
        var maxrel = MinItem([rel1, rel2, rel3, rel4]);
        var maxrelsecs = BufRd.kr(1, table_RR.bufnum, maxrel) / 96000;

This is the error output:

Execution warning: Class 'MinItem' not found
ERROR: Message 'new' not understood.
RECEIVER:
   nil
ARGS:
Instance of Array {    (0x11c81ed68, gc=F8, fmt=01, flg=00, set=02)
  indexed slots [4]
      0 : Integer 8
      1 : Integer 8
      2 : Integer 8
      3 : Integer 15
}

PROTECTED CALL STACK:
	Meta_MethodError:new	0x11707cc80
		arg this = DoesNotUnderstandError
		arg what = nil
		arg receiver = nil
	Meta_DoesNotUnderstandError:new	0x11707ec40
		arg this = DoesNotUnderstandError
		arg receiver = nil
		arg selector = new
		arg args = [ [ 8, 8, 8, 15 ] ]
	Object:doesNotUnderstand	0x11c4591c0
		arg this = nil
		arg selector = new
		arg args = nil
	Meta_Tx81z:ar	0x11b2616c0
		arg this = Tx81z
		arg gate = an OutputProxy
		arg velocity = an OutputProxy
		arg kfreq1 = a BinaryOpUGen
		arg kfreq2 = a BinaryOpUGen
		arg kfreq3 = a BinaryOpUGen
		arg kfreq4 = an OutputProxy
		arg volume = 99
		arg velocityCurve = 2
		arg op1 = 1
		arg op2 = 0.6
		arg op3 = 0.52
		arg op4 = 0.6
		arg feedback = 0.91
		arg algorithm = an OutputProxy
		arg doneAction = 2
		arg att4 = 31
		arg dec4 = 16
		arg sust4 = 3
		arg ext4 = 7
		arg rel4 = 15
		arg wave4 = 3
		arg att3 = 31
		arg dec3 = 17
		arg sust3 = 3
		arg ext3 = 0
		arg rel3 = 8
		arg wave3 = 0
		arg att2 = 31
		arg dec2 = 9
		arg sust2 = 0
		arg ext2 = 0
		arg rel2 = 8
		arg wave2 = 0
		arg att1 = 31
		arg dec1 = 9
		arg sust1 = 0
		arg ext1 = 0
		arg rel1 = 8
		arg wave1 = 0
		var algIdx = an OutputProxy
		var kOut = an OutputProxy
		var algbuf = 17
		var algnumcols = 10
		var waveTables = 19
		var kWaveBuf4 = an OutputProxy
		var kWaveBuf3 = an OutputProxy
		var kWaveBuf2 = an OutputProxy
		var kWaveBuf1 = an OutputProxy
		var mtxcols = 10
		var algrow = a BinaryOpUGen
		var maxrel = nil
		var maxrelsecs = nil
		var velcurveBuf = nil
		var fback = nil
		var aOP1 = nil
		var aOP2 = nil
		var aOP3 = nil
		var aOP4 = nil
		var ain4 = nil
		var ain3 = nil
		var ain2 = nil
		var ain1 = nil
		var a0 = nil
		var coef = nil
		var doneEnv = nil
	a FunctionDef	0x12377efc8
		sourceCode = "{|gate=1, kfreq=220, vel=90, algorithm=0|
    var tx = Tx81z.ar(gate, velocity:vel, algorithm:algorithm,
        kfreq1:kfreq/2, kfreq2:kfreq/2*1.02, kfreq3:kfreq*0.996, kfreq4:kfreq,
        feedback:0.91, wave4:3, op2:0.6, op3: 0.52, op4:0.6, doneAction:2);
    Out.ar(0, tx);
}"
		arg gate = an OutputProxy
		arg kfreq = an OutputProxy
		arg vel = an OutputProxy
		arg algorithm = an OutputProxy
		var tx = nil
	SynthDef:buildUgenGraph	0x11b84c380
		arg this = a SynthDef
		arg func = a Function
		arg rates = nil
		arg prependArgs = [  ]
		var result = nil
		var saveControlNames = nil
	a FunctionDef	0x11b84a9c0
		sourceCode = "<an open Function>"
	Function:prTry	0x118d75fc0
		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>
	SynthDef:build
		arg this = <instance of SynthDef>
		arg ugenGraphFunc = <instance of Function>
		arg rates = nil
		arg prependArgs = nil
	< closed FunctionDef >  (no arguments or variables)
	Interpreter:interpretPrintCmdLine
		arg this = <instance of Interpreter>
		var res = nil
		var func = <instance of Function>
		var code = "(
SynthDef(\tx81z_demo, {|ga..."
		var doc = nil
		var ideClass = <instance of Meta_ScIDE>
	Process:interpretPrintCmdLine
		arg this = <instance of Main>
^^ The preceding error dump is for ERROR: Message 'new' not understood.
RECEIVER: nil

Tested with default settings on latest SC version on both windows and macos.

Gate and Envelope Release Behavior

Closing the gate does not ramp down according to 'rel' time as described in code comments:

  • If gate is closed while envelope has not reached 0, it ramps down
    to 0 in rel time.

Setting gate to 0 cuts the audio and creates an audible click, despite long decay and release times.

Tested using the code found in the help file (modified with slower envelope times). Same behavior with both MIDI and using the "a.set(\gate, 0);" approach.

(
SynthDef(\tx81z_demo, {|gate=1, kfreq=220, vel=90, algorithm=0|
	var tx = Tx81z.ar(gate, velocity:vel, algorithm:algorithm,
		kfreq1:kfreq/2, kfreq2:kfreq/2*4.02, kfreq3:kfreq*0.996, kfreq4:kfreq,
		wave1:0, wave2:0, wave3:0, wave4:0,
		op1: 1, op2:0, op3:0, op4:0,
		att1: 16, att2: 23, att3: 23, att4: 23,
		dec1: 4, dec2: 7, dec3: 7, dec4: 7,
		sust1: 4, sust2: 5, sust3: 5, sust4: 5,
		ext1: 4, ext2: 5, ext3: 5, ext4: 5,
		rel1: 4, rel2: 4, rel3: 4, rel4: 4,
		feedback:0.91, doneAction:2);
	Out.ar(0, tx ! 2);
}).send;
)

(  // use a midi keyboard
~synths = Array.fill(128, nil);
MIDIFunc.noteOn({|vel, midinote|
	~synths[midinote] = Synth(\tx81z_demo, args:[kfreq:midinote.midicps, vel:vel, algorithm:4]);
});
MIDIFunc.noteOff({|vel, midinote|
	~synths[midinote].set(\gate, 0);
});
) 

a = Synth(\tx81z_demo, args:[freq:440, vel:90, algorithm:0]);
a.set(\gate, 0);

Bypassing MIDIFunc.noteOff by setting gate to 1 fixes the issue but quickly kills the cpu.

ERROR: Message 'bufnum' not understood.

Hi there, I was wondering if this UGen / synth can be made available for Sonic Pi, so I am trying to work myself into it. On Scide I get an error when trying to create the synthdef.

I have put the UGen in SCClassLibrary and recompiled it without errors. I can then init the UGen and set up MIDI as suggested in the code with

(
// init data of Tx81z, connect to midi
Tx81z.initData();
MIDIClient.init;
MIDIIn.connectAll;
)

However, when I run

(
SynthDef(\tx81z_demo, {|gate=1, kfreq=220, vel=90, algorithm=0|
    var tx = Tx81z.ar(gate, velocity:vel, algorithm:algorithm,
        kfreq1:kfreq/2, kfreq2:kfreq/2*1.02, kfreq3:kfreq*0.996, kfreq4:kfreq,
        feedback:0.91, wave4:3, op2:0.6, op3: 0.52, op4:0.6, doneAction:2);
    Out.ar(0, tx);
}).send;

I get an error:

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

PROTECTED CALL STACK:
	Meta_MethodError:new	0x55f02c113f80
		arg this = DoesNotUnderstandError
		arg what = nil
		arg receiver = nil
	Meta_DoesNotUnderstandError:new	0x55f02c1162c0
		arg this = DoesNotUnderstandError
		arg receiver = nil
		arg selector = bufnum
		arg args = [  ]
	Object:doesNotUnderstand	0x55f02c2214c0
		arg this = nil
		arg selector = bufnum
		arg args = nil
	Meta_Tx81z:ar	0x55f02cd89140
		arg this = Tx81z
		arg gate = an OutputProxy
		arg velocity = an OutputProxy
		arg kfreq1 = a BinaryOpUGen
		arg kfreq2 = a BinaryOpUGen
		arg kfreq3 = a BinaryOpUGen
		arg kfreq4 = an OutputProxy
		arg volume = 99
		arg velocityCurve = 2
		arg op1 = 1
		arg op2 = 0.6
		arg op3 = 0.52
		arg op4 = 0.6
		arg feedback = 0.91
		arg algorithm = an OutputProxy
		arg doneAction = 2
		arg att4 = 31
		arg dec4 = 16
		arg sust4 = 3
		arg ext4 = 7
		arg rel4 = 15
		arg wave4 = 3
		arg att3 = 31
		arg dec3 = 17
		arg sust3 = 3
		arg ext3 = 0
		arg rel3 = 8
		arg wave3 = 0
		arg att2 = 31
		arg dec2 = 9
		arg sust2 = 0
		arg ext2 = 0
		arg rel2 = 8
		arg wave2 = 0
		arg att1 = 31
		arg dec1 = 9
		arg sust1 = 0
		arg ext1 = 0
		arg rel1 = 8
		arg wave1 = 0
		var algIdx = an OutputProxy
		var kOut = nil
		var algbuf = nil
		var algnumcols = nil
		var waveTables = nil
		var kWaveBuf4 = nil
		var kWaveBuf3 = nil
		var kWaveBuf2 = nil
		var kWaveBuf1 = nil
		var mtxcols = nil
		var algrow = nil
		var velcurveBuf = nil
		var fback = nil
		var aOP1 = nil
		var aOP2 = nil
		var aOP3 = nil
		var aOP4 = nil
		var ain4 = nil
		var ain3 = nil
		var ain2 = nil
		var ain1 = nil
		var a0 = nil
		var coef = nil
		var doneEnv = nil
	a FunctionDef	0x55f02c3eeed8
		sourceCode = "{|gate=1, kfreq=220, vel=90, algorithm=0|
    var tx = Tx81z.ar(gate, velocity:vel, algorithm:algorithm,
        kfreq1:kfreq/2, kfreq2:kfreq/2*1.02, kfreq3:kfreq*0.996, kfreq4:kfreq,
        feedback:0.91, wave4:3, op2:0.6, op3: 0.52, op4:0.6, doneAction:2);
    Out.ar(0, tx);
}"
		arg gate = an OutputProxy
		arg kfreq = an OutputProxy
		arg vel = an OutputProxy
		arg algorithm = an OutputProxy
		var tx = nil
	SynthDef:buildUgenGraph	0x55f02babd380
		arg this = a SynthDef
		arg func = a Function
		arg rates = nil
		arg prependArgs = [  ]
		var result = nil
		var saveControlNames = nil
	a FunctionDef	0x55f02baab7c0
		sourceCode = "<an open Function>"
	Function:prTry	0x55f02895eac0
		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>
	SynthDef:build
		arg this = <instance of SynthDef>
		arg ugenGraphFunc = <instance of Function>
		arg rates = nil
		arg prependArgs = nil
	< closed FunctionDef >  (no arguments or variables)
	Interpreter:interpretPrintCmdLine
		arg this = <instance of Interpreter>
		var res = nil
		var func = <instance of Function>
		var code = "(
SynthDef(\tx81z_demo, {|ga..."
		var doc = nil
		var ideClass = <instance of Meta_ScIDE>
	Process:interpretPrintCmdLine
		arg this = <instance of Main>
^^ ERROR: Message 'bufnum' not understood.
RECEIVER: nil

So far I have always been using built-in UGens. I don't have experience with custom UGens, so this may be the reason for my asking. Any help is appreciated.

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.