back to list

A benign use of a form of music, to learn to retune...

🔗Jon Szanto <JSZANTO@...>

8/11/2001 1:05:32 AM

My friends,

Help. I need somebody.
Help. Not just anybody.
Help. You know I need somebody.

I need someone who really understands retuning midi files!

I'm asking the list as a group, but I'm also asking for people like
Robert Walker, John de Laubenfels, Jacky maybe, and anyone else who
has worked with midi music construction and wants to tune synths that
don't store tuning tables.

The piece I've uploaded, a segment of something called "Gamelan Moon"
(find it in the ListMom folder), is something that I want to use as a
template for 'laying on' differing tunings to an existing piece. The
recording is about 70-80% synth, and the rest acoustic. There are
multiple tracks/layers of synth stuff, so maybe I would have to plan
either rewrites or record in layers and combine them later in a multi-
track digital recorder.

How can I take an idea, currently locked in the frozen tundra of 12-
tET, and give it freedom in a new tuning?

Help. I need somebody.

{Please note that the piece was written on spec for commercial
purposes, and is not intended as a reflection of my soul. I would
never proffer something like this as a proxy for true gamelan music
and artistry, and if anyone would want to call me out on
philosophical grounds as a dilettante, they wouldn't have an argument
from me. I'm using this as a springboard for a texture and (future)
tuning world that might evolve a similar but differing musical
style...}

Longingly yours,
White-man Szanto

🔗Robert Walker <robertwalker@...>

11/11/2001 8:34:20 AM

Hi Jon,

If you have a 12-tet midi clip already, and want
to retune it to some other tuning, using any arbitrary mapping
of midi clips to pitches, this is easy.

SCALA is the one to use if one wants to keep the
exact timings of the midi clip. Keeps quantization
so makes the midi file easy to read in sequencer, and chords may
be a bit more crisp at millisecond level, if in midi file
they are exactly simultaneous (may be relayed as not exactly
simultaneous as notes are relayed one at a time). One may be
able to hear this, especially in chord with many notes.

Only thing need to remember with SCALA is to do set/exclude 10
first to exclude the non melodic percussion channel from the mapping
- one can do a .cmd file with all the necessary instructions.
This is the one I use:

...........................
! retune.cmd
! retune in.mid using retune.scl
load retune.scl
show
set exclude 10
example/midi in.mid out.mid
...........................

Then use in SCALA as:
@retune
to retune in.mid to out.mid using the scale retune.scl

If one wants to try it out to hear what it sounds like, or play
in scale yourself (which prob. won't be to the two or three milliseconds
accuracy anyway) and hear what it sounds like, you can midi relay.
E.g. in FTS.

On the other hand, if you want to recover a midi file from a mp3 file, this
is v. challenging computationally, because the mp3 as wave recording has
lost all the original midi information used to create it. Sort of like
the difference between working with bitmaps, and with vector graphics.

So one can't expect too much from programs that claim to do
this, at present anyway.

The computer has to recognise the instruments and disentangle them all,
and this is very hard to do. It has a hard enough time finding a single
line with no accompaniment.

Finding the instruments in an mp3 recording can be compared with
tasks such as trying find the ingredients of an already baked cake, or find
the amount of tea, milk and sugar in a cup of tea, from computer
programmer's point of view.

I.e. can't be done directly, but if you know enough about the
ingredients, it might be possible to do it indirectly.

We can do such a thing when listening, and hear what are the instruments
playing, and the separate lines, but I'm sure nobody really knows how we
do it!

Computer can recognise all sorts of things in an mp3, but it
doesn't have our ready familiarity with things like the sound
of an oboe or flute, so that's why it can't pick those out.

Even recovering a single melodic line is somehwat like this
(because of the complexity of a note, the attack, changes in
timbre as it progresses, etc).

Computer is very liable to either add in extra notes, target the wrong
partial, or leave some of the notes out altogether, though progress is being
made in that.

I'm working on options in FTS to recover a single melodic line
with as much pitch accuracy as I can from a short wave recording
(for seeds for fractal tunes, but could be more generally useful).

