Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Amos Pro PLAY Command  (Read 5228 times)

0 Members and 1 Guest are viewing this topic.

Ronnie_ASA

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 4
  • Generic Amiga User
Amos Pro PLAY Command
« on: March 14, 2014, 06:48:35 AM »

I have AMOS Pro and the manual and was looking to exercise the old grey cells by programming a little music using the Amiga soundchip.  I have old ZX Spectrum programs with music in them and have done the conversions for AmigaBASIC and wanted to do the conversions for AMOS Pro however I am encountering a problem with the PLAY Command.

In AmigaBASIC, as with all versions of BASIC for 8-bit and 16-bit machines, one can specify the pitch and duration of a note.  With AmigaBASIC one can also define the volume and the voice.  For example, one can have a note at middle C playing for 2 seconds.  This makes it very easy to make conversions between the ZX Spectrum BEEP command and the AmigaBASIC SOUND command.

However AMOS Pro seems to be different.  Whilst you can certainly set the volume of the note (not within the parameters but as a separate line), and you can set the pitch and voice (far easier to do than in AmigaBASIC) there seems to be no way to set the duration of the note.  Notes play for little more than a beep.

Have I missed something here?  is there a way to define the duration of a note in AMOS Pro?  It would seem very odd if you cannot.
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: Amos Pro PLAY Command
« Reply #1 on: March 18, 2014, 01:54:15 PM »

Hi!

I remember the Play command on my Commodore 128.  The problems I had with it at the time were that it would tie up the CPU and the 3 voices would go out of sync with one another all the time.  If you post the string passed to the Play command, I can try to convert it into a Protracker music file suitable for use with Track Play command in Amos Pro.  Also, if you haven't installed the AMCAF extension yet, it's freeware nowadays and has more powerful music playback capabilities in its Pt Play command and so on.
Logged

Ronnie_ASA

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 4
  • Generic Amiga User
Re: Amos Pro PLAY Command
« Reply #2 on: March 19, 2014, 06:30:09 PM »

I haven't written anything yet as this has been a stumbling block.  As it is what you are saying is that something as simple as holding a note for more than a beep is beyond AMOS but not AmigaBASIC.

Guess it will be AmigaBASIC I will be using then.  I can't understand why something so simple isn't do-able in AMOS.
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: Amos Pro PLAY Command
« Reply #3 on: March 20, 2014, 03:03:39 PM »

Amos and AmosPro have a music bank format which is slightly buggy but could be fixed.  It's not the Play command you are familiar with, nor is it designed to be compatible with any earlier versions of BASIC other than maybe Stos BASIC (the Amos predecessor for Atari ST).  The Track Play command is also buggy but the string-based parsers for music are not available for Amos, which is kind of odd considering that there are such sub-languages for it called AMAL (AMos Animation Language) and another one called Interface Language for GUI building.

If you like, I could write a converter for the old Play string language that would compile them into the Amos Music bank format.  Just don't expect it done any time soon.
Logged

Ronnie_ASA

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 4
  • Generic Amiga User
Re: Amos Pro PLAY Command
« Reply #4 on: March 20, 2014, 05:06:54 PM »

Nah I will just forget using AMOS and do the conversions from old Speccy tunes to AmigaBASIC instead.  if AMOS in incapable of doing something as simple as being able to hold a note for longer than a beep then its not worth my time.
Logged

bruceuncle

  • AMOS Dev
  • A500
  • *****
  • Karma: 6
  • Offline Offline
  • Gender: Male
  • Posts: 425
  • WINUAE Amiga User
Re: Amos Pro PLAY Command
« Reply #5 on: March 20, 2014, 09:12:57 PM »

I think it's a case of RTFM  ;D .  The AMOS instructions are different and may be unfamiliar, but there's nothing much that it can't do with the Amiga's sound system.  Slogging through Section 8 of the manual and examining the examples should put you on the right track.  Also have a look at the AMOS Music Bank structure from page 14.E.08 onwards.

