Jump to content
IGNORED

A.L. sound converter


Opry99er

Recommended Posts

Mark got busy with TurboForth and such.... He has a higher calling now. :) As far as my little converter, I have the most updated code on my computer, but it's little more than a "type in XB sound values, get BYTE-formatted soundlist on your screen, choose to save to CLIP."

 

I should make a video of how it works. Tursi helped quite a bit with making the conversion formula work and adding the "CLIP" code. :)

 

If you want the most updated version of the code, let me know and I will post it here.... Pretty simple, really, and probably not what you're looking for. It's really made as an accompaniment program to Matthews XB sound player. :)

Link to comment
Share on other sites

Okay... so, here's the history here. I started writing this converter for "Honeycomb Rapture"'s music... Mark Wills was intending on helping me automate the process and create a disk-based load and save feature. Unfortunately for me (but VERY fortunately for the TI community) Willsy got tied up with Turboforth and was unable to help me out. So, the development kind of died out for a while. I am actually very glad you brought this back up, because I should really finish it. =) There isn't much to update from the previous postings... just a bypass for instructions at the beginning and a LITTLE better UI... but nothing significant. Just be careful to only input valid values, otherwise the program will crash. I will add safeguards against that today. =) For now, here's the latest update. Thanks to Mark for support and Tursi for helping develop the convert formula--- The CLIP feature is awesome. =)

 

DSK access and writability to DV80 should happen today or tomorrow... then again, we've heard THAT before. =)

CONVERT.zip

Link to comment
Share on other sites

Okay... so, here's the history here. I started writing this converter for "Honeycomb Rapture"'s music... Mark Wills was intending on helping me automate the process and create a disk-based load and save feature. Unfortunately for me (but VERY fortunately for the TI community) Willsy got tied up with Turboforth and was unable to help me out. So, the development kind of died out for a while. I am actually very glad you brought this back up, because I should really finish it. =) There isn't much to update from the previous postings... just a bypass for instructions at the beginning and a LITTLE better UI... but nothing significant. Just be careful to only input valid values, otherwise the program will crash. I will add safeguards against that today. =) For now, here's the latest update. Thanks to Mark for support and Tursi for helping develop the convert formula--- The CLIP feature is awesome. =)

 

DSK access and writability to DV80 should happen today or tomorrow... then again, we've heard THAT before. =)

 

Nice work Owen :) A long time ago, I had created an XB program called Soundgen that had a graphical interface (including mouse support for the Mechatroninc mouse!) which let you set up the parameters for the 3 sound channels and one noise channel and printed out the needed values for the CALL SOUND statement as well as played the sound. I always regretted however not including the ability of linking sounds into a playlist, something that would not have been too hard to do (I may do that at some point still :) ).

Are you considering adding the playlist feature to your program? I think it will greatly enhance its value.

Link to comment
Share on other sites

Could you expound on that a little, Vorticon? Not exactly sure what you're referring to when you say "playlist.".

 

After one is satisfied with a particular sound, it can be added to a playlist which can then be played in its entirety. This is great for short compositions or sound effects. Editing of the playlist individual componenents should also be possible.

Link to comment
Share on other sites

ahhhhhh... yes, that is precisely what I am hoping to accomplish with adding DSK access. =) It would save your XB values into the DV80 file alongside the assembly BYTE DATA... this would allow XB to pull the original sounds from disk for playing, as you suggest, in addition to setting up a soundlist like this:

 

 


