[.uhm] FM Synthesis in Hive

Official support for: u-he.com
Post Reply New Topic
RELATED
PRODUCTS

Post

Double post....sorry
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

Post

cytospur wrote:If anyone wants to 'cheat' then there are wavetables available here:
This particular thread is about scripting… no 'cheating' here :-)

Post

drzhnn wrote:...practice until it clicks...
I distracted my reasonable self with a banana, while my rebellious self committed an impulse buy. Now I have to continue learning, otherwise I will blame myself for spending money on something that I won't use.
:hug:
That tubular bell is great. Checked it out although I'm on the road -> Berlin!
Last edited by Howard on Tue Sep 25, 2018 9:04 am, edited 1 time in total.

Post

Howard wrote:
cytospur wrote:If anyone wants to 'cheat' then there are wavetables available here:
This particular thread is about scripting… no 'cheating' here :-)
It was a joke. I think the scripting approach is brilliant and inspired. 'Fantastic' as I said in my first sentence of the post that you part quoted :wink:
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

Post

drzhnn wrote: I was exhausted by switching between Hive, text editor
Same here. Any chance of a standalone .uhm/wavetable editor?

Post

drzhnn wrote:I tried but the way I see it I need to create a sin(2*pi*phase*harmonic + x/harmonic) line for each harmonic, and there're 1024 harmonics... I tested up to 100 and it still wasn't saw-ish enough
The additive approach to sawtooth is

sin(2*pi*phase*harmonic)/harmonic, starting with harmonic = 1

The easiest way to do this in Hive is

Spectrum "1/index", because index is the same as harmonic in the Spectrum function

Anyhow, the appraoch I posted above (using lowpass) is very effective in simulating FM feedback sawteeth.

#---

I totally agree that the workflow is tedious. But I also think it's surprisingly fast to get to good results compared to visual methods. Because every line is a batch process, it turns tedious frame-by-frame editing into a possibly strenuous one-time thought process. I think the "strenuousness" of this thought process will be countered by lists of numerous examples which people can easily copy and paste in to their own scripts.

#---

We might also need to explain some basic concepts a bit more visually, e.g. what exactly happens during the process of a Wave/Spectrum/Phase command.

Post

hakey wrote:
drzhnn wrote: I was exhausted by switching between Hive, text editor
Same here. Any chance of a standalone .uhm/wavetable editor?
I hardly switch between apps... I load the script I'm going to edit into Hive, put wavetable on auto and spend the rest of my time in the text editor. Whenever I save the changes to the text file, Hive automatically loads it in the background, and I keep playing away on the keyboard.

Thats aid, a standalone wavetable editor would be a great thing, but we won't be able to pull that off.

Post

hakey wrote:
drzhnn wrote: I was exhausted by switching between Hive, text editor
Same here. Any chance of a standalone .uhm/wavetable editor?
Tips: Use a simple host (e.g. Ju-X AUhosting), display Hive AND the text editor at the same time, "split screen". Click to switch focus, don't use cmd+tab (or whatever the equivalent is in the PC world).
As Urs says, unless you're building a preset you can just save (if necessary) and play most of the time, especially if you use the "Auto" scan in your testbed preset.

Post

Okay, thanks.

Post

btw, for anyone using Notepad, scripts need to be saved with quotation marks - wavetable.uhm should be saved as "wavetable.uhm". Otherwise Notepad adds an invisible .txt extension.

Had me scratching my head for a while.

Post

hakey wrote:btw, for anyone using Notepad, scripts need to be saved with quotation marks - wavetable.uhm should be saved as "wavetable.uhm". Otherwise Notepad adds an invisible .txt extension.

Had me scratching my head for a while.
On Windows, I suggest you use Notepad++ instead of Notepad (it's what I've been using). Notepad can cause issues when scripting, such as adding hidden characters, and switching symbols like " to quotations, and not saving extensions (like you mentioned).

Post

Thanks for the suggestion. 8)

Post

Back in the days (before I replaced myself with Windows-savvy developers) I think it was Ultraedit for me. But I also think the different licensing models were a mess. Not sure if there's a slim & free version.

Post

Urs wrote:We might also need to explain some basic concepts a bit more visually, e.g. what exactly happens during the process of a Wave/Spectrum/Phase command.
I not sure I understand the y variable. Is it a value of a sample at [current_index - 1] in -1.0 to 1.0 range?

Post

drzhnn wrote:
Urs wrote:We might also need to explain some basic concepts a bit more visually, e.g. what exactly happens during the process of a Wave/Spectrum/Phase command.
I not sure I understand the y variable. Is it a value of a sample at [current_index - 1] in -1.0 to 1.0 range?
Almost...

The samples are not necessarily in -1/+1 range. You can do whatever range you want, but Hive automatically adjusts the RMS to fit the sawtooth (we think it's a bit low though, so we'll boost it a bit in the final version)

When I say almost, I mean that the values of the current frame are stored in a temporary buffer, then blended into the target buffer using the blend mode. Such that, in almost C, vastly simplified,

Code: Select all

Wave  blend=multiply "sin(2*pi*phase + y) + x"
becomes

Code: Select all

for( frame = start; frame <= end; frame++ )
{
	table = (frame-start)/(end-start);
	
		// Pass 1: run equation on frame
	
	for( index = 0; index < 2048; index++ )
	{
		y = tmp[ index - 1 ];
		x = main[ frame ][ index ];
		phase=index/2048;
		tmp[ index ] = sin(2*pi*phase + y) + x;
	}
	
		// Pass 2: blend frame into buffer
	
	for( index = 0; index < 2048; index++ )
	{
		main[ frame ][ index ] = doBlend(tmp[ index ], main[ frame ][ index ], multiply );
	}
}

Post Reply

Return to “u-he”