Roman Black Sound (btc)


Closed Thread
Results 1 to 40 of 58

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default Roman Black Sound (btc)

    (Split from a different thread)<hr>
    Roman, ssssat You?

    I have done the btc stuff in PBP.
    Worked really well. (depending on bit rate vs RC constant etc)
    OK, well it made sounds even if they didn't match, just not quite as good.

    Reproduced a few wav files, like spock saying "Fascinating" and a couple others.

    But frankly, I got stuck because the conversion program wouldn't open a sound file made after about say 1998 or so. (guesstimate).

    Any sound files I find these days didn't work.

    To my constant "dismay", I can only report that I lost the entire program in a hard disk crash. I know, sounds like the "Dog ate my homework" but really, that's what happened.

    But anyhow, I remember exactly how it was done, and could probably reproduce it, even better since I know how it works. It might even be worth the effort, if the conversion program works better now??????

    Best Regards,
    Last edited by Darrel Taylor; - 12th February 2008 at 23:00. Reason: Moved posts
    DT

  2. #2
    Join Date
    Feb 2008
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    Hmmmm, "Dog ate my homework"?? (grin)

    Hi Darrel, yes it's me. Have we met before?

    Cool that you got the BTc working for BASIC! I would love to get a PICBASIC version available to put on my web page or link to on my page.

    I don't have a huge amount of time available but I can provide some input or help, and I can also add some "export to BASIC" facility to the 2.0 BTc Encoder if you think it would be popular on the forum for PIC BASIC users.

    Please check out the new BTc Encoder, it fixes that bug that wouldn't open some windows-generated .WAV files. It also has some real powerful features like dynamic compression and re-sampling data rates. Things that I had been promising to add for years.

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    >> Have we met before?

    We have not.
    We've talked about your program's a few times around here. I just didn't expect to see you.

    Welcome!

    I've looked at the new encoder. It's definately works much better now.
    Nice new features too.

    Looks like I've got some re-creating to do.

    >> and I can also add some "export to BASIC" facility to the 2.0 BTc Encoder if you think ...

    I don't think that will be necessary, since PBP can handle ASM files with ease.
    However, if you were so inclined, it would be nice to have a second ASM output format.

    Something like this would be very helpfull.
    Code:
    Filename  macro      ; Filename of the original sound (no extensions)
        dw   22050       ; Playback Bitrate
        dw   832         ; Sound Length in bytes
        dw   16          ; bt Constant
        dw   1           ; btc model (0=1bit 1=1.5bit)
    ;----------------------------------------
        db    0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa    ; The sound data
        db    0x55, 0xaa, 0x55, 0xb5, 0x52, 0x4a, 0xd2, 0x5a    
       ; etc.
      endm
    But that's just something to ponder on.

    Once I get it re-created, I'll have a better idea. (no doubt)
    <hr>
    I didn't want to highjack Paul Borgmeier's great thread about your other program, so I've split these posts into to a new thread.
    DT

  4. #4
    Join Date
    Feb 2008
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    Hi again Darrel and thanks for the welcome! In fairness I never work with PICBASIC so you probably won't be seeing much of me here. My main reason for searching forums was to get some feedback on the new release of BTc Encoder 2.0 and get some user examples to link to on my web page. I develop commercial hardware and software so my web page has always been sorely neglected, just a few "hobby" style doodads. I am looking at improving it with some of the voluminous work i've done over the last few years.

    I'll add your suggestion of outputiing BTc sound data as a DW table to my list of things to do. There are a few people getting back to me with suggestions for the new BTc Encoder so I have a feeling that in a few weeks v2.0 will become super v2.1 ha ha!

    Please feel free to contact me by email (or publicly here) if you need anything re the re-creation of your BTc player.

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Cool btc Player re-creation

    Ok, "Dog ate my homework" might have been a "Good thing".

    Here's a simple "btc Player" that can use any bitrate/btc model.
    It has an easy IMPORT function that embeds the sound in the program data.
    There are 2 "PLAY" functions. PlaySound, and RepeatSound.

    I've changed the format of the ASM files, so this won't be very useful without modifications to the btc encoder. Or an external program can be used to convert the existing ASM/btc files to the new format. I've knocked up a simple program to do that here, but it's really, really ugly. Works for me, but it would be a nightmare for anyone else.

    The new ASM format looks like this ...
    Code:
    ; Simulated output for DT's suggestion to Roman Black
    
    btc_bitrate  = 22050       ; Playback Bitrate
    btc_length   = 4270        ; Sound Length in bytes
    btc_btc      = 64          ; bt Constant
    btc_model    = 1           ; btc model (0=1bit 1=1.5bit)
    btc_wordbits = 16          ; 8=retlw, 14=16F's, 16 for 18F
    ;---------------------------------------------------------
        DB  0xB5,0x6A,0xAA,0x52,0xCA,0xA9,0x4B,0x35,0xAD,0xB6,0xB5,0x9A,0xDB,0x56,0xAA,0xAA
        DB  0xB5,0x55,0x52,0x52,0x52,0x12,0x42,0x20,0x84,0x52,0x99,0x6B,0x5A,0xEE,0xF6,0xF7
        DB  0xBB,0xB7,0x75,0xAC,0xA9,0x14,0x52,0x89,0x25,0x28,0xA9,0x4C,0xA5,0x2A,0x52,0xAA
        ; etc.
    This format allows you to easily Import sound files like this ...
    Code:
    INCLUDE "DT_RBSound.pbp"
    
    @    ImportSound  Space, "SpaceNew.asm"
    @    ImportSound  Bang, "Bang1New.asm"
    Each Import line specifies the "Name" to call the sound in the program (Space, Bang), and the associated sound file to load.

    Then to play the sound, you simply ...
    Code:
    @     PlaySound Bang
    @     RepeatSound Space, 3
    <hr>
    This is a test program that plays a few sounds from a space game, and a line from kirk and spock.

    I've just taken the filtered output from the PIC and fed it into the Line-in of my laptop.
    I think the input is loading down the filter, as it sounds much better when I plug it directly into the sound input of my Viewsonic monitor. An op-amp buffer would probably help.

    Here is the recorded sound from the example.
    http://www.pbpgroup.com/files/picout.mp3

    Code:
    ;-- Target = 18F --
    @   __CONFIG    _CONFIG1H, _OSCS_OFF_1H & _HS_OSC_1H
    DEFINE OSC 10
    
    btc_Pin1  VAR PORTC.2
    btc_Pin2  VAR PORTC.3
    X         VAR BYTE
    Y         VAR BYTE
    LATE_LED  VAR PORTC.5
    
    INCLUDE "DT_RBSound.pbp"
    
    @    ImportSound  Space, "SpaceNew.asm"
    @    ImportSound  Bang, "Bang1New.asm"
    @    ImportSound  Hit, "HitNew.asm"
    @    ImportSound  Shoot, "ShootNew.asm"
    @    ImportSound  Fascinating, "FascinatingNew.asm"
    @    ImportSound  Kirk, "BeamUpNew.asm"
    @    ImportSound  BigGun, "RazorNew.asm"
    
    
    T1CON = 0
    
    Main:
        high LATE_LED
        pause 500
        low LATE_LED
        FOR Y = 1 to 2
            FOR X = 1 to 2
                @ PlaySound BigGun
                Pause 500
            NEXT X
            @ PlaySound Shoot
            Pause 500
        NEXT Y
        @ PlaySound Hit
        Pause 500
        @ RepeatSound Hit,10
        Pause 1000
        @ RepeatSound Shoot, 4
        @ RepeatSound BigGun, 2
        pause 1000
        @ RepeatSound Space, 3
        @ PlaySound Bang
        Pause 500
        @ PlaySound Kirk
        Pause 1000
        @ PlaySound Fascinating
    goto Main
    There are still many things that can be done with it, like having a background sound using interrupts. Playing "segments" of a sound file, and probably many more. But for a quick re-creation, it turned out pretty good.

    The zip file contains the module, demo program and all the sound files needed to compile it.
    <br>
    Attached Files Attached Files
    DT

  6. #6
    Join Date
    Nov 2005
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    Would be nice have a 14bit core version.
    Regards
    Gianni

  7. #7
    Join Date
    Dec 2006
    Location
    Brasil, Sao Paulo, Campinas
    Posts
    54


    Did you find this post helpful? Yes | No

    Default Re: btc Player re-creation

    Darrel,
    I was reading your article on Wiki and decided to test it. I have a proto hardwares done (18F452 + 4MHZ cristal) and I would like very much to use this tool with my circuits. Firstlly I want to understand better some things.
    I tested using RB_Sound Folder files (TestRBSound.pbp, DT_RBSound.pbp and the asm files like HitNew.asm, FascinatingNew.asm...)
    in the TestRBSound.pbp is assigned:
    btc_Pin1 - PORTC.2
    btc_Pin2 - PORTC.3
    LATE_LED - PORTC.5
    well, I wired a led to the PortC.5. It is done
    What I need to do with btc_Pin1 and btc_Pin2. How to wire and where?
    ...others files (Number folder) into the .asm files has a draw:
    Digital label + resistor R = 25968 ohms and a 0.22uF capacitor to the ground and Analogue label on junction. Need I to put a speeker here or a buzzer? Or is necessary to use a pre-amplifier? Do you used the BTc.exe (BTC Sound Encoder from Roman Black)? I teste it using a Ding.wav from windows and exported to a ding.asm, but into the files is diferent comparing with your files...Into the one.asm for example you coment "File converted to .BSM format with the freeware btc_convertor by Darrel Taylos...Is it other converter diferent of the BTC Soundd Encoder?

    Well...
    Then I decided to wire a 26k resistor to portc.2 and a 0.22uF capacitor like the draw, and puted a buzzer on junction only to test. The portC.3 NC.
    I compiled with sucess but it don't worked!
    The led blink just one time and nothing occur.
    I don't know what I need to use, if a buzzer, a speeker, a amplifier, how to wire it with certainly but the led should to blink basead on program!
    Then I alterate the program to blink 5 times, and then the led blinked 5 times but after it stoped again...I percever the after @ PlaySound BigGun line, nothing occur (led always low, buzzer low)
    If you can help me to use it I would be very happy.
    I really apreciate it and woul like to use in my projects

  8. #8
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Throw me a bone....

    Is it just me, or is anyone else having problems finding Norms code? Might be a firewall issue, I can click on the attachement, but I can't download it: http://www.protonbasic.co.uk/forum/a...1&d=1169530365 When I click on it IE says "Done" but I have a blank screen. And when I look on protons NEW site, i don't see any attachements, which does seem kind of strange. I became a member of their new forum, just in case only members could view attachements. Maybe I have to wait a little while?

    In any case, thanks Norm! Very interesting work. I look forward to seing your proton code ... but not sure when I will be allowed to. Maybe when I get home to a less restrictive firewall I will have better luck.
    Last edited by ScaleRobotics; - 14th August 2010 at 19:12.
    http://www.scalerobotics.com

  9. #9
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by scalerobotics View Post
    Is it just me, or is anyone else having problems finding Norms code? Might be a firewall issue, I can click on the attachement, but I can't download it: http://www.protonbasic.co.uk/forum/a...1&d=1169530365 When I click on it IE says "Done" but I have a blank screen. And when I look on protons NEW site, i don't see any attachements, which does seem kind of strange. I became a member of their new forum, just in case only members could view attachements. Maybe I have to wait a little while?

    In any case, thanks Norm! Very interesting work. I look forward to seing your proton code ... but not sure when I will be allowed to. Maybe when I get home to a less restrictive firewall I will have better luck.
    I'll update my website to include all the files.

    The ADPCM basic code was ported from the full C ADPCM code.

    Norm
    Last edited by Normnet; - 14th August 2010 at 19:46.

  10. #10
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by scalerobotics View Post
    Is it just me, or is anyone else having problems finding Norms code? Might be a firewall issue, .
    Hi, Walter

    Lol ...

    But ... would this help ???

    Alain
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by Acetronics2; - 14th August 2010 at 20:07.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  11. #11
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Microchip sound playing and recording application note AN643

    I had not seen this before. I have not played the files from a PIC yet, but it sounds interesting as well. This C code uses a "simplified Adaptive Differential Pulse Code Modulation (ADPCM) algorithm". The files look slightly larger than the Roman Black files, but not by much, comparing to the numbers files sizes. The source code also has an executable file called winspeech.exe which encodes wave files.

    Name:  WinSpeech.PNG
