HP Forums
( Free42 ) Random Melody - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: ( Free42 ) Random Melody (/thread-15098.html)



( Free42 ) Random Melody - Gamo - 05-31-2020 07:33 AM

This program run the "Random Tone" between
Tone 1 to 6 in an infinite loop to produce
"Random Melody"

Demo Clip: https://youtu.be/PxY_8OMilUQ

Program:

LBL "T"
RAN 6 x 1 + IP
1 - X=0
GTO 00 //(1)
1 - X= 0
GTO 01 //(2)
1 - X=0
GTO 02 //(3)
1 - X=0
GTO 03 //(4)
1 - X=0
GTO 04 //(5)
1 - X=0
GTO "T"
TONE 6 //(6)
GTO "RANT"
LBL 00 TONE 1 GTO "T"
LBL 01 TONE 2 GTO "T"
LBL 02 TONE 3 GTO "T"
LBL 03 TONE 4 GTO "T"
LBL 04 TONE 5 GTO "T"

Gamo 5/31/2020


RE: ( Free42 ) Random Melody - Werner - 05-31-2020 07:54 AM

Why not use TONE IND ST X?
Werner


RE: ( Free42 ) Random Melody - Gamo - 05-31-2020 09:07 AM

Thanks for the review Werner
This is my first try on HP-42S programming and
That is very nice idea about the Indirect Stack manipulation.

Gamo


RE: ( Free42 ) Random Melody - Eddie W. Shore - 05-31-2020 02:01 PM

Very nice musical program. I like how stretched a few tones into a medley.


RE: ( Free42 ) Random Melody - Gamo - 05-31-2020 05:23 PM

Thanks Eddie and Werner for the review.
As Werner mentioned about TONE IND ST X

Here is the program updates.

LBL "TT"
RAN 9 x 1 + IP
TONE IND ST X
GTO "TT"

Much shorter program and this time used all
9 Tones, test it and sound melody is not as good
to hear compared to only 6 Tones version.

Gamo


RE: ( Free42 ) Random Melody - ijabbott - 06-03-2020 09:49 AM

(05-31-2020 05:23 PM)Gamo Wrote:  Thanks Eddie and Werner for the review.
As Werner mentioned about TONE IND ST X

Here is the program updates.

LBL "TT"
RAN 9 x 1 + IP
TONE IND ST X
GTO "TT"

Much shorter program and this time used all
9 Tones, test it and sound melody is not as good
to hear compared to only 6 Tones version.

Gamo

You don't really need the IP. Also, there are 10 tones from 0 to 9, so you can do:

LBL "TT"
RAN
10
x
TONE IND ST X
GTO "TT"

to play a random melody with the 10 different tones.


RE: ( Free42 ) Random Melody - Gamo - 06-03-2020 10:03 AM

ijabbott, Thanks for the updates and thats right no need of the

[1 + IP] I was thinking about that Random Dice routine and just

put it in eventhough this have nothing to do with Random Tones.

Gamo