summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO36
-rw-r--r--PKGBUILD90
-rw-r--r--anarange.138
-rw-r--r--downsample.137
-rw-r--r--rhybag.137
-rw-r--r--sbagen.install23
6 files changed, 261 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..4921f4ab5670
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,36 @@
+pkgbase = sbagen
+ pkgdesc = A binural brainwave generator
+ pkgver = 1.4.5
+ pkgrel = 6
+ url = http://uazu.net/sbagen
+ install = sbagen.install
+ arch = i686
+ arch = x86_64
+ arch = arm
+ arch = armv6h
+ arch = armv7h
+ license = GPL
+ makedepends = libmad
+ makedepends = libvorbis
+ depends = bash
+ depends = perl
+ options = !strip
+ source = http://uazu.net/sbagen/sbagen-1.4.5.tgz
+ source = http://uazu.net/sbagen/sbagen-river-1.4.1.tgz
+ source = http://uazu.net/sbagen/rhybag-0.1.1.tgz
+ source = http://uazu.net/sbagen/binaural-analysis-20040521.tgz
+ source = anarange.1
+ source = downsample.1
+ source = rhybag.1
+ sha512sums = 35a8cdf0ca59cef01200a102c6f718b163006eec6c3450e7ee32bac0454be2db4d9a4df2f1a52d6cc2beda1d45bf9a7816a2c9dfae710eef14dbe5667cec9bf9
+ sha512sums = f61c9308c671dc9cef9b9e60ba37cc5a9dc6ac45b5ab34d0818e08f6006eeba0ede4756e0c5375b11963e04f4e1e801119af8df8726c867e3be399983b12bc30
+ sha512sums = 19a432b3d465881a113b0aad3f774062952b3f0229ae77e668b0c43d47c94d595cae1b7178c7a30fbc7d7f05da1cc9c0255ad0de7daba8023da2fd7fc6057e2b
+ sha512sums = ca60751ed67bf87aa75465fc1f70a57f3ae4e704a0ff5f745d955b65dd624394be74bc19470b8d5d25df13c70241efac355b66a49773d0584623157151e0b074
+ sha512sums = a14924d7b001f2e558b97d32a844dd18b54eb7ae7a1111a25dae1b3c53129cedeb546043301ee15ac33fed03ad4dc5330e534c3ab27d3f1f6a166499319cbaa7
+ sha512sums = a84e774f1a4c1f57716f3097228baebb8caf5424bd1316ce1d8f596cac44e9a16c1a56814405b48b87557108db1d4cf4fee56875b82d7390ec3c41d4e2a280a8
+ sha512sums = db30da37feb3c970f1dcc5271aa9350b3694c48fdb5585db2e6f3f178f9cd26af1fd48d238786ccac19d2f65ebcccff9622b358b2a16396696e94448e66648f5
+ depends_x86_64 = lib32-glibc
+ makedepends_x86_64 = gcc-multilib
+
+pkgname = sbagen
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..f6932b146c01
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,90 @@
+# Maintainer: Kevin MacMartin <prurigro at gmail dot com>
+
+pkgname=sbagen
+pkgver=1.4.5
+_river_ver=1.4.1
+_rhybag_ver=0.1.1
+_binauralanalysis_ver=20040521
+pkgrel=6
+pkgdesc="A binural brainwave generator"
+url="http://uazu.net/sbagen"
+license=('GPL')
+depends=('bash' 'perl')
+makedepends=('libmad' 'libvorbis')
+depends_x86_64+=('lib32-glibc')
+makedepends_x86_64+=('gcc-multilib')
+arch=('i686' 'x86_64' 'arm' 'armv6h' 'armv7h')
+options=('!strip')
+install=${pkgname}.install
+
+source=(
+ "$url/${pkgname}-$pkgver.tgz"
+ "$url/${pkgname}-river-$_river_ver.tgz"
+ "$url/rhybag-$_rhybag_ver.tgz"
+ "$url/binaural-analysis-$_binauralanalysis_ver.tgz"
+ "anarange.1"
+ "downsample.1"
+ "rhybag.1"
+)
+sha512sums=(
+ '35a8cdf0ca59cef01200a102c6f718b163006eec6c3450e7ee32bac0454be2db4d9a4df2f1a52d6cc2beda1d45bf9a7816a2c9dfae710eef14dbe5667cec9bf9'
+ 'f61c9308c671dc9cef9b9e60ba37cc5a9dc6ac45b5ab34d0818e08f6006eeba0ede4756e0c5375b11963e04f4e1e801119af8df8726c867e3be399983b12bc30'
+ '19a432b3d465881a113b0aad3f774062952b3f0229ae77e668b0c43d47c94d595cae1b7178c7a30fbc7d7f05da1cc9c0255ad0de7daba8023da2fd7fc6057e2b'
+ 'ca60751ed67bf87aa75465fc1f70a57f3ae4e704a0ff5f745d955b65dd624394be74bc19470b8d5d25df13c70241efac355b66a49773d0584623157151e0b074'
+ 'a14924d7b001f2e558b97d32a844dd18b54eb7ae7a1111a25dae1b3c53129cedeb546043301ee15ac33fed03ad4dc5330e534c3ab27d3f1f6a166499319cbaa7'
+ 'a84e774f1a4c1f57716f3097228baebb8caf5424bd1316ce1d8f596cac44e9a16c1a56814405b48b87557108db1d4cf4fee56875b82d7390ec3c41d4e2a280a8'
+ 'db30da37feb3c970f1dcc5271aa9350b3694c48fdb5585db2e6f3f178f9cd26af1fd48d238786ccac19d2f65ebcccff9622b358b2a16396696e94448e66648f5'
+)
+
+prepare() {
+ cd ${pkgname}-${pkgver}
+
+ while read -r file; do
+ sed -i -re 's|(river[12]\.ogg)|/usr/share/sbagen/media/\1|g' "$file"
+ done < <(grep -ir "river1\.ogg" examples/ | sed 's|:.*$||')
+}
+
+build() {
+ # Remove compiler flags set by makepkg.conf
+ unset CFLAGS
+
+ # Compile sbagen
+ cd ${pkgname}-${pkgver}
+ rm sbagen
+ cc -DOGG_DECODE -DMP3_DECODE -Wa,--noexecstack -DT_LINUX -Wall -m32 -O3 -s -lm -lpthread -Wl,-z,noexecstack sbagen.c libs/linux-libmad.a libs/linux-libvorbisidec.a -o sbagen
+
+ # Compile rhybag
+ cd ../rhybag-${_rhybag_ver}
+ cc -O2 -s -lm main.c -o rhybag 2>&1 1>&0 | ./strip_warnings > mk.err
+
+ cd ../binaural-analysis
+ rm anarange downsample
+ ./mk
+}
+
+package() {
+ ### Install rhybag
+ install -Dm755 rhybag-$_rhybag_ver/rhybag "$pkgdir"/usr/bin/rhybag
+
+ ### Install river sounds
+ install -Dm644 ${pkgname}-$_river_ver/river1.ogg "$pkgdir"/usr/share/$pkgname/media/river1.ogg
+ install -Dm644 ${pkgname}-$_river_ver/river2.ogg "$pkgdir"/usr/share/$pkgname/media/river2.ogg
+
+ ### Install Binaural analysis tools
+ install -Dm755 binaural-analysis/anarange "$pkgdir"/usr/bin/anarange
+ install -Dm755 binaural-analysis/downsample "$pkgdir"/usr/bin/downsample
+
+ ### Install manpages
+ install -Dm644 "anarange.1" "$pkgdir"/usr/share/man/man1/anarange.1
+ install -Dm644 "downsample.1" "$pkgdir"/usr/share/man/man1/downsample.1
+ install -Dm644 "rhybag.1" "$pkgdir"/usr/share/man/man1/rhybag.1
+
+ ### Install sbagen
+ cd ${pkgname}-${pkgver}
+ install -Dm755 $pkgname "$pkgdir"/usr/bin/$pkgname
+
+ # Install supplimentary files
+ find . -type f -name '[a-z]*.txt' -exec install -Dm644 '{}' "$pkgdir"/usr/share/$pkgname/doc/'{}' \;
+ find examples -type f -exec install -Dm644 '{}' "$pkgdir"/usr/share/$pkgname/'{}' \;
+ find scripts -type f -exec install -Dm644 '{}' "$pkgdir"/usr/share/$pkgname/'{}' \;
+}
diff --git a/anarange.1 b/anarange.1
new file mode 100644
index 000000000000..6f9ab1059a5e
--- /dev/null
+++ b/anarange.1
@@ -0,0 +1,38 @@
+.TH "ANARANGE" "" "July 2014" "" "Anarange Usage Information"
+.
+.SH "NAME"
+.
+.nf
+
+anarange
+.
+.fi
+.
+.SH "SYNOPSIS"
+.
+.nf
+
+anarange <rate> <from> <to> <step> <in\.raw >out\.txt
+.
+.fi
+.
+.SH "DESCRIPTION"
+Get a rough idea of where the interesting frequencies are using some other visual frequency\-display application\. You can now use the \fBanarange\fR command to analyze the downsampled file \fBin\.raw\fR, produced by the output of the \fBdownsample\fR command\.
+.
+.P
+The analysis works by doing using very narrow filters to pick up each of those frequency bands separately, using this to pick up the peak frequency in each channel\. From this the binaural carrier and beat frequencies are calculated, and the amplitude\. This is not fool\-proof \-\- noise or other frequencies in the same frequency range on the recording can put off the readings, but by scanning through the results, you will soon be able to see the trends and distinguish the real data from the interference\.
+.
+.P
+Note that the algorithm may need tweaking if you have a recording that isn\'t being analysed well\. This is all still quite improvised code \-\- I\'m not making any promises that this is going to work straight off for everything\. You may have to modify the code a little\. (There is also quite a lot of unused routines in the source from previous experimental approaches\.)
+.
+.P
+The parameters here are: the sampling rate (Hz), the lower and upper bounds of the frequency range to analyse (Hz,Hz), and the step to use\. For example, in the line above, there will be (132\-118)/0\.1 bands analysed, or 140\. The analysis outputs its results for every second of the recording, so the output text file can be quite long\.
+.
+.SH "EXAMPLE"
+.
+.nf
+
+anarange 2004\.5 118 132 0\.1 <in\.raw >out\.txt
+.
+.fi
+
diff --git a/downsample.1 b/downsample.1
new file mode 100644
index 000000000000..8729c3ea7f46
--- /dev/null
+++ b/downsample.1
@@ -0,0 +1,37 @@
+.TH "DOWNSAMPLE" "" "July 2014" "" "Downsample Usage Information"
+.
+.SH "NAME"
+.
+.nf
+
+downsample
+.
+.fi
+.
+.SH "SYNOPSIS"
+.
+.nf
+
+downsample <input\-rate> <downsamping\-ratio> [<gain>] <in\.raw >out\.txt
+.
+.fi
+.
+.SH "DESCRIPTION"
+Extract the audio from the CD or tape at 44100Hz as a WAV or RAW audio file (i\.e\. 16\-bit stereo little\-endian data)\. You\'ll need a RAW (headerless) file to work on, but as a short\-cut you can treat a 16\-bit WAV file as a RAW file \-\- the worst that can happen is that the L+R channels get swapped and there is a bit of noise at the start of the recording\.
+.
+.P
+The point of downsampling is to reduce the amount of data that needs to be processed later, speeding up the process\. A sampling rate of 2004\.5Hz leaves everything up to ~700Hz intact\. If you are looking at higher carrier frequencies, you\'ll need to use a higher sampling rate when you downsample, and it will be a bit slower to run\.
+.
+.SH "EXAMPLE"
+Downsample this RAW file to 2004\.5Hz using \'downsample\':
+.
+.IP "" 4
+.
+.nf
+
+downsample 44100 22 <in\.raw >out\.raw
+.
+.fi
+.
+.IP "" 0
+
diff --git a/rhybag.1 b/rhybag.1
new file mode 100644
index 000000000000..de6fd2c689f2
--- /dev/null
+++ b/rhybag.1
@@ -0,0 +1,37 @@
+.TH "RHYBAG" "" "July 2014" "" "Rhybag Usage Information"
+.
+.SH "NAME"
+rhybag
+.
+.SH "DESCRIPTION"
+Rhythmic Binaural Generator, version 0\.1\.1
+
+Generate smooth fast-changing binaural sequences, perhaps for inclusion with music.
+.
+.SH "USAGE"
+.
+.nf
+
+rhybag [options] sequence\-file [sequence]
+.
+.fi
+.
+.SH "OPTIONS"
+.
+.nf
+
+\-o file Output raw data to a file instead of to /dev/dsp
+\-o file\.wav Output WAV\-format data to a file
+\-O Output raw data to standard output
+
+\-r rate Manually select an output rate (Hz, default is 44100Hz)
+\-S fade_ms Set the time over which to fade sudden volume changes (def 5ms)
+\-A vol Set master volume to given 0x0\.0000000000003p\-1022ge of maximum
+\-M vol Manually set master volume level (0x0\.0000000000002p\-1022ge)
+\-D Generate debugging dump of notes and sequences
+\-DD Also generate debugging dump of rendering events
+.
+.fi
+.
+.SH "LICENSE"
+Copyright (c) 1999 Jim Peters, released under the GNU GPL
diff --git a/sbagen.install b/sbagen.install
new file mode 100644
index 000000000000..a591463154a4
--- /dev/null
+++ b/sbagen.install
@@ -0,0 +1,23 @@
+post_install() {
+cat << EOF
+
+IMPORTANT (sbagen):
+ The 'snd_pcm_oss' module must be loaded to use sbagen:
+ sudo modprobe snd_pcm_oss
+
+ You can have it start at boot by adding a config to modules-load.d:
+ sudo echo snd_pcm_oss > /etc/modules-load.d/snd-pcm-oss.conf
+
+ Non-root users must be in the audio group to access oss-emulation:
+ sudo gpasswd -a username audio
+
+ (users will need to relogin for the changes to take effect)
+
+Browse /usr/share/sbagen for samples, examples, scripts & documents!
+
+EOF
+}
+
+post_upgrade() {
+ post_install
+}