Jump to content

Photo

Sound list ripper


110 replies to this topic

#51 Asmusr OFFLINE  

Asmusr

    River Patroller

  • Topic Starter
  • 2,494 posts
  • Location:Denmark

Posted Mon Dec 1, 2014 8:31 AM

Since upgrading to Java 7 R71, I have found that the last row of a sound list will get stuck playing continuously and I am unable to stop it or start another sound.  Oddly, it seems to affect only some imported lists and not others, but repeatedly.

 

Sounds like an issue I fixed in the latest version, see post #1.



#52 OLD CS1 OFFLINE  

OLD CS1

    River Patroller

  • 4,060 posts
  • Technology Samurai
  • Location:Tallahassee, FL

Posted Mon Dec 1, 2014 9:02 AM

Ja, I did not see that update.  Thanks, again.



#53 OLD CS1 OFFLINE  

OLD CS1

    River Patroller

  • 4,060 posts
  • Technology Samurai
  • Location:Tallahassee, FL

Posted Thu Dec 4, 2014 2:03 AM

Playing around tonight with SLR.  I have couple of questions/requests:

 

1) Copy and paste: it appears you are just using a pointer and number of rows when CTRL-C is hit, as if I make a "template" section and copy it, then make changes to that section, when I paste the section with the changes gets pasted.  Am I right?  Is it possible to have a copy which actually copies so I can use the clipboard as a template?

 

2) Can an option to show row numbers be put in?

 

3) Can an option to remove a single list from the display be added?



#54 OLD CS1 OFFLINE  

OLD CS1

    River Patroller

  • 4,060 posts
  • Technology Samurai
  • Location:Tallahassee, FL

Posted Fri Dec 5, 2014 9:31 AM

I have been actually taking a little bit of an intellectual break from Arkanoid and got a wild hair.  I transcribed* the opening theme of the Commodore 64 game Trolls and Tribulations, "March of the Trolls."  Of course, the TI does not go low enough for the bass line so I took some license there (amongst a couple of other places which are virtually imperceptable unless you are Cylon.)

 

This is a raw binary export from SLR so you will import it to play.

 

* Using the original SID, I used a program called SID2MIDIw which can export a SID to MIDI or text.  The text is in a tracker format with 1/60th second intervals.  Pretty handy.  At some point I would like to create a SID-to-Sound List converter.  Later.  Much later.

 

Edit: Removed some redundant tone values, and fixed several one-off values which were calculated incorrectly in my spreadsheet.

Attached Files



#55 OLD CS1 OFFLINE  

OLD CS1

    River Patroller

  • 4,060 posts
  • Technology Samurai
  • Location:Tallahassee, FL

Posted Sat Dec 13, 2014 10:31 PM

Rasmus, is there source for SLR?  I was thinking tonight about making a modification to knock the sound table down two octaves to emulate the F18A's GROMCLK setting.



#56 Asmusr OFFLINE  

Asmusr

    River Patroller

  • Topic Starter
  • 2,494 posts
  • Location:Denmark

Posted Sun Dec 14, 2014 1:46 AM

