back to list

Kontakt, Fluidsynth, Gervill, sample tuning

🔗Aaron Andrew Hunt <aaronhunt@...>

4/1/2009 10:03:58 AM

I have a question for anyone here using Kontakt scripts
to retune sample libraries.

When you retune in Kontakt using the scripts, does
Kontakt choose the closest sample for each pitch, or does
it just take whatever sample is there for the normal MIDI
note and bend it to the pitch you have programmed for
that MIDI note?

Obviously the former gives best results while the latter
sounds terrible unless you are just tweaking a 12 tone
tuning.

I've been recently fiddling with the FluidSynth API
<http://fluidsynth.resonance.org/trac>
and discovered that FluidSynth uses the latter method to
realize their non-standard tuning tables, so everything
sounds terrible unless you are just tweaking a 12 tone
tuning.

I don't have Kontakt, so can't find this out directly
for Kontakt (for their also non-standard tuning tables),
without contacting their tech support, which has not
proven useful.

Last, has anyone been able to make Gervill work on
their PC or Mac system?
<https://gervill.dev.java.net/>
Unlike FluidSynth which has totally non-standard
architecture from a MIDI point of view, Gervill is very
well structured and it implements MTS. Check out
the tuning example Applets at the website. I would
also like to have this same question answered for
Gervill from anyone who uses it.

Thanks for your help.
AAH
=====

🔗Aaron Krister Johnson <aaron@...>

4/1/2009 12:57:56 PM

Aaron,

Yeah, shame about FluidSynth's method, otherwise, FluidSynth is a great program. But I bet such a simple sample-engine thing is common. I don't know about Kontakt, but I would guess that most smaple engines just simply map a sample to a key, maximum 128 (except of course multi-sample layers for velocity).

One (pain-in-the-ass) way of insuring sample accuracy when one needs to go wide afield of 12-equal (say +/-100 cents) would be to design a custom soundfont for a particular tuning that more uses target samples close to what you predict the end-result pitch would be in that tuning. Then, one could still load it into FluidSynth and the results would be passable.

The other (if you use Csound) would be to write a complex instrument in Csound using midi opcodes that would basically have conditional statements thatwould pick samples. But again, the desired correct pitch would have to be known beforehand, limiting the universality of the instrument. I know Prent uses such an engine, but it's for pure Csound (.sco) files, and I think he may even pass sample choice parameters to the instrument with a pre-processor script.

Best,
Aaron.

--- In MakeMicroMusic@yahoogroups.com, "Aaron Andrew Hunt" <aaronhunt@...> wrote:
>
> I have a question for anyone here using Kontakt scripts
> to retune sample libraries.
>
> When you retune in Kontakt using the scripts, does
> Kontakt choose the closest sample for each pitch, or does
> it just take whatever sample is there for the normal MIDI
> note and bend it to the pitch you have programmed for
> that MIDI note?
>
> Obviously the former gives best results while the latter
> sounds terrible unless you are just tweaking a 12 tone
> tuning.
>
> I've been recently fiddling with the FluidSynth API
> <http://fluidsynth.resonance.org/trac>
> and discovered that FluidSynth uses the latter method to
> realize their non-standard tuning tables, so everything
> sounds terrible unless you are just tweaking a 12 tone
> tuning.
>
> I don't have Kontakt, so can't find this out directly
> for Kontakt (for their also non-standard tuning tables),
> without contacting their tech support, which has not
> proven useful.
>
> Last, has anyone been able to make Gervill work on
> their PC or Mac system?
> <https://gervill.dev.java.net/>
> Unlike FluidSynth which has totally non-standard
> architecture from a MIDI point of view, Gervill is very
> well structured and it implements MTS. Check out
> the tuning example Applets at the website. I would
> also like to have this same question answered for
> Gervill from anyone who uses it.
>
> Thanks for your help.
> AAH
> =====
>

🔗Aaron Andrew Hunt <aaronhunt@...>

