Areas that could use non technical help:
(maybe for these things would be better to open a new thread elsewhere and keep this for technical stuff)

Check size and proportion of the instruments compared among them and based on average height
(adult Sims are about 1.87 tiles, sometimes referred to as meters, so about 6.13 feet)

Check prices of instruments, compared with the official ones

Choosing copyright free songs. Must obviously be solos where only that particular instrument plays,
I would hate to waste the time of contributors for an instrument that has no songs to be used with.
I'd like of course classical, but I guess also jazz and other genres are ok to make the list
more varied. I'm not very knowledgeable about music.

That's it.
Replace YOUR_OWN_NAMESPACE with something unique to you to avoid potential conflicts.
Replace InstrumentName and instrumentname with the name of the instrument you want to make.

Sims3.YOUR_OWN_NAMESPACE.InstrumentName is the string to be used as script in the OBJK.

"instrumentname" is the string to be used in the animations name (unless... see below)
and in the xml resources (those with the UNKN tag) where the tunes are defined.
EDIT: Moved away from the centralized xml database model to a modular model.

Add "instrumentname" to the list of supported instruments in the CONFIGURATION xml of the mod
That list is checked by the parser to report unknown instruments.
Made the check tunable. By default you have to do it.

If you need more personalization for a specific instrument, you can also add to the
class the following methods (overriding the default values provided by the base class):

Code:

// optional, this is to override the string used for the animations, the string returned by the base class is the one returned by GetInstrumentName
public override string GetInstrumentNameForAnimations()
{
// instead of using the instrument name, this string is used for the animation name
return "flute2";
}
// optional, the string returned by the base class is "newspaper", override it only your instrument works better with another one
public override string GetCarryModelName()
{
// this is only used by the animation of the Pick interaction, it's the way Sims grab the object
// and briefly keep it in their hands before it goes in their inventory
// possible values: glassbar, platedinner, iceCreamCartoon, etc
return "newspaper";
}

EDIT: Not sure if making those values xml tunable is really needed. We'll see.

At the moment all instruments get attached/parented to the right hand slot of the Sim (for animation purposes),
but the slot used could be specific of the instrument (I'm talking out of my ass without really checking all
implications that that change may inflict to the way the mod currently works).

EDIT
Some instruments might share the same animations (femalemike+malemike and
maybe, MAYBE, clarinet+oboe), so I could create another method to optionally
override, something like GetInstrumentNameForAnimation to point to another
string. The value returned by the abstract method of the base class, used if the
specific instrument doesn't override it, would be the same of GetInstrumentName().
EDIT2: yep, implemented. Only for femaleMike and maleMike ATM, which use "mike".
This is only for the names of the animations, in the xml DB you still have to use
the specific name of the instrument!

Why writing the code from scratch (the Watch interaction and the jig-placing are
copy/pasted and adapted though) instead of simply deriving the new instruments
classes from BandInstrument or MusicalInstrument (the official one, not mine)?
That's a great question. Some of the reasons have proven to be no longer valid
and in hindsight maybe I could have give it a shot, but I still stand by my choice.
Maybe I'll elaborate more on this later (amongst the deciding factors there are
custom skills, audio format, animations, sheet music books, etc).

Define this as bone/slot in the _RIG resource and as fx_slot in the _RSLT resource of the instrument.
This is used as origin for farting musical notes (Visual Effect).

