Sbagen Binaural beats for Linux!

Audio editors, music players, video players, burning software, etc.
Message
Author
User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#16 Post by Lobster »

Frying your brain with relaxing binaurality is also possible in Slacko Beta 5

Code: Select all

#! /bin/bash
# Psbagen (c) GNU GENERAL PUBLIC LICENSE
# Puppy Slacko version GUI created by Lobster Sept 28 2011
# added defaulttexteditor for source dode, 
# 
# http://uazu.net/sbagen/

##############
# The theory behind binaural beats 
# is that if you apply slightly different frequency 
# sine waves to each ear, a beating affect is created 
# in the brain itself, due to the brain's internal wiring. 
# If, in the presence of these tones, you relax and let your mind go, 
# your mind will naturally synchronize with the beat frequency. 
# In this way it is possible to tune the frequency of your brain waves 
# to particular frequencies that you have selected, 
# using of the four bands: Delta: deep sleep, 
# Theta: dreaming and intuitive stuff, Alpha: awake, 
# focussed inside, and Beta: awake, focussed outside. 
##############  

export Psbagen='
<window title="Psbagen v1.1" window-position="1">
<vbox>
 <menubar> 
  <menu>
   <menuitem>
         <label>~ Close Prev sound</label>
         <action>killall -KILL sbagen &</action>
    </menuitem>
    <menuitem>
         <label>Alpha Relaxation</label>
         <action>./sbagen basics/ts-brain-alpha.sbg &</action>
    </menuitem>
      <menuitem>
         <label>Beta Concentration</label>
         <action>./sbagen basics/ts-brain-beta.sbg &</action>
    </menuitem>
     <menuitem>
         <label>Delta Sleep</label>
         <action>./sbagen basics/ts-brain-delta.sbg &</action>
    </menuitem>
    <menuitem>
         <label>Theta Meditation</label>
         <action>./sbagen basics/ts-brain-theta.sbg &</action>
    </menuitem> 
    <menuitem stock="gtk-quit">
         <action>echo You selected the quit menu item</action>
         <action type="exit">exit by menu</action>
    </menuitem>
      <label>Basic</label>
  </menu> 
  <menu>
   <menuitem>
         <label>~ Close Prev sound</label>
         <action>killall -KILL sbagen &</action>
    </menuitem>  
    <menuitem>
         <label>Schumann</label>
         <action>./sbagen -E -F 6000 basics/ch-schumann-cycle.sbg &</action>
    </menuitem>
    <menuitem>
         <label>Inspiration</label>
         <action>./sbagen -E -F 6000 basics/ch-inspiration.sbg &</action>
    </menuitem>
    <menuitem>
         <label>Awakened Mind</label>
         <action>./sbagen -E -F 6000 basics/ch-awakened-mind.sbg &</action>
    </menuitem>
    <menuitem>
         <label>Purring</label>
         <action>./sbagen -E -F 6000 basics/ts-purring-cat.sbg &</action>
    </menuitem>
    <menuitem>
         <label>Chakras</label>
         <action>./sbagen -E -F 6000 basics/prog-chakras-1.sbg &</action>
    </menuitem>
    <menuitem>
         <label>OBE</label>
         <action>./sbagen -E -F 6000 basics/ch-obe.sbg &</action>
    </menuitem>
    <menuitem>
         <label>Aspirin</label>
         <action>./sbagen -E -F 6000 basics/ch-aspirin.sbg &</action>
    </menuitem>
    <menuitem>
         <label>Runners High</label>
         <action>./sbagen -E -F 6000 basics/ch-runners-high.sbg &</action>
    </menuitem>
    <menuitem>
         <label>Bells</label>
         <action>./sbagen -E -F 6000 basics/bells-3.sbg &</action>
    </menuitem>
        <menuitem>
         <label>Calm</label>
         <action>./sbagen -E -F 6000 basics/ts-calm.sbg &</action>
    </menuitem>
    <label>Sequences</label>
  </menu>
  <menu>
     <menuitem>
         <label>~ Close Prev sound</label>
         <action>killall -KILL sbagen &</action>
    </menuitem>  
     <menuitem>
         <label>Recharge</label>
         <action>./sbagen -E -F 6000 basics/ts-recharge.sbg &</action>
    </menuitem>
    <menuitem>
         <label>Concentration</label>
         <action>./sbagen -E -F 6000 basics/ts1-concentration.sbg &</action>
    </menuitem>
      <menuitem>
         <label>Focus</label>
         <action>./sbagen -E -F 6000 basics/focus-27-b.sbg &</action>
    </menuitem>
    <menuitem>
         <label>Wave</label>
         <action>./sbagen -E -F 6000 basics/wave-01.sbg &</action>
    </menuitem>
    <menuitem>
         <label>Einstein</label>
         <action>./sbagen -E -F 6000 basics/ch-einstein.sbg &</action>
    </menuitem>  
    <menuitem>
         <label>Caffiene</label>
         <action>./sbagen -E -F 6000 basics/ch-sonic-caffeine.sbg &</action>
    </menuitem>  
       <label>Focus</label>
  </menu> 
  <menu> 
    <menuitem>
         <label>Sbagen Website</label>
         <action>defaultbrowser http://uazu.net/sbagen/ &</action>
    </menuitem>
    <menuitem>
         <label>Binaural Beats Wikipedia</label>
         <action>defaultbrowser http://en.wikipedia.org/wiki/Binaural_beats &</action>
    </menuitem>
    <menuitem>
         <label>Compiling info used</label>
         <action>defaultbrowser http://www.khattam.info/howto-installing-sbagen-in-ubuntu-10-04-lucid-lynx-and-10-10-maverick-meerkat-2010-06-09.html &</action>
    </menuitem>
    <menuitem>
         <label>Audio Highs</label>
         <action>defaultbrowser http://gethighnow.com/audio-highs/ &</action>
    </menuitem>
    <menuitem>
         <label>Ambient Radio</label>
         <action>defaultbrowser http://www.internet-radio.org.uk/stations/ambient/ &</action>
    </menuitem>
    <menuitem>
         <label>Nature sounds</label>
         <action>defaultbrowser http://naturesoundsfor.me/ &</action>
    </menuitem>
    <menuitem>
         <action>defaulttexteditor psbagen1.1 &</action>
         <label>Edit source code</label>
         <action>exit</action>
    </menuitem>
  <label>Help</label>
  </menu>   
  </menubar>
 <frame>
       <pixmap>
         <input file>logo.jpg</input>
       </pixmap>
       <text><label>Puppy Sbagen</label></text>
       <text><label>Binaural Beat Generator</label></text>
       <text><label>Best effects = use headphones</label></text>
 </frame>
   <hbox>
        <button cancel></button>
   </hbox>
