Akayan Geyser Scripts

Share your scripts and packages with other Mudlet users.
Post Reply
User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Akayan Geyser Scripts

Post by Akaya »

Figured I'd start a new thread and post some of the Geyser scripts I've written in the past few months.
If you're looking for Vyzor UI scripts, I have a good collection going here:
http://forums.mudlet.org/viewtopic.php? ... 984#p14594

To start, here's a mini-map of sorts for use in Achaea. It tracks adjacent exits and gives you the room id's for each. Very simple. Lots of room for customizing. Here's a snapshot:
Image

Enjoy!
Attachments
MiniMap.zip
(963 Bytes) Downloaded 735 times

Aaze
Posts: 6
Joined: Thu Feb 19, 2015 3:09 pm

Re: Akayan Geyser Scripts

Post by Aaze »

Hey, only one?!?!? Hehehe, post more of your Geyser stuff!

User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Re: Akayan Geyser Scripts

Post by Akaya »

I haven't been playing much as of late. Though I do hover over this forum and offer help where I can. Any requests? Nothing too specific.

Aaze
Posts: 6
Joined: Thu Feb 19, 2015 3:09 pm

Re: Akayan Geyser Scripts

Post by Aaze »

Yea, me and a friend have been searching around for a Defense tracker and an affliction tracker using Geyser , but no luck so far. Those are the only two things I've been looking for for my GUI, which I created from your Geyser GUI. I was hoping to put a defence tracker in GUI.Box3 and the affliction tracker in GUI.Box2, or make the defense tracker out of the little boxes that were at the top and keep box3 as a WHOHERE or a type of mini score thing(I deleted them before really thinking what they could be used for, meh...)


i.imgur.com/gL5lQ5q.png

Edit: And I love the template!! Really helped learn a little bit of coding instead of me learning nothing digging through the manual (which confused me a lot)

User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Re: Akayan Geyser Scripts

Post by Akaya »

I have both affliction and defense tracker in this forum. If you use svo I would have no problem converting it to Geyser.

Glad you and many others enjoy the template! It really is a useful script.

Aaze
Posts: 6
Joined: Thu Feb 19, 2015 3:09 pm

Re: Akayan Geyser Scripts

Post by Aaze »

Yea, I saw those, but I use Wundersys, meh.

User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Re: Akayan Geyser Scripts

Post by Akaya »

Image

Here's a fully functional piano I created while testing things with playSoundFile() It's built with the Geyser framework.

:!: It works on Mudlet 2.1

Simply click a key to play it's note. The package includes the .wav files for each sound. You can change these if you want your piano to sound different.

Here's the script without the .wav files for your dissecting tendencies (this won't work if you simply copy/paste the script. You need those .wav files in the package!)
Code: [show] | [select all] lua
piano = {}

piano.container = Geyser.Container:new({
  name = "piano.container",
  x = 0, y = 0,
  width = 350,
  height = 200,
})

piano.white_keys = Geyser.HBox:new({
  name = "piano.white_keys",
  x = 0, y = 0, width = "100%", height = "100%",
},piano.container)

local keys = {"G#","A#","C","C#","D#","F","G"}

for k,v in pairs(keys) do
  piano[v] = Geyser.Label:new({
    name = "piano."..v,
  },piano.white_keys)
  piano[v]:setStyleSheet([[
    background-color: white;
    border-color: black;
    border-width: 2px;
    border-style: solid;
    qproperty-alignment: AlignBottom;
  ]])
  piano[v]:echo([[<center><span style="color:black"><span style="font-size: 16pt">]]..v)
  piano[v]:setClickCallback( "piano.press_key", v )
end

local w = piano.container:get_width()

local x = w/7

local width = -x + w

piano.black_keys = Geyser.HBox:new({
  name = "piano.black_keys",
  x = "5%", y = 0, width = width , height = "70%",
},piano.container)

local keys = {"A","B","blank","D","E","F#"}