Views: 1353
Size:  13.4 KB

    Source code: http://ww1.microchip.com/downloads/e...otes/an643.zip
    Attached Images Attached Images
    Last edited by ScaleRobotics; - 14th August 2010 at 17:09.
    http://www.scalerobotics.com

  12. #12
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by scalerobotics View Post
    I had not seen this before. I have not played the files from a PIC yet, but it sounds interesting as well. This C code uses a "simplified Adaptive Differential Pulse Code Modulation (ADPCM) algorithm". The files look slightly larger than the Roman Black files, but not by much, comparing to the numbers files sizes.

    Source code: http://ww1.microchip.com/downloads/e...otes/an643.zip
    See M25P32 PIC Audio.
    Options include 16 bit ADPCM compression to 4 bit in Basic.

    Sound quality far better than Roman Black's.
    The M25P32 may not be as easily found by now as its transfered ownership.

    Norm

  13. #13
    leetzeyin's Avatar
    leetzeyin Guest


    Did you find this post helpful? Yes | No

    Smile

    Hi,

    this is the first time i'm using the sound encoder, but i'm writing the software in mikroC language. Does anyone here knows mikroC language (or C language)?




    Where should i call the .C file function(below) from my main program?

    void sound_data1() org (1 * 256)
    {
    asm retlw 0x12 ;
    asm retlw 0x5E ; .....}

    i tried to write like this:
    PORTB.F4=sound_data1();
    but i don't think is correct because there are 2 output ports from the PIC shown in the diagram.


    // Digital ----------2R-----,
    // |
    // Digital ----------2R-----*----- Analogue
    // | out
    // |
    // |
    // C = 0.22 uF
    // |
    // |
    // |
    // Gnd




    Thanks !!!

  14. #14
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Wink

    Hi, Leetzeyin

    Why not ask it directly here :

    http://www.mikroe.com/forum/viewforu...4d9546d98f2797

    I think they already dealt with this encoding system ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  15. #15
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Hi, Leetzeyin
    Why not ask it directly here :
    Alain
    Didn't you get the memo?
    Apparently, PicBasicPro = mikroC = Proton Basic = mikroBasic = Assembly = Everything else...

  16. #16
    Join Date
    Jan 2007
    Location
    Brazil
    Posts
    108


    Did you find this post helpful? Yes | No

    Default eeprom..

    How do I download the .btc or .asm or .c file to the eeprom?

    Thanks..!
    Sylvio,

  17. #17
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    I did some experimenting with storing the sound in external EEPROM.
    And for sure, you have to be using the MSSP module to read the data.
    SHIFTIN or I2CREAD can't keep up with the higher bitrates.

    I tried contacting Roman several times by email, and never got an answer, so I kind of forgot about it, and haven't done anymore with it.
    <br>
    DT

  18. #18
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Roman Black Numbers

    Here are some number sound files and Darrel Taylor's example program that allow your PIC chip to talk out numbers to you. The RB sound files are pretty scratchy, so if you want a professional sounding product, this is not the way to do it. But it is understandable, and sure beats counting the flashes of an LED. It also uses a lot of storage space for the sound files. But the fact that you can store them on a chip, is pretty cool. Darrel's RB_Sound include file was used, as well as his testRBsound program . Check out post # 5 for his post in this thread.

    Here is the suggested filter (Roman Black) that may make it sound a little better.

    ; R = 25968 ohms
    ;
    ; Digital -----------R-----*----- Analogue
    ; | out
    ; |
    ; |
    ; C = 0.22 uF
    ; |
    ; |
    ; |
    ; Gnd
    ;

    Code:
    '*********************************************************************
    '*  Name    : TestRBsound.pbp  from Darrel Taylor                    *
    '*  Author  : Darrel Taylor, modified by Walter Dunckel for numbers  *
    '*  Date    : 5/24/2010                                              *
    '*  Version : 0.1                                                    *
    '*  Notes   : This version is limited to 18F's                       *
    '*          : with only 1 sound at a time                            *
    '*********************************************************************
    ;-- Target = 18F4550 --
    
    asm
       __CONFIG    _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
       __CONFIG    _CONFIG1H, _FOSC_HSPLL_HS_1H
       __CONFIG    _CONFIG2L, _PWRT_ON_2L & _BOR_OFF_2L & _VREGEN_ON_2L
       __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
       __CONFIG    _CONFIG3H, _PBADEN_OFF_3H
       __CONFIG    _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
    endasm
    
    DEFINE OSC 48
    btc_Pin1  VAR PORTC.1   'sound output pin
    btc_Pin2 var portC.3      'dummy pin to keep DT_RBSound.pbp happy
    LATE_LED var PORTD.0
    
    DEFINE  btc_DATA  db
    INCLUDE "DT_RBSound.pbp"
    
    @   ImportSound n0,    "zero.asm"
    @   ImportSound n1,    "one.asm"
    @   ImportSound n2,    "two.asm"
    @   ImportSound n3,    "three.asm"
    @   ImportSound n4,    "four.asm"
    @   ImportSound n5,    "five.asm"
    @   ImportSound n6,    "six.asm"
    @   ImportSound n7,    "seven.asm"
    @   ImportSound n8,    "eight.asm"
    @   ImportSound n9,    "nine.asm"
    @   ImportSound n10,    "ten.asm"
    @   ImportSound n11,    "eleven.asm"
    @   ImportSound n12,    "twelve.asm"
    @   ImportSound n13,    "thirteen.asm"
    @   ImportSound n14,    "fourteen.asm"
    @   ImportSound n15,    "fifteen.asm"
    @   ImportSound n16,    "sixteen.asm"
    @   ImportSound n17,    "seventeen.asm"
    @   ImportSound n18,    "eighteen.asm"
    @   ImportSound n19,    "nineteen.asm"
    @   ImportSound n20,    "twenty.asm"
    @   ImportSound n30,    "thirty.asm"
    @   ImportSound n40,    "forty.asm"
    @   ImportSound n50,    "fifty.asm"
    @   ImportSound n60,    "sixty.asm"
    @   ImportSound n70,    "seventy.asm"
    @   ImportSound n80,    "eighty.asm"
    @   ImportSound n90,    "ninety.asm"
    @   ImportSound n100,    "hundred.asm"
    @   ImportSound n1000,    "thousand.asm"
    
    Main: 'says 140,259
        @ PlaySound n1
        pause 100
        @ PlaySound n100
        pause 100
        @ PlaySound n40
        pause 100
        @ PlaySound n1000
        pause 100
        @ PlaySound n2
        pause 100
        @ PlaySound n100
        pause 100
        @ PlaySound n50
        pause 100
        @ PlaySound n9
        pause 3000
    goto main
    The attached audio sample audio-sound-mp3.zip using a 18f4550 in PIC-USB-STK hardware from Olimex. But you can also get similar sound out of a non amplified piezo speaker using a 5uf capacitor.
    Attached Files Attached Files
    Last edited by ScaleRobotics; - 27th May 2010 at 00:20.

Similar Threads

  1. Delayed output 10 secs
    By lilimike in forum mel PIC BASIC Pro
    Replies: 37
    Last Post: - 14th October 2011, 06:28
  2. new to PIC programming could really do with some help
    By karenhornby in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 5th March 2008, 14:03
  3. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 20:36
  4. Sound and sound control with minimal parts
    By bartman in forum General
    Replies: 23
    Last Post: - 18th January 2005, 14:08
  5. Re: quick fix for sound command?
    By Melanie in forum Code Examples
    Replies: 0
    Last Post: - 9th July 2004, 01:44

Members who have read this thread : 2

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts