back to list

Using a Midi Keyboard to Play Computer Genterated Tuning Files

🔗joshuamcullen <joshuamcullen@yahoo.com>

5/13/2005 1:48:26 PM

Hello,
I have seen lots of software for creating tuning files in various
formats such as C-sound, Scala, and Max's Magic Microtuner, but I am
not sure how to use my keyboard to trigger the sounds or utilize the
information in the tables. I have a midi connection but I am not sure
where to go from there. Is there some type of software environment
seperate from these progams that you need in order for your keyboard
to access these file formats. I have a yamaha P-80. If you anyone has
any recomendations I would greatly appreiciate it. Thanks.
-Joshua Cullen

🔗Jon Szanto <jszanto@cox.net>

5/13/2005 11:19:47 PM

--- In tuning@yahoogroups.com, "joshuamcullen" <joshuamcullen@y...> wrote:
> I have seen lots of software for creating tuning files in various
> formats such as C-sound, Scala, and Max's Magic Microtuner, but I am
> not sure how to use my keyboard to trigger the sounds or utilize the
> information in the tables. I have a midi connection but I am not sure
> where to go from there.

If you have a midi connection and Scala, you are set to go. You load a
tuning into Scala (or create a new one) and then under "Tools" you
select the option to relay midi. The dialogue will give you a few
choices and confirmations, and then there is an option to "Start
relaying". Scala will then watch for note inputs from the midi port,
and use pitch bends on the internal synth patches utilizing your
soundcard.

This isn't the *optimal* way to make microtonal music by any means
(for one thing, there is a fair amount of latency), but it certainly
give you the ability to hear tunings with the setup you have.

One caveat: you mention Max's Magic Microtuner, and I'm pretty sure
that is a Mac-platform-only program. The above info I wrote concerns
my setup on a Windows XP DAW. It is always very important to give us
information about your operating system of choice when asking software
questions.

HTH,
Jon

🔗Guglielmo <gugliel@guglielmomusic.com>

5/14/2005 9:53:43 AM

Another caveat relating to the use of tuning and midi -- the SOUNDS themselves, whether synthesized or sampled, are often not perfectly tuned to equal temperament. Sometimes, in fact, they are badly out of tune, or they fluctuate. Beware!

Jon Szanto wrote:
> > If you have a midi connection and Scala, you are set to go. You load a
> tuning into Scala (or create a new one) and then under "Tools" you
> select the option to relay midi. The dialogue will give you a few
> choices and confirmations, and then there is an option to "Start
> relaying". Scala will then watch for note inputs from the midi port,
> and use pitch bends on the internal synth patches utilizing your
> soundcard.
> > This isn't the *optimal* way to make microtonal music by any means
> (for one thing, there is a fair amount of latency), but it certainly
> give you the ability to hear tunings with the setup you have.
> > One caveat: you mention Max's Magic Microtuner, and I'm pretty sure
> that is a Mac-platform-only program. The above info I wrote concerns
> my setup on a Windows XP DAW. It is always very important to give us
> information about your operating system of choice when asking software
> questions.
> > HTH,
> Jon
> > > > > > You can configure your subscription by sending an empty email to one
> of these addresses (from the address at which you receive the list):
> tuning-subscribe@yahoogroups.com - join the tuning group.
> tuning-unsubscribe@yahoogroups.com - leave the group.
> tuning-nomail@yahoogroups.com - turn off mail from the group.
> tuning-digest@yahoogroups.com - set group to send daily digests.
> tuning-normal@yahoogroups.com - set group to send individual emails.
> tuning-help@yahoogroups.com - receive general help information.
> > Yahoo! Groups Links
> > > > > > >

🔗Robert Walker <robertwalker@ntlworld.com>

5/15/2005 8:21:05 PM

Hi Jon and Guglielmo,

> Another caveat relating to the use of tuning and midi -- the SOUNDS
> themselves, whether synthesized or sampled, are often not perfectly
> tuned to equal temperament. Sometimes, in fact, they are badly out of
> tune, or they fluctuate. Beware!

