Shop OBEX P1 Docs P2 Docs Learn Events
(HSS) Hydra version 1.2 released. — Parallax Forums

(HSS) Hydra version 1.2 released.

Ym2413aYm2413a Posts: 630
edited 2009-01-16 21:55 in Propeller 1
Hello everyone.

A new version of the (HSS) sound API has just released today.
Big improvements can be found in the FXsynth engine which will allow for better and more complex realtime synthesis!
Feel free to download the object from our website @: www.andrewarsenault.com/hss/

For those of you who are familiar with (HSS) then let me explain.
(HSS) stands for Hydra Sound System and is a play on the old Konami Sound System (KSS) for the MSX computers.

Being a sound system, it allows propeller based consoles and computers to playback music, compressed waves and soundFX with simple high level commands that are easy to use and very powerful.
It currently supports Realtime Synthesis of sound FXs from small 12 or 28 byte datablocks called patches (after old analog synthesizers).
Also complex and highly compressed 4-channel tracker based music files can be played back in realtime from a small yet very powerful music engine.
And DPCM compressed audio files are supported for full wave playback at some very minimalistic and memory saving bitrates.

Take a listen to the clips below for some ideas of what (Hss) can do:

-HMUS music file:
www.andrewarsenault.com/hss/hss_song4.mp3

-Six FXsynth sound FX's being played back on one channel, one after another:
www.andrewarsenault.com/hss/hss_soundfx.mp3

-HWAV adpcm file playing back a complex sound FX of a male voice (11k sampling rate):
www.andrewarsenault.com/hss/hss_dpcmfx.mp3

-HWAV file of a short music clip (11k sampling rate):
www.andrewarsenault.com/hss/hss_dpcmmus.mp3

Thanks!
--Andrew Arsenault.

Comments

  • JT CookJT Cook Posts: 487
    edited 2007-10-19 22:59
    Sweet! I have been waiting for this for a while. smilewinkgrin.gif Next time I have some time I'll have to give it a spin.
  • Ym2413aYm2413a Posts: 630
    edited 2007-10-21 09:14
    The FXsynth datasheet is now up. [noparse]:)[/noparse]
    Now you can have a better understanding of how to synthesize awesome sounds on this little soft-synth included in (HSS)!

    www.andrewarsenault.com/hss/sfx.html

    Enjoy!! and happy noise making!

    --Andrew Arsenault.
  • JT CookJT Cook Posts: 487
    edited 2007-10-27 06:22
    I just gave it a little test run and it works pretty nice! I just added it to my game and am trying to create some sound effects for it. The documentation really helps too, but my lack sound talent is making my sound programming a guess and check process.

    Also I though you were going to make it so·you can use more than 2 voices for sound effects?
  • CoolguyCoolguy Posts: 26
    edited 2007-10-29 02:54
    Andrew,
    That is awesome Andrew. Thanks for sharing them with us. Good work! Please keep us posted.
    ·
    JT,
    In my opinion, your game is one of the top ones from Hydra. I play and use it for demo all the time. If you have a new version please let us know.

    Please like you guys will keep this community growing.
    Coolguy
  • Ym2413aYm2413a Posts: 630
    edited 2007-10-29 03:56
    JT Cook said...
    I just gave it a little test run and it works pretty nice! I just added it to my game and am trying to create some sound effects for it. The documentation really helps too, but my lack sound talent is making my sound programming a guess and check process.


    Also I though you were going to make it so you can use more than 2 voices for sound effects?

    Yeah, the only thing is running a good number of FX synthesizer engines can really slow done the code and change the timing on things.

    If one needed to use more then two FX-synths at a time there is a easy trick to enable the rest. It only takes about 2 minutes to do. [noparse]:)[/noparse]

    With the stock release I kept it the same mapping as before for backwards compatibility. One could break that compatibility and do what they want, if interested. [noparse]:)[/noparse]

    Thanks!
  • JT CookJT Cook Posts: 487
    edited 2007-10-29 06:18
    Ym2413a: 2 minutes to do, huh? Give me a little hint smile.gif· I tried this with the original version and couldn't get it to work. I didn't try this in the new version, but a little pointer would help. Also I did a little searching and I can't find hmus stuff. Can you post a link that has more info on the hmus format? Another question is the frequency counter is only 8-bit, is this value multiplied by another number to get the true frequency?

    Coolguy: I am glad you like it, but there aren't going to be any future versions because I pretty muched used all 32k and also I don't think Andre would be happy if I freely posted X-Racer. The next game I am working on isn't anything technogically interesting or unique design-wise, but something I wanted to see, mainly for the 2 player competitive aspect.
  • Ym2413aYm2413a Posts: 630
    edited 2007-10-31 05:18
    Hey JT. [noparse]:)[/noparse]
    Hopefully this'll help answer some of your questions!

    .hmus is a file format designed for (Hss).
    It's a highly compressed module music format.
    Much like .S3M, .MOD, .IT or .XM. It holds small waveform samples of each instrument in the header and score data (music notes, effects and commands) in the body.

    It supports 16 instruments per file and 4 channels at once.
    Currently I'm looking to get some composers together to write some more music in this format. [noparse]:)[/noparse]
    Some people like writting chiptunes and would be interested in writting music for a whole new platform I'm sure.

    Hard part is in order to write .hmus files you have to know how to compose and work in tracker based audio formats.
    This is something a lot of programmers I've shown my work to havn't been able to do.

    The Hmus player uses a 16bit frequency look up table for the note values. This is oversampled into the 32bit freq-regs of the (Hss) wave-table synth.
    The FXsynth engine uses 8bit varables that are converted into 32bit variables after processing. 8bits where picked to keep everything in a FX-synth data-block byte sized!

    If you need music for an upcoming program, just let me know. [noparse]:)[/noparse]

    Anyway, New update is coming up.
    ADPCM conversion tool is releasing, new documentation updates and new media music files!

    Thanks Everyone!
    --Andrew Arsenault.
  • JT CookJT Cook Posts: 487
    edited 2007-10-31 23:35
    I think I get it. Not enough to probably use it, but it does answer my question and why I can't find any HMUS files on the interweb [noparse]:)[/noparse]

    You said the 8 bit fequency value is changed to a 32 bit value, now do you multiply it by 4 to get a 32bit value or is there another formula to get the true frequency from the 8 bit value?
  • Ym2413aYm2413a Posts: 630
    edited 2007-11-01 00:57
    In FX-synths case. It runs it through a FM unit first and comes out with the final 32bit number. But when it is bypassed and there is no Frequancy modulation on the waveform the 32bit value is the same as the 8bit only rotated left 24 times.

    So 0xFF would be converted to 0xFF000000 with no modulation applied.

    Thanks!
    --Andrew Arsenault
  • JT CookJT Cook Posts: 487
    edited 2007-11-01 02:14
    That can't be right because that would give you a frequency range of 16 mhz to 4 ghz
  • Ym2413aYm2413a Posts: 630
    edited 2007-11-02 12:03
    JT Cook said...
    That can't be right because that would give you a frequency range of 16 mhz to 4 ghz

    No no no. [noparse]:)[/noparse]
    That is what the engine does to get the 32bit register value for the freqancy value.

    (Freq / 2^32)*32000 = Final Sampling Rate.

    Take the sampling rate and divide that by the number of samples per hert. In most cases that's either 16, 32, 64 or 24. That'll give you the final output freq of any waveform you play back, Preset or Custom. [noparse]:)[/noparse]

    It's just basic PCM math.

    Hope that gives you some ideas!
    Thanks!

    --Andrew Arsenault.
  • JT CookJT Cook Posts: 487
    edited 2007-11-02 18:18
    Ym2413a said...

    (Freq / 2^32)*32000 = Final Sampling Rate.

    Take the sampling rate and divide that by the number of samples per hert. In most cases that's either 16, 32, 64 or 24. That'll give you the final output freq of any waveform you play back, Preset or Custom. [noparse]:)[/noparse]
    Ok this is starting to get a little clearer. Sound is programming is really still pretty new to me, so bare with me.

    So you use this to get the true wave frequency
    ((8 bit freq value << 24) / 2 ^32) * 32000

    I don't know what you mean by samples per hert, or is that anything I should worry about? What I mean is when doing sound programming with·you·driver, will that equation ever change other than the 8 bit frequency value?
  • Ym2413aYm2413a Posts: 630
    edited 2007-11-03 14:55
    Yes, Here are the simplified versions of what your looking for with FXsynth. [noparse]:)[/noparse]
    I did most of the math for ya'.

    NOTE: 
    (Hz) is the audio pitch in Hertz heard by the ear.
    (Freq) is the value of frequency set in the FXsynth block for that given sound FX.
    See http://www.andrewarsenault.com/hss/sfx.html for more details on FXsynth.
    
    
    For waveforms (1 = Fast Sine, 3 = Square) use:
    Hz = (Freq / 256)*1000
    and/or
    Freq = (Hz / 1000)*256
    
    For waveforms (0 = Sine, 2 = Sawtooth) use:
    Hz = (Freq / 256)*500
    and/or
    Freq = (Hz / 500)*256
    
    For waveform (4 = Fast Square) use:
    Hz = (Freq / 256)*4000
    and/or
    Freq = (Hz / 4000)*256
    
    For waveform (5 = Buzz) use:
    Hz = (Freq / 256)*1333
    and/or
    Freq = (Hz / 1333)*256
    
    Waveform (6 = Noise) is atonal and has no pitch.
    0xFF is white noise while 0x00 is a deep bassy rumble, Freq can be set anywhere inbetween those two extremes.
    
    



    I'm going to post this on the *Hss* website as well. [noparse]:)[/noparse]
    Hope that helps!

    If you have anymore questions, feel free to ask!
    I don't mind supporting my code. [noparse];)[/noparse]

    --Andrew Arsenault.
  • Mike CookMike Cook Posts: 829
    edited 2007-11-08 23:42

    Ym2413a

    WOW! Pretty cool! I just tried your HSS on a Demo Board, very impressed. Now I need to add audio to my ProtoBoard, it has the SD socket and my boot loader! This will make a great addition to my Big Trak Propeller re-fit. Anxiously waiting your *.wav to hwav converter!

    Thanks for all the hard work!

    Mike


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike

    Post Edited (Mike Cook) : 11/8/2007 11:48:08 PM GMT
  • JT CookJT Cook Posts: 487
    edited 2007-11-09 21:19
    Andrew, that should really help a lot in trying to make sound effects (though sound is still a learning experience for me).
  • Ym2413aYm2413a Posts: 630
    edited 2007-11-11 10:40
    Mike Cook said...
    Big Trak </A>Propeller re-fit. Anxiously waiting your *.wav to hwav converter!</P>
    Thanks for all the hard work!

    Mike

    Thanks Mike. [noparse]:)[/noparse]
    You let me know if you ever have any questions as to how to use (Hss) to it's fullest!

    Glad your getting the feel of sound synthesis JT. [noparse]:)[/noparse]
    Once you figure out what sounds like what and what does what, it comes pretty easy!

    Thanks!
    --Andrew Arsenault.
  • Ym2413aYm2413a Posts: 630
    edited 2007-12-21 11:16
    Hybrid support as just been added!. [noparse]:)[/noparse]
    Do Enjoy!

    www.andrewarsenault.com/hss/
  • justin weberjustin weber Posts: 36
    edited 2009-01-15 15:31
    sorry to post on a old thread, but how would one play an individual note. like in qbasic we had play "abc#".
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-01-16 00:52
    Here's a snippit of code that I used in my FemtoBASIC mod to create basic tones.
    It may help..

    Call it from another PUB with synth(number) and synth(0) to shut it off with a pause between.

    [b]CON[/b]
       SoundPin  =  10
    
    
    [b]PUB[/b] Synth(Freq1) | s, d, ctr, frq
    
      Freq1 := Freq1 #> 0 <# 128_000_000     'limit frequency range
    
      [b]if[/b] Freq1 < 500_000                    'if 0 to 499_999 Hz,
        ctr := constant(%00100 << 26)      '..set NCO mode
        s := 1                             '..shift = 1
      [b]else[/b]                                 'if 500_000 to 128_000_000 Hz,
        ctr := constant(%00010 << 26)      '..set PLL mode
        d := >|((Freq - 1) / 1_000_000)    'determine PLLDIV
        s := 4 - d                         'determine shift
        ctr |= d << 23                     'set PLLDIV
    
      frq := fraction(Freq1, CLKFREQ, s)    'Compute FRQA/FRQB value
      ctr |= SoundPin                           'set PINA to complete CTRA/CTRB value
    
         [b]CTRA[/b] := ctr                        'set CTRA
         [b]FRQA[/b] := frq                        'set FRQA
         [b]DIRA[/b][noparse][[/noparse]&#173;SoundPin&#093;~~                   'make pin output 
    
    
    



    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Check out: Protoboard Introduction , Propeller Cookbook 1.4 & Software Index
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card connected? - PropDOS
  • justin weberjustin weber Posts: 36
    edited 2009-01-16 19:11
    what is the fraction sub do?
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-01-16 21:55
    Opps! Sorry about that. Use this under the code above.

    PRI fraction(a, b, shift) : f
    
      if shift > 0                         'if shift, pre-shift a or b left
        a <<= shift                        'to maintain significant bits while
      if shift < 0                         'insuring proper result
        b <<= -shift
    
      repeat 32                            'perform long division of a/b
        f <<= 1
        if a => b
          a -= b
          f++
        a <<= 1
                  
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Check out: Protoboard Introduction , Propeller Cookbook 1.4 & Software Index
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card connected? - PropDOS
Sign In or Register to comment.