4/1/2009 1:27:36 PM

Hi AKJ.

--- In MakeMicroMusic@yahoogroups.com, "Aaron Krister Johnson" <aaron@...> wrote:
>
> Aaron,
>
> Yeah, shame about FluidSynth's method, otherwise,
> FluidSynth is a great program. But I bet such a
> simple sample-engine thing is common. I don't
> know about Kontakt, but I would guess that most
> smaple engines just simply map a sample to a key,
> maximum 128 (except of course multi-sample
> layers for velocity).
>
> One (pain-in-the-ass) way of insuring sample
> accuracy when one needs to go wide afield of
> 12-equal (say +/-100 cents) would be to
> design a custom soundfont for a particular
> tuning that more uses target samples close
> to what you predict the end-result pitch
> would be in that tuning. Then, one could
> still load it into FluidSynth and the results would be passable.

Yes, and since FluidSynth does have some methods for
SoundFont manipulation, it may be possible to write a
method which remaps the sample zones in a way which
fits better with the tuning. I say better, because it still
would not sound good in many cases, and in some cases
it would sound just as bad as without moving zones
around.

Another idea is to analyze a tuning with respect to the
number of different instances of a given MIDI note it
requires, in order then to make a number of different
tuning tables on different MIDI channels (since Fluid can
handle up to 128 channels) to together give the whole tuning
with the best sample maps. This would give best results,
but then there has to be a processor for MIDI input to
route to the channels, and if you're going to have one of
those, you might as well go with pitch bending per channel
since that always gets the best sample and it also gives
output in a from that is GM compatible (if you stick to
16 channels and give an option for percussion 10), whereas
this new crazy multi-channel Fluid method would be
Fluid-only compatible.

>
> The other (if you use Csound) would be to
> write a complex instrument in Csound using
> midi opcodes that would basically have conditional
> statements thatwould pick samples. But again, the
> desired correct pitch would have to be known
> beforehand, limiting the universality of the
> instrument. I know Prent uses such an engine,
> but it's for pure Csound (.sco) files, and I think
> he may even pass sample choice parameters to
> the instrument with a pre-processor script.
>
> Best,
> Aaron.

Yes, this end up being similar to the MIDI pitch bending
method, which always picks the best sample and then
bends it minimally, only within a halfstep up or down.

Gervill appears to be working like Fluid, meaning it has
the same bad sample mapping problem, the only
difference being that it does it in a more standard way,
with slightly more versatility, using MTS.

Cheers,
AAH
=====

>
> --- In MakeMicroMusic@yahoogroups.com, "Aaron Andrew Hunt" <aaronhunt@> wrote:
> >
> > I have a question for anyone here using Kontakt scripts
> > to retune sample libraries.
> >
> > When you retune in Kontakt using the scripts, does
> > Kontakt choose the closest sample for each pitch, or does
> > it just take whatever sample is there for the normal MIDI
> > note and bend it to the pitch you have programmed for
> > that MIDI note?
> >
> > Obviously the former gives best results while the latter
> > sounds terrible unless you are just tweaking a 12 tone
> > tuning.
> >
> > I've been recently fiddling with the FluidSynth API
> > <http://fluidsynth.resonance.org/trac>
> > and discovered that FluidSynth uses the latter method to
> > realize their non-standard tuning tables, so everything
> > sounds terrible unless you are just tweaking a 12 tone
> > tuning.
> >
> > I don't have Kontakt, so can't find this out directly
> > for Kontakt (for their also non-standard tuning tables),
> > without contacting their tech support, which has not
> > proven useful.
> >
> > Last, has anyone been able to make Gervill work on
> > their PC or Mac system?
> > <https://gervill.dev.java.net/>
> > Unlike FluidSynth which has totally non-standard
> > architecture from a MIDI point of view, Gervill is very
> > well structured and it implements MTS. Check out
> > the tuning example Applets at the website. I would
> > also like to have this same question answered for
> > Gervill from anyone who uses it.
> >
> > Thanks for your help.
> > AAH
> > =====
> >
>

