QB64 Phoenix Edition
Do It Yourself Project Ideas - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1)
+--- Forum: Prolific Programmers (https://qb64phoenix.com/forum/forumdisplay.php?fid=26)
+---- Forum: bplus (https://qb64phoenix.com/forum/forumdisplay.php?fid=36)
+---- Thread: Do It Yourself Project Ideas (/showthread.php?tid=3553)

Pages: 1 2


Do It Yourself Project Ideas - bplus - 03-24-2025

Nothing beats the feeling of coding your own project successfully except maybe having a child, writing a book, painting a masterpiece, ... well I guess the list could be endless Smile

Here's an idea I worked on recently that I will save you from showing the code I came up with.

I wanted to practice meditation more and I always liked following your breath exercises so:

I started with what I call a "Tesla Breath" Tesla loved numbers 3, 6, 9 
1. Inhale for count of 3
2. Hold count of 6
3. Exhale for count of 9 

not exactly box breathing but we want to be genuii like Tesla right?

4. then I added mod to slow the counts down over time so that you breath significantly slower when you finish than from when you start.

5. then I added positive words list to display while counting out Inhales, Holds and Exhales. A randomly selected word for each count. This list is separate from bas source to edit whenever you like or maybe change the flavor of meditation with a whole different list.

6. next up in last session I realized I need to build in a timer for a minimum session length to set at start.

So that's my idea for a neat little project you can make All Your Own!


RE: Do It Yourself Project Ideas - Pete - 03-24-2025

Okay, but what's a...

Quote:geunii?
Maybe reduce the amount of time you're holding your breath? Big Grin

Code: (Select All)

Do
? "Inhale":  _delay 3: Cls
? "Hold...": _delay 6 : Cls
? "Exhale": _delay 9 : Cls
Loop

Hey Mark, I was thinking about the random comments; why not jokes? See if the user can hold his friggin' breath when he hears the one about, "Why did the North Korean chicken cross the road?"

Pete


RE: Do It Yourself Project Ideas - bplus - 03-24-2025

OK I meant genii sorta like jedi Big Grin  (multiple of genius)

I dont know who you quoted here ?? I spelled it (wrongly) genuii
Quote:
Quote:
geunii?

Your code is a start but I use full screen and... well see!
   


RE: Do It Yourself Project Ideas - Pete - 03-24-2025

Oops, I transposed the u and n. Oh well, I couldn't find anything for "genuii." I figured you blacked out when trying to type genius.

But mine's in screen 0, the most relaxing screen you'll ever need!

Pete


RE: Do It Yourself Project Ideas - bplus - 03-24-2025

Well if you really, really, really need the sleep Big Grin

Oh! I like the jokes idea, for sure! but that is a different meditation. Smile

At the break of an Exhale ha, ha, ha, ha, ha, ha, ha, ha, ha!


RE: Do It Yourself Project Ideas - bplus - 03-26-2025

Update: I am adding Plasma Coloring to positive word display so every session will have a color theme mostly different from previous day. What could be more signature bplus than Plasma Coloring! Smile

Also I counted the first cycles of breath for 1 minute and get 4, that's 15 secs per breath cycle. I think that is impressive to start with but maybe someone brand new might try 10 or 12 sec cycles and work up?

I did my first 10 minute session (with 2 sips of coffee adding 2 extra cycles to 10 m) and Holy Cow I raised my diastolic from what I think is too low 55 to 71 keeping systolic 124. I think that is good? 
@Pete what do you think pro bono?


RE: Do It Yourself Project Ideas - bplus - 03-26-2025

Since the mention of jokes for meditation I pulled up my Henny pecked application from 2018.
   

Just a collection of one-liners saved in a Jokes.txt file:
sample of mine:
Quote:A computer once beat me at chess, but it was no match for me at kick boxing.
What did one ocean say to the other ocean? Nothing, they just waved.
A bank is a place that will lend you money, if you can prove that you do not need it.
What is faster, hot or cold? Hot, because you can catch a cold.
Whats the difference between a new husband and a new dog? After a year, the dog is still excited to see you.
Love may be blind, but marriage is a real eye-opener.
I say no to sweets, they dont listen.

read the txt file into a string array.
add some code to display one-liners in center of screen.
I could make mine with a little bigger text that we've been playing with here recently.
Code: (Select All)
Sub Text (x, y, textHeight, fore As _Unsigned Long, back As _Unsigned Long, txt$)
    Dim fg As _Unsigned Long, bg As _Unsigned Long, cur&, i&
    fg = _DefaultColor: bg = _BackgroundColor: cur& = _Dest
    i& = _NewImage(8 * Len(txt$), 16, 32)
    _Dest i&: Color fore, back: _PrintString (0, 0), txt$
    _PutImage (x, y)-Step(Len(txt$) * textHeight / 2, textHeight), i&, cur&
    Color fg, bg: _FreeImage i&: _Dest cur&
End Sub
Or just load your favorite font Smile

and I added a voice to read the joke, nothing beats the monotone of computer voice for Steven Wright jokes Big Grin

code I use in Windows for voice read jokes:
Code: (Select All)
Sub speak (message As String)
    Shell _Hide "Powershell -Command " + Chr$(34) + "Add-Type -AssemblyName System.Speech; (New-Object System.Speech.Synthesis.SpeechSynthesizer).Speak('" + message + "');" + Chr$(34)
End Sub

There you have it, another Do-It-Yourself Project!


RE: Do It Yourself Project Ideas - PhilOfPerth - 03-27-2025

(03-26-2025, 11:20 AM)bplus Wrote: Since the mention of jokes for meditation I pulled up my Henny pecked application from 2018.


Just a collection of one-liners saved in a Jokes.txt file:
sample of mine:
Quote:A computer once beat me at chess, but it was no match for me at kick boxing.
What did one ocean say to the other ocean? Nothing, they just waved.
A bank is a place that will lend you money, if you can prove that you do not need it.
What is faster, hot or cold? Hot, because you can catch a cold.
Whats the difference between a new husband and a new dog? After a year, the dog is still excited to see you.
Love may be blind, but marriage is a real eye-opener.
I say no to sweets, they dont listen.

read the txt file into a string array.
add some code to display one-liners in center of screen.
I could make mine with a little bigger text that we've been playing with here recently.
Code: (Select All)
Sub Text (x, y, textHeight, fore As _Unsigned Long, back As _Unsigned Long, txt$)
    Dim fg As _Unsigned Long, bg As _Unsigned Long, cur&, i&
    fg = _DefaultColor: bg = _BackgroundColor: cur& = _Dest
    i& = _NewImage(8 * Len(txt$), 16, 32)
    _Dest i&: Color fore, back: _PrintString (0, 0), txt$
    _PutImage (x, y)-Step(Len(txt$) * textHeight / 2, textHeight), i&, cur&
    Color fg, bg: _FreeImage i&: _Dest cur&
End Sub
Or just load your favorite font Smile

and I added a voice to read the joke, nothing beats the monotone of computer voice for Steven Wright jokes Big Grin

code I use in Windows for voice read jokes:
Code: (Select All)
Sub speak (message As String)
    Shell _Hide "Powershell -Command " + Chr$(34) + "Add-Type -AssemblyName System.Speech; (New-Object System.Speech.Synthesis.SpeechSynthesizer).Speak('" + message + "');" + Chr$(34)
End Sub

There you have it, another Do-It-Yourself Project!

Great; Respiration: a real inspiration (but may bring on excessive perspiration)!
I love that text-to-voice sub - may add that to some of my games to read Instructions etc. if that's ok ?


RE: Do It Yourself Project Ideas - bplus - 03-27-2025

Hey @PhilOfPerth

Here is an alternate of text to speech in case 1 line is just not enough! Smile
Code: (Select All)
'   alternate way for speech
'Sub speak (message As String)
'    '''modifed from "Code" at JB forum
'    Open "sound.vbs" For Output As #1
'    Print #1, "Dim message, sapi"
'    Print #1, "message=" + Chr$(34) + message + Chr$(34) + " "
'    Print #1, "Set sapi=CreateObject(" + Chr$(34) + "sapi.spvoice" + Chr$(34) + ")"
'    Print #1, "sapi.Speak message"
'    Close #1
'    Shell "wscript sound.vbs"
'End Sub



RE: Do It Yourself Project Ideas - SMcNeill - 03-27-2025

https://qb64phoenix.com/forum/showthread.php?tid=132 <-- Text to Speech with various options.