Top-rated recipes tagged "demo"http://code.activestate.com/recipes/tags/demo/top/2017-01-20T22:17:23-08:00ActiveState Code RecipesA DEMO to show how to write text into the Python terminal Title Bar... (Python) 2013-09-17T17:55:53-07:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578662-a-demo-to-show-how-to-write-text-into-the-python-t/ <p style="color: grey"> Python recipe 578662 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/apple/">apple</a>, <a href="/recipes/tags/bar/">bar</a>, <a href="/recipes/tags/cygwin/">cygwin</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/macbook_pro/">macbook_pro</a>, <a href="/recipes/tags/title/">title</a>, <a href="/recipes/tags/title_bar/">title_bar</a>). </p> <p>This DEMO is show how to write some text of your choice into the Title Bar of the Python terminal window.</p> <p>Firstly it imports "time" just for this demo so that a simple time delay can be generated. Next the Python terminal window is written to for the 5 seconds of delay; see code. And finally the Title Bar is restored to normal...</p> <p>A snapshot image can be seen here:-</p> <p><a href="http://wisecracker.host22.com/public/Title_Bar.jpg" rel="nofollow">http://wisecracker.host22.com/public/Title_Bar.jpg</a></p> <p>Bazza...</p> For AMIGA-Heads Only. Poking A HW, (Memory), Address On A Classic AMIGA, Inside Text Mode Python. (Python) 2012-09-09T19:25:00-07:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578255-for-amiga-heads-only-poking-a-hw-memory-address-on/ <p style="color: grey"> Python recipe 578255 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/amiga/">amiga</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/e_uae/">e_uae</a>, <a href="/recipes/tags/hardware/">hardware</a>, <a href="/recipes/tags/memory/">memory</a>, <a href="/recipes/tags/poke/">poke</a>, <a href="/recipes/tags/winuae/">winuae</a>). </p> <p>For AMIGA-Heads Only...</p> <p>This code is purely for a minimum of a stock Classic AMIGA A1200(HD), E-UAE, and WinUAE running AMIGA OS3.0x to 3.1x. It will NOT work on any other platform!</p> <p>(It MIGHT work on AMIGA OS3.5x and 3.9x with Python 2.4.6, but totally untested and I hold no responsibility for the outcome when trying it.)</p> <p>It is a DEMO to poke a byte inside _ANY_ memory address inside the standard CPU 68EC020 16MB boundary.</p> <p>This is not a function nor a class but just a DEMO to show how to write directly to HW, (or memory), addresses.</p> <p>POKING memory or hardware addresses is not recommended for novices without studying the machine first, and, this code will ignore any _ENFORCER_hits_.</p> <p>I experimented with this several years ago and have decided to finally release it. I do await the flak!</p> <p>It works from Python Versions 1.4.0 to 2.0.1 for the classic AMIGA.</p> <p>This is issued as Public Domain and you may do with it as you please.</p> <p>Ensure that the T: Volume exists on the running machine.</p> <p>See inside the code and text below it also as to how it works...</p> <p>Bazza, G0LCU...</p> Banner (Python) 2011-01-11T05:16:12-08:00Raymond Hettingerhttp://code.activestate.com/recipes/users/178123/http://code.activestate.com/recipes/577537-banner/ <p style="color: grey"> Python recipe 577537 by <a href="/recipes/users/178123/">Raymond Hettinger</a> (<a href="/recipes/tags/banner/">banner</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/formatting/">formatting</a>, <a href="/recipes/tags/printing/">printing</a>). Revision 2. </p> <p>Easily customizable banner program.</p> A DEMO To Show How To Expand A Standard Python Terminal On The Fly... (Python) 2012-12-17T12:47:14-08:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578383-a-demo-to-show-how-to-expand-a-standard-python-ter/ <p style="color: grey"> Python recipe 578383 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/apple/">apple</a>, <a href="/recipes/tags/campimeter/">campimeter</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/macbook_pro/">macbook_pro</a>, <a href="/recipes/tags/size/">size</a>, <a href="/recipes/tags/terminal/">terminal</a>, <a href="/recipes/tags/window/">window</a>). </p> <p>This code shows how to open up a default Terminal running Python to tha maximum allowed on the _desktop_. I decided on writing code to do a crude emulation of a Campimeter. Anyone who has worn spectacles for a long time has had this test done at the optician's. Originally written for a Macbook Pro, OSX 10.7.5 but also tested on Debian Linux 6.0.x. READ the code for more information!!! This code WILL alter the size of the Terminal window AND changes the colours too, although it is very easy to return back to the default state it is NOT included in the code... I EXPECT professionals to know how to doo that.</p> <p>Before running Python inside the Terminal ensure the Terminal window is at the uppermost left hand corner of your desktop...</p> <p>I needed the maximised Python Terminal for something else but this was the easiest way to demonstrate ho to do it through Python...</p> <p>Written so that kids can understand what is going on...</p> <p>Enjoy finding simple solutions to often very difficult problems... ;o)</p> <p>Bazza, G0LCU...</p> Seven Bit Colored Analogue Bar Graph Generator DEMO... (Python) 2011-03-17T22:14:52-07:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/577612-seven-bit-colored-analogue-bar-graph-generator-dem/ <p style="color: grey"> Python recipe 577612 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/analogue/">analogue</a>, <a href="/recipes/tags/anim/">anim</a>, <a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/bargraph/">bargraph</a>, <a href="/recipes/tags/color/">color</a>, <a href="/recipes/tags/colour/">colour</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/display/">display</a>, <a href="/recipes/tags/linux/">linux</a>). Revision 3. </p> <p>..For STANDARD Python 2.6 and above...</p> <p>This code will display a horizontal full colour analogue "VU" style meter. It displays green for normal, yellow for warning and red for danger with a critical error beep near the end of full scale, at value 120+.</p> <p>This version is for Python 2.6 and above and only for the Linux, (*nix?), platform.</p> <p>It is an "at a glance" display that is in colour rather than having to read say a digitally generated number.</p> <p>A Python 3.x version can be found here:-</p> <p><a href="http://www.linuxformat.com/forums/viewtopic.php?t=13443" rel="nofollow">http://www.linuxformat.com/forums/viewtopic.php?t=13443</a></p> <p>This has uses "for at a glance" voltmeters, ammeters, data-loggers, anemometers etc, etc...</p> <p>Watch for wordwrapping etc...</p> <p>NOTE:- This is Public Domain and you may do with it as you please.</p> <p>73...</p> <p>Bazza, G0LCU...</p> <p>Team AMIGA...</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> Design by contract on python vanilla (Python) 2013-11-05T20:50:30-08:00Alan Cristhian Ruizhttp://code.activestate.com/recipes/users/4186199/http://code.activestate.com/recipes/578767-design-by-contract-on-python-vanilla/ <p style="color: grey"> Python recipe 578767 by <a href="/recipes/users/4186199/">Alan Cristhian Ruiz</a> (<a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/design_pattern/">design_pattern</a>, <a href="/recipes/tags/productivity/">productivity</a>). Revision 2. </p> <p>The code below is an example that shows that we can do design by contract in python without any non-standard module.</p> Colo(u)rs Inside Text Mode Python... (Python) 2012-08-21T21:01:57-07:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578101-colours-inside-text-mode-python/ <p style="color: grey"> Python recipe 578101 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/color/">color</a>, <a href="/recipes/tags/colour/">colour</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/display/">display</a>, <a href="/recipes/tags/e_uae/">e_uae</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/macbook_pro/">macbook_pro</a>, <a href="/recipes/tags/windows/">windows</a>, <a href="/recipes/tags/winuae/">winuae</a>). Revision 2. </p> <p>A simple DEMO to show how to enhance Python inside a Terminal. This works on Classic AMIGAs, E-UAE, Debian Linux 6.0.0, PCLinuxOS 2009, Windows XP and Vista and WinUAE, from Python 1.4.0 to 3.3A2.</p> <p>Due to a complaint about my _fun_ upload recently I decided to post this so that the MANY can now find out how to manipulate text inside a Python Terminal window so that it looks much better.</p> <p>Read the code for more information...</p> <p>Enjoy finding simple solutions to often very difficult problems...</p> <p>Bazza...</p> Yet Another Python Generator... (Python) 2011-12-19T08:14:55-08:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/577990-yet-another-python-generator/ <p style="color: grey"> Python recipe 577990 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/generator/">generator</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/signal/">signal</a>, <a href="/recipes/tags/sound/">sound</a>, <a href="/recipes/tags/source/">source</a>, <a href="/recipes/tags/sweep/">sweep</a>). </p> <p>Aha, but not what big guns were expecting...</p> <p>LF Audio Sweep Generator.</p> <p>Another kids level project to do for yourselves...</p> <p>This is a Python DEMO to show the power of the sound card using Linux to generate an Audio Sweep Signal from 4KHz down to 100Hz and back again.</p> <p>Written in such a way that anyone can understand how it works... This is for Linux and Python 2.x.x. Read the code for much more information, and...... A Python 3.x.x version is here:-</p> <p><a href="http://www.linuxformat.com/forums/viewtopic.php?t=14411" rel="nofollow">http://www.linuxformat.com/forums/viewtopic.php?t=14411</a></p> <p>Enjoy finding simple solutions to often VERY difficult problems...</p> <p>Bazza, G0LCU...</p> For AMIGA-Heads Only. Generating An Audio Signal In Text Mode Python. (Python) 2011-11-30T21:23:20-08:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/577971-for-amiga-heads-only-generating-an-audio-signal-in/ <p style="color: grey"> Python recipe 577971 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/amiga/">amiga</a>, <a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/e_uae/">e_uae</a>, <a href="/recipes/tags/sound/">sound</a>, <a href="/recipes/tags/winuae/">winuae</a>). </p> <p>This DEMO is not for the big guns. It is aimed at those who still use a minimum of an ancient classic AMIGA A1200(HD), E-UAE, WinUAE, of which there are still a lot of us about...</p> <p>No comments about the use of "eval()" as Python Version 1.4.0 does not have "int()" and this is designed to work on all versions of Python available for the above platform. See the code for minimum requirements and much more information.</p> <p>MANY THANKS to Irmen de Jong for porting early versions of Python to the classic AMIGA to give we lowly users a taste of what was/is to come.</p> <p>This code will probably make the professionals cough a little, but, boy what fun it is to see how powerful Python can be on an open platform like the AMIGA.</p> <p>Written in such a way that anyone can understand how it works...</p> <p>I really don't care how you vote this as it is for those, including professionals, who enjoy messing with AMIGA variants purely for fun and relaxation, and, to......</p> <p>Enjoy finding simple solutions to often VERY difficult problems... ;o)</p> <p>Bazza, G0LCU...</p> A DEMO Frequency Counter With A Difference - Text Mode Python. (Python) 2011-11-21T18:00:43-08:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/577955-a-demo-frequency-counter-with-a-difference-text-mo/ <p style="color: grey"> Python recipe 577955 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/counter/">counter</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/frequency/">frequency</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/sound/">sound</a>). </p> <p>Hi experts...</p> <p>I think that this is a first... ;o)</p> <p>Another kids level project to do for yourselves...</p> <p>This is yet another Python DEMO to show the power of the sound card using Linux as an audio frequency counter.</p> <p>It is a kids level project that uses the sound card as an input through the microphone socket to measure up to &gt;3500Hz from a symmetrical waveform, sine square or triangle. See the comments inside the code for more details...</p> <p>The only external hardware required is a test lead; oh my, this is technical stuff... ;o)</p> <p>This is for Python 2.x.x, (probably even down to 1.5.2) but it would be just as easy to make it work on 3.x.x. I've already done it......</p> <p>......But I'll let the big guns do that for you...</p> <p>Enjoy finding simple solutions to often VERY difficult problems...</p> <p>Be aware of word wrapping etc...</p> <p>Bazza, G0LCU...</p> And Now For Something COMPLETELY Different Using Text Mode Python... (Python) 2011-10-26T19:24:32-07:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/577924-and-now-for-something-completely-different-using-t/ <p style="color: grey"> Python recipe 577924 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/sound/">sound</a>). </p> <p>Hi experts...</p> <p>A kids level project to do for yourselves...</p> <p>This is a Python DEMO to show the power of the sound card using Linux for a specific usage that I need(ed). It is a kids level project that uses the sound card as a variable DC Voltage reference for projects like stabilised linear PSUs. Why linear? Relatively clean RF wise...</p> <p>The TEST circuit is inside the code and is SOOO simple a dexterous 10 year old could make it in less than an hour and have it up and running to start using...</p> <p>My own circuit is just as simple, isolated, and, gives me MUCH more voltage range than the one inside the code... How did I do it? ;o)</p> <p>This is for Python 2.x.x, (probably even down to 1.5.2) but it would be just as easy to make it work on 3.x.x. I'll let the big guns do that...</p> <p>Enjoy finding simple solutions to often VERY difficult problems...</p> <p>Be aware of word wrapping etc...</p> <p>Bazza, G0LCU...</p> Simple Text Mode Digital Oscilloscope Graphics DEMO. (Python) 2014-01-21T19:07:49-08:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578812-simple-text-mode-digital-oscilloscope-graphics-dem/ <p style="color: grey"> Python recipe 578812 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/apple/">apple</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/graphics/">graphics</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/macbook_pro/">macbook_pro</a>). </p> <p>This is a DEMO to switch a *NIX terminal from text to _graphics_ mode on the fly.</p> <p>The graphics characters are limited to lowercase 'a' through 'z' and this DEMO just prints a small subset to see what a fun, kids level, 8 channel Logic-Analyser/Digital-Oscilloscope might look like.</p> <p>This may not work in every *NIX style terminal but does work on default terminals using bash on OSX 10.7.5, PCLinuxOS 2009 and Debian Linux 6.0.x.</p> <p>Tested on Python 2.5.x to 3.3.2 on the above platforms... (It might work on earlier versions of Python but untested.)</p> <p>Enjoy finding simple solutions to often very difficult problems...</p> <p>Bazza...</p> DEMO - Generate A Crude 1KHz Sinewave Using A BASH Script. (Bash) 2013-03-01T19:41:47-08:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578477-demo-generate-a-crude-1khz-sinewave-using-a-bash-s/ <p style="color: grey"> Bash recipe 578477 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/bash/">bash</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/generator/">generator</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/shell/">shell</a>, <a href="/recipes/tags/sinewave/">sinewave</a>, <a href="/recipes/tags/sound/">sound</a>). </p> <p>A very simple crude sinewave generator using a BASH script inside a Linux Terminal.</p> <p>The file required is generated inside the code and requires /dev/audio to work.</p> <p>Ensure you have this device, if not the download oss-compat from your OS's repository...</p> <p>It lasts for about 8 seconds before exiting and saves a 65536 byte file to your working directory/drawer/folder as sinewave.raw.</p> <p>Use an oscilloscope to check the waveform generated...</p> <p>It is entirely Public Domain and you may do with it as you please...</p> <p>Enjoy finding simple solutions to often very difficult problems... ;o)</p> <p>Bazza, G0LCU...</p> DEMO Kids Level Python RF Attenuator... (Python) 2013-02-09T10:21:39-08:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578451-demo-kids-level-python-rf-attenuator/ <p style="color: grey"> Python recipe 578451 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/apple/">apple</a>, <a href="/recipes/tags/attenuator/">attenuator</a>, <a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/macbook_pro/">macbook_pro</a>, <a href="/recipes/tags/rf/">rf</a>, <a href="/recipes/tags/sound/">sound</a>, <a href="/recipes/tags/windows/">windows</a>). </p> <p>This code is a DEMO RF Attenuator for SW listeners.</p> <p>(The code is to show how to generate the same waveform in each channel but in antiphase, as bridge output. The RF Attenuator is just a byproduct...)</p> <p>The circuit has an insertion loss of about 10dB at full gain but that doesn't matter as it IS an attenuator after all.</p> <p>It is another learning tool for kids to build and code for themselves.</p> <p>The only common user I/O on desktops, netbooks, laptops and current MacBooks is/are the Audio Mic and Ear sockets...</p> <p>This goes for "mobiles" too...</p> <p>The circuit inside the code is so easy a 10 year old could have a working unit inisde 2 hours to experiment with...</p> <p>PyAudio IS needed for this to work and although originally designed around a MacBook Pro 13 inch OSX 10.7.5 and Python 2.6.7 has shown itself to be near platform independent...</p> <p>Read the code for much more information...</p> <p>Enjoy finding simple solutions to often very difficult problems... ;o)</p> <p>Bazza, G0LCU...</p> A Shell, Binary To Hexadecimal To Decimal Demo... (Bash) 2013-01-11T18:31:03-08:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578413-a-shell-binary-to-hexadecimal-to-decimal-demo/ <p style="color: grey"> Bash recipe 578413 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/apple/">apple</a>, <a href="/recipes/tags/bash/">bash</a>, <a href="/recipes/tags/binary/">binary</a>, <a href="/recipes/tags/decimal/">decimal</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/hexadecimal/">hexadecimal</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/macbook_pro/">macbook_pro</a>, <a href="/recipes/tags/shell/">shell</a>, <a href="/recipes/tags/terminal/">terminal</a>). </p> <p>This little DEMO may be common knowledge to the big guns but not to amateurs like myself, so......</p> <p>This is an Apple Macbbok Shell/Terminal DEMO shell script to show how to:-</p> <p>1) Create a binary file... 2) Save it to your DEFAULT /directory/drwawer/folder/... 3) Display a hexadecimal dump of said binary file to prove that it is binary... 4) Select a single BYTE of that file and save it as an ASCII text decimal _number_, also to your DEFAULT /directory/drawer/folder/... 5) Read this ASCII text decimal number back in again... 6) Add this string representation to a number... 7) Stop...</p> <p>It was intended purely for OSX 10.7.5 and above using the default terminal and shell...</p> <p>It does work on many Linux flavours and shells/terminals also however.</p> <p>Written so the anyone can understand what is going on.</p> <p>The two files generated and saved in this DEMO to your DEFAULT /directory/drawer/folder/ are:-</p> <p>BinaryString.dat BinaryString.txt</p> <p>This WILL lead to something very unusual in the not too distant future...</p> <p>This is Public Domain and you may do with it as you wish...</p> <p>Enjoy finding simple solutions to often very difficult problems...</p> <p>Bazza, G0LCU...</p> A DEMO 6 Bit At A Glance Colouerd Bargraph Generator. (Bash) 2013-01-16T12:26:55-08:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578391-a-demo-6-bit-at-a-glance-colouerd-bargraph-generat/ <p style="color: grey"> Bash recipe 578391 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/analogue/">analogue</a>, <a href="/recipes/tags/anim/">anim</a>, <a href="/recipes/tags/apple/">apple</a>, <a href="/recipes/tags/bargraph/">bargraph</a>, <a href="/recipes/tags/bash/">bash</a>, <a href="/recipes/tags/beep/">beep</a>, <a href="/recipes/tags/color/">color</a>, <a href="/recipes/tags/colour/">colour</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/display/">display</a>, <a href="/recipes/tags/generator/">generator</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/macbook_pro/">macbook_pro</a>). Revision 2. </p> <p>This code generates a horizontal coloured real time bargraph generator anim for a Macbook Pro 13 inch, OSX 10.7.5, using the default standard Terminal only.</p> <p>It is UNTESTED on Linux variants but I would like any successful Linux tryers to make a comment in the comments section and tags will be added accordingly otherwise I will assume it does NOT work on other UNIX like variants.</p> <p>It is a derivative of my 7 bit bargraph generator for Python on this site elsewhere.</p> <p>The Terminal colours WILL be changed on running but it is simple to return it back to its original state.</p> <p>Read the code for more information.</p> <p>Enjoy, (and a Happy New Year)...</p> <p>Bazza, G0LCU...</p> Platform Independent White Noise Generator... (Python) 2012-11-25T10:10:45-08:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578350-platform-independent-white-noise-generator/ <p style="color: grey"> Python recipe 578350 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/apple/">apple</a>, <a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/generator/">generator</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/macbook_pro/">macbook_pro</a>, <a href="/recipes/tags/noise/">noise</a>, <a href="/recipes/tags/program/">program</a>, <a href="/recipes/tags/pyaudio/">pyaudio</a>, <a href="/recipes/tags/signal/">signal</a>, <a href="/recipes/tags/sound/">sound</a>, <a href="/recipes/tags/source/">source</a>, <a href="/recipes/tags/windows/">windows</a>). </p> <p>This code is a derivative of the Pure Sinewave Generator and produces a continuous noise out of the speakers or headphone sockets.</p> <p>It is for the hobbyist to be able to generate a pseudo-random noise signal for testing with.</p> <p>It is issued as Public Domian and you may do with it as you please.</p> <p>It is very easy to convert to Python 3.x.x but as OSX only has 2.7.x and lower ATM then these are what are used...</p> <p>An installation of pyaudio IS needed for this to work; see the code for more information.</p> <p>It is near platform independent but sadly the AMIGA is not included, but hey, I have already shown how generate sound for Classic AMIGAs.</p> <p>Enjoy finding simple solutions to often very difficult problems...</p> <p>Bazza, G0LCU...</p> Platform Independent 1KHz Pure Audio Sinewave Generator... (Python) 2012-10-23T12:53:37-07:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578301-platform-independent-1khz-pure-audio-sinewave-gene/ <p style="color: grey"> Python recipe 578301 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/apple/">apple</a>, <a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/generator/">generator</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/macbook_pro/">macbook_pro</a>, <a href="/recipes/tags/program/">program</a>, <a href="/recipes/tags/pyaudio/">pyaudio</a>, <a href="/recipes/tags/signal/">signal</a>, <a href="/recipes/tags/sinewave/">sinewave</a>, <a href="/recipes/tags/sound/">sound</a>, <a href="/recipes/tags/source/">source</a>, <a href="/recipes/tags/windows/">windows</a>). Revision 2. </p> <p>IKHz_SW_OSX.py</p> <p>A mono _pure_ sinewave generator using standard text mode Python 2.6.7 to at least 2.7.3.</p> <p>This DEMO kids level 1KHz generator is mainly for a MacBook Pro, (13 inch in my case), OSX 10.7.5 and above. See below...</p> <p>It is another simple piece of testgear for the young amateur electronics enthusiast and uses pyaudio fully installed for it to work.</p> <p>PyAudio can be obtained from here:- <a href="http://people.csail.mit.edu/hubert/pyaudio/" rel="nofollow">http://people.csail.mit.edu/hubert/pyaudio/</a></p> <p>This was primarily for a MacBook Pro, but works on at least 2 Linux flavours and Windows Vista 32 bit...</p> <p>The sinewave generated is near excellent...</p> <p>Enjoy finding simple solutions to often very difficult problems... Bazza, G0LCU...</p> For MacBook_Pro-Heads Only. Simple LF Audio Oscilloscope Using Standard Text Mode Python. (Python) 2012-10-07T14:15:55-07:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578282-for-macbook_pro-heads-only-simple-lf-audio-oscillo/ <p style="color: grey"> Python recipe 578282 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/anim/">anim</a>, <a href="/recipes/tags/apple/">apple</a>, <a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/display/">display</a>, <a href="/recipes/tags/macbook_pro/">macbook_pro</a>, <a href="/recipes/tags/oscilloscope/">oscilloscope</a>, <a href="/recipes/tags/pyaudio/">pyaudio</a>, <a href="/recipes/tags/scope/">scope</a>, <a href="/recipes/tags/sound/">sound</a>). </p> <p>For MacBook_Pro-Heads Only. Simple LF Audio Oscilloscope Using Standard Text Mode Python.</p> <p>SimpleScope_OSX.py</p> <p>Do you remember this upload from myself on 26-06-2011...</p> <p><a href="http://code.activestate.com/recipes/577771-simple-lf-audio-oscilloscope-using-standard-text-m/?in=user-4177147" rel="nofollow">http://code.activestate.com/recipes/577771-simple-lf-audio-oscilloscope-using-standard-text-m/?in=user-4177147</a></p> <p>Well here is an August 2012 vintage MacBook Pro 13 inch version of it for OSX 10.7.5...</p> <p>This is proof of concept code for a kids level project I am doing for a MacBook Pro, 13 inch, OSX 10.7.5. A DEMO to show how to display a waveform using standard text mode Python. "pyaudio" must be installed for this to work. Levels are set using the standard audio mixers, (System Preferences -> Sound).</p> <p>Just whistle a signal of say 300Hz to 3KHz, (normal voice spectrum), using say, the internal mic, and watch a waveform appear inside the X-Y graticule.</p> <p>Read the code for more information.</p> <p>$VER: SimpleScope_OSX.py_Version_0.00.10_(C)2012_B.Walker_G0LCU.</p> <p>This code is GPL2, but, the hardware information is Public Domain.</p> <p>(I am looking into including Windows and Linux variants too using pyaudio to access the sound system.)</p> <p>Enjoy finding simple solutions to often very difficult problems.</p> <p>Bazza, G0LCU...</p>