I'm using FFT, and also a particular technique involving counting the waves directly.
It's quite promising, especially for sine waves and birdsong,
some other timbres too (recorder works pretty well if the notes aren't
too short) with varying success in terms of number
of "extra notes" it finds, or desired notes it leaves out.

I have no plans at all to try to extend that to polyphony, however,
as I expect that to be several orders of magnitude harder to do.

It's not just a question of the amount of computation involved. One
doesn't know exactly what to check for anyway, even with unlimited
computation. Though, people have ideas, and good luck to them;
hope they crack it eventually!

Robert

🔗Jonathan M. Szanto <JSZANTO@...>

8/11/2001 4:43:04 PM

Robert,

I'm sorry if I gave a wrong impression: I'd *never* try to reverse-engineer a .wav or .mp3 file into a midi file. I'd rather just replay/resequence it.

Your first couple of paragraphs seemed to answer my question, but I can see that the denser the polyphony, the more stress on the system (in terms of getting good output, and not making things ragged, rhythmically). Also, would I be correct in understanding that with synth timbres/patches that have a lot of sustain I would be letting myself in for audible 'bending' of the pitches?

I won't ask too many questions before I actually get the thing running and play with it - I'm sure basic experimentation will settle some of the issues.

Cheers,
Jon

🔗Robert Walker <robertwalker@...>

8/11/2001 10:00:55 PM

Hi Jon,

> I'm sorry if I gave a wrong impression: I'd *never* try to reverse-engineer
> a .wav or .mp3 file into a midi file. I'd rather just replay/resequence it.

I was a little surprised; didn't think you would. But, frequently
asked q. Sorry to have misunderstood too.

> Your first couple of paragraphs seemed to answer my question, but I can see
> that the denser the polyphony, the more stress on the system (in terms of
> getting good output, and not making things ragged, rhythmically). Also,
> would I be correct in understanding that with synth timbres/patches that
> have a lot of sustain I would be letting myself in for audible 'bending' of
> the pitches?

Thought I'd better do some experiments here. Of course SCALA will be best,
retuning the actual midi file. In that case, will just depend on capabilities
of the synth, as it will be sent delta times of 0 for the notes of the chord.

However, how does midi relaying do in practice?

In theory Windows has 1 ms resolution for midi relaying. However in practice
one usually sets the resolution to 2 ms because 1 ms puts a lot of stress
on Windows. (1 ms. just possibly could cause Windows to run low on system resources
and stop responding in very fast dense passages).

The actual resolution achieved can be less than that,
could easily be 4 ms per note or more. However, in practice
successive note ons on my system anyway seem to be often relayed
simultaneously, or with very short time step of 2 ms.

In fact, with 20 or more note ons, mixed with pitch bends too,
one may have, say, at most glitch of 12 ms total, or a bit over
1/100th of a sec.

It's not uncommon to have 10 or 20 consecutive midi messages
all relayed with 0 delta t, and if nothing else mixed with the
note ons, say, 20 note ons with 4 ms glitch.

So, not as bad as one might think.

So, I think what I said about raggedness doesn't really apply much except for
_very_ dense polyphony. I have had some very noticeable raggedness in the past
with fractal tunes for chords with fairly large numbers of notes, but that's
for first chord in the tune, and it is setting the patches and other things
for each channel too, so I fixed it by changing the sequence of the messages
to put all the note ons together.

As for sustain, with the midi relaying through FTS anyway, if scale requires
15 or less pitches in total (as for most octave repeating scales) then
as FTS uses a least recently used algorithm for the pitch bends, often
only one pitch bend is applied per channel in entire piece. So it often isn't
a problem.

More likely to need them if you have modulation varied as well,
etc, as that is on a per channel basis as well, so one might need new channels
for pitch bends _and_ new channs for varying amounts of modulation for each pitch bend.

Basically if at any particular time you have at most 15 or less pitch bends
in play at once (not counting octaves, as they have same pitch bend)
and all with same modulation etc., then you are okay, none of the notes
get cut off.

Or, if say at most 5 pitch bends at a time, then you can have average
of three combinations of modulation etc for each one.

