home.social

Search

1000 results for “_PI_”

  1. Pi.Alert or WatchYourLAN can alert you to unknown devices appearing on your WiFi or LAN network

    gadgeteer.co.za/wp-content/upl You can self-host these open source apps that will regularly scan the devices connected to your WIFI / LAN and alert you the connection of unknown devices. Pi.Alert has a few extras like warning of […]

    gadgeteer.co.za/pi-alert-or-wa

    gadgeteer.co.za/pi-alert-or-wa

  2. Pi Pico Makes SSTV Reception a Snap - There’s a paradox in amateur radio: after all the time and effort spent getting a ... - hackaday.com/2025/01/04/pi-pic #slow-scantelevision #amateurradio #radiohacks #decoder #scottie #martin #pipico #sstv #ham

  3. Pi Day MIDI Sequencer

    If you write your dates month first, then 14th March is recognised as Pi day i.e. 3.14.(2022) in this case.  I’ve long had the idea of doing something MIDI or sequencer related to number sequences.  I’d like to do something with the Online Encyclopedia of Integer Sequences (OEIS) at some point, but as it is Pi day, I thought I’d start with that.

    Now using the digits of Pi as the trigger for playing note values is a well trodden path, and calculating Pi to a number of decimal places is a well known and well researched task but to really get going you need quite a bit of computing power.  But what if the increasing time to calculate a digit is inherently part of the “music”?  That was my idea, so I set about looking for an algorithm to calculate the digits of Pi that would run on an 8-bit microcontroller, like my Arduino.

    [youtube youtube.com/watch?v=h6bfRv2vRo]

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    If you are new to Arduino, see the Getting Started pages.

    Parts list

    • Arduino Uno
    • Optional: 8 ohm speaker or old headphone speaker with 220Ω resistor.
    • Optional: Ready-Made MIDI Module.
    • Optional: I2C 7-segment display module based on a HT16K33.
    • Optional: 10x LEDS and associated resistors
    • Breadboard and jumper wires

    The Circuit

    The most basic requirement for this circuit is some means of making a sound.  There are two options for that here:

    • Connect up a loudspeaker (and resistor) to an output pin (I’m using A0 here).
    • Connect up a MIDI interface and plug it into a synthesizer (I’m using one of my Ready-Made MIDI Modules here).

    You can pick one or both of these methods.  But whilst satisfies the main aim – of having some music generated from the digits of Pi, it isn’t very interesting to look at!

    So this also supports two optional display outputs, both of which are optional:

    • 10 LEDs (and associated resistors) on D2 to D11.
    • I2C 4-digit 7-segment display based on the HT16K33 controller.

    In my video, I’ve enabled both types of display, although I’m using one of my “led bars” that has been tweaked for use with the Arduino’s weird pin-spacing, and MIDI output to my MT-32 playing the “Bellsinger” voice.

    The Code

    The main mechanics are those I’ve used many times before – playing notes, driving LEDs and displays and so on.  To make the options easy to manage, I’ve split all the sound and display handling out into the following functions:

    • displayInit()
    • displayClear()
    • displayNoteOn(digit)
    • displayNoteOff(digit)
    • soundInit()
    • soundNoteOn(digit)
    • soundNoteOff(digit)

    Then I’ve used conditional compilation to include the appropriate code in the appropriate place.  Once again I’ve used the HT16K33 library from Rob Tillaart (details here: https://github.com/RobTillaart/HT16K33).

    But of course, the real “star” of this show is code to calculate the digits of Pi. Many methods to calculate Pi will store all previous digits and keep calculating to make the value more accurate over time.  This means that you have to keep checking digits and calculating until they stop changing at which point you can assume you know what that particular digit has to be.

    That isn’t very practical if I just want to find a single (next) digit.  Most musical applications of Pi will probably store Pi to some number of digits in memory, but I found a discussion on how to calculate the nth digit of Pi. It started with a formula discovered by David Bailey, Peter Borwein, and Simon Plouffe in 1995, which is described in full here.  The downside of this is that it allows you to calculate digits in base 16 (hex), which isn’t really what I’m after.

    However, maths doesn’t stand still and there are now forumlas that will calculate the nth digit in base 10 (i.e. decimal).  Here are some resources that talk about this:

    In the end I took the code posted to the stackoverflow discussion which has the following opening comment:

    /*
     * Computation of the n'th decimal digit of \pi with very little memory.
     * Written by Fabrice Bellard on January 8, 1997.
     * 
     * We use a slightly modified version of the method described by Simon
     * Plouffe in "On the Computation of the n'th decimal digit of various
     * transcendental numbers" (November 1996). We have modified the algorithm
     * to get a running time of O(n^2) instead of O(n^3log(n)^3).
     * 
     * This program uses mostly integer arithmetic. It may be slow on some
     * hardwares where integer multiplications and divisons must be done
     * by software. We have supposed that 'int' has a size of 32 bits. If
     * your compiler supports 'long long' integers of 64 bits, you may use
     * the integer version of 'mul_mod' (see HAS_LONG_LONG).
     */

    It only requires a few minor tweaks to run on the Arduino, mostly removing any mentions of the C main and its arguments, and any printf statements.  Thankfully the Arduino has the AVR implementation of math.h available, so that bit can remain unchanged.

    I turned the code’s main function into a calcPi() function as follows:

    int calcPi(int digit)
    {
       /* rest of function */
    
       return (int)(sum*10.0);
    }

    The provided function prints out 9 digits of Pi starting with the requested digit.  It does this by finally multiplying the ‘sum’ by 1e9 (i.e. 1000000000).  To return just a single digit I multiply the sum by 10 and return the integer result, which is just one digit – the digit of Pi for the requested location.

    I’ve checked the digits produced against a list of the first 100 digits of Pi and it appears to work fine!  There are apparently more efficient routines, but actually as I’m relying on the timing of the calculation for timing in the music, a less efficient routine is fine.

    Find it on GitHub here.

    Closing Thoughts

    I really like the idea of generative music from mathematical sequences, so I plan to do some more playing in this space at some point.

    But I’m really pleased with the idea of using the increasing complexity of the calculation to vary the timing.  I’ve left this running for a few minutes and it reaches the point where changes are noticeably slower relatively quickly. In the 3 minutes and 14 seconds of video, I think it has calculated 78 digits of Pi.

    I’m now intrigued to know how often it changes note after an hour.  Or even a day 🙂

    Update – later that day…

    I left it running for 12 hours, and it seemed to work fine at least up until digit 554, where it had calculated 27705 after 10 hours, and was changing digits approximately every 2.5 minutes.  I was quite keen to see if it would make it up to the Feynman point, which occurs at digit 762.  At this rate, I worked out it would probably take another 9 hours or so, and that was assuming the calculation didn’t get any slower!

    But when I checked in again after the full 12 hours, it was reading 74345 which Pi Search tells me occurs position 64405!  So either my Arduino had a major speed injection or something had gone wrong!

    I suspect at some point there was an overflow in the calculation that messed things up.  Or course there was a slim possibility that I’d been searching for the first instances of the sequences I was finding but it was actually a second or third occurrence but a bit of quite back-tracking and checking soon ruled that out.  And anyway, a rough calculation backwards of 550 digits in ten hours gives an average calculation time of just over 1 minute which seems much more plausible a rate given where things ended up.

    Oh well. I can say I’m good for around 10 hours of “music” this way. It was fun while it lasted 🙂

    Kevin

    [youtube youtube.com/watch?v=iE4vosZjoU] #arduino #led #midi #pi #piday #sevenSegmentDisplay
  4. Python and Pi Provide Heads Up Display For Your Experimental Airplane - You shouldn’t be looking at screens when you’re driving, but what about a heads-up display? A scre... more: hackaday.com/2019/05/10/python #transportationhacks #headsupdisplay #raspberrypi #hud #pi

  5. Pi digits test (stardot.org.uk/forums/viewtopi) - 100 digits

    Risc PC 700: 1.6s
    Neotron Pico: 3.0s
    BBC Master with ARM2: 6.4s
    BBC Master: 210s

    You can see more of this nonsense at the #RetroComputerFestival this weekend at the Centre for Computing History in Cambridge, England.

  6. #TweedeKerstdag. Mooie gelegenheid om de catalogus in #lightroom weer eens goed te krijgen. M'n #pi file-server is verdwenen, dus nu maar de foto's terug zoeken in de cloud.

  7. atari800 — Atari 800 / 65XE… на Мурмуляторе

    Для Атари на Мурмуляторе имеются целых три разных эмулятора: Atari 2600 , Atari 800 и Atari Lynx . Первый ограничен исполнением только ROM-файлов для приставки Атари 2600, последний - это очень простенький хэндхэлд, который мало распространён на просторах бывшего Союза, поэтому сосредоточимся на среднем, который теоретически эмулирует Atari 400, 800, 1200XL, 600XL, 800XL, 65XE, 130XE, 800XE, XE Game System и 5200 SuperSystem. Реализация для Мурмулятора основана на эмуляторе github.com/atari800/atari800 - который легко собирается под Линукс. Т.е. основная проблема - ограниченные ресурсы маленького RP2040. Конечно, пришлось повозиться, но удалось запихнуть всё необходимое, как минимум для вариантов оригинального компьютера с 48 КБ памяти.

    habr.com/ru/articles/842616/

    #мурмулятор #murmulator #atari #atari_800xl #atari_st #atari_will_be_back! #atari_2600 #pi_pico

  8. 曾被幣圈當笑話的 $Pi 幣,在 #PAPC 亞洲最大 #Pi Network發展推廣中心的努力下,於今年11月3日創立台灣 #Pi Network加密貨幣最大交易平台。

    看到社團創立後,社團內賣家踴躍申請,真是驗證這句:幣的價值,來自大家相信其有價值。

    祝福 $Pi 幣的價值被 $Pi 幣支持者穩定維持住。

    facebook.com/groups/pi.bidding

  9. PI: OLG hebt Einstellungsbeschluss im Strafverfahren wegen des Vorwurfs der Steuerhinterziehung gegen drei ehemalige Sportfunktionäre im Zusammenhang mit der #WM2006 auf (#Sommermärchen).

    hessenlink.de/PM20230522

  10. Pi Day is a million years away, but it's the first thing that I thought of when I went to try out @christianp's awesome hexaflexagon generator!

    Upload 3 photos and download your hexaflexagon! So many math classroom opportunities!

    somethingorotherwhatever.com/h

    #mtbos #classroommath #hexaflexagon

  11. In honor of Pi Day (March 14), enjoy part of the epic pie fight from 1965's "The Great Race" starring Natalie Wood, Tony Curtis and Jack Lemmon.

    #Movies #oldhollywood #classicmovies #pie #nationalpiday #piday #piday2023 #happypiday #pi

    youtube.com/watch?v=GfuuIwTt9N

  12. In honor of Pi Day (March 14), enjoy part of the epic pie fight from 1965's "The Great Race" starring Natalie Wood, Tony Curtis and Jack Lemmon.

    #Movies #oldhollywood #classicmovies #pie #nationalpiday #piday #piday2023 #happypiday #pi

    youtube.com/watch?v=GfuuIwTt9N