for k,v in pairs(keys) do
  piano[v] = Geyser.Label:new({
    name = "piano."..v,
  },piano.black_keys)
  piano[v]:setStyleSheet([[
    background-color: black;
    border-color: grey;
    border-width: 2px;
    border-style: solid;
    qproperty-alignment: AlignBottom;
    margin: 0px 5px 0px 5px;
  ]])
  piano[v]:echo([[<center><span style="color:black"><span style="font-size: 16pt">]]..v)
  piano[v]:setClickCallback( "piano.press_key", v )
  if v == "blank" then
  piano[v]:setStyleSheet([[
    background-color: transparent;
  ]])
  piano[v]:echo("")
  end
end



function piano.press_key( note )
  playSoundFile( getMudletHomeDir():gsub("\\","/") .. "/".. note .. ".wav")
end
Piano.zip
Install using the Package Manager!
(2.82 MiB) Downloaded 734 times

User avatar
SlySven
Posts: 1019
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Akayan Geyser Scripts

Post by SlySven »

It also Works for Me™ on a current 3.0.0 preview though that IS on *nix where Sound does work (there are problems on some 'Doze systems from Qt5 issues ATM).

One minor niggle - the lettering on the Keys is not correct and there is not anything showing on the black ones IMHO...!

Oh, and the keys are not right for the notes used. :o

For what it is worth here is a "GranderPiano" with a full 2-octave scale, but it probably won't work for some people as it stores the sound samples in a sub-directory and there are issues with current Mudlet versions not always parsing packages with such things - it seems that some compression/archive programs do not include the zero size file entries with file-names ending with a '/' which is the definitive means of coding sub-directories in zip archives.

I made the extra notes with a bit of tweaking (pitch changing) of a couple of the original samples using Audacity the quality of the lower ones is not quite as good as it could be...
Attachments
GranderPiano.png
GranderPiano.png (38.41 KiB) Viewed 11490 times
GranderPiano.mpackage
(5.77 MiB) Downloaded 654 times

User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Re: Akayan Geyser Scripts

Post by Akaya »

Yeah. Ya caught me there. The notes are misplaced and might not match perfectly to a real piano. I was having some issues building it as I don't have much knowledge on musical scales and whatnot. But the notes do go from a lower pitch to a higher one :P which was good enough for what I wastesting.

Glad someone can appreciate it. Your piano is much better and i got it working after a bit of tweaking.

User avatar
SlySven
Posts: 1019
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Akayan Geyser Scripts

Post by SlySven »

Ah, those piano lessons I had as a kid finally paid-off. Never really got anywhere on that instrument though, the previous stuff on a recorder had conditioned me to only read the upper stave (the five lines with the "treble" clef &#119070; on) and on the piano that tends to mean the higher notes for the right-hand and I got totally flummoxed by the introduction of notes on the lower stave (the one with the "bass" clef on &#119074;) which tend to be played with the left.... ;)

For the uninitiated, sharp notes which actually use the symbol "♯" and not "#" are a semi-tone (the black key) up from the natural (white) note on a piano and can also be referred to as a "flat" ("♭") that is the next note but a semi-tone down. So A♯ is more commonly known as B♭. However, until I can get the Lua sub-system to Mudlet main application inter-wiring fully Unicode (UTF-8) compliant it may not be possible to use those non-ASCII characters! :(

The scale of C - Major uses eight steps from the C in one octave to the C in the next (just the white notes) and the frequency of one is exactly twice that of the other. A piano uses what I think is an even-tempered scale and the frequencies between the keys are pretty close to a geometric progression. The black notes are to provide the extra intermediate frequencies for the other scales that have a different starting letter and the overall frequencies used are the best compromise for the actual frequencies that the different starting notes/frequencies need to get a sequence of eight notes from one octave to the next - try starting on a different note to a C and see which keys you have to use to get the "right" note - as a start I'll give you the G-minor which goes: G, A, B♭ (a.k.a. A♯), C, D, E♭ (a.k.a. D♯), and F. :geek: Note this applies to the Western(?) scale of music, other regions, e.g. India use a different geometric progression and have more notes to what we call an octave - which is why music from that region sounds different to our (well, my) ears.

Post Reply