Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Vowel fx needs an overhaul #3163

ethancrawford started this conversation in Feature/Improvement Ideas
Discussion options

There have been questions previously about the effectiveness of the :vowel fx. (See #1992 for example).

Xav has said that the current implementation leaves much to be desired. He is interested in eventually rewriting it, and has said it should be easier this time, particularly with the use of SCLang. (We might use FormantTable).

You must be logged in to vote

Replies: 3 comments

Comment options

This is the example (from the docs for FormantTable) I'd like to base it off:

// Saw freq is controlled by mouse X position
// BBandPass filter is controlled by
// FormantTable data (frequencies, resonances, amplitudes)
(
 SynthDef(\formantVoice, { arg
 f = #[ 400, 750, 2400, 2600, 2900 ],
 a = #[ 1, 0.28183829312645, 0.089125093813375, 0.1, 0.01 ],
 q = #[ 0.1, 0.10666666666667, 0.041666666666667,
 0.046153846153846, 0.041379310344828 ];
 var scale = [0, 2, 4, 7, 9]; // pentatonic major
 var scaleBuf = LocalBuf(scale.size, 1).set(scale);
 var degree = Index.kr(scaleBuf, MouseX.kr(0, BufFrames.kr(scaleBuf)));
 var vibrato = SinOsc.kr(6, mul:4);
 var base = 5 * 12;
 var in = Saw.ar(((degree + base).midicps + vibrato).lag(0.3));
 Out.ar(0, Mix.new(BBandPass.ar(in, f, q) * a).dup);
}).send(s);
)
// create a menu of the FormantTable options for preview
(
 var voices = FormantTable.keys.asArray;
 voices.sort;
 // start an instance of the synth
 #f, a, q = FormantTable.get( voices.first );
 x = Synth(\formantVoice, [\f, f, \a, a, \q, q]);
 w = Window("FormantTable Browser",
 Rect(Window.screenBounds.width/2 - 150,
 Window.screenBounds.height/2 - 30,
 300, 60));
 StaticText(w, Rect(0, 5, w.view.bounds.width, 20))
 .font_(Font("Helvetica", 11))
 .string_("Move mouse left/right to change pitch")
 .align_(\center);
 PopUpMenu(w, w.view.bounds.insetBy(15, 20).moveBy(0, 10))
 .items_(voices)
 .action_({ |v|
 // change the data based on user action
 #f, a, q = FormantTable.get( v.item );
 x.setn(\f, f);
 x.setn(\a, a);
 x.setn(\q, q);
 });
 w.onClose_({ x.free });
 w.front;
)

nb. the FormantTable class is part of the sc3-plugins repo so you need to have that set up in order for the above to work.

You must be logged in to vote
0 replies
Comment options

Sounds cool - although just to check, is the SCLang FormantTable class used just to compile the synthdef or is it necessary to generate the correct runtime args?

You must be logged in to vote
0 replies
Comment options

@samaaron - at first glance it appears to me that it's just a utility that holds the correct numbers for the filter values, so perhaps not needed at runtime.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Converted from issue

This discussion was converted from issue #2904 on July 21, 2022 09:41.

AltStyle によって変換されたページ (->オリジナル) /