Rasmus, is there source for SLR?  I was thinking tonight about making a modification to knock the sound table down two octaves to emulate the F18A's GROMCLK setting.

 
Here you are. You can set the clock in the call to the constructor of the SN76489.

 

    /**
     *  Init SN76496 to Default Values.
     *  
     *  @param clockSpeed    Clock Speed (Hz)
     *  @param sampleRate    Sample Rate (Hz)
     */


    public void init(int clockSpeed, int sampleRate)
    {
        // Master clock divided by 16 to get internal clock
        // e.g. 3579545 / 16 / 44100 = 5
        clock = (clockSpeed << SCALE) / 16 / sampleRate;
       
        regLatch = 0; 
        clockFrac = 0;        
        noiseShiftReg = SHIFT_RESET;
        noiseFreq = 0x10;

...

Attached Files



#57 OLD CS1 OFFLINE  

OLD CS1

    River Patroller

  • 4,060 posts
  • Technology Samurai
  • Location:Tallahassee, FL

Posted Sun Dec 14, 2014 10:11 PM

Thanks!  Now I get to use some REALLY rusty Java-fu I have not used in about six years.  Gonna look like "Drunken Master" without the "Master" bit.



#58 OLD CS1 OFFLINE  

OLD CS1

    River Patroller

  • 4,060 posts
  • Technology Samurai
  • Location:Tallahassee, FL

Posted Mon Dec 15, 2014 12:17 AM

Imported into Eclipse.

 

Attached File  I-Have-No-Idea-What-I-am-Doing-2.jpg   36.97KB   7 downloads

 

Can you tell me which class makes the call?  I am hoping I can just modify and compile that class, then slip it into the jar.



#59 Asmusr OFFLINE  

Asmusr

    River Patroller

  • Topic Starter
  • 2,494 posts
  • Location:Denmark

Posted Fri Dec 19, 2014 11:09 AM

Imported into Eclipse.

 

attachicon.gifI-Have-No-Idea-What-I-am-Doing-2.jpg

 

Can you tell me which class makes the call?  I am hoping I can just modify and compile that class, then slip it into the jar.

 

Sorry for not getting back to you before - I have had a really busy week at work.

 

In SoundListPlayer.java:

public void setMasterChannel(MasterChannel channel) {
    ...
    psg = new SN76489();
    ((SN76489) psg).init(PsgDeviceChannel.CLOCK_3_58MHZ / 2, MasterChannel.SAMPLE_FREQUENCY); // Add this to divide clock by 2
    ...
 


#60 OLD CS1 OFFLINE  

OLD CS1

    River Patroller

  • 4,060 posts
  • Technology Samurai
  • Location:Tallahassee, FL

Posted Fri Dec 19, 2014 11:12 AM

 

 

Sorry for not getting back to you before - I have had a really busy week at work.

 

In SoundListPlayer.java:

public void setMasterChannel(MasterChannel channel) {
    ...
    psg = new SN76489();
    ((SN76489) psg).init(PsgDeviceChannel.CLOCK_3_58MHZ / 2, MasterChannel.SAMPLE_FREQUENCY); // Add this to divide clock by 2
    ...
 

 

 

No worries.  I appreciate any time you can spare.



#61 OLD CS1 OFFLINE  

OLD CS1

    River Patroller

  • 4,060 posts
  • Technology Samurai
  • Location:Tallahassee, FL

Posted Tue Jan 27, 2015 6:11 PM

Ballblazer snippet. :)

Attached Files



#62 OLD CS1 OFFLINE  

OLD CS1

    River Patroller

  • 4,060 posts
  • Technology Samurai
  • Location:Tallahassee, FL

Posted Sun Mar 15, 2015 8:13 PM

I finally got the third-voice-to-periodic-noise ratio correct (up three octaves, down one semitone.)  So I have been able to play a little more.

 

Ghosts 'n' Goblins stage start theme.

 

Attached File  Ghosts n Goblins - Start Stage.bin   170bytes   14 downloads

(new version, fixed a few durations and the ending "bu-bummmmm." Still plays a tad fast.)

 

(I know, I should be working on 4Anoid ;))



#63 OLD CS1 OFFLINE  

OLD CS1

    River Patroller

  • 4,060 posts
  • Technology Samurai
  • Location:Tallahassee, FL

Posted Fri Mar 20, 2015 1:30 AM

More Ghosts 'n' Goblins sounds in this post.



#64 Asmusr OFFLINE  

Asmusr

    River Patroller

  • Topic Starter
  • 2,494 posts
  • Location:Denmark

Posted Sat Mar 21, 2015 9:49 AM

More Ghosts 'n' Goblins sounds in this post.

 

Since you refuse to listen to reason and use proper tools, the least I can do is to allow you to export the music in a format that can be played back on other devices. So the latest version available in post #1 contains a wav file export option. Note that only one sound list per wav file is supported.



#65 OLD CS1 OFFLINE  

OLD CS1

    River Patroller

  • 4,060 posts
  • Technology Samurai
  • Location:Tallahassee, FL

Posted Sat Mar 21, 2015 11:52 AM

 

Since you refuse to listen to reason and use proper tools, the least I can do is to allow you to export the music in a format that can be played back on other devices. So the latest version available in post #1 contains a wav file export option. Note that only one sound list per wav file is supported.

 

What proper tools? Your SLP is the closest thing to a tracker I know of for the TI and, while difficult to use that way, it works just fine for me and my hard-headedness.  Plus with the Perl script I am working on I can easily manipulate the resulting lists.

 

I do appreciate the wav file export, thank you!  Now I can more easily make tones for phones or system sounds from existing carts, disks, etc., as well as my own lists.  Besides, I figured that by exporting my lists to the .bin format I could get SLP into more peoples' hands ;)

 

(As an aside, the interleaved format of the ISR sound lists does seem to make playback very simple, I think a format like SID where each channel has its own stream would make composition much easier.)



#66 OLD CS1 OFFLINE  

OLD CS1

    River Patroller

  • 4,060 posts
  • Technology Samurai
  • Location:Tallahassee, FL

Posted Sat Mar 21, 2015 12:07 PM

Thanks to the wav export function you can "see" what the output of our TI looks like.  Very rigid, almost sterile looking.

 

Here are the first few tones of my Ghosts 'n' Goblins music file in Audacity after amplification.  You can definitely see the discrete steps of attenuation here as the tones have attenuation of 2 for the attack and 6 for the release.  The first two groups of lines are the period noise.  Assuming the output library accurately emulates the output of the 9919 it is interesting to note the noise is all positive while tones are mostly positive, whereas the recorded output of most MAME games is all positive.

 

Attached File  SLR - GnG WAV export in Audacity (amplified).png   6.94KB   1 downloads



#67 Asmusr OFFLINE  

Asmusr

    River Patroller

  • Topic Starter
  • 2,494 posts
  • Location:Denmark

Posted Sat Mar 21, 2015 12:27 PM

I consider the MOD2PSG2 tracker together with Tursi's VGM converter and player a much better choice than my basic tool. I have been using it already for Titanium, Sabre Wulf and the New Year demo music, and I don't think I will ever go back to sound lists for anything but simple sound effects. The ability to define 'instruments' makes a big difference, and bass notes using periodic noise do not have to be adjusted. 

 

I think the TMS9919 emulation used in SLR is pretty accurate, but the wave form it generates is a perfect square whereas I think a real TMS9919 waveform would have ripples and stuff around the edges. I don't know about the polarity difference - it's possible I have changed something in the conversion to wav.



#68 OLD CS1 OFFLINE  

OLD CS1

    River Patroller

  • 4,060 posts
  • Technology Samurai
  • Location:Tallahassee, FL

Posted Sat Mar 21, 2015 3:25 PM

Right, I addressed the converter(s) in my post putting my neck out for conversions*. Yes, a conversion tool would be easier, but it does at least two things: first, it relies almost exclusively on someone else's work, unless you have a tracker for that format; secondly, it takes away from the creative aspect of actually creating the sound list as per my mind's eye;  lastly, when I looked at Tursi's conversion tool it requires a special player, whereas my goal is to be compatible with the native ISR and compatible players (Matt's XB player and retrocloud's Spectra2.)

 

Now, so I do not come off sounding elitist, purist, or like an ass, I am by no means saying my way is better or any more creative, just that I prefer the feel that I get from doing it this way.

 

* Gyruss is your request?!  One of the longest and most complex arcade themes of the era I can think of!  heheheh But it is one of my favorites and I expect it to be VERY fun.



#69 Asmusr OFFLINE  

Asmusr

    River Patroller

  • Topic Starter
  • 2,494 posts
  • Location:Denmark

Posted Sat Mar 21, 2015 4:54 PM

Gyruss is the best  :)

 

