From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Cedric Roux Newsgroups: gmane.comp.audio.sox.devel Subject: Re: dev request Date: Mon, 09 Sep 2013 16:13:58 +0200 Message-ID: <522DD7A6.1010500@free.fr> References: Reply-To: sox-devel@lists.sourceforge.net NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050508080908060301040506" X-Trace: ger.gmane.org 1378736097 27553 80.91.229.3 (9 Sep 2013 14:14:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 9 Sep 2013 14:14:57 +0000 (UTC) To: sox-devel@lists.sourceforge.net Original-X-From: sox-devel-bounces@lists.sourceforge.net Mon Sep 09 16:15:00 2013 Return-path: Envelope-to: gcasd-sox-devel@m.gmane.org X-ACL-Warn: User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 In-Reply-To: X-Spam-Score: 0.0 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.27.42.6 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sed[at]free.fr) X-Headers-End: 1VJ2Ep-0003KM-V8 X-BeenThere: sox-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: sox-devel-bounces@lists.sourceforge.net Xref: news.gmane.org gmane.comp.audio.sox.devel:329 Archived-At: Received: from lists.sourceforge.net ([216.34.181.88]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VJ2F1-0006T8-Lv for gcasd-sox-devel@m.gmane.org; Mon, 09 Sep 2013 16:15:00 +0200 Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1VJ2Eu-0005Nj-KC; Mon, 09 Sep 2013 14:14:52 +0000 Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1VJ2Es-0005Nd-Hq for sox-devel@lists.sourceforge.net; Mon, 09 Sep 2013 14:14:50 +0000 Received: from smtp6-g21.free.fr ([212.27.42.6]) by sog-mx-4.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1VJ2Ep-0003KM-V8 for sox-devel@lists.sourceforge.net; Mon, 09 Sep 2013 14:14:50 +0000 Received: from [192.168.1.12] (unknown [83.201.29.150]) (Authenticated sender: sed) by smtp6-g21.free.fr (Postfix) with ESMTPSA id 8EAA382363 for ; Mon, 9 Sep 2013 16:14:37 +0200 (CEST) This is a multi-part message in MIME format. --------------050508080908060301040506 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable On 09/08/2013 11:08 PM, Brad Holland | Muzik Liberated wrote: > Hey Guys, > Since you are sox developers we thought that you may well be the best p= eople to talk to. > We are looking for a small script (perhaps using sox) that scans a raw = audio file and applies some modulation to the audio file which amplifies = the content at specific points (when the signal is lower than -6db) and = continues to do this every time the sound does this throughout its decay. > > This is to combat 8-bit sample artifacts when creating custom roms for = a drum machine. (Alesis HR-16). There is a special ASIC chip in this mac= hine that detects a 6db spike in a waveform and the chip then turns down = the gain -6db in essence, by keeping the amplitude of the waveform above = the noise floor inherent in an 8-bit audio data you are able to achieve m= uch higher fidelity in short decaying 'drum shot' type sounds. > > We are a community of enthusiasts for the machine, although none of us = could code anything like this. We'd be willing to pay/donate to the proje= ct or an individual to knock us up a bit of code to convert this.. > > A much more in-depth explanation of the process we need to accomplish i= s written in this post:http://www.burnkit2600.com/diy-sound-roms/ > > If someone is interested in helping us with this please get back to me! > > Cheers > Brad Hi Brad, attached hack might do the trick. If not, tell me, I'll have a closer look, there might be bugs in there (just a quick and dirty hack). You can compile it, right? If you're using windows you may need to change stuff in there to handle binary files correctly. Anyway, just tell me if something is wrong, whatever it is. Regards, C=E9dric. --------------050508080908060301040506 Content-Type: text/x-csrc; name="christmas.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="christmas.c" #include #include #include #include int main(int n, char **v) { char *infile; char *outfile; FILE *f; struct stat s; float *data; float *max; ssize_t size; ssize_t i; float gain; int up; float last; if (n != 3) { printf("gimme \n"); return 1; } infile = v[1]; outfile = v[2]; if (stat(infile, &s)) { perror(infile); return 1; } size = s.st_size; data = malloc(size * sizeof(float)); if (data == NULL) abort(); max = malloc(size * sizeof(float)); if (max == NULL) abort(); f = fopen(infile, "rb"); if (f == NULL) { perror(infile); return 1; } fread(data, size, 4, f); fclose(f); max[size-1] = fabsf(data[size-1]); /* populate max */ for (i = size-2; i >= 0; i--) { float m = fabsf(data[i]); if (m > max[i+1]) max[i] = m; else max[i] = max[i+1]; } /* apply gain */ gain = 1; up = 1; last = data[0]; for (i = 0; i < size; i++) { data[i] *= gain; max[i] *= gain; if (up == 0 && data[i] > last) { /* local minimum */ if (max[i] <= 0.5) gain *= 2; } if (data[i] > last) up = 1; else if (data[i] < last) up = 0; last = data[i]; } f = fopen(outfile, "wb"); if (f == NULL) { perror(outfile); return 1; } fwrite(data, size, 4, f); fclose(f); return 0; } --------------050508080908060301040506 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk --------------050508080908060301040506 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ SoX-devel mailing list SoX-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sox-devel --------------050508080908060301040506--