Csound Csound-dev Csound-tekno Search About

[programming] BMP <--> WAV

Date1998-08-03 15:20
FromDavid Schuyeteneer
Subject[programming] BMP <--> WAV
This has nothing to do with Csound, but since there are some pc/win95
people
here with sound and programming experience....I thought...


My question is : I'm writing a tool for DOS that converts a BMP to WAV and
vice
versa. I have problems with the WAV header :  the dataheader (where the
string
"data" should be found has appearantly four (4) bytes to much...How can
this
be solved....instead of the string "DATA" I get a garbage ascii character. 

Has anyone experience with writing a WAV file reader/writer in PASCAL ???µ
I use Borland Pascal v7...

thanks,
David.



Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa10768;
          3 Aug 98 16:37 BST
Received: from mercury.bath.ac.uk by stork.maths.Bath.AC.UK id aa04449;
          3 Aug 98 16:37 BST
Received: (qmail 16636 invoked from network); 3 Aug 1998 15:37:18 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by mercury.bath.ac.uk with SMTP; 3 Aug 1998 15:37:18 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (QAA10743); Mon, 3 Aug 1998 16:32:48 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 3 Aug 1998 16:32:37 +0100
Received: from gateway1.sema.co.uk [194.216.60.2] by hermes via ESMTP (QAA14056); Mon, 3 Aug 1998 16:32:36 +0100 (BST)
Received: from lones1.sema.co.uk (lones1.sema.co.uk [157.203.40.186]) by gateway1.sema.co.uk (8.8.3/8.8.3) with ESMTP id QAA10563 for ; Mon, 3 Aug 1998 16:33:38 +0100 (BST)
Message-Id: <199808031533.QAA10563@gateway1.sema.co.uk>
Received: by lones1.sema.co.uk with Internet Mail Service (5.5.2232.9)
	id ; Mon, 3 Aug 1998 16:32:47 +0100
From: WARD Giles 
To: "'csound@maths.ex.ac.uk'" 
Subject: Re: [programming] BMP  <-->  WAV
Date: Tue, 3 Aug 1999 16:30:28 +0100 
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2232.9)
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk


