Old 28th August 2011, 12:39   #1
Trivo
Junior Member
 
Join Date: Aug 2011
Posts: 2
Question about frequency

Hi, I'm new here.
I've been using milkdrop for a long time but the last few days I became interested in making my own presets. The math and programing knowledge are there but unfortunately I don't have any artistic view

Anyways I was wondering how to make my own custom range of frequencies, different than "bass", "treb", etc. if it's possible? I tried browsing the forum and went through the tutorial (really helpful and well written btw) but found nothing, maybe I missed it.
Trivo is offline   Reply With Quote
Old 28th August 2011, 14:18   #2
Amandio C
Senior Member
 
Join Date: Dec 2008
Posts: 400
Hi. MD also provides the sound spectrum for left and right channels, value1 and value2, composed of up to 512 points each. Value1 and value2 can only be read in the waves-per-point code.
In this example, the spectrum of value1 is recorded in megabuffs, frozen every few seconds and read by the shapes code. Note that the shaders cannot read the megabuffs, so neither can access the sound spectrum data.
Attached Files
File Type: milk amandio c - sunspectrum 1.milk (7.1 KB, 177 views)
Amandio C is offline   Reply With Quote
Old 28th August 2011, 15:00   #3
Trivo
Junior Member
 
Join Date: Aug 2011
Posts: 2
Well that's interesting, a bit advanced for me though (for now).

What I wanted to know was how to define (if possible) a variable that takes as input the value of the sound output for the range of 100 Hz - 200 Hz for example (lowest bass). From what I see, the "bass", "mid", "treb" variables use a quite wider range of frequency each. Can this be tweaked somehow.... would be really useful and cool

Thx for the quick reply too Amandio C!
Trivo is offline   Reply With Quote
Old 28th August 2011, 15:59   #4
Amandio C
Senior Member
 
Join Date: Dec 2008
Posts: 400
I suppose the value of bass, mid, treb, is the average sum of a pre-defined range of the 2x512 points given by value1 and value2.
Therefore, if we want a variable with a different range, we need to read only the points that we want, and calculate the average sum. To use this variable other then in the waves, we'll need to use megabuffs, because value1 and value2 can only be used in the wave per-point code. Megabuff can transmit the variable to the other MD components. If we use, as here, a single-value variable, it can also be read by the shaders.

In this example, the average sum of points #1 to #50 of (value1+value2)/2 is calculated and saved as the q1 variable. See the wave 1 per-point code. The q1 variable is then read by shape 1.

Don't expect nothing from the new variable, though.
The botttom line is, why using only one, two or three numbers, when there are 2x512 available in value1/2 ?
Attached Files
File Type: milk spectrum range.milk (7.1 KB, 172 views)
Amandio C is offline   Reply With Quote
Old 28th August 2011, 19:59   #5
Nitorami
Major Dude
 
Join Date: Mar 2008
Location: Erlangen
Posts: 868
Let me add a few words.... It's really easy but difficult to explain :

Each of the four wave section handles "number of samples" samples. We only need ONE wave section, say wave 1. We set it to the maximum number of points, 512.

In the wave1 per-point-code, the audio samples are available in value1 (left channel) and value2 (right channel). If you set "use spectrum" to OFF, value1/2 will contain the time values (like an oscilloscope), if you set it to ON, they will contain the spectrum.

gmegabuf(n) is a huge array that can be read and written from anywhere (except shaders). So all you need to do is to copy the spectral data within wave1 per-point code into gmegabuf as Amandio demonstrated.
You can then manipulate the array in the per frame section, for instance make your own bass signal, or split the spectrum up into a number of channels like an equaliser ... you can do anything you like really.
Nitorami is offline   Reply With Quote
Old 29th August 2011, 13:55   #6
Amandio C
Senior Member
 
Join Date: Dec 2008
Posts: 400
Yes, as for the modes of re-working the spectrum data, I'm not an expert.
But as before said I don't expect much of the preset response to sounds.
This reminded me of that old idea that would maybe bring MD, or other music visualizer, to a new level. In simple terms, we would use a "script" of the music file, for instance a midi file, or other format with identical structure. This type of file contains the music score and gain for every single instrument played. The midi sound would not be played, but only read by the visualizer to provide accurate sound data.
Of course, for this to be possible, the midi (or equivalent) must be created and also be synchronized with the music track. This, I believe, would make presets responsive in a way not yet known.
It's not likely though to see a software or music company creating a product like this, since the copyright laws are not friendly with midis. It could be used with older tunes though.
Amandio C is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Visualizations > MilkDrop > MilkDrop Presets

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump