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

Electric Duet

148 views
Skip to first unread message

Vladimir Ivanov

unread,
Jun 19, 2012, 7:09:22 AM6/19/12
to

There was a recent post on csa2:

> Also, how about an 'Electric Duet' player which could allow us to play
> the tweedy two-voice music we've collectected and composed over the
> years on other platforms? Perhaps extract to .WAV format and finally
> hear them in 16-bit glory?

I have done this circa year 2000 - small program that converts "Electric
Duet" files into stereo WAV by synthesizing harpsichord-like sound. They
sound rather nice.

What is the best ELD collection to try it on?

Antoine Vignau

unread,
Jun 19, 2012, 12:37:44 PM6/19/12
to
Hello Vlad,
Why don't you try it with Drift by Krüe ?
antoine

Vladimir Ivanov

unread,
Jun 19, 2012, 12:44:20 PM6/19/12
to
Replying to myself. Grabbed some images off Asimov and here's the result:

http://softjunk.org/sw/apple2/eld/


Notes:

1. The funny names are because I used CiderPress to extract the data
files, then batch convert to WAV to MP3.

2. Voice commands are not supported.

3. Due to hardware limits Electric Duet player has bounds on pitch
accuracy. I have tried to increase it wherever possible, but there are
still few places that sound slightly out of tune.

Enjoy!

Vladimir Ivanov

unread,
Jun 19, 2012, 4:06:41 PM6/19/12
to

On Tue, 19 Jun 2012, Antoine Vignau wrote:

> Why don't you try it with Drift by Krüe ?

Done.

http://softjunk.org/sw/apple2/eld/

Antoine Vignau

unread,
Jun 20, 2012, 12:55:33 AM6/20/12
to
Your conversions are great, that rocks!!!!!!!!!! YYYeeeeeaaaahhhhhh,
congratulations Vlad.

Will you make your SW available to the community?
antoine
Message has been deleted

Marc S Ressl

unread,
Jun 20, 2012, 11:25:03 AM6/20/12
to
Hello Vlad: excellent work :-)

My two cents: do you think you can make it output MIDI? With this library
for example: http://www.krizka.net/projects/libmidi/ ?

;-)

With the best wishes,

Marc.-

Vladimir Ivanov

unread,
Jun 20, 2012, 12:48:48 PM6/20/12
to

On Tue, 19 Jun 2012, Antoine Vignau wrote:

> congratulations Vlad.

Thank you, Noble Sir Toto.

> Will you make your SW available to the community?

Sure. Here is the player source and some random (although I'd prefer much
bigger and better) collection of tunes:

http://softjunk.org/sw/apple2/eld/eldplay.zip


The player is ANSI C, single small file, converting from stdin to stdout.
Example:

eldplay < electric_duet_file > file.wav


Two versions are provided.

"eldplay-oot.c" - the Out of Tune version, which uses same limited pitches
as in Electric Duet. Keen observers may have noticed that some high notes
are actually the same pitch because of insufficient accuracy.

"eldplay.c" - notes are translated to more precise equal-tempered scale,
sounds nicer.


Some history on this - I originally made it to be eventually included as
an Easter egg into a commercial product. In the end, I put a full featured
MOD player.


Last but not least - my personal respect to Paul Lutus. Electric Duet and
GraFORTH were part of my inspiration while growing as a kid.

Vladimir Ivanov

unread,
Jun 20, 2012, 1:25:36 PM6/20/12
to

Hey Marc,

On Wed, 20 Jun 2012, Marc S Ressl wrote:

> Hello Vlad: excellent work :-)

Thank you.

Check the source, I resisted the temptation to pack it into an
IOCCC-alike entry, given the extreme small size.

> My two cents: do you think you can make it output MIDI? With this library
> for example: http://www.krizka.net/projects/libmidi/ ?

Yes and no. :-)

No, because I don't speak C++.

Yes, because I dealt with MIDI parsing at a time and there is no problem
outputting MIDI stream. What do you have in mind? Time is my real limiting
factor for some time now.

BTW, you could probably do it in less than an hour with that said library.
Electric Duet format is simple:

1) three byte records

2) byte0 is duration, except if equal to 0 or 1

3) byte1 is note1 and byte2 is note2

4) byte0=0 is end of tune

5) byte0=1 is "voice" command, which changes timbre (by changing duty
ratio)

6) tables for duration and note periods are included in Electric Duet
itself