> This has nothing to do with Csound, but since there are some pc/win95
> people
> here with sound and programming experience....I thought...
> 
> 
> My question is : I'm writing a tool for DOS that converts a BMP to WAV and
> vice
> versa. I have problems with the WAV header :  the dataheader (where the
> string
> "data" should be found has appearantly four (4) bytes to much...How can
> this
> be solved....instead of the string "DATA" I get a garbage ascii character.
> 
> 
> Has anyone experience with writing a WAV file reader/writer in PASCAL ???µ
> I use Borland Pascal v7...
> 
Whilst we're on this subject, does the CSound source contain routines for
dealing with WAV/AIFF chunks?  Or does anyone know of good libraries for
doing so in C/VB/pascal?

Giles



Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa11109;
          3 Aug 98 17:32 BST
Received: from mercury.bath.ac.uk by stork.maths.Bath.AC.UK id aa07445;
          3 Aug 98 17:32 BST
Received: (qmail 18900 invoked from network); 3 Aug 1998 16:32:24 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by mercury.bath.ac.uk with SMTP; 3 Aug 1998 16:32:24 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (RAA18943); Mon, 3 Aug 1998 17:20:15 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 3 Aug 1998 17:20:04 +0100
Received: from exim@wallace.maths.bath.ac.uk [138.38.100.104] by hermes via ESMTP (RAA11941); Mon, 3 Aug 1998 17:20:03 +0100 (BST)
Received: from [138.38.99.25] (helo=maths.Bath.AC.UK ident=mmdf)
	by wallace.maths.bath.ac.uk with smtp (Exim 1.92 #2)
	id 0z3NLD-0001D2-00; Mon, 3 Aug 1998 17:20:07 +0100
Date:     Mon, 3 Aug 98 17:20:11 BST
From: J P Fitch 
To: WARD Giles 
cc: "'csound@maths.ex.ac.uk'" 
Subject:  Re:  [programming] BMP <--> WAV
Message-Id: 
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

Of course Csound has such code.  The wave stuff is in wave.c and AIFF in
aiff.c
  Latest version even has a little AIFC
=John


Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa11214;
          3 Aug 98 18:17 BST
Received: from mercury.bath.ac.uk by stork.maths.Bath.AC.UK id aa09829;
          3 Aug 98 18:17 BST
Received: (qmail 20191 invoked from network); 3 Aug 1998 17:17:45 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by mercury.bath.ac.uk with SMTP; 3 Aug 1998 17:17:45 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (SAA21313); Mon, 3 Aug 1998 18:13:12 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 3 Aug 1998 18:13:03 +0100
Received: from m1.gtn.net [207.176.194.10] by hermes via ESMTP (SAA22617); Mon, 3 Aug 1998 18:13:02 +0100 (BST)
Received: from nic.gtn.net ([207.176.194.200]) by m1.gtn.net
          (post.office MTA v2.0 0813 ID# 0-13297) with ESMTP id AAA174
          for ; Mon, 3 Aug 1998 13:12:53 -0400
Received: from gtn.net (dial19.gtn.net [207.176.194.119])
	by nic.gtn.net (8.8.8/8.8.7) with ESMTP id NAA29006
	for ; Mon, 3 Aug 1998 13:19:23 -0400 (EDT)
Message-ID: <35C5F1BD.FBF76796@gtn.net>
Date: Mon, 03 Aug 1998 13:22:05 -0400
From: Brandon Nelson 
X-Mailer: Mozilla 4.05 (Macintosh; U; PPC)
MIME-Version: 1.0
To: csound 
Subject: Pitchbend on Perf 3.47
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

While on the subject of problems with Mac, MIDI & CSound, I've not been able
to get the pitch bend to work. I've tried all the cpsmidib/pchmidib and the
pchbend opcodes with k rate variables, but pitch bend is never tracked. Anyone
else able to get it to work with Perf 3.47?

Brandon



Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa11891;
          3 Aug 98 23:39 BST
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa23564;
          3 Aug 98 23:39 BST
Received: (qmail 21906 invoked from network); 3 Aug 1998 22:39:08 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 3 Aug 1998 22:39:08 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (XAA05090); Mon, 3 Aug 1998 23:35:20 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 3 Aug 1998 23:35:11 +0100
Received: from ella.mills.edu [144.91.3.20] by hermes via SMTP (XAA23129); Mon, 3 Aug 1998 23:35:09 +0100 (BST)
Received: (qmail 22198 invoked by uid 1964); 3 Aug 1998 15:34:40 -0700
Date: Mon, 3 Aug 1998 15:34:40 -0700 (PDT)
From: "Matt J. Ingalls" 
To: csound@maths.ex.ac.uk
Subject: Mac Csound PPC 3.484(beta)
Message-ID: 
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk


BETA RELEASE		aug3.98
	Csound for Power Macintosh
===================This Version: 
	fFitch code base	3.484
	Perf "engine"		3.484 beta(0)
	Csound "front end"  	1.0 beta(0)
	
Available From:
	ftp://mills.edu/ccm/csound.ppc

===================This needs testing!  No doubt things will not
work.  When you find a potential bug don't
hesitate to email csound-dev@mills.edu
so we can fix the problem. (however, you may
first want to read the "known bugs" below)

If this "beta" version proves stable enough,
we will put out source
NOTE:  You do NOT need to remove old versions
from your hard disk anymore.  Csound/Perf now just
looks for the most recent(ly created) version of
its partner and talks to that one.  If this beta 
version is not working properly for you, you will 
need to remove both "CSound" and "Perf" applications
from your computer to use older Csound versions.

Thank you and enjoy.

===================WHAT'S HERE
===================Csound3.484beta.sit
	- new beta versions of Csound and Perf
Docs_csRef_&_Examples
	- new Csound Manual PPC (word)
	- csRef 3.47
	- Csound Manual 3.47 (docMaker)
	- old Example orc/scos
MrTweaky.sit.hqx 
	- app to convert anal files to ASCII
csRef68k.sea.hqx
Older_Versions/
	- older Perf and Csound versions
source/ 
	Mr Tweaky source
===================KNOWN BUGS/INCOMPLETE FEATURES
===================Documentation and Examples:
- has not yet been brought up todate.

Perf:
- Sometimes playback may cut off the last fraction of a
	second of the sound or (more likely and less serious)
	"hangs" for a moment after playback or when user hits 
	the transport then might give a slight "sputter"
	(problems with new OS -- will need work to fix)
- Transport is sometimes sluggish.
- RT Audio has not been tested!!!
- PostScript file write of graphics either does not
	work or writes only the first table???
- cant copy from listing window/Edit menu disabled
- Progress/Profile feature currently disabled

Front End:
- Sometimes Graphics submenu doesnt appear. (???)
- Reset All Options/Prefs does not update open windows
- Default Dirs by button flashes when appears, and if 
	dialog is already open stays in background.
- If Direct Rendering and you start CSound,
	project window doesnt open by default.
- "Synthesizing" output file name automatically might 
	sometimes replace a filename user already typed in.
	(could make this an option..)
	
===================CHANGES FROM LAST VERSION
===================Perf:
- reconciliation with canonical(fFitch) code
  (with tons of changes/bug fixes -- see his release notes)
- changed about box and version numbers
- changed default window placements
- output window makes sure it is inside current screen size
- put in a hack in sound playback to prevent cutting off the
	end of the sound.  makes transport seem sluggish. and still
	doesnt remove the bug sometimes!!!
- listing file now created and still have output window display
- added file and edit menus
- various flag letter changes to be compatible with canonical
	sources (see below)	
- Changed file creator type to SoundHack, since we like tom 
	MUCH better than Digidesign - plus seems the only other app
   	to support AIFC-floating point.
- Fixed RT MIDI crash

Front End:
- make listing file "double-click-able" to open
	with the text editor and fixed bugs with selecting
	directory to be created.
- made project window have a "zoom" mode that
	only shows orc/sco/output and generate button.
- made a small button (lower/middle left) to "zoom"
	in and out of this view mode
- added a "View Files in Text Editor" command in the
	File menu.
- updated look to smaller fonts/ rearranged
	graphic placements all around.
- fixed bug "safety" overwrite feature contaminated
	SFDIR
- changed PVANAL to Max 65536 frame size and default hopsize
	to 64
- added progress/profile window so:
- eliminated "heartbeat" option
- made 32-bit float selection and SDII and WAV selection
	enable/disable popups according to whats possible.
- chaged color
- reworded "rescale" options, "render" and "sample size"
- changed default window placement
- made UTILS, Gen Prefs, and Directory dlogs modeless
- moved options out of preference window and into general
	prefs dlog since most dealt with text editor/post
	processsor which were in the gen pref window.
- changed about box and version numbers
- Put all Graphics options in a submenu
- added unsigned char sample size
- moved "Terminate on MIDI track end" option to MIDI dlog
- removed "Scot" option as it is no longer supported
- made output soundfile extension relate to header type
	(*.aiff, *.aifc, *.snd. *.wav)
- changed some of the default options/settings
- ???  (we kind of stopped documenting 
		these things for a while)

===================NOTE TO DEVELOPERS AND USERS OF
OTHER FRONT END "LAUNCHERS"
===================We have completely consolidated our sources and canonical 3.484 source. 
To do this, we had to change some of our Mac-Specific command 
line flags.  If you are a developer of a front end "launcher" 
that uses "Perf" you may have to change your application to 
accommodate.  The Mac-Specific flags are now:

-X fnam		Sound File Directory
-q fnam		Sound Sample-In Directory
-Q fnam		Analysis Directory
-V N		Number of chars in screen buffer for output window
-E N		Number of tables in graphics window
-p			Play after rendering
-e			Rescaled floats as shorts to max amplitude
-w			Record and Save MIDI input to a file
-y N		Enables Progress Display at rate N seconds
				or for negative N, at -N kperiods
-Y N		Enables Profile Display at rate N in seconds
				or for negative N, at -N kperiods
-- fnam		log output to file ("listing" file)

===================TO DO (short term)
===================- save window locations
- save user options in pref file rather
	than the application
- enable progress/profile (get code from dave)
- progress/profile on utils
- add user able to set creator of generated files
- cancel on score generation
- make output filename extension an option
- get perf to stop w/ cmd-period
- get perf playback play/stop with space bar?
- make score optional
- compile 68k version
- add a "sndinfo" button next to outputfile
- have option to not show output window at all
	(only to listing)???
- have project/orc files differences transparant
	
===================TO DO (long term)
===================- separate windows for dispfft and display
- try to patch "dribble" output to a file to
	output in the front end instead




matt ingalls
mingalls@concentric.net