If a new pitch bend is needed, FTS sends an all sound off before applying it.

Does this if any notes have been played in the channel at all since midi
out was opened as one can't set an upper bound on how long a note (e.g. harp)
might sustain after it is switched off.

Another case which takes one over the 15 channels is if you have
two simultaneous note ons with the same note number and varied
patch. As one can imagine, this could easily happen with full orchestral
piece being midi relayed, as JdL has reported on TL with some adaptive
retunings. Some soundcards / synths switch off the first note when
the second is sounded.

Depends on whether your synth supports multiple note ons for same midi note
number and channel (and varied patch) - obv. a midi clip has
to support the least common denominator. But if it is for making an
mp3, then one can go along with whatever ones synth does, and it might
be perfectly okay to have sim. note ons with same note number and varied
patch as this is sometimes supported.

With this in mind, I've just added option to FTS beta preview which one can
tick to allow multiple patches for same note and chann. I'll be uploading
it soon; prob. tomorrow as it's not quite ready tonight.

> I won't ask too many questions before I actually get the thing running and
> play with it - I'm sure basic experimentation will settle some of the issues.

Okay fine. If you wish to experiment with FTS then the latest beta preview is the
one to try for midi relaying as I gradually add more things to it. For a while
it was a bit buggy as I'd done a major overhaul of some things to do with the
midi relaying, but is pretty okay now I think. Also means if you have a bug
report or want a new option, I can fix it very easily as it is in the code
I'm actually working with at present.

Robert

🔗John A. deLaubenfels <jdl@...>

8/13/2001 4:13:02 AM

Jon, I'd be glad to give you any help I'm able to. Unfortunately, I
don't have any friendly tools to offer; my software works in batch mode,
without human interaction beyond launching it.

Certainly I _can_ help if you have any questions about how to translate
a particular tuning into a particular pitch bend, but you probably
already know how to do this (?).

Another thing I could do, if you like, is run your .mid file thru my
program, just to see if it is able to reassign channels without running
out. If it works, I could (I _think_) return a file with all new
channel assignments, ready for tuning, but not actually tuned by my
program.

I have contemplated, but have never actually done, a splitting of a
work into separate files for later recombination in the .wav world. I
do have the means for removing one or more voices from a given .mid
file, in case that helps.

Please let me know if I've understood your questions correctly and if
any of this might be helpful.

JdL

🔗Robert Walker <robertwalker@...>

8/14/2001 8:50:46 PM

Hi Jon,

I've realised that what I said wasn't quite right.

Problem is that the midi note off message has no provision
for saying which patch you want to switch off. E.g.
if you have a flute and oboe playing the same note in the
same channel, there's no way to say one wants to switch off
the flute rather than the oboe.

I suppose one could have a synth designed so that it
switches off the note for whichever patch was applied most recently,
for that note; then one could say which note to switch off by doing an extra
patch before the note off. One could design other systems too.
If any such system is used on an actual synth, I could program FTS accordingly.

HOwever, on listening to your gamelan piece, I think it is
hardly likely to run out of channels for the pitch bends.

I enjoyed listening to it. I hear 12-tet as having
something of a gamelan flavour to it anyway somehow; not sure why
as gamelans aren't equal temperament. Sort of that kind of timeless
gamelan quality about it somehow. Strange. I wonder if anyone
else feels that? (Maybe this is more a topic for spiritual_tuning).

Anyway, your piece brings out this quality nicely. Especially like
those repeating gong like descending 12-tet fifths. Might be interesting
to see what happens if they are justly intonated - subtle difference
but might be interesting to see if they make them too much points of
rest / cadential for the overall flow of the piece - I think it might.

Also enjoyed your fallen angels piece, the excerpt. Haven't
yet tried to download the complete piece.

I've added a section to the fts preview download page, which is
a draft for new help section on midi relaying with FTS.

The fts preview is up to date, and I have even added a tick box
Out | Options | Mult patches for same note and chann. Could be
useful when midi relaying if one knows that the only unison notes
begin and end simultaneously for all the instruments playing them.

http://robertinventor.tripod.com/ftsbeta.htm

Robert