Searching \ for '[PIC] LUT from sound file?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=sound
Search entire site for: 'LUT from sound file?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] LUT from sound file?'
2005\03\09@230947 by Peter Nielsen

flavicon
face
Sorry for the repeat. This was my first question and I neglected to put
[PIC] in the subject line so maybe most readers didn't receive or read it.
Anyway, I was surprised at the lack of response from such a knowledgable
group, so just to be sure ... here it is again.

I need to produce 8 bit LUT's of a single cycle of varying shaped waveforms
generated in an audio waveform editor.

Programs such as CoolEdit (now Adobe Audition) can generate arbitary waves
at 255sps and save as ASCII text data which gives numerical values that
then need to be converted one-by-one to hex. This seems like a round-about
approach. Does anyone have a better suggestion?

I would have thought this need might have been previously addressed by some
program that would convert a WAV or raw PCM file to a LUT, where the user
specifies the desired number of values. It certainly would be handy.

Thanks for any advice on this.

Peter Nielsen

2005\03\10@011707 by Robert Rolf

picon face
Peter Nielsen wrote:

> Sorry for the repeat. This was my first question and I neglected to put
> [PIC] in the subject line so maybe most readers didn't receive or read it.

Yep.

> Anyway, I was surprised at the lack of response from such a knowledgable
> group, so just to be sure ... here it is again.

If we don't respond it's probably because we don't have a ready
answer. Or the answer is so obvious we can't be bothered to state it.

> I need to produce 8 bit LUT's of a single cycle of varying shaped waveforms
> generated in an audio waveform editor.
>
> Programs such as CoolEdit (now Adobe Audition) can generate arbitary waves
> at 255sps and save as ASCII text data which gives numerical values that
> then need to be converted one-by-one to hex.

Why convert? Why not set the assembler default radix to decimal?

> This seems like a round-about
> approach. Does anyone have a better suggestion?

Use an editor in column mode to add your 255 "  DB " prefix to the
values. Word can do it, then save as ASCII.

You can also use excel to generate your values and produce
a 'report' with the required prefix characters.

> I would have thought this need might have been previously addressed by some
> program that would convert a WAV or raw PCM file to a LUT, where the user
> specifies the desired number of values. It certainly would be handy.

The was previously discussed on the list. Olin? has some tools for
encoding sound files into data tables.
Search the archive. http://www.piclist.com

R

2005\03\10@023911 by Ake Hedman

flavicon
face
Peter Nielsen wrote:

{Quote hidden}

There are many tools available for this. http://www.softforall.com/mp3naudoi/RippersEncoders/Complete_Audio_Converter_Pro01090043.htm is one sample.

BTW is [PIC] the right tag for this subject? ;-)
Cheers
/Ake

--  ---
Ake Hedman (YAP - Yet Another Programmer)
eurosource, Brattbergavägen 17, 820 50 LOS, Sweden
Phone: (46) 657 413430 Cellular: (46) 73 84 84 102
Company home: http://www.eurosource.se      Kryddor/Te/Kaffe: http://www.brattberg.com
Personal homepage: http://www.eurosource.se/akhe
Automated home: http://www.vscp.org

2005\03\10@024958 by Russell McMahon

face
flavicon
face
>> Sorry for the repeat. This was my first question and I neglected to
>> put
>> [PIC] in the subject line so maybe most readers didn't receive or
>> read it.

> Yep.

>> Anyway, I was surprised at the lack of response from such a
>> knowledgable
>> group, so just to be sure ... here it is again.

> If we don't respond it's probably because we don't have a ready
> answer. Or the answer is so obvious we can't be bothered to state
> it.

These two responses don't seem to be well correlated :-)


       RM

2005\03\10@035047 by Jan-Erik Soderholm
face picon face
> if I only knew, what a LUT is....

Look Up Table.



2005\03\10@040812 by Alan B. Pearce

face picon face
>Programs such as CoolEdit (now Adobe Audition) can generate arbitary waves
>at 255sps and save as ASCII text data which gives numerical values that
>then need to be converted one-by-one to hex. This seems like a round-about
>approach. Does anyone have a better suggestion?

Well two possibilities

Import the decimal values, and precede the table with the operator that
define decimal as the default.

The second is to import the decimal values in a column in Excel, and use the
hex operator to get the hex values in the next column, which you can then
copy out.

2005\03\10@040953 by Mike Harrison

flavicon
face
On Thu, 10 Mar 2005 15:05:39 +1100, you wrote:

>Sorry for the repeat. This was my first question and I neglected to put
>[PIC] in the subject line so maybe most readers didn't receive or read it.
>Anyway, I was surprised at the lack of response from such a knowledgable
>group, so just to be sure ... here it is again.
>
>I need to produce 8 bit LUT's of a single cycle of varying shaped waveforms
>generated in an audio waveform editor.
>
>Programs such as CoolEdit (now Adobe Audition) can generate arbitary waves
>at 255sps and save as ASCII text data which gives numerical values that
>then need to be converted one-by-one to hex. This seems like a round-about
>approach. Does anyone have a better suggestion?

you don't need to convert to hex - you can do 'radix dec' before the data

If you're only doing a few, then search and replace in  decent text editor will get you most of the
way from a list of numbers to something you can put in a source file.
If you need to do any numeric conversion, either use excel, or have a macro e.g


radix dec

macro snd a
dt a/2+128
endm

sounddata

snd 120
snd 100


radix hex



2005\03\10@043612 by Jan-Erik Soderholm

