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.
> 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
>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
>
>
>> 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 :-)
>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.
>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
> 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.
"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.
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
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
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...
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.
> 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
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).