</vbox>
</window>'

gtkdialog3 --program Psbagen 
unset Psbagen
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

burek
Posts: 3
Joined: Sat 12 May 2012, 12:02

#17 Post by burek »

Here is a free database of sbg files (for SBaGen) with audio preview: http://sbagendb.gusari.org/.

Puppyt
Posts: 907
Joined: Fri 09 May 2008, 23:37
Location: Moorooka, Queensland
Contact:

#18 Post by Puppyt »

duck1dong, Lobster, 666philb -
this is bloody brilliant! I've been using sbagen for a few weeks in XP (to cool my nerves whenever in that environment) and Lobster - your GUI is marvelous! I understand that a Windows GUI is work-in-progress for author Jim Peters, and I deal with console windows when running sbagen there. The additional features including 'convert *.sbg to 30min, 60min *.wav' are great in windoze - I'm forced to use it as I have a e740 PocketPC (winCE 2002), as sbagen ports only exist for winCE2003 onwards. Not needed here in puppydom I guess with available audio mixers and recorders, but I haven't explored that opportunity yet.

The console approach has spoiled me a little however - I can see the sbg file technical notes (contributors' names, rationale for design, playback data etc) that the Lobster GUI shields me from. Is there a possibility for a "shields down" option so those notes can be viewed during playback? Another "feature" of the consoles is that multiple *.sbg files can be played simultaneously (there are some really naff combos you can get with various tonal sequences when overlaying different files, as Jim Peters notes with his 'purring cat' discovery) - but I don't yet see how that can happen here. You've very kindly provided the script for your GUI, Lobster - I guess if I pulled my fingers out (of my ears) I could write it myself...

Using this now as I write in FATSlacko5.3.3 - no further dependencies required after downloading the pet here http://www.murga-linux.com/puppy/viewto ... 169#496169. Brain happily sizzling now,
Cheers!
Search engines for Puppy
[url]http://puppylinux.us/psearch.html[/url]; [url=https://cse.google.com/cse?cx=015995643981050743583%3Aabvzbibgzxo&q=#gsc.tab=0]Google Custom Search[/url]; [url]http://wellminded.net63.net/[/url] others TBA...

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#19 Post by nooby »

Sorry, me being so stressed out that I fail to read every post.

Am I supposed to use Headphones and that it works less effective
over the speakers?

Thanks for that link.
I use Google Search on Puppy Forum
not an ideal solution though

burek
Posts: 3
Joined: Sat 12 May 2012, 12:02

#20 Post by burek »

nooby, yes, you neead headphones, because pulsing beats form in your brain, not in your ears, like with monaural beats. If you understand how BA beats work, it will be obvious why do you nead headphones:

Image

Both your ears get the different frequency, so those freqs "mix" in your brain, producing pulsing beats. And if you play it on your speakers, both freqs would just interfere already with each others and that "mixed" audio will get into both your ears, somehow distorted because of the different distances between each of your ears and each speaker.

P.S.
If you compress your audio, avoid using mp3, because it will distort your audio really noticeably. I've tested the results using aac+ (he-aac v2) audio codec and concluded that 320 kbps mp3 has more artifacts (distortions) than 48 kbps aac+. Just to be sure, I'm using 64 kbps aac+ (that is still 5 times less than mp3 with far better quality).

Quote from: http://en.wikipedia.org/wiki/High-Effic ... dio_Coding
Scientific testing by the European Broadcasting Union has indicated that HE-AAC at 48 kbit/s was ranked as "Excellent" quality using the MUSHRA scale.[8] MP3 in the same testing received a score less than half that of HE-AAC and was ranked "Poor" using the MUSHRA scale. Data from this testing also indicated that some individuals confused 48 kbit/s encoded material with an uncompressed original.
Shortly, aac+ is a great audio codec and it gets more and more popular, effectively replacing an old mp3 codec.

You can try with NeroAACEnc or you can use ffmpeg with libaacplus lib and pipe it to the output of sbagen, to produce really high quality audio.

Code: Select all

sbagen -WO <sbagen params> | ffmpeg -y -f wav -i - -acodec libaacplus -ab 64k -ac 2 -ar 44100 out.aac

Puppyt
Posts: 907
Joined: Fri 09 May 2008, 23:37
Location: Moorooka, Queensland
Contact:

#21 Post by Puppyt »

Thanks for the code example, burek - and welcome to the kennels :)
So I guess that your example might be included in the GUI script Lobster has provided, perhaps? Would the duration of the generated wave file be stipulated by the user in the "<sbagen params>" part of the code, or clipped manually by the user with another program, like Audacity?

