Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tralala tralala

9 views
Skip to first unread message

Helmut Giese

unread,
Sep 20, 2005, 6:51:17 AM9/20/05
to
Hello ot there,
venturing into the world of music here is what I want to do:
I have several midi files, each corresponding to one voice (is that
the term? think soprano, base, etc.) of the same song. I would like to

- play all of them at the same time,
- but assign each of them specifically to either the right or left
speaker
- be able to adjust the volume for each speaker/side individually.

The idea is to have a training aid for members of a choir, e.g. a
soprano could hear her own melody on the right and the rest on the
left. Don't know if this will help but I think it's worth a try.

I'd appreciate any ideas to where to start looking.
Bye with a friendly tralala
Helmut Giese

Jeff Godfrey

unread,
Sep 20, 2005, 8:53:16 AM9/20/05
to
----- Original Message -----
From: "Helmut Giese" <hgi...@ratiosoft.com>
Newsgroups: comp.lang.tcl
Sent: Tuesday, September 20, 2005 5:51 AM
Subject: Tralala tralala


> Hello ot there,
> venturing into the world of music here is what I want to do:
> I have several midi files, each corresponding to one voice (is that
> the term? think soprano, base, etc.) of the same song. I would like to
>
> - play all of them at the same time,
> - but assign each of them specifically to either the right or left
> speaker
> - be able to adjust the volume for each speaker/side individually.
>
> The idea is to have a training aid for members of a choir, e.g. a
> soprano could hear her own melody on the right and the rest on the
> left. Don't know if this will help but I think it's worth a try.

Hi Helmut,

I assume the typical response to such a request would be "check out
Snack" - though I don't honestly know how well its abilities match your
specific requirements. I believe it can do at least some of what you want,
though I'm not sure it can read a MIDI file...

In case you don't know, you can find the Snack home page here:

http://www.speech.kth.se/snack/

Jeff


Helmut Giese

unread,
Sep 20, 2005, 9:13:24 AM9/20/05
to
On Tue, 20 Sep 2005 12:53:16 GMT, "Jeff Godfrey"
<jeff_g...@pobox.com> wrote:

>Hi Helmut,
>
>I assume the typical response to such a request would be "check out
>Snack" - though I don't honestly know how well its abilities match your
>specific requirements. I believe it can do at least some of what you want,
>though I'm not sure it can read a MIDI file...
>
>In case you don't know, you can find the Snack home page here:
>
>http://www.speech.kth.se/snack/

Thanks Jeff,
even if you consider it a 'typical response' it is a start.
Best regards
Helmut Giese

Andreas Leitgeb

unread,
Sep 20, 2005, 9:50:59 AM9/20/05
to
Helmut Giese <hgi...@ratiosoft.com> wrote:
>>In case you don't know, you can find the Snack home page here:
>>http://www.speech.kth.se/snack/
> even if you consider it a 'typical response' it is a start.

If you're more after generating MIDI-files (and have them
played by timidity or media-player or whatever), I've once done
some work in tcl on midi-files, but no really usable tool
emerged from it. just a few scripts that parse apart given
midi-files to some internal format, eventually transform it
a bit and write it back (actually using an hex2bin external
prog for simplicity, but it could surely do that in pure tcl, too.

If interested, mail me (you can even mail me in german :-)
And by tomorrow I'll try to dig the scripts out from my hd
and place them on some webserver, but again, it's just parts,
nothing complete...

PS: my task at that time was to remove single tracks from
midi-files so they would play (and still sound mostly complete)
on my mobile phone, which seems to have some low limit on
concurrent noises, or whatever.

PPS: If snack can help with midi-file-synthesis, then rather
don't waste your time with my scripts :-)

Helmut Giese

unread,
Sep 20, 2005, 10:55:06 AM9/20/05
to
On Tue, 20 Sep 2005 12:53:16 GMT, "Jeff Godfrey"
<jeff_g...@pobox.com> wrote:

>In case you don't know, you can find the Snack home page here:
>
>http://www.speech.kth.se/snack/

and going there I learned that the ActiveState distro includes snack -
so I am right back at my own hard disk.
There are even lots of examples in the demo subdir - great.
- mapChan allows to switch between left and right speaker. Great, this
should give me an idea how to feed different sources to the 2
speakers.
- fourChan sems to be an example on how to mix diferent sources. Looks
like I'm almost there.

Hm, snack doesn't support midi files :( not quite there yet.

Hunting around on the wiki I found TclMixer which supports midi files.
This tool is built around the concept of 'sound' (supposedly short
samples) and 'music' (which can be arbitraryly long).
'music' supports midi files while 'sound' does not.
TclMixer can play
- one 'music' plus several 'sounds' or
- several 'sounds'
at the same time.
However, what I need is /several/ 'music'(s) at the same time (because
I have several midi files) - not quite there yet.

But all in all it looks good - lots of pieces are already there.
We'll see how it goes.
Helmut Giese

Helmut Giese

unread,
Sep 20, 2005, 11:01:29 AM9/20/05
to
Hi Andreas,

>If you're more after generating MIDI-files (and have them
>played by timidity or media-player or whatever), I've once done
No, I get midi files and I want to sort of mix them togehter and then
play them.