Jon Szanto wrote:
>
> If you have a midi connection and Scala, you are set to go. You load a
> tuning into Scala (or create a new one) and then under "Tools" you
> select the option to relay midi. The dialogue will give you a few
> choices and confirmations, and then there is an option to "Start
> relaying". Scala will then watch for note inputs from the midi port,
> and use pitch bends on the internal synth patches utilizing your
> soundcard.
>
> This isn't the *optimal* way to make microtonal music by any means
> (for one thing, there is a fair amount of latency), but it certainly
> give you the ability to hear tunings with the setup you have.
>
> One caveat: you mention Max's Magic Microtuner, and I'm pretty sure
> that is a Mac-platform-only program. The above info I wrote concerns
> my setup on a Windows XP DAW. It is always very important to give us
> information about your operating system of choice when asking software
> questions.
>

Just to say, both are addressable. You may be able to reduce the latency by
changing the settings for DirectSound buffers - normally you can get it down
to about 20 ms latency or thereabouts which is tolerable for playing
- you can still play crisp chords, it is just that all the notes
are delayed by a fixed amount. You can reduce it much further by
using Asio which gets it down to a millisecond or so - assuming
your synth recognises it. That feels like no latency at all to
many people. I don't notice anything at all when playing
keyboard at that level of latency.

It corresponds to the time it takes for sound
to travel a foot. So if you play e.g. a marimba which is
say a metre across, and the notes are exactly in time as you
face it, a listener to your side will hear them staggered
by 3 ms. which will help put it in perspective.

Or to put it another way - if you go to a live performance
of an orchestra and you are able to sit to one side, or
if the conductor is standing near to the orchestra rather
than in the middle of the audience, then you would expect
to get differences in synchronisation of probably a few ms.

Here is a picture of a much simplified concert
with a an orchestra with conductor
and audience, and we suppose the
conductor has just conducted them in a chord which is
exactly in time to his ears:

Orchestra

left ...........
. . .
3m . .
. . .
centre 3m conductor 3m audience
.
3m
.
right

Where that is meant to be a triangular grid
just to simplify the calculation

Then the distance from the conductor to them
- lets say the back seats are arranged at equal
distance from the conductor - is the same.

For the audience, the left of the orchestra
is at a distance of 6*sqrt(3)/2 metres, or about
5.2 metres, and the centre is at a distance of
six metres, a difference in travel time of
a couple of milliseconds or so.

Someone right in the middle but
well at the back of the audience will
hear a difference of over a metre of
travel distance for the instrumentalists
at the edge of the orchestra - or 3 ms.

If someone listens from the side
then the difference will be quite a bit more
too - in this case, about
30 ms (ten metres travel difference).
That I suppose might be quite noticeable
for those particularly sensitive to
timings - three hundredths of a second.
Perhaps there is something to be said
for asking orchestra players to sit close
together to help side listeners...
Or if somehow it could be underwater ...
- sound travels far faster underwater :-).

Of course this all depends on the size of the
orchestra and the layout, but it gives a very rough
idea. And if recorded to CD it could presumably be synchronised
to the same exactness as the notes are heard by the conductor.

