mò
VŸýAc           @   sÈ  d  Z  d Z d Z y e Wn d( \ Z Z n Xy| d k Z d k Z d k Z d k Z d k	 Z	 e i
 i e i i e	 i e i ƒ  ƒ d d d g ƒ ƒ d	 k l Z l Z Wn1 y e i i d
 e ƒ Wn e GHn X‚  n Xe i d i e i ƒ d Z e i ƒ  d Z d „  Z d d d d d d d d d d d d d g Z d d d d d d d d d d  d! d" d# g Z d k Z d$ k l Z d% k l Z l  Z  d& „  Z! e" d' j o e! e i d ƒ n d S()   sú   facilitate spirit communications using set of particular frequencies

   spirit communications powered by 13 simulaneous audio frequencies
   131, 141, 151, 241, 272, 282, 292, 302, 415, 433, 515, 653, 701 Hz
   see www.worlditc.org/k_06_spiricom.htmsB  
    whitenoise.py -- generate frequencies to aid spirit communications
    Copyright (C) 2005  John Comeau <jc@jcomeau.com>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    s5   Not all needed libraries found, upgrade or check pathi   i    Ni   t   libt   python(   s   gpls	   jclicenses   %s
iÿÿÿÿc          G   s   d  S(   N(    (   t   whatever(    (    t   ./whitenoise.pyt
   DebugPrint2   s    iƒ   i   i—   iñ   i  i  i$  i.  iŸ  i±  i  i  i½  i   i   i   i   i   i   i
   i   i   i   (   s   arcane(   s   midis   pymidic          G   sg  yJ xC t  |  d ƒ t i j p t  |  d ƒ t i j o |  d }  q WWn f  }  n Xt |  ƒ d j  o% t i i d t	 ƒ t i
 d ƒ n t ƒ  o t t _ n y t |  d ƒ } Wn- t i i d ƒ t i i d ƒ d } n Xt i d d ƒ } t i | d d ƒ t i | d d ƒ t i d	 d
 ƒ i ƒ  } d } x~ t d t t ƒ ƒ D]g } t | } t | } t i | | ƒ } t i | | | | | | ƒ t i | d | | d f ƒ qYW| d j o t  i! | d ƒ n~ t i" d ƒ x` t d t t ƒ ƒ D]I } t | } t | } t i | | ƒ } t i | d | | d f ƒ q	Wt i# | ƒ d S(   sw   generate frequencies for specified time period:

    131, 141, 151, 241, 272, 282, 292, 302, 415, 433, 515, 653, 701 Hzi    i   s.   Usage: %s DURATION(ms) (use 0 for continuous)
s*   No duration or invalid duration specified
s'   Playing notes forever until key is hit
s	   /dev/midit   wbt   Flutet   allt	   frequencyi   i@   iè  s   Hit <ENTER> to stop...N($   t   typet   argst   typest   ListTypet	   TupleTypet   lent   syst   stderrt   writet   selft   exitR   t   midit   floatt   durationt   pymidit   opent
   midihandlet   SetChannelProgramt   NoteMappingt   valuest   tonest   channelt   ranget	   spirit_hzt   indext   tonet   channelst   arcanet   NearestValueIndext   notet   SetChannelPitchFrequencyt   timet   sleept   pauset   close(   R
   R"   R   R!   R   R&   R   R   (    (    R   t
   whitenoise>   sP      4


 

! 

!t   __main__(   i   i    (#   t   __doc__t	   Copyrightt   errormessaget   Truet   FalseR   t   osR   t   ret   pwdt   patht   appendt   sept   joint   getpwuidt   geteuidt   com.jcomeaut   gplt	   jclicenseR   R   t   argvt   splitR   t   originalselfR   R    R#   R(   R$   t   com.jcomeau.midiR   R   R,   t   __name__(   R   R/   R   R=   R   R4   R$   R    R1   RA   R   R5   R   R#   R2   R   R0   R>   R(   R,   R3   (    (    R   t   ?   s6   -8		--		,