🔗Robert Strauss <robert@...>

4/1/2009 2:03:19 PM

--- In MakeMicroMusic@yahoogroups.com, "Aaron Andrew Hunt" <aaronhunt@...> wrote:
>
> I have a question for anyone here using Kontakt scripts
> to retune sample libraries.
>
> When you retune in Kontakt using the scripts, does
> Kontakt choose the closest sample for each pitch, or does
> it just take whatever sample is there for the normal MIDI
> note and bend it to the pitch you have programmed for
> that MIDI note?
>
Hi Aaron,

Kontakt's scripting facility can retune the sample
associated with a midi note by an offset of any millicent
integer up or down. If you have samples spaced at semitones
in Kontakt's graphic sample map (default loading for most
commercial sample sets), the retuning needed for any pitch
is a quartertone at most.

Kontakt's 'factory' microtuning script is set up to apply
offsets to 12 tone ET. Retuning non 12 tone scales takes
a custom script because the sample that needs to be retuned
is generally mapped to a different midi note than the one
being played. Kontakt scripting can change the note number
of an incoming midi note event to handle this.

- Robert

🔗Aaron Andrew Hunt <aaronhunt@...>

4/1/2009 4:20:45 PM

--- In MakeMicroMusic@yahoogroups.com,
--- "Robert Strauss" <robert@...> wrote:
> Kontakt's scripting facility can retune the sample
> associated with a midi note by an offset of any
> millicent integer up or down. If you have samples
> spaced at semitones in Kontakt's graphic sample
> map (default loading for most commercial sample
> sets), the retuning needed for any pitch
> is a quartertone at most.
>
> Kontakt's 'factory' microtuning script is set up to
> apply offsets to 12 tone ET. Retuning non 12 tone
> scales takes a custom script because the sample
> that needs to be retuned is generally mapped to a
> different midi note than the one being played.
> Kontakt scripting can change the note number
> of an incoming midi note event to handle this.

Hi Robert!

OK, let me make sure I understand correctly.

- Custom Kontakt microtonal tuning scripts
can be written so that, given a standard 12ET
sample set, any MIDI note can be assigned to
any pitch, with very pitch using the correct sample
with minimal retuning, meaning samples will
always be within a halfstep of original pitch,
meaning they will never be retuned more
than +/- a quartertone. Correct?

Thanks,
AAH

🔗Robert Strauss <robert@...>

4/1/2009 5:40:00 PM

--- In MakeMicroMusic@yahoogroups.com, "Aaron Andrew Hunt" <aaronhunt@...> wrote:
>
> --- In MakeMicroMusic@yahoogroups.com,
> --- "Robert Strauss" <robert@> wrote:
> > Kontakt's scripting facility can retune the sample
> > associated with a midi note by an offset of any
> > millicent integer up or down. If you have samples
> > spaced at semitones in Kontakt's graphic sample
> > map (default loading for most commercial sample
> > sets), the retuning needed for any pitch
> > is a quartertone at most.
> >
> > Kontakt's 'factory' microtuning script is set up to
> > apply offsets to 12 tone ET. Retuning non 12 tone
> > scales takes a custom script because the sample
> > that needs to be retuned is generally mapped to a
> > different midi note than the one being played.
> > Kontakt scripting can change the note number
> > of an incoming midi note event to handle this.
>
>
> Hi Robert!
>
> OK, let me make sure I understand correctly.
>
> - Custom Kontakt microtonal tuning scripts
> can be written so that, given a standard 12ET
> sample set, any MIDI note can be assigned to
> any pitch, with very pitch using the correct sample
> with minimal retuning, meaning samples will
> always be within a halfstep of original pitch,
> meaning they will never be retuned more
> than +/- a quartertone. Correct?
>
> Thanks,
> AAH
>

Aaron,

