Shop OBEX P1 Docs P2 Docs Learn Events
Yet another wave player, now NCO based and noise (almost) free — Parallax Forums

Yet another wave player, now NCO based and noise (almost) free

pik33pik33 Posts: 2,350
edited 2012-07-20 10:54 in Propeller 1
This is at last what I wanted. No noise (of course there has to be some noise but compared to duty dac with or without dithering, this is much, much better)

And only one cog used.

This version uses NCO/PWM mode with 8 bit resolution, 7x oversampling, noise shaping and standard 80 MHz clocked Propeller

To do - compute constants in init procedure, to enable different sampling rates and overclocked Propeller without manually changing these constants in code and then place it in OBEX :)

Comments

  • pik33pik33 Posts: 2,350
    edited 2012-07-19 02:37
    And sonething strange happens with this driver. I tried to add this to my player instead this duty dac used now, and then it don't work as expected, generating buzzing sound in one channel.

    Then I discovered that these artifacts are caused by access to "bufnum" variable from another object - and only this variable - and only from another object (???), so I tried to change its place in my code.

    I changed this:
    VAR
    
      long cog
      long buf[512]
      long bufnum
    
    

    to this
      long bufnum
      long cog
      long buf[512]
    
    

    and it helped but I don't know exactly why. There has to be a bug somewhere.
  • kuronekokuroneko Posts: 3,623
    edited 2012-07-19 02:56
    bufcnt is a res which is used during sample location calculations without being initialised (NG: offset $0D06A places it in the global stack area). With your variable swap it ends up at offset $4065 which is well clear of anything disturbing).


    A relative to buf[], in the archive posted in this thread
  • pik33pik33 Posts: 2,350
    edited 2012-07-19 03:12
    Fixed, changed bufcnt from res1 to long 0 so it is initialized now. Thank you :)
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-07-19 15:44
    Nice work :)
  • Martin HodgeMartin Hodge Posts: 1,246
    edited 2012-07-20 07:02
    What external circuitry does one need to test this?
  • pik33pik33 Posts: 2,350
    edited 2012-07-20 09:25
    I use a Propeller demo board with sd card added on pins p0..p3 and standard audio out @ 10,11 (with corrected RC filters)

    Any standard propeller audio environment will do. Base frequency is something about 308 kHz. (7x44.1)
  • cavelambcavelamb Posts: 720
    edited 2012-07-20 09:59
    What external circuitry does one need to test this?

    Powered speakers is all.

    http://www.instructables.com/id/Building-a-custom-shield-for-the-Gangster-Gadget-P/step8/null/
  • pik33pik33 Posts: 2,350
    edited 2012-07-20 10:54
    I added this driver to this player instead of duty dac one

    http://forums.parallax.com/showthread.php?140767-A-new-topic-for-vga-(not-only)-sid-player (compile with bst, enable unused methods removing)

    so you can try this driver there... The player uses modified Kye's driver so you can have your wav and dmp files in subdirectories on big (I use 8 GB) fat32 formatted SD and long (up to 32 chars) filenamed (the player reads LFNs)
Sign In or Register to comment.