CPCWiki forum

General Category => Other retro => Topic started by: AMSDOS on 12:24, 17 April 16

Title: Programming Query: Translate Enterprise Wokstix to Locomotive BASIC
Post by: AMSDOS on 12:24, 17 April 16
Feel free to move to Programming area if you feel it's necessary.


I'm posting here because this program was written for an Enterprise Computer System, though when one looks at this code, it looks like Locomotive BASIC, until you look at the SOUND & other related statements (used in Line 30). Unfortunately I don't know Enterprise BASIC (otherwise known as EXOS BASIC), and the program was sent to CPC-Power.


I have to wonder though if something like this already exists for the Amstrad because the program itself sounds rather interesting. Otherwise does anyone know how those Sound related commands could be rewritten in Locomotive BASIC?


[attachimg=1]



Attachments Displayed Below Message Body

Title: Re: Programming Query: Translate Enterprise Wokstix to Locomotive BASIC
Post by: andycadley on 13:59, 17 April 16
It looks like the Enterprise sound command takes a pitch value, a duration, right and left volumes (between 1 and 100, always the same on both channels) and a source value which is presumably one of two channels. It shouldn't be too hard to map those onto Locomotive BASIC equivalents. Then you'd just need to replace the values that get read into the array with suitable pitches for the AY. The accompanying text tells that they are all sharps, so it's probably a reasonable assumption you start with C# and just move up the scale.
Title: Re: Programming Query: Translate Enterprise Wokstix to Locomotive BASIC
Post by: SRS on 22:20, 17 April 16
I guess @Geco (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1605) can help about that.

He's one of the Enterprise experts here.
Title: Re: Programming Query: Translate Enterprise Wokstix to Locomotive BASIC
Post by: AMSDOS on 12:52, 18 April 16
Thanks folks, I'll contact @Geco (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1605) if they haven't replied here.


Looks like the program might take some interpretation to get the same result from Locomotive BASIC. Line 30 is the one that puzzles me. I can see it would relate to our ENV command, but the semi-colon bit is confusing, and then moves onto RELEASE which I don't know if the Amstrad has, there maybe something in the Firmware which deals with Sound Release.
Title: Re: Programming Query: Translate Enterprise Wokstix to Locomotive BASIC
Post by: Geco on 19:53, 18 April 16
I think this program can be implemented quite easily into Locomotive Basic, there is no special filter, or effect usage, just simple envelopes.
In Enterprise you can define envelopes from 1-255 ( envelope 0 silent, 255 max volume)
One envelope can contain more patterns each pattern is separated by ;
Ex.
ENVELOPE NUMBER 10; 2,8,63,50;0,24,-16,100;-5,47,-39,50
contains 3 patterns , and the identifier of the envelope is 10, 2nd number is the difference from the actual sound in half tones, 3rd number gives the changes of left speaker (maximum is 63, here increase the volume from the actual volume with 8/64), 4th number is the change of right speaker (here the volume goes to the max from the actual value), 5th number is the duration in 1/50 seconds, 6th,7th,8th,9th are the same like 2nd,3rd,4th,5th.

You should create separate ENV and ENT's for reach the same effect, and as I remember well, in the envelopes in CPC the new values are stored not the changes, so some calculation is necessary to creat the same envelope in CPC.
I made the same during Sorcery+ conversion.

Here is you can find the description of SOUND and ENVELOPE commands on 108-113 pages:
http://enterprise.iko.hu/books/EnterpriseProgrammingGuide.pdf (http://enterprise.iko.hu/books/EnterpriseProgrammingGuide.pdf)

Title: Re: Programming Query: Translate Enterprise Wokstix to Locomotive BASIC
Post by: Geco on 20:00, 18 April 16
As I see the envelope in Wokstix is an easy one.
you need an ENV which increase the volume from 0 to the max in 1/50 second, then an envelop which holds the volumes on max for 10/50 sec (I guess it can be skipped, just use the sound command) and the last ENV which moves the volume to 0 in 30/50 second.
an ENT which increase tone by 2/5 half tone in 1/50 second then an ENT which decrease the tone by 2/5 half tone in 10/50 seconds, and the last part makes no effect on tone.
Title: Re: Programming Query: Translate Enterprise Wokstix to Locomotive BASIC
Post by: Geco on 20:03, 18 April 16
I forgot the release, it can cause some difficulties, if the sound is shorter than the envelope before then envelope processing will be finished at that time and play back will be continued in release phase.

The book has good description about it.
Title: Re: Programming Query: Translate Enterprise Wokstix to Locomotive BASIC
Post by: andycadley on 20:35, 18 April 16
I wouldn't worry that much about the envelope though, I suspect it's just there to add a slightly "nicer" sound to each note, probably to get something "piano-like".
Title: Re: Programming Query: Translate Enterprise Wokstix to Locomotive BASIC
Post by: AMSDOS on 03:39, 20 April 16
I wouldn't worry that much about the envelope though, I suspect it's just there to add a slightly "nicer" sound to each note, probably to get something "piano-like".


May not be a bad option since I understand the SOUND better than those ENVs & ENTs and work from there.
Title: Re: Programming Query: Translate Enterprise Wokstix to Locomotive BASIC
Post by: AMSDOS on 03:41, 20 April 16
Might also help if I download an Enterprise Emulator, any recommendations?
Title: Re: Programming Query: Translate Enterprise Wokstix to Locomotive BASIC
Post by: Geco on 09:43, 20 April 16
Might also help if I download an Enterprise Emulator, any recommendations?
My recommendation is mailto:https://sourceforge.net/projects/ep128emu/ (https://sourceforge.net/projects/ep128emu/) , this is the best EP128emu, it should be configured to be able to read a file from HDD, but if I see well you just want to type the program, and you can save it as a snapshot.
There is EP32 also, it is a quite old, but functioning well, and XEP128, it is under development.
Title: Re: Programming Query: Translate Enterprise Wokstix to Locomotive BASIC
Post by: AMSDOS on 01:27, 21 April 16
I'll give EP32 a go, my emulator computer is getting a bit old now.  ;D 
Title: Re: Programming Query: Translate Enterprise Wokstix to Locomotive BASIC
Post by: Geco on 09:35, 21 April 16
I'll give EP32 a go, my emulator computer is getting a bit old now.  ;D
EP128emu ran well on a PIII 833MHz also :D (if I remember well I used EP128emu V2 on PIII) , but sure PII or PIII was enough for EP32 , and I guess you have much newer machine ;)
Title: Re: Programming Query: Translate Enterprise Wokstix to Locomotive BASIC
Post by: AMSDOS on 03:10, 22 April 16
EP128emu ran well on a PIII 833MHz also :D (if I remember well I used EP128emu V2 on PIII) , but sure PII or PIII was enough for EP32 , and I guess you have much newer machine ;)


It's a 2005 computer running XP with Celeron processor running around 1GHz @ half a Gb.  :D
Title: Re: Programming Query: Translate Enterprise Wokstix to Locomotive BASIC
Post by: Geco on 17:25, 22 April 16

It's a 2005 computer running XP with Celeron processor running around 1GHz @ half a Gb.  :D
It should be enough for EP128Emu, and for all other 8bit machine emulators :D (java emulators excluded :D )