>just a few scripts that parse apart given
>midi-files

Well, this sounds good. If I can parse midi files the next step would
be to feed the data into snack.

>If interested, mail me (you can even mail me in german :-)
>And by tomorrow I'll try to dig the scripts out from my hd
>and place them on some webserver, but again, it's just parts,
>nothing complete...

This would be great. Please mail them.

>PPS: If snack can help with midi-file-synthesis, then rather
> don't waste your time with my scripts :-)

snack doesn't support the midi format.
Best regards
Helmut Giese

Uwe Klein

unread,
Sep 20, 2005, 11:02:51 AM9/20/05
to
Helmut Giese wrote:
> On Tue, 20 Sep 2005 12:53:16 GMT, "Jeff Godfrey"
> at the same time.
> However, what I need is /several/ 'music'(s) at the same time (because
> I have several midi files) - not quite there yet.

You have 4 voices? 3 to one ear and the remaining to the other side?

What keeps you from mergin all voices into one file?

You have multiple choices there:
single track multiple instruments ( i.e. on different chanels )
or
multiple track single instrument


Working with midifiles try "jazz" http://www.jazzware.com/

uwe

Donal K. Fellows

unread,
Sep 20, 2005, 5:05:27 PM9/20/05
to
Helmut Giese wrote:
> No, I get midi files and I want to sort of mix them togehter and then
> play them.

The core of a midi player is available in muzic.kit (which was announced
here fairly recently) but you will need to do some assembly to build a
full MIDI player, possibly with the help of Andreas's parsing scripts.
http://wiki.tcl.tk/14652 for details.

Donal.

Andreas Leitgeb

unread,
Sep 21, 2005, 4:17:04 AM9/21/05
to

Damn, sorry, I've forgotten... tomorrow...
I've added an reminder to my phone's calendar now...

Anyway, all it does is take apart the midi-file into its tracks,
and each track into its single events with timing information.
I don't know if that helps with muzic.kit, but it may help
with generating a new midi-file that contains both tracks,
and have the system's midi-player play that.

Helmut Giese

unread,
Sep 21, 2005, 5:04:00 AM9/21/05
to
On 21 Sep 2005 08:17:04 GMT, Andreas Leitgeb
<a...@gamma.logic.tuwien.ac.at> wrote:

>Damn, sorry, I've forgotten... tomorrow...
>I've added an reminder to my phone's calendar now...

Patiently waiting ... waiting ... waiting :)

Helmut Giese

unread,
Sep 21, 2005, 5:17:26 AM9/21/05
to

Thanks Donal,
yes, I was aware of Muzic. Currently I am just doing research (in a
domain completely new to me) to find a way to achieve what I am after.
I think that Andreas's scripts will provide some insight on midi
details, I could throw my files at them and see where I can go from
there, etc.
Best regards
Helmut Giese

Helmut Giese

unread,
Sep 21, 2005, 5:44:26 AM9/21/05
to
On Tue, 20 Sep 2005 17:02:51 +0200, Uwe Klein
<uwe_klein_...@t-online.de> wrote:

>Helmut Giese wrote:
>> On Tue, 20 Sep 2005 12:53:16 GMT, "Jeff Godfrey"
>> at the same time.
>> However, what I need is /several/ 'music'(s) at the same time (because
>> I have several midi files) - not quite there yet.
>
>You have 4 voices? 3 to one ear and the remaining to the other side?
>
>What keeps you from mergin all voices into one file?

Tout au contraire: I am happy to have them separated.

Ever been in a choir? How do you learn a new song?
Of course there are those people who not only can read music (sheets)
but are actually able to sing what is written there. Me, I can
neither, and at the hobbyist level this is rather the default.

So, you listen to your voice (?) / tune (?) and try to memorize it.
But that's not enough: When in a choir people sometimes get confused
when all the rest around them is singing something different, e.g. a
tenor standing next to a strong base might have problems at a certain
part of a difficult song to stick to his tune when the base is doing
something completely different.

So this little training aide I envision would allow a singer to first
hear just his/her part to memorize it and then sort of simulate the
choir environment by mixing in the other voices at will, e.g. the
tenor might find it helpful to hear the base on his left while trying
to stick to his tune.
That's the basic idea. Don't know if it will be useful or not, but Tcl
being what it is, I am willing to invest a weekend or so to give it a
try.

>Working with midifiles try "jazz" http://www.jazzware.com/

Whow. that'll take hours just to get an overview of what this tool
makes possible.
Thanks and best regards
Helmut Giese

Uwe Klein

unread,
Sep 21, 2005, 6:34:34 AM9/21/05
to
Helmut Giese wrote:
> On Tue, 20 Sep 2005 17:02:51 +0200, Uwe Klein
> <uwe_klein_...@t-online.de> wrote:
>
>
>>Helmut Giese wrote:
>>
>>>On Tue, 20 Sep 2005 12:53:16 GMT, "Jeff Godfrey"
>>>at the same time.
>>>However, what I need is /several/ 'music'(s) at the same time (because
>>>I have several midi files) - not quite there yet.
>>
>>You have 4 voices? 3 to one ear and the remaining to the other side?
>>
>>What keeps you from mergin all voices into one file?
>
> Tout au contraire: I am happy to have them separated.
please reconsider!

>
> Ever been in a choir? How do you learn a new song?

Yes i sing once a week. We train per voice (TenorI TenorII BassI BassII)
then in permutations of 2 voices and then all voices.

> Of course there are those people who not only can read music (sheets)

I can read notes, making the proper sound is a hurdle sometimes ;-/

> but are actually able to sing what is written there. Me, I can
> neither, and at the hobbyist level this is rather the default.

another programming language to learn;-))

What i understood from your posting further up is:

you can play one Midifile and decide to which side
the different voices/devices are sent.

