From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Zelphir Kaltstahl Newsgroups: gmane.lisp.guile.user Subject: I've made a sound/audio thing Date: Sun, 4 Sep 2022 12:16:16 +0000 Message-ID: <017e97d7-bccd-e6a7-5ef2-55e302e8459e@posteo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4207"; mail-complaints-to="usenet@ciao.gmane.io" To: Guile User Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun Sep 04 14:16:40 2022 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oUoYK-0000ui-8d for guile-user@m.gmane-mx.org; Sun, 04 Sep 2022 14:16:40 +0200 Original-Received: from localhost ([::1]:45928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oUoYI-0004DF-Lb for guile-user@m.gmane-mx.org; Sun, 04 Sep 2022 08:16:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUoY5-0004D6-AT for guile-user@gnu.org; Sun, 04 Sep 2022 08:16:25 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:45189) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUoY1-0002wB-U9 for guile-user@gnu.org; Sun, 04 Sep 2022 08:16:24 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 2191E240028 for ; Sun, 4 Sep 2022 14:16:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1662293778; bh=lMAX6zOWc9xSCQeP0KJWVua3vETu6tHrxdzNUP7RQao=; h=Date:To:From:Subject:From; b=TPPdE5bzDHVo74ILTwfgw3mldwawMVgifnpTzt+8mv+hdfCuzgZY+D1V08iavOPWa x3GPmLVlDvf3XbxFOQYrCxjMU3ExKGQRSzestIBMUvGvi348RS0dK3Hg4Qj7Zf3aWI 8IcW0C6vnHjwMjhSql0R7xapOPvRebxMzBHH6vwyhxrcIpKzm6G4ckSJWdg1jKqvv8 SwsepIi5EeAh1i245smRLLwXN8ao1vdYuDi66KZyNW1fvdP/GD7TBhvzumCBA9CBwH qfgH2QHKRik/nKXpEE0R7iK+rBdljrx/HLQqz0/xvthLzlKu5GEHIotwCxhXWxasKm CGAssYLe+PodA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4ML9c13HMVz6tp1 for ; Sun, 4 Sep 2022 14:16:17 +0200 (CEST) Content-Language: en-US Received-SPF: pass client-ip=185.67.36.65; envelope-from=zelphirkaltstahl@posteo.de; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:18567 Archived-At: Hello Guile users! Recently I've looked at "how to write a wav file?" and wrote some code to output in RIFF-WAVE fie format: https://notabug.org/ZelphirKaltstahl/guile-examples/src/master/sound/riff-wave. It only writes a file currently, and does not read in any files yet. Hopefully I will work on it more soon. My idea is, that Guile should be kind of perfect for making functions, which output sample values. Just combining functions. I want to make more effects like fade-in and fade out, amplify, change of sample rate or whatever else is simple to do. Already implemented things like a function to make another function "stepped" (is what I call it), so that one only gives an integer and it will give the sample of the index that is that integer, considering a previously given step size. I imagine, that it should be possible, to build good abstractions over sample values and then give helper functions allowing anyone to make their own effects and so on. When reading in files is implemented, one could easily write a little Guile code and apply effects to any wav file. I know libsndfile exists and perhaps I should be using FFI to interface with it, but I still have not gotten around to learning more about how to use FFI and also I made the mistake of looking at the implementation of wav file format in the libsndfile library … biiig mistake :D Well, I also would probably not have learned as much about wav files and some bytevector and vector stuff, if I had used libsndfile. Though more about FFI … Will see how far I take it : ) Best regards, Zelphir -- repositories: https://notabug.org/ZelphirKaltstahl