Skip to content

Commit

Permalink
yutani: release wavetable oscillators
Browse files Browse the repository at this point in the history
  • Loading branch information
JoepVanlier committed Oct 28, 2023
1 parent 38819b5 commit 71925af
Show file tree
Hide file tree
Showing 3 changed files with 12,131 additions and 34 deletions.
66 changes: 57 additions & 9 deletions Yutani/Saike_Yutani.jsfx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
desc:Yutani Mono Bass Synth [Saike] (BETA)
tags: synth bass
version: 0.90
version: 0.91
author: Joep Vanlier
changelog: Started work on supported wavetable oscillators.
changelog: Release first version of wavetable oscillators
license: MIT
provides:
Yutani_Dependencies/*
Expand Down Expand Up @@ -48,7 +48,7 @@ slider9:glide_time=.4<0,1,.00001>-Glide time

slider10:amp_accent=0<0, 1, 1>-Amp Accent
slider11:amp_atk=0<0, 1, .000001>-Amp Attack
slider12:amp_decay=1<0, 1, .000001>-Amp Decay
slider12:amp_decay=0.2<0, 1, .000001>-Amp Decay
slider13:amp_sustain=1<0, 1, .00001>-Sustain level

slider14:pitch_env=0<-12, 12, .000001>-Pitch envelope level
Expand Down Expand Up @@ -142,7 +142,7 @@ import Saike_Yutani_sample_delay_buffer.jsfx-inc
import Saike_Yutani_LFOs.jsfx-inc

@init
VERSION = 3;
VERSION = 4;
gfx_ext_retina == 0 ? gfx_ext_retina = 1;
amp1 = 1;
style = 1;
Expand Down Expand Up @@ -483,17 +483,18 @@ version < 3 ? (
);

file_var(0, has_wavetable_data);
file_var(0, estimate_pitch);

loop(188,
loop(187,
file_var(0, 0);
);

has_wavetable ? (
has_wavetable_data ? (
wt.serialize_sample(SAMPLES_PER_WT, WT_LENGTH);
wt2.serialize_sample(SAMPLES_PER_WT, WT_LENGTH);
);

VERSION = 3;
VERSION = 4;

@slider
updateSlider();
Expand Down Expand Up @@ -1498,11 +1499,16 @@ Wavetable oscillator. Drag a sample into Yutani to
load it as a wavetable."
);

oscResetToggle.drawToggle(cX - 1.9 * knobSize, cY + 1.15 * knobSize, .15*knobSize, .15*knobSize, free_osc, widget_r, widget_g, widget_b, widget_a, toggle_r, toggle_g, toggle_b, toggle_a, "Free\n\nDo not reset the phase of oscillator on note on.\n\nNote that for comb filters, this setting switches\nthe input from impulse to noise.");

oscResetToggle.label = sprintf(33, " Free"); // Free
oscResetToggle.drawToggle(cX - 1.9 * knobSize, cY + 1.15 * knobSize, .15*knobSize, .15*knobSize, free_osc, widget_r, widget_g, widget_b, widget_a, toggle_r, toggle_g, toggle_b, toggle_a, "Free\n\nDo not reset the phase of oscillator on note on.\n\nNote that for comb filters, this setting switches\nthe input from impulse to noise.");
free_osc = oscResetToggle.processMouseToggle(mouse_x, mouse_y, mouse_cap);

osc1_shape == 9 ? (
estimatePitchToggle.label = sprintf(33, " Pitch"); // Free
estimatePitchToggle.drawToggle(cX - 0.4 * knobSize, cY + 1.15 * knobSize, .15*knobSize, .15*knobSize, estimate_pitch, widget_r, widget_g, widget_b, widget_a, toggle_r, toggle_g, toggle_b, toggle_a, "Estimate pitch when dropping wave for the wave table.");
estimate_pitch = estimatePitchToggle.processMouseToggle(mouse_x, mouse_y, mouse_cap);
);

cX += 2*knobSize;

osc1AmpKnob.knob_set(sprintf(1, "%.1f dB", osc1_db), 1, (osc1_db + 48)/48);
Expand Down Expand Up @@ -1712,6 +1718,12 @@ syncToggle.drawToggle(cX - 1.9 * knobSize, cY + 1.15 * knobSize, .15*knobSize, .
syncToggle.label = sprintf(15, syncToggle.inactive ? "" : " H-sync"); // Sync
hardsync = syncToggle.processMouseToggle(mouse_x, mouse_y, mouse_cap);

osc2_shape == 9 ? (
estimatePitchToggle2.label = sprintf(33, " Pitch"); // Free
estimatePitchToggle2.drawToggle(cX - 0.4 * knobSize, cY + 1.15 * knobSize, .15*knobSize, .15*knobSize, estimate_pitch, widget_r, widget_g, widget_b, widget_a, toggle_r, toggle_g, toggle_b, toggle_a, "Estimate pitch when dropping wave for the wave table.");
estimate_pitch = estimatePitchToggle2.processMouseToggle(mouse_x, mouse_y, mouse_cap);
);

cX += 2*knobSize;

osc2AmpKnob.knob_set(sprintf(1, "%.1f dB", osc2_db), 1, (osc2_db + 48)/48);
Expand Down Expand Up @@ -3111,3 +3123,39 @@ text_box.render_text_input();

/* Reset dropped file status */
gfx_getdropfile(-1);


debug_wt = 0;

dx = 1;
debug_wt ? (
cx = 10;
s = wt.scratch_start;
loop(WT_LENGTH * 8,
gfx_circle(cx, 0.85 * gfx_h - 0.15 * gfx_h * s[] , 3);
gfx_line(cx, 0.85 * gfx_h - 0.15 * gfx_h * s[], cx + dx, 0.85 * gfx_h - 0.15 * gfx_h * s[1], 3);
cx += dx;
s += 1;
);

cx = 10;
s = wt.sample_mem_start;
cy_offs = 0.15 * gfx_h;
loop(8,
cx = 10;
loop(WT_LENGTH,
// gfx_circle(cx, 0.25 * gfx_h - 0.15 * gfx_h * s[] , 3);
gfx_line(cx, cy_offs - 0.05 * gfx_h * s[], cx + dx, cy_offs - 0.05 * gfx_h * s[1], 3);
cx += dx;
s += 1;
);
cy_offs += 20
);

gfx_line(10 + wt.min_idx_unrefined * dx, 0, 10 + wt.min_idx_unrefined * dx, gfx_h);
gfx_set(0.5, 0.5, 0.5, 1.0);
gfx_line(10 + wt.min_idx * dx, 0, 10 + wt.min_idx * dx, gfx_h);
gfx_x = 0;
gfx_y = 0;
gfx_printf("%f: %f", wt.min_idx, wt.scratch_start[wt.min_idx]);
);
Loading

0 comments on commit 71925af

Please sign in to comment.