#!/usr/bin/perl # # This script generates a sequence for the night and starts # playing it. All through the night tone-sets are played, five # minutes on, then five minutes off. The gaps are designed to # allow the brain some freedom to wander before being pulled # back by another tone-set. This feels more comfortable to me # than 100% saturation tone-sets. Also, others have noted that # the brain responds better to changes. # # The tone-sets consist of the following frequencies: # # - A random sub-delta frequency in the range 0.2 to 1.0 Hz, # designed to stimulate interesting things way down there in the # region beyond true delta (in my opinion something signficant # changes around 0.9Hz) # # - A mid-range frequency in the range 3.5 to 5Hz, which cycles up # and down slowly throughout the night, ending at 5Hz, hopefully # modelling the natural sleep cycle. I'm using a cycle of about # 90 minutes. # # - An optional random high beta frequency in the range 32 to 40 # Hz (switched on/off using command-line options). I can't # remember exactly what this was for - something someone # mentioned in an E-mail. I always use it now. # # In addition, at a few random points during the night, other # predefined tone-sets are played for 15 minutes. These are # designed to break the pattern and cause disturbance and # hopefully unexpected changes in consciousness. # # All-in-all, this is the sequence I use now when I fancy a # `binaural' night. I've found it helps me bring waking # consciousness and sleeping consciousness closer - no longer # sleeping "the sleep of oblivion" as Merilyn Tunneshende puts # it. It also helps me sleep more efficiently - I seem to get # better value from my night. It also gives a different quality # to the night, which is why I don't use it all the time. # # I particularly like the deep slow waves, which is why I was # drawn to sub-delta to start with, and this is based around # these, now with a lot of extra trimmings based on ideas from # all over. # # For Windows users without Perl, I've put an example sequence # generate by this script in the file `prog-NSDWS-example'. # sub usage { print STDERR < %02d:%02d\n", int($tar), int(60 * ($tar - int($tar))); my $beta= $opt_b ? " %.2f+%.2f/3.5" : ''; my @ts= (); # Tone-sets my @tl= (); # Time-lines # Base binaural range my $r0= 0.2; my $r1= 1.0; my $lr0= log $r0; my $lr1= log $r1; # Binaural range for beta my $br0= 32; my $br1= 40; my $lbr0= log $br0; my $lbr1= log $br1; # Carrier range my $cr0= 60; my $cr1= 120; my $lcr0= log $cr0; my $lcr1= log $cr1; # Upper tone range my $ur0= 3.5; my $ur1= 5; # It will end on this frequency just before wake-up time my $lur0= log $ur0; my $lur1= log $ur1; my $ulen= 1.531; # Cycle length for upper tone my $cnt= 0; while (1) { $hh= -3 + int($cnt / 6); $mm= 10 * ($cnt % 6); last if ($hh + $mm/60 >= $tar); $hh += 24 if ($hh < 0); if (rand() < 0.05) { $nn= int(10 * rand); push @tl, sprintf "%02d:%02d sp%di ->\n", $hh, $mm, $nn; push @tl, sprintf "+0:0:20 sp%d ->\n", $nn; push @tl, sprintf "+0:14:40 sp%d ->\n", $nn; push @tl, sprintf "+0:15 off\n"; $cnt += 2; # We're taking two 10min slots } else { $bb= exp($lr0 + ($lr1 - $lr0) * rand); $cc= exp($lcr0 + ($lcr1 - $lcr0) * rand); $dd= exp($lbr0 + ($lbr1 - $lbr0) * rand); $uu= exp($lur0 + 0.5 * ($lur1 - $lur0) * (1 + cos(($tar - ($hh + $mm/60)) / $ulen * 2 * 3.14159))); push @ts, sprintf ("t%02d: %.2f+%5.3f/40 %.2f+%.2f/10$beta\n", $cnt, $cc, $bb, $cc * 2, $uu, $cc * 5, $dd); push @tl, sprintf "%02d:%02d t%02d\n", $hh, $mm, $cnt; push @tl, sprintf "%02d:%02d off\n", $hh, $mm+5; $cnt++; } } die unless open OUT, ">tmp-prog"; print OUT <