Skip to content

add support for wavetable ENV #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 38 additions & 17 deletions src/mruby-zest/example/ZynOscilMod.qml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,15 @@ Widget {
label: "frequency";
highlight_pos: :top
}
TabButton {
label: "wavetable";
highlight_pos: :top
}

function set_tab(wid)
{
id = get_tab wid
vs = [:amplitude, :frequency]
vs = [:amplitude, :frequency, :wavetable]
root.set_view_pos(:subsubview, vs[id])
root.change_view
}
Expand All @@ -55,7 +59,7 @@ Widget {
function set_view()
{
subsubview = root.get_view_pos(:subsubview)
vs = [:amplitude, :frequency]
vs = [:amplitude, :frequency, :wavetable]
if(!vs.include?(subsubview))
subsubview = :amplitude
root.set_view_pos(:subsubview, subsubview)
Expand All @@ -76,22 +80,39 @@ Widget {
elm = vis.children[0]
elm.refresh if elm.respond_to? :refresh
}
else
footer.children[1].value = true
gen.extern = basemod.extern
env.extern = basemod.extern + "FMFreqEnvelope/"
vis.extern = basemod.extern + "FMFreqEnvelope/"
gen.content = Qml::ZynFreqMod
env.content = Qml::ZynFreqEnv
vis.content = Qml::ZynEnvEdit
vis.children[0].layoutOpts = Hash.new
vis.children[0].layoutOpts[:main_width] = 0.8
else if(subsubview == :wavetable)
footer.children[2].value = true
gen.extern = basemod.extern
env.extern = basemod.extern + "WaveEnvelope/"
vis.extern = basemod.extern + "WaveEnvelope/"
gen.content = Qml::ZynAmpMod
env.content = Qml::ZynWaveEnv
vis.content = Qml::ZynEnvEdit
vis.children[0].layoutOpts = Hash.new
vis.children[0].layoutOpts[:main_width] = 0.8

env.children[0].toggleable = basemod.extern + "PFMFreqEnvelopeEnabled"
env.children[0].whenModified = lambda {
elm = vis.children[0]
elm.refresh if elm.respond_to? :refresh
}
env.children[0].toggleable = basemod.extern + "PWaveEnvelopeEnabled"
env.children[0].whenModified = lambda {
elm = vis.children[0]
elm.refresh if elm.respond_to? :refresh
}
else
footer.children[1].value = true
gen.extern = basemod.extern
env.extern = basemod.extern + "FMFreqEnvelope/"
vis.extern = basemod.extern + "FMFreqEnvelope/"
gen.content = Qml::ZynFreqMod
env.content = Qml::ZynFreqEnv
vis.content = Qml::ZynEnvEdit
vis.children[0].layoutOpts = Hash.new
vis.children[0].layoutOpts[:main_width] = 0.8

env.children[0].toggleable = basemod.extern + "PFMFreqEnvelopeEnabled"
env.children[0].whenModified = lambda {
elm = vis.children[0]
elm.refresh if elm.respond_to? :refresh
}
end
end
db.update_values
}
Expand Down
38 changes: 38 additions & 0 deletions src/mruby-zest/example/ZynWaveEnv.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Group {
id: box
label: "Envelope"
property Function whenModified: nil

function cb()
{
whenModified.call if whenModified
}

ParModuleRow {
id: top
Knob {
whenValue: lambda { box.cb };
extern: box.extern+"A_dt"
type: :float
}
Knob {
whenValue: lambda { box.cb };
extern: box.extern+"D_dt"
type: :float
}
Knob { whenValue: lambda { box.cb }; extern: box.extern+"PS_val"}
}
ParModuleRow {
id: bot
Knob {
whenValue: lambda { box.cb };
extern: box.extern+"R_dt"
type: :float
}
Knob { whenValue: lambda { box.cb }; extern: box.extern+"Penvstretch"}
Col {
ToggleButton { label: "FRCR"; whenValue: lambda { box.cb }; extern: box.extern+"Pforcedrelease"}
ToggleButton { label: "repeat"; whenValue: lambda { box.cb }; extern: box.extern+"Prepeating"}
}
}
}
Loading