As for the latency in Scala - that should be almost nonexistent
unless you have an old and very slow computer (perhaps
100 MhZ or so, though I haven't tested that).

Soundcard midi synths can be strange sometimes
when it comes to latency. I've got one on my laptop
that normally works with fairly little in the way of latency but
now and again for no apparent reason starts acting
up and giving you quite a lot, maybe a half second or so of latency.
Closing the midi out and opening it again fixes
it - just for that partiular midi synth on the
soundcard, not for any other
device that I'm playing it on at the time.

Just sending notes through a midi cable gives a
transmission delay because of the time it takes
notes to go through the cable. But fairly small,
a third of a millisecond per note if the keyboard
uses running status. However if you have a dense
chord of say 10 notes, that could take 3 ms
to transmit through the midi cable, corresponding
to the same latency as that 1 meter marimba
listened to from the side, except that it is
a transmission delay which is a bit different,
means that the notes become ragged by that amount
rather than uniformly delayed. But it is ragged
by the same amount as the chords on the marimba
as heard from the side.

If midi cable transmission is a factor, you can fix that by
using USB midi which has a far faster transmission
rate.

Transmission of midi signals from program
to program within a single computer is very fast
(and doesn't seem to depend on the midi signal size
- a big sysex takes the same time as a note on).

Then for the actual relaying through SCALA,
I have an option in FTS which lets me measure
the transmission rate for other programs and on my
new laptop SCALA relays 10 note ons in 3 ms
and 10 note offs in 5 ms.

It takes 1 and 2 ms respectively
to transmit the 10 notes through the loopback
and back. So that means it is 0.2 ms per note
for the note ons and 0.3 ms per note for the
note offs approximately for the extra transmission
delay in SCALA because of whatever internal
processing it does for the retuning. It wasn't
that much different on my old 400 Mhz computer
actually, so probably some of that isn't so
much what SCALA is doing as some kind of extra
overhead somewhere maybe just due to
relaying the notes around using the midi
methods SCALA uses - probably the loopback
is coded in some low level way to
get its transmission rate so very high.

My older p.c. at 400 Mhz has rather slower
transmission rate but it is still only of about the order
of transmission through a midi cable and not
what most would consider very significant.

So if you get latency problems it is almost certainly
going to be due to your soundcard or soft synth or cabling
rather than SCALA, I'd have thought.

To make sure that you know where the latency is happening,
use a very simple setup - just relay directly from your
midi keyboard into SCALA, and select whatever is your least
latency output. Compare it with relaying your same midi keyboard
through your normal sequencer. If both have high latency
you need ot work on improving the latency of your system
perhaps by getting another soundcard or by updating
its drivers, or using Asio drivers.

As for the sounds, they are often measurably quite a bit out of tune indeed
on the cents level if you want them exact to say the nearest
cent. Particularly wave table ones. Also even if reasonably
in tune, they may beat because of the looping artefacts.
Also they often have a fair bit of residual vibrato, just
a small amount. So if your soundfont voices beat wildly
in just intonaton chords, it may be that they are reasonably
in tune but that individual notes all have a bit of
vibrato.

Anyway that is addressable too.
If the main focus is the tuning, then try a good FM synth.
I use the FM7 soft synth and its tuning is very exact indeed
in my measurments, a tiny fraction of a cent. A good FM
soft synth shouldn't have any tuning problems. Though
it may be tricky to use it with pitch polyphony as
we desire since they are often locked into the
equal tempered model or have few tunings available
to use. In the case of the FM7 there are some example
tunings and you can adjust the 12-t tuning yourself too,
or you can use MTS sysexes (a bit more tricky).

The Midicode synth is also worth looking at for
voices that help one to hear just intonation chords
if that is ones main aim.

Or you use a hardware synth and find out how to tune
it to the desired tuning using SCALA.

Or you can try a very simple sound font, make your own, to reduce the
amount of work involved, you can use only
a few samples, as few as you are permitted to use,
and make sure they are all perfectly in tune.

I'm working on some other things for next release of
FTS 3.0 - mainly support of CSound in real time
via instruments retuned and played in CSoundAV
in real time.

If one finds out that the latency is in the
soundcard, then one can get any soft synth or
sampler that can deal with Asio. I've been
using Virtual Sampler (VSampler) on my
laptop and it works fine and uses Asio
- and can play Gigs and sound fonts.

If one wants to get Asio for a soundcard,
and the one you have doesn't support it,
I've discovered that someone has at last
sused it out - the Asio4All driver
actually works and gives Asio type
latency levels playing a Giga
file via Virtual Sampler
on my very ordinary laptop!
So it probably will work on most -
I didn't get this laptop for its
soundcard at all, it is just whatever
an entry level type laptop gets
supplied with nowadays.

http://www.asio4all.com/

I'm testing Scala right now with
a keyboard connected to my laptop
via usb midi and with Virtual Sampler
playing a gig file,
using that Asio driver. I'd
say it is instant. Anyway for anyone
who has noticed any latency in their
setup, I'd say try
a setup like that first and see
if you notice anything with
the latency removed as far as
possible from the other stages
of the relaying process.

BTW you can get the VSampler
for a free 30 day trial and then
at the end of that can go on
testing it except that it plays
a tone on top of your playing
every so often when it is in
demo mode at the end of the trial.
Robert

🔗Robert Walker <robertwalker@ntlworld.com>

5/15/2005 8:57:46 PM

Hi there,

Sorry of course the difference in travel time
for the sideways listener in that orchestra
diagram should be about 5 metres or about
15 ms.

Robert

🔗Jon Szanto <jszanto@cox.net>

5/15/2005 9:03:06 PM

Robert!!!

My God, man, can't you write a short and concise post?????? How in the
world can one respond to all that???????

:)