BYTE 9,133,42,144,166,8,176,204,31,223,18
      BYTE 9,133,42,144,167,9,176,204,31,223,9
      BYTE 9,133,42,144,166,8,176,204,31,223,18
      BYTE 9,133,42,144,167,9,176,204,31,223,9
      BYTE 9,133,42,144,166,8,176,204,31,223,18
      BYTE 9,133,42,144,167,9,176,204,31,223,9
      BYTE 9,133,42,144,164,28,176,201,10,208,18
      BYTE 9,133,42,144,172,31,191,204,31,223,9
      BYTE 9,140,31,144,175,7,176,204,31,223,18
      BYTE 9,140,31,144,166,8,176,204,31,223,9
      BYTE 9,140,31,144,175,7,176,204,31,223,18
      BYTE 9,140,31,144,166,8,176,204,31,223,9
      BYTE 9,140,31,144,175,7,176,204,31,223,18
      BYTE 9,140,31,144,166,8,176,204,31,223,9
      BYTE 9,140,31,144,162,21,176,199,9,208,18
      BYTE 9,140,31,144,172,31,191,204,31,223,9
      BYTE 9,133,42,144,166,8,176,204,31,223,18
      BYTE 9,133,42,144,167,9,176,204,31,223,9
      BYTE 9,133,42,144,166,8,176,204,31,223,18
      BYTE 9,133,42,144,167,9,176,204,31,223,9
      BYTE 9,133,42,144,166,8,176,204,31,223,18
      BYTE 9,133,42,144,167,9,176,204,31,223,9
      BYTE 9,133,42,144,164,28,176,201,10,208,18
      BYTE 9,140,31,159,172,31,191,204,31,223,9
      BYTE 9,141,56,144,164,28,176,199,9,208,28
      BYTE 9,141,56,144,164,28,176,201,10,208,28
      BYTE 9,141,56,144,164,28,176,195,11,208,28
      BYTE 9,141,56,144,164,28,176,201,10,208,28
      BYTE 9,133,42,144,166,8,176,204,31,223,18
      BYTE 9,133,42,144,167,9,176,204,31,223,9
      BYTE 9,133,42,144,166,8,176,204,31,223,18
      BYTE 9,133,42,144,167,9,176,204,31,223,9
      BYTE 9,133,42,144,166,8,176,204,31,223,18
      BYTE 9,133,42,144,167,9,176,204,31,223,9
      BYTE 9,133,42,144,164,28,176,201,10,208,18
      BYTE 9,133,42,144,172,31,191,204,31,223,9
      BYTE 9,140,31,144,175,7,176,204,31,223,18
      BYTE 9,140,31,144,166,8,176,204,31,223,9
      BYTE 9,140,31,144,175,7,176,204,31,223,18
      BYTE 9,140,31,144,166,8,176,204,31,223,9
      BYTE 9,140,31,144,175,7,176,204,31,223,18
      BYTE 9,140,31,144,166,8,176,204,31,223,9
      BYTE 9,140,31,144,162,21,176,199,9,208,18
      BYTE 9,140,31,159,172,31,191,204,31,223,9
      BYTE 9,141,56,144,174,18,176,193,7,208,18
      BYTE 9,141,56,144,174,18,176,199,9,208,9
      BYTE 9,141,56,144,174,18,176,193,7,208,18
      BYTE 9,141,56,144,174,18,176,199,9,208,9
      BYTE 9,141,56,144,174,18,176,193,7,208,18
      BYTE 9,141,56,144,174,18,176,199,9,208,9
      BYTE 9,141,56,144,172,37,176,193,7,208,9
      BYTE 9,141,56,144,172,37,176,196,6,208,9
      BYTE 9,141,56,144,172,37,176,201,5,208,9
      BYTE 9,133,42,144,164,28,176,196,5,208,18
      BYTE 9,140,31,159,172,31,191,204,31,223,9
      BYTE 9,141,56,144,172,31,191,204,31,223,9
      BYTE 9,141,56,144,172,37,176,204,31,223,9
      BYTE 9,141,56,144,172,37,176,196,28,208,9
      BYTE 9,133,42,144,173,56,176,204,31,223,18
      BYTE 9,140,31,159,172,31,191,204,31,223,43
      BYTE >03,>9F,>BF,>DF,>00

 

 

 

This is the Honeycomb Rapture song (in its entirety) after I used the converter to convert it. =)

Link to comment
Share on other sites

Thanks for sharing the latest version.

 

I started work on a Flash version. I did the intro screen, got to the second screen and then wandered into redesign. I would keep duration, frequencies and volumes on the same screen - also for easy editing. Maybe one could choose edit, and then skip thru using enter and thus quickly make the desired changes. Also if one enters a digit, a frequency would be expected, but a letter (A thru G) would expect a note. Examples could be A3 (220Hz) and D#4 (311Hz). Also no frequency (using spaces, delete or erase) would indicate the channel to turn off (be silent). Then I also made loose designs for tracker (song), player, piano style input, music sheet notation and more. Earth calling. Let's try and do one simple thing after the other.

 

Any comments to my previously posted spreadsheet are welcome.

 

http://www.atariage.com/forums/topic/160010-music-tools/page__view__findpost__p__2002184

 

My Flash tool will be at this location. You can't really do anything right now.

 

http://sometimes.planet-99.net/vgm.html

 

:)

Link to comment
Share on other sites

Okay... so, here's the history here. I started writing this converter for "Honeycomb Rapture"'s music... Mark Wills was intending on helping me automate the process and create a disk-based load and save feature. Unfortunately for me (but VERY fortunately for the TI community) Willsy got tied up with Turboforth and was unable to help me out. So, the development kind of died out for a while. I am actually very glad you brought this back up, because I should really finish it. =) There isn't much to update from the previous postings... just a bypass for instructions at the beginning and a LITTLE better UI... but nothing significant. Just be careful to only input valid values, otherwise the program will crash. I will add safeguards against that today. =) For now, here's the latest update. Thanks to Mark for support and Tursi for helping develop the convert formula--- The CLIP feature is awesome. =)

 