face picon face
> On Thu, 10 Mar 2005 15:05:39 +1100, you wrote:
>
> > Programs such as CoolEdit (now Adobe Audition) can generate
> > arbitary waves
> > at 255sps and save as ASCII text data which gives numerical
> >  values that
> > then need to be converted one-by-one to hex. This seems like
> > a round-about
> > approach. Does anyone have a better suggestion?

If you're like me, I guess that you'dlike something that
can run in "batch", like in a BAT file or something. IMHO,
having to fire up Excel or similar "heavy" tools isn't what
one would liketo do. At least not if this will be run on a
regular basis. (The "Windows Scripting" tool from Microsoft
might be another option, b.t.w) This was you can rellativily easy
integrate the WAV->LUT tool with MPASM in the same BAT
file, if you'd like, for an automated "build" directly from the
WAV file.

Personaly I'm quite found of WinBatch from Wilson WindowWare.
See http://www.winbatch.com.

Actulay, the WinBatch quick intro is quite funny :
http://www.winbatch.com/quickstart.html

Quote :

"WinBatch is a bunch of software that allows people to create
their own software programs to do stuff on their own computers.
This is done by "programming", which is, basically, sitting in front
of a computer and typing in a bunch of text, called "code"."

If you didn't knew already... :-)
Enjoy,
Jan-Erik.



2005\03\10@074204 by olin_piclist

face picon face
Peter Nielsen wrote:
> I would have thought this need might have been previously addressed by
> some program that would convert a WAV or raw PCM file to a LUT, where
> the user specifies the desired number of values. It certainly would be
> handy.

I have some WAV file manipulation programs at
http://www.embedinc.com/pic/dload.htm.  Among other things, this software
can resample a WAV file to a different sample rate, extract only sections of
the original, and write WAV data to a text file in comma separated values
format.  From there it would only take a few edit operations to produce a
table in MPASM format.

Another program is part of the HAL firmware on the same page.  It is
specific to the HAL firmware, but takes a WAV file and produces an MPASM
include file.  This table is intended for 14 bit core machines and contains
two 7 bit samples per word.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

2005\03\10@075100 by olin_piclist

face picon face
Palmed GmbH wrote:
> if I only knew, what a LUT is....

Look Up Table.

> mit freundlichen Grüßen

Oh, in that case maybe something like
Aufschlagzahlenindercomputervergisnessmittel?


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.co

2005\03\10@075244 by olin_piclist

face picon face
Alan B. Pearce wrote:
> Well two possibilities
>
> Import the decimal values, and precede the table with the operator that
> define decimal as the default.
>
> The second is to import the decimal values in a column in Excel, and
> use the hex operator to get the hex values in the next column, which
> you can then copy out.

To me the far more obvious answer is to set decimal as the default radix
anyway.  I'd rather have HEX be the exception.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

2005\03\10@110900 by peiserma

flavicon
face
piclist-bounces@mit.edu wrote:
> Aufschlagzahlenindercomputervergisnessmittel? Pardon?

tongue-in-cheek humor poking fun at our habit of creating
really long compound words.

if you use LEO to translate 'look up', one of the results
you get is 'eine Tabelle aufschlagen'

maybe instead of 'aufschlag' it should be 'nachschlag(en)'

having to explain a joke makes it non-funny. No wonder
everyone considers Germans so serious :)

RechnerTabellenaufschlag?

2005\03\10@114342 by William Chops Westfield

face picon face
On Mar 10, 2005, at 1:36 AM, Jan-Erik Soderholm wrote:

> If you're like me, I guess that you'dlike something that
> can run in "batch", like in a BAT file or something.

There are all sorts of unix shell scripting languages that
do this thing pretty easily; all you need to do is install
one of those windows packages that includes a unix shell and
appropriate utilities.  I did this to create a "utility" to
copy from a kid's digital camera flash card to appropriate
places and fire up irfanview, once...

OTOH, the last time I needed to do some very basic unix shell
scripting, I gave up trying to figure out the various obscure
and inconsistent shells and stuff, and just wrote a little
C program (already knowing C) to do it instead...

BillW

2005\03\10@120000 by Ake Hedman

flavicon
face
Peter,

I don't understand the need for all the extra work. If the 8-bit wav file is converted to a PCM file (uncompressed wav) the binary values are already there. Use a hex editor or build a simple script (as Bill suggest) if needed to do repeatedly.

Cheers
/Ake


William Chops Westfield wrote:

{Quote hidden}

--  ---
Ake Hedman (YAP - Yet Another Programmer)
eurosource, Brattbergavägen 17, 820 50 LOS, Sweden
Phone: (46) 657 413430 Cellular: (46) 73 84 84 102
Company home: http://www.eurosource.se      Kryddor/Te/Kaffe: http://www.brattberg.com
Personal homepage: http://www.eurosource.se/akhe
Automated home: http://www.vscp.org

2005\03\10@133536 by Peter L. Peres

picon face


On Thu, 10 Mar 2005, William Chops Westfield wrote:

> OTOH, the last time I needed to do some very basic unix shell
> scripting, I gave up trying to figure out the various obscure
> and inconsistent shells and stuff, and just wrote a little
> C program (already knowing C) to do it instead...

I find that as I get proficient with the (200+) various scripting
languages available I started using scripting languages *instead* of
proper C programs. The last instance for me being a bit-banged a/d
converter which I had to read out to figure out some glitches, in the
form of a realtime scope with recording facility, and I caught myself
writing the i/o readout and scope gui in tcl, this taking less than half
a day. The odd thing was, that it worked (in real time), and it was less
than 200 lines of code. Then I converted to a X11/Xlib program written
in C and that worked too, but the speed gains were not so great ... (bit
banged io is very slow).

Peter

More... (looser matching)
- Last day of these posts
- In 2005 , 2006 only
- Today
- New search...