Now you take _1_ Midifile that has all the voices ( as chan_1, chan_2 ..
and direct the one voice you want to duplicate to one stereo side and
all other voices to the other side.


uwe

Donal K. Fellows

unread,
Sep 21, 2005, 6:48:28 AM9/21/05
to
Andreas Leitgeb wrote:
> Anyway, all it does is take apart the midi-file into its tracks,
> and each track into its single events with timing information.

Which is the sort of thing that you need to feed muzic.kit, which is
like the back-end of a MIDI player. Since you've got the front-end, it
sounds like a good thing to marry one to the other...

Donal.

Andreas Leitgeb

unread,
Sep 21, 2005, 7:46:29 AM9/21/05
to
Donal K. Fellows <donal.k...@manchester.ac.uk> wrote:

Does muzic treat a noteon with volume 0 just like a noteoff?

Btw, "tclkit muzic play" does not produce any sound on my
linux-machine :-(

It writes the following errors, but seems to try, anyway (but no luck):

fluidsynth: error: Can't set the sample rate
fluidsynth: warning: Failed to pin the sample data to RAM; swapping is possible.

Possibly, my soundcard only accepts 48000kHz :-(

MH

unread,
Sep 21, 2005, 5:07:48 PM9/21/05
to
In article <4331253a...@News.Individual.DE>,

Sounds like fun! If you get it to work, could you let us know here?
(or at least email me?)

Might be fun to play around with..

Thanks,
Mattias

jos.de...@gmail.com

unread,
Sep 22, 2005, 2:11:42 AM9/22/05
to
Hi Helmut,

I wrote a tcl lib to read, write and sequence midi files. It can als
pritn a textual representation of the midi file. I could only test it
on Windows till now and the sequencer does not yet change the rhythm of
the piece being played as stated in the midi file. I might be of some
help to merge different midi files. I you are interested, let me know
and I'll send it to you. It's to big to put on the wiki (2000 lines)
and I don't have a website where I can put it.

Kind regards,

Jos.

Helmut Giese

unread,
Sep 22, 2005, 5:17:42 AM9/22/05
to

Hi Jos,
this could be very helpful. Please mail it to
hgiese at ratiosoft dot com

Helmut Giese

unread,
Sep 22, 2005, 5:30:04 AM9/22/05
to
On Wed, 21 Sep 2005 21:07:48 +0000 (UTC),
mghe...@nyquist.uwaterloo.ca.uwaterloo.ca (MH) wrote:

>Sounds like fun!
Well, I hope so.


> If you get it to work, could you let us know here?
>(or at least email me?)

Hm, I am thinking of course to turn this into a commercial app which
will make me rich and famous, but anybody here on clt who is
interested can have a copy for free.
But then it's a bit early for any plans in this direction, having not
yet written a single line of code.
Bye
Helmut Giese

Andreas Leitgeb

unread,
Sep 22, 2005, 6:47:05 AM9/22/05
to
> Donal K. Fellows <donal.k...@manchester.ac.uk> wrote:
>>> Anyway, all it does is take apart the midi-file into its tracks,
>>> and each track into its single events with timing information.
>> Which is the sort of thing that you need to feed muzic.kit, which is
>> like the back-end of a MIDI player. Since you've got the front-end, it
>> sounds like a good thing to marry one to the other...

It's now available for playing around:

<http://avl.enemy.org/TclTk/parsers/>

Most likely, one should first have a look at the source,
just to see how to use it...

Helmut Giese

unread,
Sep 22, 2005, 10:42:48 AM9/22/05
to
On 22 Sep 2005 10:47:05 GMT, Andreas Leitgeb
<a...@gamma.logic.tuwien.ac.at> wrote:

>> Donal K. Fellows <donal.k...@manchester.ac.uk> wrote:
>>>> Anyway, all it does is take apart the midi-file into its tracks,
>>>> and each track into its single events with timing information.
>>> Which is the sort of thing that you need to feed muzic.kit, which is
>>> like the back-end of a MIDI player. Since you've got the front-end, it
>>> sounds like a good thing to marry one to the other...
>
>It's now available for playing around:
>
><http://avl.enemy.org/TclTk/parsers/>

Thanks a lot,
you saved my weekend :)

>Most likely, one should first have a look at the source,
>just to see how to use it...

Whow, that sounds like an interesting concept, never heard of it
before. :)

Thanks and bye with a friendly tralala
Helmut Giese

Steve Landers

unread,
Sep 22, 2005, 11:24:23 PM9/22/05
to
Andreas Leitgeb wrote:
> Donal K. Fellows <donal.k...@manchester.ac.uk> wrote:
>
>>Andreas Leitgeb wrote:
>>
>>>Anyway, all it does is take apart the midi-file into its tracks,
>>>and each track into its single events with timing information.
>>
>>Which is the sort of thing that you need to feed muzic.kit, which is
>>like the back-end of a MIDI player. Since you've got the front-end, it
>>sounds like a good thing to marry one to the other...
>
>
> Does muzic treat a noteon with volume 0 just like a noteoff?

yes

>
> Btw, "tclkit muzic play" does not produce any sound on my
> linux-machine :-(
>
> It writes the following errors, but seems to try, anyway (but no luck):
>
> fluidsynth: error: Can't set the sample rate
> fluidsynth: warning: Failed to pin the sample data to RAM; swapping is possible.
>
> Possibly, my soundcard only accepts 48000kHz :-(
>

Or you don't have permission to write to the sound device.

Depending on your Linux distro you might need to use a multiplexor like
artsd

Steve

--
Steve Landers Software Design Solutions
Digital Smarties st...@DigitalSmarties.com
Perth, Western Australia DigitalSmarties.com


Andreas Leitgeb

unread,
Sep 23, 2005, 6:22:59 AM9/23/05
to
Steve Landers <st...@DigitalSmarties.com> wrote:

> Andreas Leitgeb wrote:
>> Does muzic treat a noteon with volume 0 just like a noteoff?
> yes
Good thing so, then :-)
Lots of midi-files are (semantically) screwed that way.

>> Btw, "tclkit muzic play" does not produce any sound on my
>> linux-machine :-(

>> fluidsynth: error: Can't set the sample rate
>> fluidsynth: warning: Failed to pin the sample data to RAM; swapping is possible.
>> Possibly, my soundcard only accepts 48000kHz :-(
> Or you don't have permission to write to the sound device.

If that were the cause, I'd expect a more specific error-message.

> Depending on your Linux distro you might need to use a multiplexor like
> artsd

To disperse further speculation, here's an excerpt of the strace-log:
open("/dev/dsp", O_WRONLY) = 5
ioctl(5, SNDCTL_DSP_SETFRAGMENT, 0xbfffd388) = 0
ioctl(5, SNDCTL_DSP_SETFMT or SOUND_PCM_READ_BITS, 0xbfffd384) = 0
ioctl(5, SOUND_PCM_READ_CHANNELS, 0xbfffd380) = 0
ioctl(5, SNDCTL_DSP_SPEED or SOUND_PCM_READ_RATE, 0xbfffd37c) = 0
write(2, "fluidsynth: error: Can\'t set the"..., 45) = 45

furthermore, esd upon startup writes:
unsupported playback rate: 44100
Audio device open for 44.1Khz, stereo, 16bit failed
Trying 44.1Khz, 8bit stereo.
unsupported sound format: 32
Audio device open for 44.1Khz, stereo, 8bit failed
Trying 48Khz, 16bit stereo.
and esddsp muzic.kit then also gives sound...

So, the question is:
Is there a way for muzic to adapt itself to other sample-rates,
without resorting to wrappers?

Steve Landers

unread,
Sep 23, 2005, 10:46:47 PM9/23/05
to
Andreas Leitgeb wrote:

>>>Btw, "tclkit muzic play" does not produce any sound on my
>>>linux-machine :-(
>>>fluidsynth: error: Can't set the sample rate
>>>fluidsynth: warning: Failed to pin the sample data to RAM; swapping is possible.
>>>Possibly, my soundcard only accepts 48000kHz :-(
>>
>>Or you don't have permission to write to the sound device.
>
> If that were the cause, I'd expect a more specific error-message.

Fluidsynth is actually doing that lower level stuff

> To disperse further speculation, here's an excerpt of the strace-log:
> open("/dev/dsp", O_WRONLY) = 5
> ioctl(5, SNDCTL_DSP_SETFRAGMENT, 0xbfffd388) = 0
> ioctl(5, SNDCTL_DSP_SETFMT or SOUND_PCM_READ_BITS, 0xbfffd384) = 0
> ioctl(5, SOUND_PCM_READ_CHANNELS, 0xbfffd380) = 0
> ioctl(5, SNDCTL_DSP_SPEED or SOUND_PCM_READ_RATE, 0xbfffd37c) = 0
> write(2, "fluidsynth: error: Can\'t set the"..., 45) = 45
>
> furthermore, esd upon startup writes:
> unsupported playback rate: 44100
> Audio device open for 44.1Khz, stereo, 16bit failed
> Trying 44.1Khz, 8bit stereo.
> unsupported sound format: 32
> Audio device open for 44.1Khz, stereo, 8bit failed
> Trying 48Khz, 16bit stereo.
> and esddsp muzic.kit then also gives sound...
>
> So, the question is:
> Is there a way for muzic to adapt itself to other sample-rates,
> without resorting to wrappers?

No - but there could be easily. Take a look at the Muzic source - it
just calls Fluidsynth (on Linux) and follow the links to the fluidsynth
docs. It might just a matter of setting an option.

I don't have time to look into it myself, but I'm more than happy to
integrate it if you make progress

Cheers

0 new messages