Physically modelled instruments

Official support for: mutools.com
Post Reply New Topic
RELATED
PRODUCTS

Post

Hello,

I've been trying to implement some physical modelled instruments in MU.LAB. The plucked one uses Short Echo' module and the flute/bassoon one uses the newly introduced 'Modular feedback delay' module (instruments attached below; demo: https://dl.dropboxusercontent.com/u/104 ... _instr.mp3 )

What I really have problem with is the instruments tuning. The 'Note to modulation' node outputs the signal that I try to remap with 'Modulation mappers', but I have problem with deriving the delay values corresponding with given note from it. Here's the formula: http://www.phys.unsw.edu.au/jw/notes.html , http://www.kvraudio.com/forum/viewtopic.php?p=2821806

Any tips on how to patch that math expression and pass the output value it to feedback delay/echo module to fix the instruments?
You do not have the required permissions to view the files attached to this post.

Post

I didn't know you could do this sort of thing in MuLab

Post

I don't know Mulab, but what you are going to do is an implementation of "Karplus-Strong".

If you can set the delay times in milliseconds, you have to calculate from note number to hertz to milliseconds.
Note number to hertz is always doubling (440 Hz = A', 880 Hz = A'', the other notes are each 1/12 of the difference of the octave gap).
One delay cycle is one wavelength, so 10 ms delay is: 1/0.010s hertz = 100 Hz. 440Hz is 0.0022727 sec delay.
ImageImage

Post

aMUSEd wrote:I didn't know you could do this sort of thing in MuLab
That's the power of the MUX modular editor ;)
WOK wrote:I don't know Mulab, but what you are going to do is an implementation of "Karplus-Strong".

If you can set the delay times in milliseconds, you have to calculate from note number to hertz to milliseconds.
Note number to hertz is always doubling (440 Hz = A', 880 Hz = A'', the other notes are each 1/12 of the difference of the octave gap).
One delay cycle is one wavelength, so 10 ms delay is: 1/0.010s hertz = 100 Hz. 440Hz is 0.0022727 sec delay.
Thanks for showing in my thread WOK and taking your time to write math explanations. The links I posted have already all required formulas (maybe except t=1/f :wink: ). My question is more directed to MU.LAB/MUX users because I'm having problems with patching the formula in the MUX nodal network. I'm missing math operators such as: sqrt, pow, divide (or don't know how to implement them with currently available means).

I've already made a simple Karplus-Strong plucked string in PureData a while ago, but I'm looking for making something more complex and available in my 'native environment' (with some effects in feedback loop and with the midi cc wired to the parameters and note translated to delay).

So far the pitch is scaled just so it fits the usable range, but my instruments remain very badly tuned so far :roll:

Post

I was struggeling with the same problem some time ago.
Haven't solved it, but with the curve property in the Mod Mapper it might be worth revisiting it.

Some general math with Mulab:
Use the Modulation Mapper and use
- Offset = Add/Sub a fixed value, or a variable value if you modulate Offset
- Amplitude = Multiply
- set Offset and Amplitude = 0 and connect a mod signal to both modulation inputs and you get X^2. Repeat this and you get X^3, etc.

Have not tried:
- use the curve to get log/exp/sin

Post

AndreasD wrote:I was struggeling with the same problem some time ago.
Haven't solved it, but with the curve property in the Mod Mapper it might be worth revisiting it.

Some general math with Mulab:
Use the Modulation Mapper and use
- Offset = Add/Sub a fixed value, or a variable value if you modulate Offset
- Amplitude = Multiply
- set Offset and Amplitude = 0 and connect a mod signal to both modulation inputs and you get X^2. Repeat this and you get X^3, etc.

Have not tried:
- use the curve to get log/exp/sin
What further is missing from your list it's the divide function and pow(x,y). It would be highly useful (maybe necessary) to solve that equation. Multiplication is kind of problematic, because I'd have to raise 2 to power of the n (n being the number of the key) so that method would work only up to several keys on the keyboard (think: number of connections, rounding errors).
As for the curves - I've tried them but I couldn't find any closer description of them. My experiments with them didn't yield satisfying results.

I've had another idea, based on the thing that the frequencies are doubling (delay times are halving) with each octave. Unfortunately this doesn't work as expected to me. I thought that if I input event into constant modulation generator the wiring will only work between the NoteOn-NoteOff event timespan and at other times it won't generate any signal, but currently it looks like it's been all the time active. When the all lines are active they add up to the signal level, and the output remains always 100% saturated. If I overcame this and I didn't make other mistakes in my nodes it would create functional delay time generator for synth.

Any ideas what could be done about that and how I can fix my patch?

Oh, BTW. Here is my 24 equal temperament splitter that I based my node network on. It allows you to play on a single keyboard or compose on single staff a microtonal music. Two 12-tone octaves are effectively condensed into a single one containing 24 tones.
It works like that:
1. create two instances of a single instrument
2. detune the second one by 0,25 tone up
3. connect the first one to the first output and the second to the second output
(alternatively you can use the single instrument if you route the pitch bend data along with the second output - that's setup for monophonic instruments)
I hope you enjoy: https://dl.dropboxusercontent.com/u/104 ... _qtone.mp3
You do not have the required permissions to view the files attached to this post.

Post

Your note_to_delay patch is interesting, but does not work as the event connections you use do not have any effect on the constant and mod mapper modules.

Can you try to exchange the constant (C,C#...B) modules with ADSR (0,0,100,0) and use the Global Level (or the Sustain) for the constant values.
Additional ADSRs are connected to the mod mapper amplitude input and are triggered from the octave module event outputs. These ADSR (0,0,100,0) Global Level is set to the current mod mapper amplitude. The mod mapper's amplitude=0!

There might be an easier approach, but this should prove the concept.

(haven't tried it!!)

Post

Thank you for tips! After implementing them I think the patch is working correctly now. I've made it to work with 'Mono echo short" because it has lower range of delay parameter (up to 100ms) and lowest minimum feedback delay value of all modules. I've used an additional mapper to set it to the range of the delay module.

Code: Select all

x = 244.62494027711419015766841853798 ms is the 100% of output from my patch (or it could be x/2 - with one octave higher output)

so to scale it to the range of the delay module I've used this equation: (((244.62494027711419015766841853798 / 4) / 100) / 2) + 0.5 = 0.80578117534639273769708552317248
the output value is supposed to be pasted onto 'Modulation mapper's' 'Amplitude' knob (I've omitted for simplicity in the calculations the minimum '0.021 ms' value, but it should be included for the accurate tuning)
I must think about how to approach the scaling with new 'Modular Feedback Delay'. Its range of 2000 ms and minimum value of 1ms is way greater making it harder to use and with lower accuracy. 'Parameter Event Generator's' default resolution is way too few to scale the logarithmic range accurately. I don't know how high it's possible to go with the resolution - I must experiment with it more, but now with functioning 'note to delay' patch it should be easier. :hyper:

Thanks again for your help AndreasD. I hope you enjoy my patch as well. :tu:
You do not have the required permissions to view the files attached to this post.

Post

I can't get it to work in my patch at the moment.
My patch works nicely apart from the note tracking we discussed here.

BTW, i have a ADSR plus parameter event generator setup to put the delay's feedback to 100% as long as a note is active. Might be useful.

Post

I changed your patch quickly. The weird thing is that the echo module had minimum delay value of 0.5 ms (looks to me like a legacy compatibility thing). I created the new short echo module (which had lower minimum value) and put it in the place of the older one. Also I deleted your previous mappers and put my patch in that place. I hope I didn't destroy anything important.
You do not have the required permissions to view the files attached to this post.

Post

Thanks!

Works like a charm now.

Post Reply

Return to “MuTools”