Oh, but I've come to know and love you, so I'll just ignore most of it
and do the best I can...

--- In tuning@yahoogroups.com, "Robert Walker" <robertwalker@n...> wrote:
> Just to say, both are addressable. You may be able to reduce the
latency by
> changing the settings for DirectSound buffers - normally you can get
it down
> to about 20 ms latency or thereabouts which is tolerable for playing
> - you can still play crisp chords, it is just that all the notes
> are delayed by a fixed amount. You can reduce it much further by
> using Asio which gets it down to a millisecond or so - assuming
> your synth recognises it. That feels like no latency at all to
> many people. I don't notice anything at all when playing
> keyboard at that level of latency.

Robert, if I'm not mistaken, Scala doesn't have any ASIO setting, but
that doesn't matter: Scala is only using my internal soundcard, which
I *never* use for real music making. Are the DirectSound buffers going
to affect sound settings in other programs?

> Or to put it another way - if you go to a live performance
> of an orchestra and you are able to sit to one side, or
> if the conductor is standing near to the orchestra rather
> than in the middle of the audience, then you would expect
> to get differences in synchronisation of probably a few ms.

Don't forget, one of the people you are speaking to has been standing
inside an orchestra for 30 years. And I hasten to add that -
especially for those of us in the back - we have learned and are
required to play measurably ahead of what we see (and, to a certain
extent, *hear*) so that our sounds meet at the podium at the same time
as the concertmaster's (or "leader", in your land...). We personally
have to account for the distance.

> As for the latency in Scala - that should be almost nonexistent
> unless you have an old and very slow computer (perhaps
> 100 MhZ or so, though I haven't tested that).

Wrong - 3.0 Ghz, 1 gig ram, completely optimised for music-only
applications (i.e. very, very little overhead in terms of services
running, etc.). I can assure you that the latency is far greater than
in any of my hosts (Sonar, Chainer, Audiomulch).

> Just sending notes through a midi cable gives a
> transmission delay because of the time it takes
> notes to go through the cable. But fairly small,
> a third of a millisecond per note if the keyboard
> uses running status. However if you have a dense
> chord of say 10 notes, that could take 3 ms
> to transmit through the midi cable, corresponding
> to the same latency as that 1 meter marimba
> listened to from the side, except that it is
> a transmission delay which is a bit different,
> means that the notes become ragged by that amount
> rather than uniformly delayed. But it is ragged
> by the same amount as the chords on the marimba
> as heard from the side.

I'm sorry, but you are ruminating in extreme complexity! A simple
keyboard input, via USB, right into the computer should be able to
create a sound from the card almost instantaneously. I believe there
are either settings that *might* help, or the relay function in Scala
(i.e. channel-splitting, allocating, and sending pitch bends) isn't
efficient.

> So if you get latency problems it is almost certainly
> going to be due to your soundcard or soft synth or cabling
> rather than SCALA, I'd have thought.

Well, I don't get it then. I can play the soundcard through any other
host, in realtime, and get virtually no latency. It is only on Scala.
Anyhow, I don't think anyone would attempt to really do a lot of music
making this way - it was simply a suggestion that if one has a
keyboard and Scala (and soundcard, which seems common on most all
systems), they already have the tools to be able to hear these tunings.

Hope all is well with you these days, you've been somewhat quiet of late!!

Cheers,
Jon