Yes, that's it. Generally, you would want to set up
arrays in Kontakt that hold, or can be used to calculate
a target cent value for each midi note. Since the cent
tuning of a standard 12ET sample set is implicit, the
guts of a script would be just a few lines of code to
pick the closest sample, figure its retuning, and trigger
that samples' midi note instead of the played note.

- Robert

🔗Aaron Andrew Hunt <aaronhunt@...>

4/1/2009 9:03:03 PM

Great; thank you, Robert.

If anyone can point me to documentation of the
Kontakt scripting language, please let me know;
I can't find it online.

Cheers,
AAH
====

--- In MakeMicroMusic@yahoogroups.com, "Robert Strauss" <robert@...> wrote:
>
> --- In MakeMicroMusic@yahoogroups.com, "Aaron Andrew Hunt" <aaronhunt@> wrote:
> >
> > --- In MakeMicroMusic@yahoogroups.com,
> > --- "Robert Strauss" <robert@> wrote:
> > > Kontakt's scripting facility can retune the sample
> > > associated with a midi note by an offset of any
> > > millicent integer up or down. If you have samples
> > > spaced at semitones in Kontakt's graphic sample
> > > map (default loading for most commercial sample
> > > sets), the retuning needed for any pitch
> > > is a quartertone at most.
> > >
> > > Kontakt's 'factory' microtuning script is set up to
> > > apply offsets to 12 tone ET. Retuning non 12 tone
> > > scales takes a custom script because the sample
> > > that needs to be retuned is generally mapped to a
> > > different midi note than the one being played.
> > > Kontakt scripting can change the note number
> > > of an incoming midi note event to handle this.
> >
> >
> > Hi Robert!
> >
> > OK, let me make sure I understand correctly.
> >
> > - Custom Kontakt microtonal tuning scripts
> > can be written so that, given a standard 12ET
> > sample set, any MIDI note can be assigned to
> > any pitch, with very pitch using the correct sample
> > with minimal retuning, meaning samples will
> > always be within a halfstep of original pitch,
> > meaning they will never be retuned more
> > than +/- a quartertone. Correct?
> >
> > Thanks,
> > AAH
> >
>
> Aaron,
>
> Yes, that's it. Generally, you would want to set up
> arrays in Kontakt that hold, or can be used to calculate
> a target cent value for each midi note. Since the cent
> tuning of a standard 12ET sample set is implicit, the
> guts of a script would be just a few lines of code to
> pick the closest sample, figure its retuning, and trigger
> that samples' midi note instead of the played note.
>
> - Robert
>

🔗Robert Strauss <robert@...>

4/2/2009 10:48:55 AM

--- In MakeMicroMusic@yahoogroups.com, "Aaron Andrew Hunt" <aaronhunt@...> wrote:
>
> Great; thank you, Robert.
>
> If anyone can point me to documentation of the
> Kontakt scripting language, please let me know;
> I can't find it online.
>
> Cheers,
> AAH
> ====
>
>
Aaron,

You can get the Kontakt script manual by downloading the Kontakt 3
Demo package, which is full-featured except for saving changes. The
demo has no date expiration, so you can get a good idea of
whether scripting will fit your purpose before plunking down cash.
- Robert

🔗Aaron Andrew Hunt <aaronhunt@...>

4/2/2009 12:29:40 PM

Ah, perfect (how did I miss that?)
Thanks, Robert!
Aaron
=====

--- In MakeMicroMusic@yahoogroups.com, "Robert Strauss" <robert@...> wrote:
>
> --- In MakeMicroMusic@yahoogroups.com, "Aaron Andrew Hunt" <aaronhunt@> wrote:
> >
> > Great; thank you, Robert.
> >
> > If anyone can point me to documentation of the
> > Kontakt scripting language, please let me know;
> > I can't find it online.
> >
> > Cheers,
> > AAH
> > ====
> >
> >
> Aaron,
>
> You can get the Kontakt script manual by downloading the Kontakt 3
> Demo package, which is full-featured except for saving changes. The
> demo has no date expiration, so you can get a good idea of
> whether scripting will fit your purpose before plunking down cash.
> - Robert
>