Lisias

unread,
Jul 7, 2012, 9:22:35 AM7/7/12
to
Hi, Vladimir.

Nice job, thank you.

I downloaded the source to play a bit, but didn't managed to build a
functional binary. My binary generated waves that looks like a bar graph
or the Manhattan Skyline : a long series of single phased rectangular
waves (I checked it out with Audacity).

I think it's something on my compiling environment, I'm using WinXP,
mingw and gcc 4.6.2.

Could you inform, please, the environment you used to successfully build
your binaries?

Regards,
--
Lisias

Vladimir Ivanov

unread,
Jul 8, 2012, 4:21:32 PM7/8/12
to

Hi Lisias,

On Sat, 7 Jul 2012, Lisias wrote:

> Nice job, thank you.

Just a quick hack done in the dark ages, recently revived.

> I downloaded the source to play a bit, but didn't managed to build a
> functional binary. My binary generated waves that looks like a bar graph
> or the Manhattan Skyline : a long series of single phased rectangular
> waves (I checked it out with Audacity).
>
> I think it's something on my compiling environment, I'm using WinXP, mingw
> and gcc 4.6.2.

Is it 32 or 64-bit? I am not sure it is 64-bit safe, mostly the excite()
function.

> Could you inform, please, the environment you used to successfully build
> your binaries?

Linux 32-bit, gcc 4.4.5 on this particular machine, but that shouldn't
matter.


It has been reworked a bit. There was a bug where the table of the notes
(periods) was transposed from A to E, and the tempo was faster by about
14%. Also added option to dump the tune in text format and option to play
with rectangular waveforms, both very similar to Electric Duet.

I will soon release the updated version, just a matter of spare time.

-- Vlad

Lisias

unread,
Jul 10, 2012, 5:27:30 PM7/10/12
to
On 8/7/2012 17:21, Vladimir Ivanov wrote:
>
> Hi Lisias,
>
> On Sat, 7 Jul 2012, Lisias wrote:
>
>> Nice job, thank you.
>
> Just a quick hack done in the dark ages, recently revived.

Nice hack! :-)


>> [about eldplay generating squared trash and not sound]
>>
>> I think it's something on my compiling environment, I'm using WinXP,
>> mingw and gcc 4.6.2.
>
> Is it 32 or 64-bit? I am not sure it is 64-bit safe, mostly the excite()
> function.

32 bits.

To be sure, I did a printf on stderr with sizeof(n) on the excite
function, and the result is 4.



>> Could you inform, please, the environment you used to successfully
>> build your binaries?
>
> Linux 32-bit, gcc 4.4.5 on this particular machine, but that shouldn't
> matter.

I agree, but so something else should matters ( me included! :-P ).

I converted M.AIR using "my" eldplay and compared with the one I
downloaded from http://softjunk.org/sw/apple2/eld/.

Well, my one uses 24 Megabytes, while yours, just 2M. It's funny, but I
just though on doing this now. =]

Perhaps we're dealing with some endianess problem? Your machine is i386?

Regards,
--
Lisias

Vladimir Ivanov

unread,
Jul 11, 2012, 4:38:33 AM7/11/12
to

On Tue, 10 Jul 2012, Lisias wrote:

> 32 bits.

Guess it should be library problem then. Perhaps redirection of
stdin/stdout, perhaps not, but should be easy to catch.

> I agree, but so something else should matters ( me included! :-P ).

Could you please drop me an email so we look into it? You'd get to test
the newer version that has rectangular waveform output and print options.

> I converted M.AIR using "my" eldplay and compared with the one I downloaded
> from http://softjunk.org/sw/apple2/eld/.
>
> Well, my one uses 24 Megabytes, while yours, just 2M. It's funny, but I just
> though on doing this now. =]

Perfectly normal, since the website has MP3 files for bandwidth reasons.
They have misleading ".wav" in the middle of the name, but that's because
of batch conversion of:

M.xxx -> M.xxx.wav -> M.xxx.wav.mp3

Things done in a hurry.

> Perhaps we're dealing with some endianess problem? Your machine is i386?

Yes, i386. Talking about portability, I think:
- at least excite() is not 64-bit safe (the shift constant)
- it won't work on big-endian, because PCM data in WAV needs to be LE
- it should be alignment safe (no misaligned data accesses)

It is just a small toy program. I cheated shamelessly even on the WAV
header. :-)
0 new messages