Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[AUDIO] Authentic Early Medieval MEGA PACK - Interactive and Random Soundtrack Generation

Discussion in 'Assets and Asset Store' started by Marma, May 7, 2016.

  1. Marma

    Marma

    Joined:
    Nov 7, 2014
    Posts:
    269
    Hi Unity Devs!
    Well, I think this is my FINAL and ULTIMATE Medieval Audio Pack. It combines both the Authentic Early Medieval Audio Pack and the Authentic Medieval Battle PRO.

    All in all, you get an incredible combination of fixed soundtracks and dynamically/randomly generated music.

    The soundtracks have been carefully composed using a combination of virtual instruments from the Middle Ages and live instruments such as drums, recorders and classical guitar (emulating the sound of a lute) to ensure historical accuracy. The melodies and general sonority are based on extensive listening of pieces of music composed around the 10th and 11th century and on research of early medieval music harmony.

    The combination of authenticity and random/interactive music generation makes this Asset unbeatable and truly the only one of it's kind on the Unity Assetstore.

    This pack includes:
    • 9 full pieces (all of which are both loopable and non-loopable)
    • 9 random soundtrack generation scripts:
      • 2 medieval church organs (minor/major)
      • 2 Gregorian chants (one ensemble in minor, one "live" singers in major)
      • A medieval lute (a sort of guitar)
      • A medieval harp
      • A medieval flute
      • A medieval folk dance music generation
      • A medieval battle music generation
        • These two last ones offer an incomparable variety of randomly generated soundtracks as they include a great number of melodies, song structures and instruments.
    • 2 Interactive and/or Randomly generated soundtracks
      • One basic interactive "Exploration and Battle" script
      • One Interactive and Randomly generated Medieval Battle music which switches between "Peace" and "Battle" mood.
    • An easy DRAG AND DROP Prefab system for quick "in game" integration. NO CODING REQUIRED! Simply drag and drop the Prefabs of your choice into your game, reposition the triggers, and YOU ARE DONE! (see the demo videos)
    • A system to change the tempo/pitch of several of the randomly generated soundtracks for even more variety!
    • 18 different chimes to underline events like a victory, defeat, a click on a button and the likes...
    • Multiple ambiance sounds including campfire, battle, castle courtyard, forest, horses walking, winter wind..., all loopable.
    • As a bonus, over 200 medieval sound FX!
    In short, with this pack, the music will always stay fresh, varied and your players will never hear the same soundtrack twice!

    THE PACK SHOULD BE AVAILABLE SOMEWHERE AROUND MID-MAY. Stay tuned!!! :D







    :cool:
     
  2. Parallaxe

    Parallaxe

    Joined:
    Apr 9, 2013
    Posts:
    118
    Hi there

    I already own the two packs. Will you still update the two existing packs, or only the new/combined pack?
     
    Marma likes this.
  3. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,630
    I like what you do with the scripts and prefabs. It's helpful! :)
     
    Marma likes this.
  4. Marma

    Marma

    Joined:
    Nov 7, 2014
    Posts:
    269
    Hi!

    @Parallaxe: Both packs are being updated to the latest version as we speak!
    So yes, don't worry, you'll get all of it for "free"! ;)
    Basically, a brand new battle music and 3 new randomly generated soundtracks. :cool:

    @hopeful: Thanks! It means a lot! I really try to make my packs as easy to use as possible... Not everyone is into scripting... :p
     
    Teila likes this.
  5. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,929
    Love this! Thank you. :)
     
    Marma likes this.
  6. Marma

    Marma

    Joined:
    Nov 7, 2014
    Posts:
    269
  7. Duende

    Duende

    Joined:
    Oct 11, 2014
    Posts:
    193
    Wow, this asset looks amazing. I do not understand why it is not more known or this post has more pages.

    I have a couple of questions. First, I'm a bit confused with so much different version of Authentic Early Medieval and upgrades, what would I have to buy to have it all?

    Another question, when you generate a song randomly, do you generate it with a seed? Is it possible to repeat the same song again?
     
  8. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,630
    Well, it's good music and there's only so much you can say about it, since it doesn't need a lot of support. :)

    One thing you might look into is Marma's full library of music. If it's within your budget, I'd think it would give you everything you need and much more.
     
    Duende and Teila like this.
  9. Duende

    Duende

    Joined:
    Oct 11, 2014
    Posts:
    193
    At first I am interested in everything he has about authentic medieval music. Maybe in the future I might also be interested in the asset of the drums or if he makes assets from other cultures.

    I have another question about his asset, other than the two I made. Let's see if Marma goes through his post to answer them.
     
  10. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,630
    Periodically the forum fails to notify thread owners of new posts. You might try contacting him by support email, as normally he would have responded by now.
     
    Duende likes this.
  11. Duende

    Duende

    Joined:
    Oct 11, 2014
    Posts:
    193
    Ok, I just sent him an email. Let's hope he goes through here.
     
  12. Marma

    Marma

    Joined:
    Nov 7, 2014
    Posts:
    269
    Hi guys!
    Sorry about the delay in answering, indeed, I received no notification for your posts! :eek:
    Thanks a lot hopeful, for helping out! ;)

    Duende: Yes, it's a bit of a "mess" my medieval series, I published many different assets and tried to break them up in separate packs to cater for different needs. If you want everything medieval related, then the Mega Pack is what you need. https://assetstore.unity.com/packages/audio/music/world/authentic-early-medieval-mega-pack-62367

    The "Giga Pack" includes all my assets, so it's a real bargain, but if you only need medieval stuff, then of course, no use buying all the stuff. You can always upgrade by the way, for the price difference!

    About the song generation, no, there is no way to "repeat" a previously randomly generated track.
    However, if you have basic knowledge in audio sequencing, you can easily "assemble" your own custom medieval song by simply drag/dropping the various samples... They are well organized in the "Resources" folder into subfolders, sorted by tempo and such, so all of the samples will fit together.

    If you have any other question, feel free to ask! I'll try to monitor this thread a bit more diligently.. :D
    Sincerely,
    Marma
     
    Duende likes this.
  13. Duende

    Duende

    Joined:
    Oct 11, 2014
    Posts:
    193
    Thank you very much for answering. :)

    I do not know how your algorithm will choose songs randomly, but maybe you do not know that it is possible to always get the same random value, so with a seed you can get the same song. To make my game I am working a lot with procedural algorithms and randomness and I could help you to add this feature, if you want.

    I think that would be faster than gutting all the algorithms of your asset to find out how you create the songs randomly. :p

    I have another couple of questions:

    Would it be possible to know when an instrument is playing? An example of what I want to do: a random song is chosen where there is a laud, a flute and a drum. The flute sounds in some parts but not always. So the game would create 3 characters, each with their instrument, and the flute character would only perform their playing animation when the flute sounds in the song.

    Another question, do you plan to make assets from the same historical period but from other cultures?
     
  14. Marma

    Marma

    Joined:
    Nov 7, 2014
    Posts:
    269
    Hi!
    OK, so basically, the songs are generated via two main features:
    - The first one is a "grid" where the song "structure" is built (for instance, drums start at measure 1, melody starts at measure 4...)
    - The second one is a random integer which determines out of for instance 8 drum samples, which one is playing.

    So basically, if you manually set the integer for the song "structure" and all the integers for which melody is playing, then you can "force" the script to play the music you want.

    If you want to know which instrument is playing, I think this is linked to the "song structures". Some have flute, others have other instruments..

    As far as other historical periods, the only asset I've produced along those lines is the "Infinite Drums" one, which is more "ethnic/jungle", but also "epic orchestral" if you so choose..
    What exactly did you have in mind?
     
  15. Duende

    Duende

    Joined:
    Oct 11, 2014
    Posts:
    193
    I downloaded the free version and it has been very easy to change your algorithm in order to play the same song using a seed. I mark the changes between comments:

    Code (CSharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. public class random_guitar : MonoBehaviour {
    6.  
    7.    public AudioSource audio_guitarA;
    8.    public AudioSource audio_guitarB;
    9.    int guitarA;
    10.    int guitarB;
    11.    Object[] AudioArray_guitarA;
    12.    Object[] AudioArray_guitarB;
    13.    public float bpm = 100.0F;
    14.    public int beatsPerMeasure = 4;
    15.    private double singleMeasureTime;
    16.    private double delayEvent;
    17.    private bool running = false;
    18.    private int i;
    19.  
    20.     // Changed -----------------------------------------
    21.     public int seed;
    22.     System.Random randomNumber;
    23.     // Changed -----------------------------------------
    24.  
    25.     // Use this for initialization
    26.     void Start () {
    27.        // Changed -----------------------------------------
    28.        randomNumber = new System.Random(seed.GetHashCode());
    29.        // Changed -----------------------------------------
    30.  
    31.        bpm = 100.0F;
    32.        beatsPerMeasure = 4;
    33.        int i = 0;
    34.        singleMeasureTime = AudioSettings.dspTime + 2.0F;
    35.        running = true;
    36.         // Changed -----------------------------------------
    37.         guitarA = randomNumber.Next(0, 4);
    38.         guitarB = randomNumber.Next(0, 4);
    39.         // Changed -----------------------------------------
    40.  
    41.         //Load the GUITAR A samples into the AudioClip Array
    42.         audio_guitarA = (AudioSource)gameObject.AddComponent <AudioSource>();
    43.  
    44.        AudioArray_guitarA = Resources.LoadAll("random/minor/4-4/100/guitar",typeof(AudioClip));
    45.        
    46.        Debug.Log("The Length of the GUITAR A array is " + AudioArray_guitarA.Length);
    47.        audio_guitarA.clip = AudioArray_guitarA[guitarA] as AudioClip;        
    48.        
    49.        //Load the GUITAR B samples into the AudioClip Array
    50.        audio_guitarB = (AudioSource)gameObject.AddComponent <AudioSource>();
    51.  
    52.        AudioArray_guitarB = Resources.LoadAll("random/minor/4-4/100/guitar",typeof(AudioClip));
    53.        
    54.        Debug.Log("The Length of the GUITAR B array is " + AudioArray_guitarB.Length);
    55.        
    56.        audio_guitarB.clip = AudioArray_guitarB[guitarB] as AudioClip;                    
    57.    }  
    58.    
    59.    // Update is called once per frame
    60.    void Update () {
    61.        if (!running)
    62.            return;
    63.        double time = AudioSettings.dspTime;
    64.        if (i == 0) {      
    65.            if (time + 1.0F > singleMeasureTime) {
    66.                 // Changed -----------------------------------------
    67.                 guitarA = randomNumber.Next(0, 4);
    68.                 // Changed -----------------------------------------
    69.                 audio_guitarA.clip = AudioArray_guitarA[guitarA] as AudioClip;
    70.                audio_guitarA.PlayScheduled (time);
    71.            }
    72.        }
    73.        if (i==4 ){
    74.            if (time + 1.0F > singleMeasureTime) {
    75.                 // Changed -----------------------------------------
    76.                 guitarB = randomNumber.Next(0, 4);
    77.                 // Changed -----------------------------------------
    78.                 audio_guitarB.clip = AudioArray_guitarB[guitarB] as AudioClip;
    79.                audio_guitarB.PlayScheduled(time);
    80.            }
    81.        }                
    82.        //THE most important part of this script: this is the metronome, keeping count of the measures and making sure the audio is in sync
    83.        if (time + 1.0F > singleMeasureTime) {
    84.            i +=1;
    85.            Debug.Log ("The i int equals  " + i);
    86.            if (i==8){
    87.                i = 0;
    88.            }
    89.            singleMeasureTime += 60.0F / bpm * beatsPerMeasure;
    90.            Debug.Log("The single measure time is " + singleMeasureTime);
    91.        }
    92.    }
    93. }
    94.  
    Yes, looking at the free version and some of your videos, I think it is possible to know what instrument is playing.

    The drums is another asset that also interests me. Although the songs you have for example do not sound like a traditional song that a tribe would play in the village, but as something more environmental and modern.
    As well, Gregorian chants do not work for me because they sound with a church echo, I would have preferred the clean chant and add the echo in runtime, depending on where it sounds.

    I am thinking of multiple cultures: Asian (China, Japan, Mongol, etc.), Hindu, Near East (Persia, Arabia, etc.), African, Ancient Greece and Rome, Nordic, Native Americans of the South and North, Celtic, Pirate or maritime... even some more I can think... :D
     
  16. Marma

    Marma

    Joined:
    Nov 7, 2014
    Posts:
    269
    Wow!
    Ok, that's a LOT of different "cultures"... Some of them however, will sound very similar. Between China and Japan for instance.
    Ancient Greece and Rome, actually, we have very little information on the music that was played, but it was probably monophonic and very basic. I have made a couple of tracks for a game jam in this style, but nothing of the "scale" and complexity as the Medieval music.
    Some of the ones you list would ideally also include chants, which is always difficult to emulate.

    In any case, I can see that you know your way around code!
    I'm sure you'll have no problem tweaking my scripts, although I must confess I learned all this by myself, so it's not very "clean" or optimized... :p

    As regards the Infinite Drums pack, I was thinking of this track which is a bit more "jungle"/ethnic, but perhaps it's a bit too complex?
    https://soundcloud.com/marmamusic/infinite-drums-n3

    I also have one variation where there are "only" drums, which may do the trick.
     
  17. Duende

    Duende

    Joined:
    Oct 11, 2014
    Posts:
    193
    Yes, there are many similarities and others are not "cultures", like the songs of sailors or pirates. Hahaha
    But between China and Japan there are similarities but their traditional songs are different, even different instruments.

    I know, but you can always add some imagination and your own invention to make it look like music from that era. Something similar to tribal songs of Africa or Native Americans would happen, there is not much information about those songs but you can do something that looks like it.

    For example, other cultures, which would not be realistic, would be songs of elves and dwarves. You would have no choice but to invent everything. :p

    I showed you the code so you could see how easy it is, it's a feature that you can add to your asset very quickly. So that the user can choose if he wants a particular song or a random seed and the songs are always different.

    In any case, I do not know how will be the rest of the scripts you have created, but I would like to play and compose songs as well as you programing. ;)

    Yes, that song might be worth it but with the drums only, I suppose.

    In general, I'm very interested in your work because you create random songs and also separate the instruments that sound. It's just what I was looking for and needed.

    Therefore, in the future (when I have the game prepared for a Kickstarter), if you do not make new assets from other cultures, I would like to hire you to create them. If you're interested.
     
    Last edited: Dec 15, 2017
  18. Marma

    Marma

    Joined:
    Nov 7, 2014
    Posts:
    269
    Thanks for thinking of me, Duende! :)
    We'll keep in touch then!
    In the meantime, if you decide to buy the Medieval Pack, feel free to play around with it.
    If you manage to tweak it for creating custom songs, I'll include it in an upgrade, and I can compose a certain number of songs for you in exchange for your work! ;)
     
  19. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,630
    Just wanted to underline that keying off of a random seed is a great way to coordinate the music over a multiplayer network. :)
     
    Marma likes this.
  20. Duende

    Duende

    Joined:
    Oct 11, 2014
    Posts:
    193
    Count on it. :)

    I have another question, is it possible to filter instruments? For example: that a song be played only with laud and drums, or with flute and drums, or with flute and lute, only laud, only flute, flute and drums, etc.
     
  21. Marma

    Marma

    Joined:
    Nov 7, 2014
    Posts:
    269
    Yes. The song structures are basically Arrays with 0 and 1 in them, which mean "at measure 1, don't play anything if the value is 0, at measure 4, play the flute..." so if you set the entire array to 0 for instance, then none of those instruments will play. If you assign an array for an instrument that was supposed to play in that song structure to another instrument, that other instrument will play instead... I hope this is understandable? :confused:
     
  22. Duende

    Duende

    Joined:
    Oct 11, 2014
    Posts:
    193
    Ok, I think I understand.

    Another question, and I think this will be the last. :p

    I'm only interested in non loopable songs. Is it possible to set the duration of a song? For example:
    The song that is going to sound randomly has a structure A, B, C, D:

    A melody start.
    B and C melodies.
    D final melody.

    But would it be possible for the song to be longer with the structure A, B, C, B, C, D? Or even A, B, C, B, C, B, C, D.

    I do not have much idea of music or composition, so do not take into account if I said any nonsense. :rolleyes:
     
  23. Marma

    Marma

    Joined:
    Nov 7, 2014
    Posts:
    269
    Well, technically, it could, but you would have to "create" your arrays custom.
    Here is how it could work:
    I usually break up my samples into "set" durations that depend on the tempo.
    For instance, a 120 beats per minute song, with a loop of 4 measures in 4/4 would be 16 beats, or 8 seconds.
    This is usually the percussion/drums loop. The melodies would have 4 to 8 measures, sometimes even 16 measures in length depending on the type of melody.
    So what you could do is create "custom" arrays where either you assemble "parts" of arrays and move between them (for instance, start with array 1 and when finished, go to array 2...) but this you would have to build, because it's not foreseen in the script yet.
    Another solution would be to "create" new sets of arrays that have the length that you want, and you calculate their duration knowing the duration of each sample (melodies/drums...)
    For instance, if you want a song that lasts 1 minute, you make an array that plays 7 drum samples (which last 4 measures, or 8 seconds each).
    This is really getting complicated... :p
     
  24. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,630
    Would it make sense to create scriptable objects to represent the A, B, C compositions, and then you play those scriptable objects as needed?

    In general, I think SOs are the way to go if you need to build a music library where you are trying to equalize track volume in the editor (some tracks - in general - need to be always played louder, others softer than the default), and you may also want to play substrings of a track, or loop or not loop, you may want to set mixer settings, and other such things. If you have a lot of music, you might use SOs to preload the tracks for different points in the game, make playlists for random music selection, etc.

    Anyway, maybe it's not for everyone or all cases, but I tend to orient that way.
     
  25. Marma

    Marma

    Joined:
    Nov 7, 2014
    Posts:
    269
    Thanks hopeful,
    I didn't know this was possible!
    It might be a bit difficult though to implement very small pieces of music that can be interchangeable in a very fluid way.
    The precomposed song structures for the random script follow "traditional" music composition rules, that is, a certain structure within the song that makes it sound like a precomposed track, that is, melodies repeat themselves, usually alternate in a AB AB or AA BB or A BB A fashion, which takes at least 2 minutes or so... All in all, it wouldn't be that much different to simply make sure that the "next" song structure simply follows directly at the end of the previous one instead of making a break, and you can have endless music playing with no breaks. To be able to "change" ambiances in the middle of a track is very tricky. I have tried to do that in my "Infinite Fantasy" script where you can change between different intensities mid-melody/sample, but to change moods, you need at least to wait for the end of a loop/sample.

    Anyways, really interesting discussion!
     
  26. Duende

    Duende

    Joined:
    Oct 11, 2014
    Posts:
    193
    Well, without access to the code, for now, I find it a bit hard to see, although it is enough to know that there is a possibility to change the length of the songs to extend them by repeating melodies. When I see the code I'm sure I can figure out how to do it. :p

    Thank you very much to both for responding and helping. :) We'll be in touch, Marma. ;)
     
    Marma likes this.
  27. Duende

    Duende

    Joined:
    Oct 11, 2014
    Posts:
    193
    Hey Marma, I took advantage of the discounts to buy your asset, although I still do not need it in my game because I am developing other aspects of the game.

    I've been examining at the script code medieval_master_script and I think I could fix some things. For example, you create many AudioSource at the beginning, for folk music as well as for guitar or Gregorian chant, maybe it would be better to create a pool of objects with AudioSource and load the ones you need. (I recognize that I have not worked much with the Unity audios yet and I do not know if this would be the optimal solution, but at least it would not fill the scebe object "music" with the medieval_master_script script of many AudioSource's and the algorithm would only load what you need).

    It is also possible to add a seed so that, depending on a number, it will return a particular song, it would be very simple.

    Then, I have been analyzing the operation of the algorithm. If I'm not wrong, basically do this:
    1- Get a structure, you have 6 different structures.
    2- Get a random melody for each instrument, the instruments can have between 6 and 10 different melodies.
    3- Runs through the array, and depending on the structure and the instrument, a melody will be played (or not) in each part of the song.

    I have also noticed that all the melodies of the different instruments end up the same or very similar. Would it be possible to make the melodies end with different notes? I do not know exactly what notes they are, because I do not have music knowledge. And also all the melodies are the same but with different instruments.

    Among there are only 6 structures and 10 different melodies, the songs are quite similar between them. You could sell addons of this asset with more structures and melodies, if you do not want to add more songs to this asset for the same price.

    I also agree to help you with the code if you need help. :)
     
    Marma likes this.
  28. Marma

    Marma

    Joined:
    Nov 7, 2014
    Posts:
    269
    Hi Duende!
    Thanks a lot for your message and your proposal!
    Indeed, I'm not a very good coder, I'm more of a composer..
    The script works but is probably far from "optimal" in terms of memory or computing power... :oops:

    I don't know how I could compensate for your work, perhaps I can give you a free access to the Giga Pack... :)
    I can let you do the modifications and once it works, simply send me the updated pack via the cloud and I can upload it as an update and credit you in the INFO text file. ;)

    As for the melodies and song structures, I could indeed do even more randomness but it would really be overkill and would require a lot more composing... The melodies cannot really end on other notes because they have to sound like typical musical phrases with a beginning and end, and the end always stops with the same note (the fundamental).

    Instead of adding to the script, what I did is I tried to make it easy to switch between multiple random scripts via the drag and drop prefabs which really provides a lot more randomness! :cool:
    Basically, you can alternate between battle themes, the medieval folk songs, medieval church, or basic ambiances like the harp and flute, or lute, without having to include everything in the same script.

    Talk to you soon!
    Sincerely,
    Marma
     
  29. Duende

    Duende

    Joined:
    Oct 11, 2014
    Posts:
    193
    You've done a good job with the code, really, it's simple and understandable. And besides, you are not a programmer, you are a musician, that has more merit. :)

    Thank you very much, but I would prefer that you compensate my work with more work on your part. :p I would like you to make more melodies and structures.

    We would also have to get in touch to know exactly what you wanted with your code, so as not to modify it too much and keep your vision.

    Ok, I do not know if this would be possible:

    Could you compose new melodies, with a different final note, and use the same 6 structures? That is, we would have 10 'melodies A' that end with the note Re (for example) and then 8 'melodies B' that end with the note Mi. In this way we would have 18 melodies, separated into A and B.

    So the algorithm would first choose whether to use the 'melodies A' and the 'melodies B', and within those melodies, the algorithm would choose one of the 10 or 8 melodies, respectively.

    If the structures can not be reused with different melodies, the 'melodies A' would have their own 6 structures and the 'melodies B' would also have their 6 (or whatever) structures.

    I do not know if you understand what I mean.

    I think I understand what you mean. The problem of having everything loaded in the game, and check in the Update what is running and what is not running, is that you are loading something that maybe the player or the programmer will not use. For example, it is possible that the Gregorian chant will not use it, but it is also loading in memory and scene with the AudioSource. It also loads the audio files of the folder and creates its audio and structure array.

    In addition, so many AudioSources are created within the 'music' object in scene that it is almost impossible to navigate in their inspector. :p
     
    Marma likes this.
  30. Marma

    Marma

    Joined:
    Nov 7, 2014
    Posts:
    269
    OK, let's try that. Next week, I have a couple of days off, I can try to compose some melodies that end with different notes and send them over, and let you work on the script.
    If you have any questions, I can explicit how things work.
    I think I updated the script to work with a sort of "grid" with arrays where when the number is 1, it means you have to play a melody, if it's 0, then you don't play anything. Which means that you can virtually add as many song structures as you want, you just need to add them as arrays... :p
     
    Duende and hopeful like this.
  31. Duende

    Duende

    Joined:
    Oct 11, 2014
    Posts:
    193
    Ok, does it seem good to you that I start adding a seed, so you can choose a particular song or a random one? I can also try adding the pool of audios, it's okay for you?

    I also worry a bit about modifying the algorithm, you add it, and in case you have to update it, you do not know what I've done. I will try to explain the changes.

    Yes, I've seen it, it seems right, it's a good idea, I like it. I have seen that the value can be 1 or 2. I thought that 1 played short melodies and 2 played long melodies, but it is not like that. What is the difference between the value 1 and 2? I do not have clear about.

    But adding structures is not easy, It requires musical knowledge to sound good, right?

    About the structures I came up with an improvement that I forgot to comment on in the previous message.
    To make songs with a random duration, you could do this:

    First, separating the array into groups, for example, an array of 10 cells, could have 5 parts:
    Part A: start (1 cell)
    Part B: melody 1 (3 cells)
    Part C: chorus (2 cells)
    Part D: melody 2 (3 cells)
    Part E: final (1 cells)

    You could create templates of structures, so that the algorithm knows what type of structure it is and how the different cells of the array are separated and grouped.

    So, when playing a song, if the duration is short, it would go through the array from beginning to end and that's it. But if we want a longer song, the array could go back to part B when it comes to part E (It would not play it). And then, when it came a second time to part E, it would not go back to part B and the song would end, playing the part E and reaching the end of the array. This could be repeated as many times as you want.

    Another option would be this, an array of 7 cells:

    Part A: start (1 cell)
    Part B: melody (3 cells)
    Part C: chorus (2 cells)
    Part D: final (1 cells)

    In this case, when it get to part D, it will go back to part B, and part B and C will be repeating as many times as you like.

    The idea of structuring this, in different parts, is because I suppose that each structure has a different number of array cells destined to be the beginning and the end. I mean, some structures will use 1 cell of the array for the initial melody, others will use 2, others will use 3, etc. Maybe even a structure has 0 cells destined to the beginning melody and it starts with a melody that is repeated, I do not know.

    It's an idea and I wrote invented examples. You are free to change it or adapt it, because you know more about music and the work of the structures. Tell me what you think, but it would be nice if the length of the songs was another random factor when it comes to generating them. :)
     
  32. Marma

    Marma

    Joined:
    Nov 7, 2014
    Posts:
    269
    Thanks for the suggestions!
    So, about the arrays and separating them into different parts. I remember now why I composed my melodies the way I did... Basically, if you end all melodies with the fundamental note (the note of the main chord), then any melody can be the "end" of the song, and so regardless of where you stop the music, it will always sound natural. If you start composing melodies which don't end with that note, then you always have to play a few extra measures after the melody has stopped playing to make it sound natural (the break).

    Also, I didn't want any parts of the array to repeat specifically to make sure that the script sounds like a live medieval band playing tunes. Each song is unique since it will randomly chose between the song structures and the samples after every song. What can be done is to have the next song directly after the last sample of the previous song has stopped playing so that the music never stops. Even though I'm not sure that's a good thing...
    I also added a "pitch bend"/tempo feature which could also make the songs sound a bit different each time (3 different "speeds").

    I'll let you modify the script, you can comment on it to explain how it's structured and I can give you feedback based on my musical knowledge and what's musically advisable or not depending on what you're going for. I'll also compose some extra melodies, see how that works out next week. ;)
     
  33. Duende

    Duende

    Joined:
    Oct 11, 2014
    Posts:
    193
    Hmm, yes, it would be something more complicated, because you would have to establish rules, so that when a certain melody was played, the following melodies would be limited to ones that fit well with the previous one. Even you should have end melodies. But the result would be spectacular. :O

    Yes, I've seen the speed change, but that makes the melody go faster or slower. It adds variety and randomness, its great, but I still think that something is needed to lengthen the songs, so that the duration of the song (regardless of whether it is fast or slow), is also random. That's why I thought that a solution would be to go through parts or cells of the structure array again.

    Can you think of a way to make the songs have a random value also for its duration? I do not mean to manually create a longer structure, but the algorithm is responsible for lengthening or shortening the song randomly when the song is created.

    Ok, let's see if between the two of us we make this asset even bigger. :)

    Edit:
    You did not answer these two questions from my previous post and I am interested in knowing:

    1- I have seen that the value can be 1 or 2. I thought that 1 played short melodies and 2 played long melodies, but it is not like that. What is the difference between the value 1 and 2? I do not have clear about.

    2- But adding structures is not easy, It requires musical knowledge to sound good, right?
     
    Last edited: May 7, 2018
  34. Marma

    Marma

    Joined:
    Nov 7, 2014
    Posts:
    269
    Hi Duende,
    So for the 1st question: I'll have to check, I'm not sure what the values mean...
    For the 2nd question: yes, it does.

    As for the rest: we can definitely make this work.
    What we can do, is exactly as I said: break down the arrays into song "parts". For instance, 6 "intro" arrays which will always serve as a "start" for the song, then 4 or 5 different "mid song" arrays which can be played in any order/sequence and randomized in length, and then 6 "end song" arrays which will either play at the end of the randomly generated song, or which will be played whenever needed if the song needs to come to an end.

    How about that?
    I'll work on a few melodies/arrays tomorrow or this afternoon if I have a moment. ;)

    EDIT: If you check out my "rock" asset, it's pretty much how I composed it... The song can play infinitely long, and the "loops" are interchangeable and randomly played, and if you want to end it, it will go to the end of a sample and then play a "custom" end for it!
     
    Duende likes this.
  35. Marma

    Marma

    Joined:
    Nov 7, 2014
    Posts:
    269
    I checked the script, it would seems that the "2" value in the array aims at alternating between melodies (for instance, having 2 different "long" melodies instead of 1)
     
    Duende likes this.