🔗Cody Hallenbeck <codyhallenbeck@...>

4/2/2009 12:51:13 PM

Hey Aaron,
I can confirm that Kontakt retunes arbitrarily large scales well using
Scala's kontakt script export function (I haven't tried the
12equalboresme script). The obvious limitation is that you can only
use 128 notes total, which is a bummer if you want to work with, say,
72EDO.

Mostly I find it frustrating to find samples that don't have heavy
vibrato. I'd really like to work with sampled strings, for example,
but they always have lots of vibrato.

On Thu, Apr 2, 2009 at 12:29 PM, Aaron Andrew Hunt <aaronhunt@...> wrote:
> Ah, perfect (how did I miss that?)
> Thanks, Robert!
> Aaron
> =====
>
> --- In MakeMicroMusic@yahoogroups.com, "Robert Strauss" <robert@...> wrote:
>>
>> --- In MakeMicroMusic@yahoogroups.com, "Aaron Andrew Hunt" <aaronhunt@>
>> wrote:
>> >
>> > Great; thank you, Robert.
>> >
>> > If anyone can point me to documentation of the
>> > Kontakt scripting language, please let me know;
>> > I can't find it online.
>> >
>> > Cheers,
>> > AAH
>> > ====
>> >
>> >
>> Aaron,
>>
>> You can get the Kontakt script manual by downloading the Kontakt 3
>> Demo package, which is full-featured except for saving changes. The
>> demo has no date expiration, so you can get a good idea of
>> whether scripting will fit your purpose before plunking down cash.
>> - Robert
>>
>
>

🔗Aaron Krister Johnson <aaron@...>

4/3/2009 12:47:49 PM

Hi (other) Aaron,

One more thing--I think the old (deprecated) soundfont opcodes
in Csound can take an arbitrary cps or oct or midinotenumber from a .sco or .csd p-field value and automagically use the correct sample within the standard MIDI note number value...i.e. the opcode sfplay I think will determine that the pitch being requested is usually handled by a certain sample under normal 12-equal usage, and will use that sample if a close-enough pitch is requested.

This might make using Csound as a soundfont engine more attractive as opposed to FluidSynth. However, for live realtime-MIDI, I think FluidSynth is more robust, and handles sustain pedal messages without dropouts and meltdowns much better, in my experience.

For non-realtime, though, I would go with using Csound for it's generality and flexibility here.

Best,
the other Aaron.

--- In MakeMicroMusic@yahoogroups.com, "Aaron Andrew Hunt" <aaronhunt@...> wrote:
>
> I have a question for anyone here using Kontakt scripts
> to retune sample libraries.
>
> When you retune in Kontakt using the scripts, does
> Kontakt choose the closest sample for each pitch, or does
> it just take whatever sample is there for the normal MIDI
> note and bend it to the pitch you have programmed for
> that MIDI note?
>
> Obviously the former gives best results while the latter
> sounds terrible unless you are just tweaking a 12 tone
> tuning.
>
> I've been recently fiddling with the FluidSynth API
> <http://fluidsynth.resonance.org/trac>
> and discovered that FluidSynth uses the latter method to
> realize their non-standard tuning tables, so everything
> sounds terrible unless you are just tweaking a 12 tone
> tuning.
>
> I don't have Kontakt, so can't find this out directly
> for Kontakt (for their also non-standard tuning tables),
> without contacting their tech support, which has not
> proven useful.
>
> Last, has anyone been able to make Gervill work on
> their PC or Mac system?
> <https://gervill.dev.java.net/>
> Unlike FluidSynth which has totally non-standard
> architecture from a MIDI point of view, Gervill is very
> well structured and it implements MTS. Check out
> the tuning example Applets at the website. I would
> also like to have this same question answered for
> Gervill from anyone who uses it.
>
> Thanks for your help.
> AAH
> =====
>