DSK access and writability to DV80 should happen today or tomorrow... then again, we've heard THAT before. =)

 

Nice work Owen :) A long time ago, I had created an XB program called Soundgen that had a graphical interface (including mouse support for the Mechatroninc mouse!) which let you set up the parameters for the 3 sound channels and one noise channel and printed out the needed values for the CALL SOUND statement as well as played the sound. I always regretted however not including the ability of linking sounds into a playlist, something that would not have been too hard to do (I may do that at some point still :) ).

Are you considering adding the playlist feature to your program? I think it will greatly enhance its value.

 

I dug around and found the Soundgen program. Here it is. Docs are included.

Soundgen.zip

Link to comment
Share on other sites

Okay, so I have silently gone thru version 0.2, 0.3 and now 0.4. And there's really nothing much to do. There's the chance to review the design at this early stage, and also try out some very limited functionality. Comments are more than welcome.

 

http://sometimes.planet-99.net/vgm.html

 

I'm basically taking this threads A.L. sound converter/music loader and converting it to Flash. The colors are the same. I'm using another dedicated font. There's an intro screen. Remind me to add a fanfare. I'm leaving out instructions. I'm putting all the user inputs (duration, frequencies and volumes) into one screen. I'm allowing cursor to be moved freely around using arrow keys. Enter and Tabulator will advance to next labelled input. Other than that you can use space and delete, and enter digits.

 

Up next ...

Syntax checking and error messaging.

Assembler and clipboard output.

Allowing notes to be entered instead of frequencies.

TI Basic output and optional clipboard.

 

That should be about it. I might add a piano style input and/or simple music sheet notation. And I'll look into producing 9919 sound too. I guess it won't be able to play songs. A tracker will probably be another tool.

Link to comment
Share on other sites

I dug around and found the Soundgen program. Here it is. Docs are included.

Could we have the MOUSE file too ? :)

 

I'm afraid I can't seem to find it as I don't have the Mechatronics mouse anymore. However, I do have a Horizon mouse, and I'm thinking I could probably adapt it for that purpose. And while I'm at it I may as well implement sound lists. I haven't touched that program in 13 years, so it would fun to revamp it a bit :)

Link to comment
Share on other sites

Hi Owen

 

Just something I fell over. I know I'm nitpicking but since I'm doing ventures into sound tools and more, I/we might as well try and get things if not right then perhaps better. A typical test and debug situation is extreme values.

 

Duration

 

The duration should be changed from (0-4250) to (1-4250). A value of 0 will make your program break if you try and "play".

 

I tried a duration of 4250 and it converted into 265. That's a byte out of range (0-255). I looked at your code and you divide duration by 16. I looked in the EA manual and Intern and a more correct calculation is multiply by 6 and divide by 100. That's like dividing by 16.66666...

 

Also I tried a duration of 1 thru 15, and they converted to 0 (zero). A duration of 0 is an instruction to the player to stop operation. I don't think that's good. I suppose it's not a big issue with "simple" music, but sooner or later someone will be doing "effects" (sound or in music), and some effects tend to change in shorter time intervals.

 

;)

Edited by sometimes99er
Link to comment
Share on other sites

For some reason I have been unable to try out your program... Really strange--- can't use Patterns.swf either... Wanted to use it for some SPRITE work on Calimari Carl.

Hmmm ...

 

Requirements for "patterns" are Flash 9. Sure you're using the correct link ? http://sometimes.planet-99.net/patterns.html - I changed server some months ago.

 

Requirements for "video game music" are Flash 10 though. Try and get/update your Flash player. http://get.adobe.com/flashplayer

 

:)

Link to comment
Share on other sites

Duration

 

A duration of 0 is an instruction to the player to stop operation (=stop playing soundlist). I don't think that's good. I suppose it's not a big issue with "simple" music, but sooner or later someone will be doing "effects" (sound or in music), and some effects tend to change in shorter time intervals.

Here's how CALL SOUND does it according to the Intern book (page 166). A duration of 0 is corrected to 1. Nice of TI to trap that one. And of course the same we will/should do in our tools.

 

3550 : CALL GROM@>377D        CFI for duration
3553 : DMUL @>834A,>0006      Compute duration, *6
3557 : DDIV @>834A,>0064      divided by 100
355B : CZ   @>834B            0?
355D : BR   GROM@>3561
355F : INC  @>834B            At least 1
3561 : ST   VDP@>03E4,@>834B  Duration in sound list

:)

Link to comment
Share on other sites

CALL SOUND

 

The first parameter is duration in milliseconds. Now setting that to 1 would internally calculate to 0, and then be trapped and corrected to 1. A value of 1 in a sound list is 1/60th of a second.

 

