Skip to content
This repository was archived by the owner on Nov 23, 2023. It is now read-only.

Commit 5c4f2bb

Browse files
iipyper example comments, notepredictor example synth volume
1 parent 9f38576 commit 5c4f2bb

4 files changed

Lines changed: 7 additions & 11 deletions

File tree

examples/iipyper/iipyper-tutorial.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
from iipyper import OSC, MIDI, repeat, run
44

5-
# TODO: MIDI
6-
# TODO: loops are broken, why?
7-
85
def main(osc_host='127.0.0.1', osc_port=9999, loop_time=1, loop_msg='hello'):
96
# loop API:
107
# use the @repeat decorator to define functions which run every n seconds
@@ -63,7 +60,7 @@ def keyword_example(address, arg1=0, arg2=1, arg3=99):
6360
print(address, arg1, arg2, arg3)
6461
# no return value: does not send OSC back
6562

66-
# can also give the route explictly to the decorator,
63+
# can also give the route explicitly to the decorator,
6764
# supporting wildcards
6865
@osc.args('/math/*')
6966
def _(address, a, b):
@@ -74,7 +71,7 @@ def _(address, a, b):
7471
if op=='mul':
7572
return address, a * b
7673

77-
# OSC clients can be created explcitly and given names:
74+
# OSC clients can be created explicitly and given names:
7875
osc.create_client('supercollider', port=57120) # uses same host as server
7976
# but clients will also be created automatically when possible
8077

@@ -91,9 +88,8 @@ def _(address, a, b):
9188
osc('supercollider2', '/other_send_test', 3)
9289

9390
# it may be possible to have async/threaded option for both OSC and MIDI?
94-
# MIDI is threaded and OSC is async
95-
# but MIDI could be enqueued and handled in the loop,
96-
# OSC could launch the threading server?
91+
# MIDI handlers are threaded in mido and OSC handlers as async in pythonosc.
92+
# currently MIDI is enqueued and handled async.
9793

9894
if __name__=='__main__':
9995
run(main)

examples/notepredictor/autopitch.scd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ s.waitForBoot{
7272
(
7373
SynthDef(\pluck, {
7474
var vel = \vel.kr;
75-
var signal = Saw.ar(\freq.kr(20), 3e-2) * EnvGate.new(1);
75+
var signal = Saw.ar(\freq.kr(20), 0.2) * EnvGate.new(1);
7676
var fr = 2.pow(Decay.ar(Impulse.ar(0), 3)*6*vel+8);
7777
signal = BLowPass.ar(signal, fr)*vel;
7878
Out.ar([0,1], signal);

examples/notepredictor/linnstrument-display.scd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ s.waitForBoot{
4141
};
4242
SynthDef(\pluck, {
4343
var vel = \vel.kr;
44-
var signal = Saw.ar(\freq.kr(20), 3e-2) * EnvGate.new(1);
44+
var signal = Saw.ar(\freq.kr(20), 0.2) * EnvGate.new(1);
4545
var fr = 2.pow(Decay.ar(Impulse.ar(0), 3)*6*vel+8);
4646
signal = BLowPass.ar(signal, fr)*vel;
4747
Out.ar([0,1], signal);

notepredictor/notepredictor/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ def predict(self,
425425
pred_pitch = [x.item() for x in pred_pitch]
426426
pred_time = [x.item() for x in pred_time]
427427
pred_vel = [x.item() for x in pred_vel]
428-
print(pred_time, pred_pitch, pred_vel)
428+
# print(pred_time, pred_pitch, pred_vel)
429429
else:
430430
# return single predictions
431431
pred_pitch = pred_pitch.item()

0 commit comments

Comments
 (0)