Have a look at AMOSPro_Examples:Examples/H-7/Help_76.AMOS for a working demo  of how to use it.  (Or just press [Help] over the Play instruction in a program and the option to load that example is in the help window.)

My first project with AMOS many, many years ago was a full music editor for creating banks in the AMOS format (now lost in the mists of time and an unfortunate flood at a mates garage).  There was nothing I couldn't do with it including resampling and playing the notes as they were drawn on screen.

Persist with learning the "AMOS way" and you'll find it very rich and powerful - just different!

Converting old Commodore Play string formats shouldn't be too difficult.  That's what programming's all about  ;)  Good luck with it all.
Logged
Repeat after me ...  "The AMOS Pro architecture is complex but it is not complicated."

bruceuncle

  • AMOS Dev
  • A500
  • *****
  • Karma: 6
  • Offline Offline
  • Gender: Male
  • Posts: 425
  • WINUAE Amiga User
Re: Amos Pro PLAY Command
« Reply #6 on: March 20, 2014, 09:24:58 PM »

Extending a note:

Code: [Select]
Rem  Wave 1 is the built-in sine wave
Rem  Use a string to set any other waveforms of your own design
Rem  This just plays the sine wave for 2 seconds tapering to half volume
Wave 1 To 1 : Rem Set the channel
Set Envel 1,3 To 200,32 : Rem Set duration as 2 seconds tapering to half volume
Play 1,200 : Rem Play for 2 seconds
Edit
Logged
Repeat after me ...  "The AMOS Pro architecture is complex but it is not complicated."

Ronnie_ASA

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 4
  • Generic Amiga User
Re: Amos Pro PLAY Command
« Reply #7 on: March 24, 2014, 06:06:50 PM »

Clearly I dont understand this.  I've read through the AMOS Pro manual and at no point does it mention any way of setting the duration for a note generated by the AMiga's own chip.  I'm not talking about samples or anything 3rd party, just the Amiga's own soundchip which with AMIGABasic you can set the duration of a note which having read through AMOS' manual several times, seems impossible to do without at least some overly complicated programming which quite frankly shouldnt be necessary for something so relatively simple, especially as it can be done relatively simply on AMIGABasic.
Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: Amos Pro PLAY Command
« Reply #8 on: March 24, 2014, 06:52:47 PM »


well bruceuncle has given plenty of guidance that makes perfect sense.

Lets have a look back at the manual...

http://www.ultimateamiga.co.uk/HostedProjects/AMOSFactory/AMOSProManual/8/804.html

You've see that the Play command relies on setting up a 'wave' - this is not uncommon for BASIC, i believe the ZX Spectrum does something very similar (and therefore anything with the AY-8910 chip will likely need to be set up the same way - i'd be surprised if SID wasnt the same)

Quote
SET ENVEL
instruction: create a volume envelope
Set Envel wave number,phase number To duration,volume

AMOS Professional uses envelopes to change your original wave forms according to a set pattern. The parameters are as follows:

The wave number sets the wave form to be affected, and any number can be used including the pre-set wave numbers zero and 1.

The phase number refers to one of seven individual sections of the original wave form that is to be defined, ranging from 0 to 6.

The duration controls the length of this particular segment (phase number) of the wave form, and is expressed in units of one 50th of a second. This is how the speed of a volume change in any phase of the wave form is controlled.

Volume specifies the volume to be reached by the end of this phase, ranging from zero for silence up to 63 for full blast.

I believe the section in bold is the bit you are missing. (which follows on a couple of pages later) All you need to do is adjust this parameter for each note with a different duration.


If you are adamant that you prefer AmigaBasic's simple PLAY command, sure , stick with that, but complaining because AMOS is offering you a more powerful and controllable option, and that it is "not worth my time" when you are bypassing much of what is documented, seems... well ... strange.
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Pages: [1]   Go Up
 

TinyPortal 2.2.2 © 2005-2022