Generally we will assume US version, and will not be dealing with 1/50th of a second which comes with European consoles.

 

Now, the TI Basic parameter may suggest, that you could have 1,000 different frequencies playing in a second, but the maximum is off course 60 frequencies a second (for one channel).

 

Note

Later we will deal with both US and European versions, so both can play (simple music) at the same speed. Also we will add custom players with ability to play more frequencies a second (detailed music) and even do so accurately (as close as we can get on the real iron).

Edited by sometimes99er
Link to comment
Share on other sites

This is great stuff, K-man. I will be updating my program as we get further along... Tursi was instrumental (no pun intended) in getting the program to output the proper BYTE data for the soundlist... I had a formula, but it was nowhere near as efficient as his. Mine was centered around producing hex data and was pretty bad. :) Tursi to the rescue again. :)

 

I have not experienced any issues with the current formula, and I have converted alot of sound using this program.... But TI Intern is pretty much the standard, isn't it? :)

 

I'm very interested in how to resolve the NTSC/PAL differences. :) I'm also very interested in including Matthew's XB soundplayer into my program here--- it will allow me to add disk access and play back the soundlist from top to bottom. :)

Link to comment
Share on other sites

Sometimes is right.. BASIC divides the millisecond count to convert it down into 60ths of a second (I don't know if it adjusts for the 1/50th second refresh in PAL?)

 

So for PAL, divide by 50 instead of 60 and you'll get the right duration. :) I don't remember the math we did, but it wasn't that complicated, was it?

Link to comment
Share on other sites

Frequency

 

Let's start out with the notes A and A#.

 

In the Editor/Assembler Manual, 20.3, page 318, the frequencies are listed as 110.00 and 116.54. The calculated frequency codes are 1017 and 960. The formula is given in 20.1.2, page 315:

 

Frequency Code = 111,860.8 / Frequency

 

The frequency code is basically what we're going to feed the sound processor.

 

111,860.8 / 110.00 = 1,016.916363...

111,860.8 / 116.54 = 959.848978...

 

Further investigation shows that TI are rounding to integer using round to nearest. The table in the EA does however not have to be the ultimate truth about desired frequency codes. Are they actually hitting the closest possible note or not. An electronic frequency counter (stroboscope) could perhaps give us the answer.

 

In Beginner's BASIC, Appendix A, page 124, the frequencies are listed as 110 and 117. Using the same formula would of course yield the same result for A, but not A#.

 

111,860.8 / 110 = 1,016.916363...

111,860.8 / 117 = 956.075213...

 

I don't know if one can distinguish 960 from 956. Going backwards we get frequencies 116.521666... and 117.009205..., and that's what you should be hearing (in theory).

 

Here's a snip from the Basic version

 

770 AFREQ1=111860.8/FREQ1
790 AFREQ1_1ST=(INT(AFREQ1)AND 15)+128
800 AFREQ1_2ND=INT(AFREQ1/16)

The rounding to integer is using round down (INT). This could be changed to round to nearest by simply adding 0.5 to the frequency and then do the round down. Like this if you want to

 

770 AFREQ1=INT(111860.8/FREQ1+.5)
790 AFREQ1_1ST=(AFREQ1 AND 15)+128
800 AFREQ1_2ND=INT(AFREQ1/16)

:)

Edited by sometimes99er
Link to comment
Share on other sites

Up next ...

Syntax checking and error messaging.

Assembler and clipboard output.

The above has been implemented. Also there's the ability to switch between decimal and hexadecimal output. Clipboard output is formatted with tabulator and linefeed.

 

Things should be in a usable state, hence version 1.0

 

http://sometimes.planet-99.net/vgm.html

 

I guess Owen's original workflow was something like

 

  1. Compose music on some instrument
  2. Bring the music down as notes on paper
  3. Bring notes into TI Basic Sound statements
  4. Test and debug
  5. Convert by hand into assembler sound list

And then the last step was automated. My tool does much the same as Owen's. It will let you enter, edit and convert, but you still can't play the sound.

 

This has not been an attempt to outdo the work done by Owen and Tursi. Thanks to them I've had more to play and compare with. Thru the process I've learned and maybe discovered a few things. The experiences with duration and frequencies are more or less documented in this thread.

 

Allowing notes to be entered instead of frequencies.

TI Basic output and optional clipboard.

I'll do the above, and mainly because they should be easy to do. Also this should make it easier for any TI programmer to go from "notes on paper" to "TI Basic Sound statements".

 

I'm not sure I will be adding the ability to play the sound. I will be working on this task though, but it might surface in another tool with different layout, design, more options etc.

 

If there are any problems, suggestions or questions, please don't hesitate.

 

:)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...