If you clone one of the existing musical instruments (only a place-holder flute is available at the moment
I'm writing this) the slot is already defined so all you have to do is update its position/orientation
(in both resources) based on the mesh used.
S3PE's RigEditor (right click on the _RIG resource) is very helpful for this as it can generate
the values for the matrix used to define the vector in the RSLT.

Probably defining this slot only in the RSLT resource is enough... not tested.

No Jazz script used. Didn't seem necessary, although a jazz script too can support animations with variable names.

The animations are kept shorts to minimize the awkwardness of keep going and farting notes after the song ended.

The animations' names have a standard format. Only the name of the instrument changes.

There are 3 looping animations that rotate randomly, the one used is picked with the following percentage chances:
loop1 50%
loop2 35%
loop3 15%

A more flexible system would be to use, for each instrument, a tunable field with a
comma separated list of weights.
The list has 4 entries? It means that instrument has 4 animations (loop1, ..., loop4).
The values of the list are "4, 3, 2, 1"? It means that *loop1* has a 40% chance to be used, etc.
Something like that, it's not a fleshed out idea.

I wish there was a way to see both Sim and object (parented to the Sim slot) in Blender,
my life would be much easier and I wouldn't have to work "blindly".
I know blender can import CASP items (attached to the respective bones),
so something like that should be doable.

EDIT: I was thinking about unlocking certain looping animations at certain ability levels,
to give the impression that the player is getting confident and "busting new moves",
but since there are only 3 animations, using only 2 or 1 could be too repetitive
and making more than 3 is a lot more work.

With the default tipping tuning, to make sure that a song has always
the chance to get a tip, the duration must be at least 30 sim-minutes.

At normal speed, 1 real time minute duration (1:13) roughly translates to 1 sim-hour (your mileage may vary).
Using a faster speed actually increases the duration (the audio playing can't really be quickened).

Audio Encoding

See HERE for the encoding process (I've updated it after experimenting with this mod).

Note: official band instrument (as well as most of audio effects) use a different audio format
(only a .snr file using a different codec).

For the AUDT resource, just duplicate one of mine, change its name* (same used for the _AUD,
this is not a strict rule but a common and convenient practice**) and regenerate the instance ID.
Now use Grid to update the reference to the _AUD resource:
- [1] Blocks (the ID of the block is called "Samples")
--- Items
----- [0] Items
------- Data
--------- Instance
Paste in the Instance field the InstanceID hex code of the _AUD resource
(or of the AUDT resource, since we used the same for both).

*Instead of changing its name, you can directly paste the InstanceId of the AUDT
in the Instance input box of the "Resource details" window.

**I stand corrected. That's not always the case. Stereo stations' music seems to be
like that, but audio effects and band instruments' songs use different names (and InstanceIDs)
for AUDT and _AUD.

The UNKN resource in the _Mod (TunesDataBase Template) is there just for reference.
Don't edit that directly, export it to a new package, change its name and generate a new hash for its InstanceID.
I suggest to put the UNKN resource in the same package with the audio,
to make sure that you can't have one without the other
(the mod doesn't check if the audio resources for a tune really exist).

The entries should be self explanatory.

You have to use the name of the AUDT resource (the key used to generate its Instance ID)
in the InstanceKey field of the Tune entry related to that particular audio.

I was thinking that the Genre field of the xml database could also be used to separate tunes based on their level:
0 = "Practice"
1 = "Easy"
2 = "Medium"
3 = "Hard"
An idea I Just had out of nowhere.
Note that the Genre field will be used only if the related option is enabled in the CONFIGURATION xml.

In the error reports (the dialogs displayed when reaching the main menu after starting the game),
I've added the name of the tune (in addition to the row of the table) to help spot the faulty entry.

The names used for the instrument in the tunes DB must be listed in the kSupportedInstruments tag
in the CONFIGURATION xml in the _Mod package or a warning will tell that an unsupported
instrument has been used (and that tune will not be added to the database).
Made this check optional because it's usefulness is arguable (see CODING post for more info).

To give me an easier time making the animations (not sure if the system I'm
using allows to move/rotate them - when they are parented to the Sim's slot - by changing
the values of the offsetBone bone in the _RIG resource, like it does for DriedFood for example),
objects must have a specific position (check how the flute is not centered on the x=0 and z=0)
and be "facing up" (this would be especially important for sax and trumpet).

There's something wrong with the sun shadow meshes of the flute
(reason could be using mismatched versions of blender and plugin used)
I haven't made the mask texture because without the final mesh there's no point.

I think the MODL is ok (hell, it could even be simplified more, there are many unnecessary
vertices and polygons), since that is used when the camera is far away.
The shadow MLODs are ok too (as far as the mesh is concerned, but they project
a shadow with a wrong offset), but if the MODL get simplified then they could be simplified too.

I'd like the MLOD with more details but under 1K polygons, preferably around 500.
I want meshes with a complexity comparable to that of the official band instruments,
IIRC the guitar is about 500 or 600 faces.

I found this free (as price and licence) 3d model online, DAMN IT, CAN'T FIND THE LINK
(IIRC it was black with silver buttons).
it could be used as reference or used directly, but if it it's like the other models
I found then this too is very high def. Blender has the decimate tool to reduce
the complexity of the mesh preserving its overall shape, but it still requires
manual editing, something I'm not up to.

The base mesh could be cloned from the flute (but I'd like that low def mesh to be
even more simplified, it has unnecessary vertices and faces),
not sure about the different size between a clarinet and flute and, to make a valid
comparison, the flute should first be well proportioned (see first post when I talk
about average Sim height for comparison)

Note: I won't attempt a trombone because it will require to also animate the object
(the instrument has a very noticeable moving part) and I want to keep it simple
(having the Sim animation in synch with the object animation sounds like a nightmare).

NOTE: for now, I'll focus on the flute (if there's interest in the mod).
I'm not sure I have enough stamina to make assets for all 5 instruments.

Question: If you simply move or rotate a mesh with MilkShape (or Blender)
and then update the MODL/MLOD resources with this modified version, does
the existing UV mapping get preserved or you have to re-make the textures?

It's a bit of a stretch, but I've added coding support to 2 new instruments: maleMike and femaleMike.
The game messages would still be related to playing instruments,
but these could be used to make Sims sing instead of play.

Sing with or without accompanying music? Copyright problems?
I don't know, we'll see when and if we get there.

They can share the same mesh but use 2 different OBJD and OBJK.
Obviously it has to be a portable and cordless mike (the mod is limited to that ATM).

They can share the same set of animations using the string mike
(not that having different animations for male and female Sims would be a bad idea,
but this reduces the work to do).

-----

I've removed the tune Anadolia and I'm currently testing 8 new tunes for the flute
(2 per each level), the list is heavily classical music oriented. The .package file
with just the audio is about 6MB.

I've cut some of them because they seemed too long. Some were longer than the
one I've used in the first release, Anadolia, which was about 2 min and 10 sec and
seemed endless to me. The new ones are on average 1 min long and I'm checking,
among other things, if all of them, except the 2 used at level 0 who are about 30
seconds long, are long enough to get tips.

-----

The download page should be back soon.
EDIT: Or not, I've asked to keep it on hold until a serious issue get fixed. See next post.

This has nothing to do with the mod itself, I think it has to do with the pre or post audio encoding,
i.e. the format/settings of the mp3 to be encoded and/or the (lack of) hex editing on the .snr file.

If it wasn't already crystal clear, I don't know shit about digital audio.

Observations and possible causes:

Maybe I'm over-reacting, maybe it was just that single audio file whose encoding somehow
went wrong. Wishful thinking for the win! I need to stress-test it more, I'm tempted to release
the updated version here to get help with that (hehe, as if people would be happy to wait for
the game to load, wait for the game to crash and start over again).

The game crashes when the audio ends or is about to end.
No error messages and no logs. Not from NRaas ErrorTrap at least (which makes sense),
I haven't really looked for other kind of logs (and they wouldn't probably help me much).

In one of the thread about audio encoding, lenglel suggests to use 128bps or lower
as Bit Rate Mode (SOURCE), others seemed to get good results with that,
but the original tutorial by FlyBy says to use variable and others seemed to get
good results with that.. I have always used variable.

When encoding, should I use the --single-block option or not? I've always used it.
The help of the ealayer3 command (I use version 0.6.2) simply says that using thatCreate a stream to be loaded in memory. Not sure what it means.
A snr file created without that option is bigger. Example:
- 655K noSingleBlock.snr (uses header starting with 00 00 ... this could actually be header-less)
- 640K singleBlock.snr (uses header starting with 05 04 AC 44 00 ...)
I've always used that option for encoding.

Looks like the audio must use a stereo track, audio with a mono track seems to regularly
make the game crash. All the new audio files I'm currently testing were originally mono,
I used the steps described HERE to turn them into stereo.
Could that be a problem or there are no relevant differences between a file who was
originally stereo and one which was turned from mono to stereo using that method?
Let me reiterate what I've already mentioned: I don't know shit about digital audio.
If I had to guess, I'd say it's the latter (no difference).

Never* had a crash with the audio file used in the first release of the mod, Anadolia,
which was originally a midi file (.mid) converted to mp3, exported with Audacity as mp3
using the suggested options and then encoded.

Never* had a crash with the music for the Limbo mod, which was also originally a midi.
In that mod the audio was played in a loop, a fact that may or may not be relevant
since the crash happens when the audio ends and a looping audio may have
a "different way" of ending, if that makes any sense.
By the way, in that mod too the audio doesn't survive a save+reload (if you save the
game while the music is playing, when you reload that game the audio is muted).

*Sometimes I'm not the more attentive person in the world, so maybe it happened
and I didn't notice.

Of course this is hardly solid proof for anything, it could just be a coincidence:
maybe those files too can make the game crash given enough time/chances
or maybe the fact that they were originally midi files has nothing to do with it.

Hex editing of the .snr file

The header, the first 8 bytes of the .snr file.

I've already mentioned that the header of core snr files used for sound effects and instrument's songs
are different than that generated with the encoding process. Maybe there's more to it.

Haven't used an hex editor to change that "00" to "40" as suggested in the original tutorial by FlyBy
(I didn't do that for the music of the Limbo mod)
(I did that for the songs of the Japanese Stereo Station mod).
EDIT : I checked and I wasn't remembering correctly the meaning of that change.

Quote:

Originally Posted by Original FlyBy Tutorial

[...]we have to change the byte at address 04 into '40' in order to tell the engine that this is a header and not a file containing
sound-data.

So that operation is used only when you have a .snr and a sns file, doing it here makes no sense.

Haven't added that extra chunk of data to the file as suggested in the original tutorial by Flyby
(I didn't do that for the music of the Limbo mod)
(I didn't do that for the songs of the Japanese Stereo Station mod).

Should I try using both a .snr file and a .sns file? My understanding is that they are used only for
stereo station songs and maybe (haven't checked) for background music, jukebox and similar.
They are definitely not used for musical instruments' songs.

On the other hand, looks like most sound effects and all (?) band instruments' songs use the
EA XAS ADPCM codec, so at this point I could try using that codec or keep using the ealayer3
codec but with both .snr and .sns files.

I'll re-read the whole thread with the tutorial (and other relevant ones) to look for clues, if I find a way
to iron out the potential causes of the crashes, I'll update the encoding guide in the post above.

This sure was an unexpected twist, I thought I had this audio encoding shit under control.
The fact that there is people helping to make/improve the instruments makes it tenfold more disheartening.
I sadly have to suggest to temporarily stop all activities because if this problem is not solved
it is a deal breaker and I don't want their generosity, enthusiasm, skill, time and efforts to be wasted.

EDIT:
I've abandoned my experimental (more like delusional) encoding process
and gone back to the traditional one (.snr + .sns file).
But no hex editing of the .sns file (adding that chunk of code, it was never
explained what that was for) since music seems to play well without it.

I'll post the updated mod to see if there someone willing to test it.
I have a bad record with things like this, usually no one ever replies [PITY-BAITING 101].

It's tuned to have all songs available from the start (the tag kTimesToLevelUp is set to 0
in the CONFIGURATION xml) without having to "level-up".

For the record, the audio who made the game crash was that for Old MacDonald had a farm*
but I suspect it was just a coincidence, potentially all of them can make the game crash.

*Hehe, I didn't find a flute version of "twinkle twinkle little star" to use as level 0 tune. I remember
that was the very first song used in school when I was 10 years old to learn how to play a flute,
the lamest existing model of a flute, a green monstrosity.

NOTE: if you leave the game running in the background (no focus in the window, so no sound)
the game will probably not crash despite going on for sim-days with Sims playing autonomously.

Now that I think about it, I've used only 1 Sim (with the Virtuoso trait) for testing,
maybe giving a flute to more Sims can help. Not exactly sure what that would
help to accomplish though... uhm... I lost my train of thought.

CHANGELOG

Now uses a gameplay oriented xml tuning (instead of the testing purposes one).
****** EXCEPT FOR LEVEL-UP AS MENTIONED ABOVE

Moved localization (i18n) from the xml to the classic STBLs resources.

Selectable Sims are notified when "their" playing ability increases and when RH concerts are unlocked.

Payment for half-assed concerts is now halved instead of getting no money at all.

Cooldown tooltip now shows how many hours remain before being able to perform another concert.
Featuring the programming [in]famous "1 hours" message!

It's a bit of a stretch, but I've added coding support to the instruments "maleMike" and "femaleMike"
to make Sims sing (but you'll still get messages related to playing an instrument).

Different instruments can now share the same set of animations.

BugFix: when playing autonomously, the interaction's name was empty.

Error reports when parsing the TunesDataBase now mention the name of the tune
(in addition to the row of the table) to help spot the faulty entry in the xml db.

New flute "playlist" (classical music oriented) with 8 tunes, two per each level.
****** Tired of the same old gameplay? Put some excitement in your sessions:
****** EACH TUNE CAN MAKE YOUR GAME CRASH! FUUUUUUUUUUUUUUUUU**!

EDIT: I'm also interested in knowing if a tune ends with some weird (sometimes scratchy) sound.
That might be caused by the absence of silence or sound fading at the end.

I do not know if I can be much help here as I know nothing about building mods. I did install the four files and tested the flute. I had my sim play all the available music start to finish and the music selections and audio is wonderful. The animation looked great but I'm not sure if it is intended to have the hands move while playing. It looked and sounded awesome to me. My game did not crash and I was able to save and quit without any issues. Also, no script errors were generated.

If there is something else I can try with the flute let me know. Also would be happy to test the other instruments when they are ready. Is there something I need to download and install for the other instruments. Not sure how to proceed.

Thank you so much for this Arsil and looking forward to see what comes next

Wow, thanks, you put a smile on my face, but, for your own good, please refrain your optimism
(which is appreciated, by the way). Keep testing the mod, it will eventually make the game crash.
If you can, try to keep track of which tunes cause the crash. For what is worth, because I'm afraid
it's all of them.

The flute is the only instrument currently available.

The animations are still placeholders:
- they look stiff because only the upper part of the body moves
- the left arm is weirdly/unnaturally rotated/twisted.
- no finger movement
- no blowing mouth/lips (and overall no facial expressions/variations)
Well, even if I try my best, I'm not so good to make all these things look much better anyway.

If I can say so myself, the flow of movements so far isn't half bad. It's generated by randomly
picking one of 3 different looping animations (they each have a different chance to be chosen).

Before putting more effort into them I'd like to have a more detailed mesh (not that I can see it
while I'm making the animations... but maybe that's because I'm still a Blender newbie), so I
can fine tune them based on the position of the flute's "mouth hole" and "buttons" (I don't know
how they are called technically). Or at least that was the plan before discovering the crashes...
* gets depressed again after the brief respite

I actually wouldn't mind trying out making the animations, I've followed a few character animation lessons before (Though that was with Maya, not blender) I studied (But still study it) anatomy too though that's just for art purposes lol. However, I'm pretty familiar with blender so I wouldn't mind giving the animations a try and making poses for the sims. (I haven't really shared any though) Oh! And I actually played the flute myself, wasn't that great at it, but I know how to play it. In case you were looking for someone who could do them for you.

If you do, then I have a few questions:

- Do you want them to be more... like, cartoon-ish as in, let's say TS4's animations where they're a bit overdone but fun to look at. Or just go with a more simple, realistic movements?
- Do you have a limit for how many random clips you want?

Love to see you smile Arsil. My apologies but I am a hopeless optimist. To me, Murphy was an optimist :D. I do realize my testing was limited to one world one household but I was absolutely thrilled with the music selections and the audio. I am familiar with the music selections and my sim didn't miss a beat playing.

Other than to keep testing I was not sure if you wanted me to test more and/or other situations. I will keep testing the flute in other households/other worlds. Will let you know when/if it crashes along with the details on the music selection and anything else that was going on before a crash.

BTW, the animations are not half bad at all. In fact if what I am seeing is the way it needs to work, no complaints here.

Here are some of the concept art of the flute I am following as a base. Sadly my game is crashing ( with memory exceeded error of all things thanks to huge amount of CC which I am trying frantically to reduce...I so wish the game could use my 16 GB RAM ). So I am unable to test at the moment but I may just mesh first(till I get the green signal from Arsil)

The fourth and fifth picture shows how I want the flute to end up looking like. Its okay right ?

Quote:

Originally Posted by Greenplumbbob

Oh! And I actually played the flute myself, wasn't that great at it, but I know how to play it.

One silly question - How many 'holes' are there in the whole contraption in neutral position ? Two ? One through which wind is blown and one at the end ? ( Sorry..I am clueless about the western classical flute ...we have more of the basic wooden variety of flute played more commonly in my part of the world )

EDIT: I'm getting forum-sick again. I'm spending so much time writing that
in the meantime 2 other posts were made. That's a bad sign.

[I'm answering to Greenplumbbob]

Thanks for the offer, it's much appreciated. And I would gladly accept it, but I don't want
anyone to make any kind of commitment for the time being, not until the problem with the
audio is resolved. I've asked the people who already offered to help to be on stand-by.
I don't want their work to go to waste.

Anyway, just for sake of argument.

Quote:

Do you want them [the animations] to be more... like, cartoon-ish as in, let's say TS4's animations where
they're a bit overdone but fun to look at. Or just go with a more simple, realistic movements?

The latter, but that's just my personal preference. If you were to make them I won't put any restraint
on your creativity. Ok, I'm lying, I'll become such a pain in the butt that you'll hate me.
Anyway, nothing would prevent you or anyone else to make them available as alternative, but frankly
at this point that sounds like a luxury and a misuse of human resources.

Quote:

Do you have a limit for how many random clips you want?

The thing is that the mod right now is pretty simple, so the number of clips must be the same for
each instrument. Of course this is easily solvable with a more flexible code, but that can be done
later. I probably got this backwards, it would be better to design a flexible system from the start
but, hey, I'm not a good planner. To answer your questions: 3 clips.
If you have enough energy to do more, you could do the animations for a second instrument
(not available at this time).

Quote:

Unless someone else wants to volunteer of course!

I never hoped that someone would offer to make the animations.
You are doing it on purpose only because the mod seems hopeless now, aren't you? :P
My grandest fantasies where limited to getting a little help from pose makers - calling them "posers"
would be inappropriate, right? - to get a few frames to use as a reference (for the blowing
mouth/lips when playing the flute, for instance).
Truth be told, I may have become a little invested in the flute animations myself and I wouldn't mind
to try making an improved version of them, so maybe you could wait when a new instrument is
available or maybe we could do the flute ones together (honestly I doubt I can animate well the
fingers for example). I'll try not to be a jerk, but for full disclosure I have to tell you that I may
have traumatized some of my past close collaborators... That said, in an ideal world my work
with this mod is done and other people would do all the objects, animations and audio.

Like I said this was just for the sake of argument. All the plans are on hold.
I know that I sounded a bit defeated and pessimistic here and in my previous posts, but I don't
want the time and efforts that I've invested in this to go to waste either. Now I'm a bit distracted
by other things, but I'll soon put back all my focus on this.

-----

Anyway, since you seems to know Blender better than me, let me ask you a question:
is there a way to attach/parent a (bone/joint of a) mesh to a bone/joint of another mesh?
So that when such bone/joint (the slot on the right hand of the Sim) moves then the
attached/parented mesh (the flute) will follow suit? Sorry for the poorly phrased explanation.

The Blender plugin (the one for animations/poses by "A") has the option "Load CAS"
to add a CASP item and "attach" it to the Sim mesh (to specific bones depending on the item).
So in theory it's possible. Is something like that doable with regular (non CASP) objects?
That would be such a great help, because that way I could actually see where the heck
the flute (or any other object) ends up when, for instance, I change the arm position
so I could avoid sticking it into the Sim's nose.

Nah that's fine by me! I totally understand and I don't you're a jerk!

Aanyways, regarding the blender question. Actually, there is. Though what the CASP option for blender does, is basically importing 2 of the same rigs (so the entire sim rig all over again, over the, well, actual sim) and indeed merge them together. However, this is more of a reference option since the CLIP animation tool pretty much ignores the CASP after export. I thyink you have to make a different sim-rig for that which I guess, is something waay beyond anyone's knowledge because then we'd be dealing with engine stuff I think.

Though, I think the option you're looking for is the ctrl+P? From what I understand from what you're trying to explain. It basically gives the mesh a bone, or merges it with the sim's body. Depending on what option you choose of course!