forked from mruby-zest/mruby-zest-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scratch.rb
81 lines (65 loc) · 2.13 KB
/
scratch.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#puts "Trying to create a remote instance"
#remote = OSC::Remote.new
#puts "Trying to create a view on the metadata of a parameter"
#meta = OSC::RemoteMetadata.new(remote, "/part0/kit0/adpars/VoicePar0/FreqLfo/Pfreq")
#puts "Trying to dump some of said metadata"
#puts meta.short_name
delay_size = 5
# type of offset
# | root event
# | | offset
# v v v
sched.active_event [:frame, 0, 0]
sched.add lambda {|run|
$remote.settf("/part0/kit0/Psubenabled", true)
$remote.settf("/part0/kit0/Ppadenabled", true)
run.set_view_pos(:view, :add_synth)
run.set_view_pos(:subview, :oscil)
run.change_view
}
sched.active_event [:frame, 1*delay_size, delay_size]
sched.add lambda {|run|
run.screenshot("test-screenshot-add-synth.png")
widgets = run.filter_widgets(nil) do |x|
ret = false
if(x.respond_to?(:label))
ret = true if x.label.downcase == "base func."
ret = true if x.label.downcase == "to sine"
end
ret
end
#puts "widget="
#puts widgets
#puts "end widgets"
bb = run.joint_bounding_box(widgets)
run.screenshot("test-screenshot-close-region.png", bb)
run.set_view_pos(:view, :pad_synth)
run.set_view_pos(:subview, :harmonics)
run.change_view
}
sched.active_event [:frame, 2*delay_size, delay_size]
sched.add lambda {|run|
run.screenshot("test-screenshot-pad-synth.png")
#puts "PAD Synth = #{run.get_view_pos(:view)}"
run.set_view_pos(:view, :sub_synth)
run.change_view
}
sched.active_event [:frame, 3*delay_size, delay_size]
sched.add lambda {|run| run.screenshot("test-screenshot-sub-synth.png") }
views = [:kit, :effects, :midi_learn, :mixer,
:banks, :about, :automate, :colors,
:settings]
views.each_with_index do |v, ind|
puts v
sched.add lambda {|run|
run.set_view_pos(:view, v)
run.change_view
}
sched.active_event [:frame, (ind+4)*delay_size, delay_size]
sched.add lambda {|run|
run.screenshot("test-screenshot-#{v.to_s}.png")
}
end
sched.add lambda {|run|
exit
}