How to improve this .uhm?
- KVRAF
- 5234 posts since 25 Feb, 2008
The attached .uhm wavetable uses two bandpass filter functions in parallel to give two formants in a matrix that can be swept independently for different vowel sounds (set Tables to 8 and assign WT Position and WT Multi Pos to the X and Y of an XY - theoretically, every vowel sound and dipthong should be in there).
The first formant sweeps from 0.14 to 0.28, the second 0.28 to 0.49, which corresponds to 280 to 800 (F1) and 800 to 2600 Hz (F2) at C3.
The number of lines of code can probably be reduced a bit. Any ideas?
The first formant sweeps from 0.14 to 0.28, the second 0.28 to 0.49, which corresponds to 280 to 800 (F1) and 800 to 2600 Hz (F2) at C3.
The number of lines of code can probably be reduced a bit. Any ideas?
You do not have the required permissions to view the files attached to this post.
- u-he
- 30215 posts since 8 Aug, 2002 from Berlin
I don't have Hive in front of me right now, but it looks much like you could reuse the envelope built into uhm to create the repeating pattern of bandpass frequencies.
Envelope L0=0.14 T1=1 L1=0.16 T2=2 L2=0.18 ... T7=7 L7=0.28
Wave target=aux1 start=0 end=7 "bandpass(2*phase-1, env(frame), 0.9)"
You can also use the Move instruction to copy already created frames, which is much faster than always using the same bandpass. That is, first you create frames 0 to 7, then you do the rest like this:
Move source=aux1 target=aux1 start=0 end=7 to=8 // creates 8-15
Move source=aux1 target=aux1 start=0 end=15 to=16 // creates 16-31
Move source=aux1 target=aux1 start=0 end=31 to=32 // creates 32-63
The second set of formants I'd do pretty much like you did them. If the file loads slowly, maybe also use the Move command to create the copies, even if it makes the file longer.
Envelope L0=0.14 T1=1 L1=0.16 T2=2 L2=0.18 ... T7=7 L7=0.28
Wave target=aux1 start=0 end=7 "bandpass(2*phase-1, env(frame), 0.9)"
You can also use the Move instruction to copy already created frames, which is much faster than always using the same bandpass. That is, first you create frames 0 to 7, then you do the rest like this:
Move source=aux1 target=aux1 start=0 end=7 to=8 // creates 8-15
Move source=aux1 target=aux1 start=0 end=15 to=16 // creates 16-31
Move source=aux1 target=aux1 start=0 end=31 to=32 // creates 32-63
The second set of formants I'd do pretty much like you did them. If the file loads slowly, maybe also use the Move command to create the copies, even if it makes the file longer.
- KVRAF
- Topic Starter
- 5234 posts since 25 Feb, 2008
I now have
The formant in aux1 isn't there any longer. What have I missed?
Code: Select all
Info "Set Tables to 8"
NumFrames =64
Envelope L0=0.14 T1=1 L1=0.16 T2=2 L2=0.18 T3=3 L3=0.20 T4=4 L4=0.22 T5=5 L5=0.24 T6=6 L6=0.26 T7=7 L7=0.28
Wave target=aux1 start=0 end=7 "bandpass(2*phase-1, env(frame), 0.9)"
Move source=aux1 target=aux1 start=0 end=7 to=8
Move source=aux1 target=aux1 start=0 end=15 to=16
Move source=aux1 target=aux1 start=0 end=31 to=32
Wave target=aux2 start=0 end=7 "bandpass(2*phase-1, 0.28, 0.9)"
Wave target=aux2 start=8 end=15 "bandpass(2*phase-1, 0.31, 0.9)"
Wave target=aux2 start=16 end=23 "bandpass(2*phase-1, 0.34, 0.9)"
Wave target=aux2 start=24 end=31 "bandpass(2*phase-1, 0.37, 0.9)"
Wave target=aux2 start=32 end=39 "bandpass(2*phase-1, 0.40, 0.9)"
Wave target=aux2 start=40 end=47 "bandpass(2*phase-1, 0.43, 0.9)"
Wave target=aux2 start=48 end=55 "bandpass(2*phase-1, 0.46, 0.9)"
Wave target=aux2 start=56 end=63 "bandpass(2*phase-1, 0.49, 0.9)"
Wave "aux2 +aux1"
Normalize base=all- u-he
- 30215 posts since 8 Aug, 2002 from Berlin
good question! I have to check it out when I get in front of a setup... (currently on vacation, haven't set up a desk yet)
- u-he
- 30215 posts since 8 Aug, 2002 from Berlin
You decide what the input value is, in the parameter you call env() with. I just don’t remember if it’s relative or absolute “time”. It’s usually not time though. It’s more of a curve that can be mapped.
- u-he
- 30215 posts since 8 Aug, 2002 from Berlin
(The concept of vacation is unknown to me, except for the best vacation ever - glamping at Uluru - which has lasted for 2 days without internet connection and two visits to the field of lights)
- KVRAF
- Topic Starter
- 5234 posts since 25 Feb, 2008
Ah, I get how the envelope works.
The original .uhm works okay - seems to load quickly enough. I just thought it probably wasn't the most efficient way to code it. Will have a play around and see if I can find out why your envelope suggestion didn't work.
Enjoy your holiday!
The original .uhm works okay - seems to load quickly enough. I just thought it probably wasn't the most efficient way to code it. Will have a play around and see if I can find out why your envelope suggestion didn't work.
Enjoy your holiday!
- KVRAF
- Topic Starter
- 5234 posts since 25 Feb, 2008
Sorry, a few more questions.
I tried the following envelope example from the scripting doc:
Loading the wavetable in Hive all that happens is that it keeps the first frame of whatever wavetable was previously loaded - no sign of the fin/triangle that it should make?
Probably just an oddity, but "Additive Chords" from the factory wavetables seems to be missing a closing apostrophe around the formula in line 8, yet it works?
And, silly question, but what is 'x' here and in the other uhm's that use 'x' (I can't find a definition in the scripting doc)?
I tried the following envelope example from the scripting doc:
Code: Select all
Envelope curve=exponential L0=0 T1=0.25 L1=1 T2=0.5 L2=-1 T3=0.25 L4=0
Wave ”env(phase)”Probably just an oddity, but "Additive Chords" from the factory wavetables seems to be missing a closing apostrophe around the formula in line 8, yet it works?
Code: Select all
// by Howard Scarr
Info "5th, 7th, 4th, add9, major triad, maj7"
NumFrames = 6
Wave "0 + sin(2*pi*phase*(frame+1))"
Wave "x + sin(2*pi*phase*(frame+4))
Wave "x + sin(2*pi*phase*(frame+6))"
Normalize db=0 base=each-
- KVRian
- 1482 posts since 26 Jun, 2002 from London, UK
x is the output from the previous Wave instruction.
Wavetables for DUNE2/3, Blofeld, IL Harmor, Hive and Serum etc: http://charlesdickens.neocities.org/
£10 for lifetime updates including wavetable editor for Windows.
Music: https://soundcloud.com/markholt
£10 for lifetime updates including wavetable editor for Windows.
Music: https://soundcloud.com/markholt
- KVRAF
- Topic Starter
- 5234 posts since 25 Feb, 2008
okay, thanks.
(should have read the scripting doc more carefully - 'x' is listed under 'variables')
- KVRAF
- 4197 posts since 23 May, 2004 from Bad Vilbel, Germany
Oops...hakey wrote: Sat Oct 16, 2021 6:15 pm Probably just an oddity, but "Additive Chords" from the factory wavetables seems to be missing a closing apostrophe around the formula in line 8, yet it works?
