Popular recipes tagged "apple" but not "macbook_pro"http://code.activestate.com/recipes/tags/apple-macbook_pro/2017-05-13T12:12:30-07:00ActiveState Code RecipesA white noise generator to sooth baby to sleep. (Bash) 2017-05-13T12:12:30-07:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/580801-a-white-noise-generator-to-sooth-baby-to-sleep/ <p style="color: grey"> Bash recipe 580801 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/alarm/">alarm</a>, <a href="/recipes/tags/apple/">apple</a>, <a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/baby_alarm/">baby_alarm</a>, <a href="/recipes/tags/cygwin/">cygwin</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/noise/">noise</a>, <a href="/recipes/tags/sleep/">sleep</a>, <a href="/recipes/tags/sound/">sound</a>, <a href="/recipes/tags/whitenoise/">whitenoise</a>). </p> <p>This is a simple BASH, DASH and SH script to sooth a newborn baby to sleep for a laptop with a builtin mic. Develeoped around an Apple MacBook Pro.</p> <p>Usage:- [./]shush.sh &lt;time in seconds from 18 to 2700&gt; [sensitivity [Hh|Mm|Ll]]&lt;CR&gt;</p> <p>If time is omitted it defaults to 2 bursts of 9 seconds each and if sensitivity is omitted defaults to [M]edium.</p> <p>It uses Quicktime Player for Apple OSX 10.12.4 minimum /dev/dsp for CygWin and some Linux flavours and arecored for Linux ALSA machines for baby awake detector.</p> <p>Upon the two arguments the white noise generator runs for approximately the time given in $1 in bursts of 9 seconds until the time limit is reached. $2 is used to detect of baby is awake and reruns the noise generator again with a new noise waveform.</p> <p>Enjoy...</p> A pseudo-echo, (or printf), function for any Python version. (Python) 2017-01-20T22:17:23-08:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/580750-a-pseudo-echo-or-printf-function-for-any-python-ve/ <p style="color: grey"> Python recipe 580750 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/amiga/">amiga</a>, <a href="/recipes/tags/apple/">apple</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/echo/">echo</a>, <a href="/recipes/tags/fs_uae/">fs_uae</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/printf/">printf</a>, <a href="/recipes/tags/unix/">unix</a>, <a href="/recipes/tags/windows/">windows</a>, <a href="/recipes/tags/winuae/">winuae</a>). </p> <p>A simple example of having a pseudo-echo using sys.stdout.write...</p> <p>This gives exactly the same results from Python Versions, 1.4.0, 2.0.1, 2.5.6, 2.6.9, 3.4.3 and 3.5.2 on various platforms including the classic AMIGA A1200.</p> <p>Enjoy finding simple solutions to often very difficult problems...</p> <p>Bazza.</p> A Function To Create A 1 Second Sinewave WAVE Beep File. (Python) 2014-11-23T19:24:46-08:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578971-a-function-to-create-a-1-second-sinewave-wave-beep/ <p style="color: grey"> Python recipe 578971 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/amiga/">amiga</a>, <a href="/recipes/tags/apple/">apple</a>, <a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/beep/">beep</a>, <a href="/recipes/tags/error_beep/">error_beep</a>, <a href="/recipes/tags/error_sound/">error_sound</a>, <a href="/recipes/tags/e_uae/">e_uae</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/sinewave/">sinewave</a>, <a href="/recipes/tags/sound/">sound</a>, <a href="/recipes/tags/wav/">wav</a>, <a href="/recipes/tags/wave/">wave</a>, <a href="/recipes/tags/windows/">windows</a>, <a href="/recipes/tags/winuae/">winuae</a>). </p> <p>sinebeep.py</p> <p>Creating an audio file called...</p> <p>beep.wav</p> <p>...that can be played using almost ANY audio player available.</p> <p>This simple snippet of code generates a 1 second sinewave WAVE file. It IS saved inside the CURRENT drawer so that you can find it... ;o)</p> <p>This works on:- Classic stock AMIGA A1200, using Python 1.4.0. WinUAE and E-UAE, AmigaOS 3.0.x using Python 1.4.0 to 2.0.1. Windows, to at least 7, using Python 2.0.1 to 3.3.2. Various Linux flavours using Python 2.4.6 to 3.2.2. Apple OSX 10.7.x and above using Python 2.5.6 to 3.4.1.</p> <p>The file size is 8044 bytes and _IF_ you need to it can be palyed directly without a player on some Linux flavours that have the /dev/dsp device. It is an 8 bit, unsigned integer, mono, 8000Hz sampling speed 8000 byte RAW file with the WAVE header added.</p> <p>It will still work with PulseAudio and OSS using...</p> <p>cat /full/path/to/beep.wav &gt; /dev/dsp</p> <p>...but with a momenatry click due to the 44 header bytes; but hey it is a beep alternative...</p> <p>Enjoy finding simple solutions to often very difficult problems.</p> <p>Bazza.</p>