Sound list format is little more than a raw stream of the bytes to send to the PSG. I totally understand that this is the standard sound format for the Ti-99/4A and you want to stick to it, but in my humble opinion the format sucks.

 

This is the process I use with Tursi's player:

 

- First I create my VGM music in MOD2PSG2

- Then I Tursi's Windows tool to convert the VGM into TI compressed format. Takes about 10 secs.

- Then I turn the binary file into a assembly DATA statements. I have my own little Java program for this that I'm happy to share.

- In my assembly project I include Tursi's player and the sound file, and I call the @stinit procedure.

- Finally, I call the player every frame @stplay, but this is my own hack. You can also let the IRS hand it as Tursi intended.



#70 OLD CS1 OFFLINE  

OLD CS1

    River Patroller

  • 4,060 posts
  • Technology Samurai
  • Location:Tallahassee, FL

Posted Sat Mar 21, 2015 5:54 PM

I totally understand that this is the standard sound format for the Ti-99/4A and you want to stick to it, but in my humble opinion the format sucks.

 

Oh, no, it does suck.  It is very efficient, though.  Even though storage-wise a sound list can be very expensive, it requires only a single two counters in PAD RAM to run the list (current location pointer and duration countdown) with a couple of other status bits.  It sucks for creating lists because of the interleaving of all four channels into a single stream.  The first part of a tune I lay down, in most cases a bass line, I often have to divide durations up to fit in the melody or accompaniment or to accommodate a tone's trailing attenuation.  It is also very easy to get lost with a big list which is why I will usually divide it up into parts and let SLR combine them when I export by removing the last 0-duration line when I export.

 

There are much better formats out there.  Off the top of my head, SID and MOD spring to mind.  SID is three discreet streams, one for each channel, and each stream is mostly register values for the SID with other information for the player.  MOD has the concept of patterns and, but its nature, instruments.  The SID editors I have used in the past were excellent, Stereo SID Editor by far being my favorite.

 

While I have been working on my lists in the standard ISR stream format, I have been poking away at my own player comprised of the pattern and instrument model.  I have not decided if the raw format will be a single stream or separate streams for each channel, but largely with a good editor that will not matter.  I plan to be able to define up to 16 "instruments" which are essentially just patterns for a very rudimentary A-D-S-R envelope (resolution of one jiffy) spanning one to three tone channels, or spanning channel three and the noise channel.  The instruments will be indexed within each pattern the player will simply keep track of each channel individually, the instruments are of course preemptive, and each pattern will be referenced from what should be a compact pattern list.

 

The problem is the editor.  I lack the skill to easily throw one together, but I will give it my best shot once I get there.



#71 Asmusr OFFLINE  

Asmusr

    River Patroller

  • Topic Starter
  • 2,494 posts
  • Location:Denmark

Posted Sun Mar 22, 2015 1:32 AM

The problem is the editor.  I lack the skill to easily throw one together, but I will give it my best shot once I get there.

 

But MOD2PSG2 is, despite the name, a full featured editor/tracker for our little sound chip.

 

Attached File  Image1.png   45.48KB   2 downloads



#72 Tursi OFFLINE  

Tursi

    River Patroller

  • 4,848 posts
  • HarmlessLion
  • Location:BUR

Posted Sun Mar 22, 2015 5:17 AM

Assuming the output library accurately emulates the output of the 9919 it is interesting to note the noise is all positive while tones are mostly positive, whereas the recorded output of most MAME games is all positive.

 

None of them are very accurate in my experience. I've spent a lot of time measuring the output of the actual console to improve Classic99's playback. (In the end, I left it inaccurate too, and I'll briefly cover why).

 

First thing is that the real output is very noisy, in three ways. First, the 99/4A just throws a crapton of noise onto the wire - up to a volt's worth in many cases!

Second, the 2dB attenuation has a 50% plus or minus error per the datasheet, so each step is anywhere from 1db to 3db attenuation.

Thirdly (and this is documented and emulated in some libraries), the chip leaks, so all the waveforms drift towards zero rather than being square. ;)

 

I measured the attenuation as best as I could on my scope, and got ranges from roughly 0 to 720mV at the TI output. (Again, sound chip emulators emulate the sound chip.. I don't think /any/ attempt to include the analog circuitry between the sound chip's output pin and the output of the computer). I saw the center point near 1v, so, nothing ever went negative. Also, for attenuation, I saw the highest voltage stay constant and the lowest voltage increase (actually moving the center point).

 

The SMS Power documentation says that noise never goes negative, but my older measurements said that white noise does, and periodic noise doesn't. I still need to reverify that. In fact, all this still needs more testing to be certain I didn't screw something up.

 

In the end, all that matters is the shape and the amplitude, not the center point. Leaving the center point at 0 volts actually plays nicer with the host system, avoiding clicks on startup and the like. :)


Edited by Tursi, Sun Mar 22, 2015 5:22 AM.


#73 Tursi OFFLINE  

Tursi

    River Patroller

  • 4,848 posts
  • HarmlessLion
  • Location:BUR

Posted Sun Mar 22, 2015 5:21 AM

Back ON topic, Gyruss rocks. I look forward to hearing what you do with it. :) I think many of us have had our eye on doing a conversion for that one ;)



#74 OLD CS1 OFFLINE  

OLD CS1

    River Patroller

  • 4,060 posts
  • Technology Samurai
  • Location:Tallahassee, FL

Posted Sun Mar 22, 2015 3:27 PM

 

But MOD2PSG2 is, despite the name, a full featured editor/tracker for our little sound chip.

 

attachicon.gifImage1.png

 

hrmmmm Interesting.  I think I have that but was only using it for fringe case.  I will give it a whirl this week.



#75 OLD CS1 OFFLINE  

OLD CS1

    River Patroller

  • 4,060 posts
  • Technology Samurai
  • Location:Tallahassee, FL

Posted Sun Mar 22, 2015 10:47 PM

Just to be aware, the export does not always function properly.  A few different sound lists export distorted or as noise.  I have attached a couple of examples.  I am NOT worried about you fixing it considering it was a big favor.

 

I converted a couple to MP3 to save space/time.  The original wav files were corrupted, already.

Attached Files






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users