Great tip too on replacing outmoded MP3 with aac+ - do I understand correctly that 64kbps aac+ files are compressed to 20% to those of similar MP3's, but with superior quality? That's impressive indeed!
Search engines for Puppy
[url]http://puppylinux.us/psearch.html[/url]; [url=https://cse.google.com/cse?cx=015995643981050743583%3Aabvzbibgzxo&q=#gsc.tab=0]Google Custom Search[/url]; [url]http://wellminded.net63.net/[/url] others TBA...

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#22 Post by nooby »

Yes that seems reasonable and my neighbors will be happy too
if I change to headphones of good quality. :)

As it is now the whole building shake rattle and roll to that beat Groowy
I use Google Search on Puppy Forum
not an ideal solution though

burek
Posts: 3
Joined: Sat 12 May 2012, 12:02

#23 Post by burek »

Puppyt, there are several ways to limit the duration of the output file, without the need for an external app like Audacity:
- pressing [q] or [ctrl+c] on the keyboard to stop ffmpeg (it will correctly finish writting the output file)
- specifying -t <seconds> in ffmpeg's options, like this:

Code: Select all

sbagen -WO <sbagen params> | ffmpeg -y -f wav -i - -acodec libaacplus -ab 64k -ac 2 -ar 44100 -t 300 out.aac
- specifying the duration with SBaGen options, either on the command line (for example with t<duration>) or within an .sbg file

Personally, I never used GUI scripts, I like to control things using cmd line, knowing exactly what I did and what is to be an expected output :)

And yes, aac+ is of far better quality than mp3, for the same bitrate selected. If you search with Google for online radio stations, you'll notice that 90% of them are streaming their audio using aac+ at 32 kbps which is 10 times smaller bandwidth, comparing to the mp3 @ 320 kbps with even worse audio quality perceived than aac+.

64 kbps aac+ is probably the highest quality you'll need for your audio files (I've reencoded all my mp3s to 32kbps aac+ and now I have 10 times more space on my hdd with the same songs of the same quality) :)

Puppyt
Posts: 907
Joined: Fri 09 May 2008, 23:37
Location: Moorooka, Queensland
Contact:

#24 Post by Puppyt »

Thanks burek - that's a huge help :)
Search engines for Puppy
[url]http://puppylinux.us/psearch.html[/url]; [url=https://cse.google.com/cse?cx=015995643981050743583%3Aabvzbibgzxo&q=#gsc.tab=0]Google Custom Search[/url]; [url]http://wellminded.net63.net/[/url] others TBA...

Post Reply