Lokai

Moderator
Lokai submitted a new resource:

My Music System with Synthesizer - Use only on Test Shard please. This has potentially powerful and untested parts.

Fun Piano/Harp/Lute/Drums player. Lets you switch between the instruments and play them out on a piano-style keyboard. You can also (in theory) create tracks of music, including sheet-music style output, and save and load tracks.

It has been a while since I tested this, but I think it relied on XML Attachments to load and save, and I am pretty sure it saved the tracks as attachments on the instrument in your pack.

WARNING!: PLEASE DO NOT USE ON LIVE SHARD WITHOUT EXTENSIVE TESTING FIRST.

Read more about this resource...
 
Lokai updated My Music System with Synthesizer with a new update entry:

UPDATED: My Music System with Synthesizer and Magic Chords

View attachment 8280

Updated and tested further. The only real problem I am having with this now is that attachments are not loading to instruments on server restart. This means your tracks will need to be added to the instruments again if you want to play the tracks.

NEW! - Added a "magic chord" option. Lets you play chords using the lower register of the keyboard. (Reminds me of the days I used to play Lowrey organs in the mall.) Chords can not be used in the song recording at this...

Read the rest of this update entry...
 
Thanks, I'll take a look tomorrow.

EDIT:
Ah, it IS saving the tracks then, and allowing them to load without serialization issues now?
 
Last edited:
Update said:
The only real problem I am having with this now is that attachments are not loading to instruments on server restart. This means your tracks will need to be added to the instruments again if you want to play the tracks.

Nope. Still the same problem. But, there was enough done to warrant an update.
 
If double click piano and just click "play" directly then the server will crush:
Server Crash Report
===================

ServUO Version 0.5, Build 6265.22542
Operating System: Microsoft Windows NT 6.2.9200.0
.NET Framework: 4.0.30319.42000
Time: 2017/2/28 14:21:11
Mobiles: 24725
Items: 387637
Exception:
System.ArgumentOutOfRangeException: 索引超出范围。必须为非负值并小于集合大小。
参数名: index
在 System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
在 Server.Gumps.SynthGump.OnResponse(NetState sender, RelayInfo info)
在 Server.Network.PacketHandlers.DisplayGumpResponse(NetState state, PacketReader pvSrc) 位置 d:\MiddangeardUO\Server\Network\PacketHandlers.cs:行号 1469
在 Server.Network.MessagePump.HandleReceive(NetState ns) 位置 d:\MiddangeardUO\Server\Network\MessagePump.cs:行号 187
在 Server.Network.MessagePump.Slice() 位置 d:\MiddangeardUO\Server\Network\MessagePump.cs:行号 115
在 Server.Core.Main(String[] args) 位置 d:\MiddangeardUO\Server\Main.cs:行号 571
 
Your script is also creating internal items.

Everytime you [playlute it creates 3 lutes on the internal map and does not dispose of them.
 
Yes. I am aware of the internal items. I was attempting to deal with them, but I agree that this has a ways to go. It's just so darn interesting that I wanted to share it AS IS, hence the "BETA" designation. If I am able, I will definitely update this with any corrections needed.

Thanks!
 
@Lokai
Just did a bunch of stuff on To-Do List, so I'm going to poke around with this today. Have you seen the playable piano script as well? I have it...anyway, lets see what we see here

EDIT:
Overall, it seems to be working for me. I created a track and saved it just fine, and it loaded as well. Why do you need the PlayLute, PlayHarp, etc?

Honestly, I think as it is, without those commands (which are creating the Internal items anyway), it is great dude! I would just suggest more ease of use, but I know this is Beta ;)
 
Last edited:
@tass23 - I got it to work with the piano addon, but I couldn't get it to do anything with a regular instrument. Am I misunderstanding what this actually does?

Looking at the code, I saw several functions that never get called, so I assume some functionality is missing or not added yet?
 
The components of the piano addon and the "Synth" command, I think, call the main gump.

The PlayLute, PlayHarp, etc, I was just playing with to generate chords using different instruments. The piano is not an instrument, and it does not need an instrument to generate sounds in the gump, but if you want the script to have YOU play back the tracks, either individually or combined, you need to have instruments in your pack to attach the XmlMusic attachments. I wanted to do this so that when people try to play the music they composed, they fail terribly if they are not experienced in Musicianship. (*evil laugh*)
 
The components of the piano addon and the "Synth" command, I think, call the main gump.

The PlayLute, PlayHarp, etc, I was just playing with to generate chords using different instruments. The piano is not an instrument, and it does not need an instrument to generate sounds in the gump, but if you want the script to have YOU play back the tracks, either individually or combined, you need to have instruments in your pack to attach the XmlMusic attachments. I wanted to do this so that when people try to play the music they composed, they fail terribly if they are not experienced in Musicianship. (*evil laugh*)
You have accomplished your objective, dude! ;)
Now, I'm also assuming that since the "music" is put into the Songs folder, that as long as any player knows the name of the song, they can load it. I don't know what will happen if the Instrument version doesn't match, i.e. can a harp track be played on a lute?
Perhaps I might also suggest ways to track how many people have "installed" a track, then you could have a Billboard Top 10, Top 20, etc. You could incorporate sales companies to "purchase" tracks based on length, number of notes, etc...not sure if you would be able to prevent people from just "typing jibberish" though to create music.
A context menu to open the Synth would be good (if an instrument has the attachment, the menu is available...BaseInstrument change, but nothing major, but it may not be needed since it's XmlAttachment-based).
 
I don't know what will happen if the Instrument version doesn't match, i.e. can a harp track be played on a lute?

You can select a track, and reattach it to another instrument by clicking the number I think, and it lets you target the instrument. it's too bad that pauses and drum notes (ie. sound effects) have different lengths from other note sounds, because it makes it so tracks run at different speeds. oh well.
 
Ah, perhaps there are some short sounds to mimic say a tambourine, for example..
It's possible to cut off sounds too, so maybe that's the key...forcing a 2.5 second sound, down to 1 second, like trimming it.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back