enhancements
This commit is contained in:
parent
761e3cfbf7
commit
58ac740143
5 changed files with 31 additions and 17 deletions
|
|
@ -1,17 +1,22 @@
|
|||
s.setup(sec(100))
|
||||
|
||||
n = s.node(3)
|
||||
|
||||
;n->s.left
|
||||
;n->s.right
|
||||
s.setup(100)
|
||||
|
||||
;0 s.left.@setgain(0.7)
|
||||
;0 s.right.@setgain(0.7)
|
||||
|
||||
;0 n.setpos(1,1,1)
|
||||
;sec(1) n.setpos(-100,1,1)
|
||||
ns = []
|
||||
for k in range(0, 100):
|
||||
n = s.node(20)
|
||||
ns.append(n)
|
||||
;n->s.left
|
||||
;n->s.right
|
||||
|
||||
for i in range(0,40):
|
||||
;0 n.@setfreq(i, s.note("C3")*(i+1))
|
||||
;0 n.@setgain(0.04)
|
||||
|
||||
;0-sec(90) n.triangle()
|
||||
;0 n.setpos(1,1,1)
|
||||
;0 n.setpin(52, 0.9)
|
||||
|
||||
for i in range(0,20):
|
||||
;0 n.@setfreq(i, s.note("C3")*(i+1))
|
||||
;0 n.@setfreqgain(i, 1/float(i+1))
|
||||
|
||||
;0-9 ns[4].sine()
|
||||
|
|
@ -81,10 +81,10 @@ class SonnumCompiler:
|
|||
|
||||
if operand.startswith('@'):
|
||||
operand = operand[1:]
|
||||
ln = f'{src_nodename}.{operand}({starttick}, {endtick}, [{cmdargs}])'
|
||||
ln = f'{src_nodename}.{operand}(sec({starttick}), sec({endtick}), [{cmdargs}])'
|
||||
|
||||
else:
|
||||
ln = f'self.add_activity("{operand}", {starttick}, {endtick}, {src_nodename}, {trg_nodename}, [{cmdargs}])'
|
||||
ln = f'self.add_activity("{operand}", sec({starttick}), sec({endtick}), {src_nodename}, {trg_nodename}, [{cmdargs}])'
|
||||
|
||||
ln = tablevel*'\t' + ln
|
||||
py_src.append(ln)
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ class Sonnum:
|
|||
|
||||
def setup(self, endtick):
|
||||
|
||||
endtick = self.sec(endtick)
|
||||
self.end = endtick
|
||||
self.endtick(endtick)
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,9 @@ def freqpin(freq_no):
|
|||
def gainpin(freq_no):
|
||||
return 112+freq_no
|
||||
|
||||
def shiftpin(freq_no):
|
||||
return 160+freq_no
|
||||
|
||||
def sec(seconds):
|
||||
return seconds * 44100
|
||||
|
||||
|
|
@ -49,6 +52,11 @@ class SoundNode:
|
|||
gain = args[1]
|
||||
self.act("setpin", starttick, endtick, self, None, [gainpin(freq_no), gain])
|
||||
|
||||
def setfreqshift(self, starttick, endtick, args):
|
||||
freq_no = args[0]
|
||||
shift = args[1]
|
||||
self.act("setpin", starttick, endtick, self, None, [shiftpin(freq_no), shift])
|
||||
|
||||
def setgain(self, starttick, endtick, args):
|
||||
gain = args[0]
|
||||
self.act("setpin", starttick, endtick, self, None, [GAIN, gain])
|
||||
|
|
|
|||
|
|
@ -128,8 +128,8 @@ pub fn skewsine(self: *Activity) void {
|
|||
|
||||
const current_tick: f64 = @floatFromInt(self.soundnode.fab.current_tick);
|
||||
|
||||
const skew = self.soundnode.pins[@intFromFloat(self.operands[1])];
|
||||
const maingain = self.soundnode.corrGain(self.operands[0]);
|
||||
const skew = self.soundnode.pins[@intFromFloat(self.operands[0])];
|
||||
const maingain = self.soundnode.corrGain(self.operands[1]);
|
||||
|
||||
var final_amp: f64 = 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue