Retronitus - Noise from the past!

12345679»

Comments

  • Well, after all, it is just a lil' beeper speaker. Kind of like some old computers have.

    Regarding the capacitor value, i'm not sure. Maybe 100uF ? With the pretentious audio-grade ones I used, that's the next step up. But 47uF certainly isn't terrible, as you can hear from my recordings.
  • JRetSapDoogJRetSapDoog Posts: 787
    edited 2018-10-31 - 03:11:38
    Maybe my filter is lame. With respect to the left channel in the schematic above, I only use surface mount decoupling caps (104's) for C4 and C5, and I use 180R instead of 750R for R20. Although I think there's a lot of variability on what values can be used, maybe my values and the cap type(s) are not ideal. Then again, it is mono and the speaker is small (though the beeps can be quite loud).
  • Here is the formula to calculate the 3db cutoff frequency
    f3db=1/(2*pi*r1*c1)

    For 19.4KHz the series R is 820 ohms and the capacitor to gnd is 10nF.
    My Prop boards: P8XBlade2, RamBlade, CpuBlade, TriBlade
    Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
    Website: www.clusos.com
    Prop Tools (Index) , Emulators (Index) , ZiCog (Z80)
  • Maybe my filter is lame. With respect to the left channel in the schematic above, I only use surface mount decoupling caps (104's) for C4 and C5, and I use 180R instead of 750R for R20. Although I think there's a lot of variability on what values can be used, maybe my values and the cap type(s) are not ideal. Then again, it is mono and the speaker is small (though the beeps can be quite loud).
    Your sound circuit works fine for the beeps it was intended for. I was probably silly to try to use it for this music software.

  • JRetSapDoogJRetSapDoog Posts: 787
    edited 2018-11-01 - 02:31:48
    Cluso99: Thanks for the formula. Guess that makes the 3dB cutoff for my current components (180R & 0.1uF) 8.84KHz. Sounds like there's room for improvement.

    David: Well, I had hoped that it would be able to play music, but I never got around to trying any.
  • David: Well, I had hoped that it would be able to play music, but I never got around to trying any.
    That's okay. It plays beeps quite well!

  • Wuerfel_21Wuerfel_21 Posts: 234
    edited 2019-01-13 - 20:22:34
    Hmm, I've been thinking about how to crunch the song data even smaller. Some people think about philosophy and the meaning of life while they're in the shower, I think about PASM....
    The actual note data is already extremely dense, but the pattern sequences are not only quite large, but also aren't very flexible.
    As far as I can tell, at the max tempo, the music routine is called 16 times per step - twice per channel, first to step through the patterns, second to load a new pattern from the sequence. If the max tempo was halved (still plenty fast at 64kHz), there would be four calls per step. There's the one for the pattern, but now we can interpret up to three sequence commands that can be 16 bit each. I haven't tested it yet, but I think replacing patternHandler with this would work:
    patternHandler                                             
    B3            rdbyte    tempValue1, c1_stepPointer       wz
            if_nz jmp       #phaseAcc
                 'nop
    G1            rdword    tempValue1, c1_patternPointer 
    
                  shr       tempValue1, #1                  wc  ' check bit 0
    B4      if_nc mov       c1_stepPointer, tempValue1          ' run pattern
            if_nc jmp       #patternNext
    
                  shr       tempValue1,#1                      wc  ' check bit 1
            if_c  jmp       #patternSetStuff                    ' if set, set instrument, octave, note
                  shr       tempValue1,#1                      wc  ' check bit 2
            if_c  jmp       #patternJump
    '----------------------------------------------------------- 
                  mov       tempo, tempValue1                     
                  shl       tempo, #14                          ' set tempo                      
                  jmp       #patternNext                         
                  
    patternJump
                  shr       tempValue1,#1                      wc ' use bit 3 as sign
                  jmp       #patternSum                                                                
    '-----------------------------------------------------------
    patternSetStuff
    F4            mov       c1_octave, tempValue1                
    F5            shr       c1_octave, #10                       
    E6            mov       c1_note, tempValue1                 ' This takes care of "octave" and "note" init values
    E7            shr       c1_note, #6                          
    E8            and       c1_note, #15              
    '-----------------------------------------------------------                                                             
                  and       tempValue1, #63                     ' Note = noteOn address 
                  add       tempValue1, instrumenPointer              '
    C2            rdlong    c1_noteOn, tempValue1               ' TODO: Why are these longs?
    
    patternNext   mov       tempValue1, #2 wc
    patternSum
    G2            sumc      c1_patternPointer, tempValue1
                  jmp       #phaseAcc
    
    this code is only 3 longs longer than the original code. I will see if I can get it going with one of the existing tunes.

    EDIT: This is slightly shorter, at the cost of using more cycles when not having to load a command.
    Still haven't tested it.
    patternHandler                                             
    B3            rdbyte    tempValue1, c1_stepPointer       wz
            'if_nz jmp      #phaseAcc
                 'nop
    G1      if_z  rdword    tempValue1, c1_patternPointer 
    
             if_z shr       tempValue1, #1                  wc  ' check bit 0
    B4 if_nc_and_z mov      c1_stepPointer, tempValue1          ' run pattern
      if_nc_and_z jmp       #patternNext
    
            if_z  shr       tempValue1,#1                      wc  ' check bit 1
       if_c_and_z jmp       #patternSetStuff                    ' if set, set instrument, octave, note
            if_z  shr       tempValue1,#1                      wc  ' check bit 2
      if_c_or_nz  jmp       #patternJump
    '----------------------------------------------------------- 
                  mov       tempo, tempValue1                     
                  shl       tempo, #14                          ' set tempo                      
                  jmp       #patternNext                         
                  
    patternJump
            if_z  shr       tempValue1,#1                      wc ' use bit 3 as sign
                  jmp       #patternSum                                                                
    '-----------------------------------------------------------
    patternSetStuff
    F4            mov       c1_octave, tempValue1                
    F5            shr       c1_octave, #10                       
    E6            mov       c1_note, tempValue1                 ' This takes care of "octave" and "note" init values
    E7            shr       c1_note, #6                          
    E8            and       c1_note, #15              
    '-----------------------------------------------------------                                                             
                  and       tempValue1, #63                     ' Note = noteOn address 
                  add       tempValue1, instrumenPointer              '
    C2            rdlong    c1_noteOn, tempValue1               ' TODO: Why are these longs?
    
    patternNext   mov       tempValue1, #2 wc
    patternSum
    G2      if_z  sumc      c1_patternPointer, tempValue1
                  jmp       #phaseAcc
    
  • There definitely are ways to improve Retronitus data format and make it more flexible etc. It will be interesting to see what you will come up with. P1 Retronitus is "abandoned" for now, so feel free to pick it apart, improve upon it or change it to suit your needs. I will look in here from time to time when I am not spending time in the P2 forum. In the future I will take what I have learned from Retronitus and make an improved version for the P2.
    SIDcog - The sound of the Commodore 64 in a single cog: Thread, OBEX
  • I noticed this while messing around: The square and triangle channels have twice the amplitude of the saw and noise channels. The square channels in particular divide their volume by 8 and then add or subtract that to/from the output, leading to a max. peak-to-peak volume of $1FFFFFFF (whereas to avoid overflow, it should be $0FFFFFFF)
    Is there any particular reason for this?
Sign In or Register to comment.