Search Unity

[Released] Procedural Music Generator

Discussion in 'Assets and Asset Store' started by Misanthes, Oct 11, 2017.

  1. Misanthes

    Misanthes

    Joined:
    Sep 25, 2015
    Posts:
    68
    Hey everyone :)
    Just wanted to announce the release of my procedural music generator asset.
    It's available on the unity asset store here: https://www.assetstore.unity3d.com/en/#!/content/99791
    A demo is available on my gitlab page:
    https://gitlab.com/StickAndbindleGames/musicgenerator_linuxdemo
    https://gitlab.com/StickAndbindleGames/musicgenerator_osxdemo
    https://gitlab.com/StickAndbindleGames/musicgenerator_windemo


    The music is editable in real-time and can be adapted to in-game events, and the song settings are extremely configurable.

    I'm starting work on the next update, and would be interested in any features that would make the generator more useful to you. Currently planned on the todo list is:
    • Exotic scales and a more sensible melodic minor lead
    • Nicer menu dropdowns
    • Android support
    • New chiptune samples (they seem to be the favorite)
    • Synced pre-made phrases or sfx (timed to the current playing configuration).
    Feel free to post here, or email me at stickandbindlegames@protonmail.com
    Thanks for your time! I look forward to anyone's thoughts :).
    -Tyran



     
    Last edited: Apr 28, 2019
    Unity-Nikos, Teila, Igualop and 6 others like this.
  2. gegebel

    gegebel

    Joined:
    Jan 29, 2014
    Posts:
    469
    Looks nice but from the demo I feel like I need a Bachelor of music to understand everything :(
     
    Misanthes likes this.
  3. Misanthes

    Misanthes

    Joined:
    Sep 25, 2015
    Posts:
    68
    Thanks :) I believe I forgot to add the tips and tricks documentation to the demo. However, if you hold shift over any UI Element a tooltip will popup with a more in-depth explanation of what the variable will do. Though, even knowing that, there's still some trial and error involved.

    I'll be working on a tutorial video this weekend walking through setting up a song. Ideally, the user shouldn't need to know much about music theory to create a good sounding song. A good deal of the variables were made available as they can improve the depth and sound of a song, but aren't strictly necessary.

    If you have any specific questions in the meantime, I'd be happy to answer them, feel free to email me at stickandbindlegames@protonmail.com, or through unity.

    Cheers!
     
    Last edited: Oct 14, 2018
    Mark_01 and pixelsteam like this.
  4. jimburn

    jimburn

    Joined:
    Apr 1, 2017
    Posts:
    64
    Your asset is awesome... keep working on it.
    You need a better asset store icon / graphics, it is not eye catching enough.

    Create more presets as most people will be too lazy to create their own.

    Think about usability. The more use your customer's have the more sales.

    Also think about more modern presets, like Sci-Fi style with synths drones and stuff that are more into the modern, horror styles. This thing can be great with ambient styles too.

    You assets deserve more attention, take the time to polish the visual, there are so many assets in the asset store you do not want to get lost in the crowd.

    Thanks for taking the work of Lucas Art to the next level ;).
     
  5. john_hattan

    john_hattan

    Joined:
    Aug 28, 2013
    Posts:
    11
    I just bought it, and it works quite nicely on Windows. Any plans to get it working on WebGL or mobile?
     
  6. pixelsteam

    pixelsteam

    Joined:
    May 1, 2009
    Posts:
    924
    Yes great work. Also interested in mobile.
    I am also looking for a sampler type of asset from a list of generated wav files.
     
  7. Misanthes

    Misanthes

    Joined:
    Sep 25, 2015
    Posts:
    68
    Thanks for the feedback, it's appreciated. I'm planning on uploading some additional presets and instruments. Presets are not a problem, but instruments are a little difficult as I can't ship through Unity with assets created by others, unless they're CCO, so instrument samples have to be either public domain, or recorded myself. But, sci-fi, synth and such shouldn't be too much of a problem as I can generate those myself.

    And, yeah, the art :/ A few people have mentioned that. My art-skills are certainly sub-par, but I'm sadly still pretty far in the hole on some samples I contracted someone to create, and then never used. So, contracting anyone for a new logo is out of the question for now (though, I'm happy to take submissions :) ).

    To my knowledge the only obstacle would maybe be the loading of the instrument samples from asset bundles at runtime. I hadn't looked too far into it, however and would be happy to revisit it. If I recall, it was enough of a different process for loading assets, and I've much less webGL/Android experience, that i decided to release on PC. I'll message you if it looks like something I'll have the time to setup.
     
    Last edited: Nov 18, 2017
  8. goldbug

    goldbug

    Joined:
    Oct 12, 2011
    Posts:
    768
    Does this work in mobile?

    Nice job making this package, but you could make it easier to use.
    I don't know anything about music, so words like "tempo" and "key" mean nothing to me. I have no idea how to adjust those settings to get an effect for my game.

    My suggestion is to have some presets like "sci-fy", "medieval", etc...
    Then allow me to switch the mood on the fly for things like boss fights, exploration, menu, danger, etc...

    Presets are essential for the rest of us.
     
    Last edited: Nov 28, 2017
  9. Misanthes

    Misanthes

    Joined:
    Sep 25, 2015
    Posts:
    68
    There's currently some bugs when I try to build for mobile I haven't had time to work through, but it does not currently work on mobile or webgl.

    If you hold shift while mousing over the UI elements, a tooltip will popup explaining what the element does. But, admittedly, either a small amount of music knowledge or trial and error is helpful.

    The asset does come with presets. I'll be adding more periodically as they're mostly a starting point now, rather than a solution to any sound you may need (there's only about 10 currently). You can see most of the current ones in the Presets Overview video linked above.

    Cheers!
     
  10. goldbug

    goldbug

    Joined:
    Oct 12, 2011
    Posts:
    768
    All right, I bought it. It seems to have a lot of potential. I do hope to see it ported to mobile.
     
  11. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Been running your demo obsessively the last 12hrs…. This is amazing!
     
  12. Misanthes

    Misanthes

    Joined:
    Sep 25, 2015
    Posts:
    68
    Thanks :D Though, I encourage anyone to do an official review on the asset page if you have time, I'm pretty barren there still! :)
     
  13. Stanton560

    Stanton560

    Joined:
    Aug 21, 2017
    Posts:
    14
    My res is 1366 * 768, and I couldn't find the play button :) Took me a while and then I realized the canvas is designed for 1920 * 1080!
     
  14. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Hi, I am on a Mac. I don't know where to find my demo presets. I'm searching for "StickandBindle". Maybe I am misunderstanding the Setup instructions?

    Thanks for help, I love this tool, now I need to get it functioning in Unity.

    **edit – nm, I RTFM…. lol
     
    Last edited: Jan 24, 2018
    Misanthes likes this.
  15. Misanthes

    Misanthes

    Joined:
    Sep 25, 2015
    Posts:
    68
    When you build the player, you should be able to set the size you want, the UI will resize to most resolutions. However, the build settings will be local to your project settings. (1366x768 should be perfectly fine. It's possible your project settings are something else if things aren't on-screen). In the Unity Editor, you can go to Edit>Project Settings > Player to set the supported aspect ratios. If you're playing _in_ the Unity Editor, The canvas will do its best to resize to your project window (though, depending on how you've sized your window or if you're zoomed in, some things may overlap. Just drag your editor window until it all fits.) Let me know if you have other questions!
    Cheers :)
     
    Last edited: Jan 25, 2018
    Stanton560 likes this.
  16. rossillingworth

    rossillingworth

    Joined:
    Mar 20, 2014
    Posts:
    1
    Just getting started. Seems amazing.

    1 Question...
    What am I doing wrong with the editor scene?
    I created a new blank project and imported the asset, then moved the streaming assets and everything seems to work in the players,but the Editor scene fails with:

    Failed to load GpuProgram from binary shader data in 'Sprites/Default'.
    UnityEngine.AssetBundle:LoadAsset(String)
    ProcGenMusic.InstrumentListPanelUI:CreateInstrumentUIObjectBase() (at Assets/MusicGenerator/Assets/UIEditor/Scripts/InstrumentListPanelUI.cs:65)
    ProcGenMusic.InstrumentListPanelUI:Awake() (at Assets/MusicGenerator/Assets/UIEditor/Scripts/InstrumentListPanelUI.cs:22)

    and

    D3D shader blob is empty!


    Any suggestions?
     
    Misanthes likes this.
  17. Misanthes

    Misanthes

    Joined:
    Sep 25, 2015
    Posts:
    68
    May I ask what version of Unity you're on, what platform you're working on and what platform you're building the editor scene for? Seems like maybe an issue with the asset bundles and/or a platform/version issue. Do you get the errors when running the editor scene in the Unity editor, when building the scene, or both (also, did you import the asset bundles for your target platform)? I'll need a bit of info.

    Please feel free to respond directly to my email at stickandbindlegames@protonmail.com (I'll catch it quicker and we won't muddy this thread too much with tech support things. I'll update for others if it turns out it's a wider issue).

    But, I'm happy to work with you until we get it working :)
     
    Last edited: Apr 8, 2019
  18. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Hi, I have a general interface question.

    I've been using high Chord Notes values to get these little rising glissandro-esque chords, but I can't find a way to get them to play the chord descending. I'm assuming it is probably the way the chords are written (bottom-up), but to be honest I'm not sure what settings are making this work in the first place, lol.

    Any advice for descending arpeggios (or arpeggios in general)?

    Screen Shot 2018-02-08 at 10.49.37 AM.png Screen Shot 2018-02-08 at 10.50.05 AM.png
     
    Misanthes likes this.
  19. Misanthes

    Misanthes

    Joined:
    Sep 25, 2015
    Posts:
    68
    So, this is actually a bit of a bug, that will take a bit to explain. But _rhythm_ instruments have an option to strum them which does ascend (like strumming a chord on the guitar or harp for example).

    Apparently, that setting persists when switching from a rhythm instrument to melodic when it selects a chord note. And with your high chord note odds this happens near every time for you. And you're still getting the strum effect on your melodic instrument. (if you switch back to rhythm, you're able to set the length of delay between the notes. It's nice to align that so it's timed correctly with your tempo and the next chord).

    In the InstrumentSet.cs file ln 445 is the IEnumerator StrumClip(), which will iterate over the list of ints that comprise the chord and stagger their play time, rather than all at once.

    They are indeed added in ascending order, and the coroutine loop ascends through it.

    Though now that I'm aware of it (thank you! :D ), rather than fix the bug, I think it'd be more useful for me to expose it more usefully and allow melodic instruments to 'strum' or arpeggio as well, though add in the ability to randomize those notes.

    For your purposes (until I find time to commit a change). Just continue to exploit the bug, but in order to not have it ascend, you'll either need to rearrange the order of your clips before looping through them in the StrumClip() or store an order for them to play, and then edit the strum function to play in that order (though, I imagine you'd want it the same 'random' order for each chord that instrument plays through the end of the measure, so would need to store that order and reset it at the end of the measure, by either adding code to ExitNormalMeasure() (or exitRepeatingMeasure() if you're using the repeat option). You could also subscribe to the event listener in the MusicGenerator class for exiting the measure and add your logic in your own class (probably the safest option, so there's no conflict for you when I update).

    I know that's a bit involved, feel free to email if you have followup questions (though, my apologies in advance I may be a bit unavailable until next wednesday or thursday. So, I'm sorry in advance for the slow response!).
     
    Last edited: Feb 8, 2018
    wetcircuit likes this.
  20. tonywalsh

    tonywalsh

    Joined:
    Jun 4, 2014
    Posts:
    16
    Hi, just wanted to publicly thank the developer for a very fast reply to an email I sent.
    I haven't used the tool enough to rate it yet, but I'm glad to see the developer is active.
     
    Misanthes likes this.
  21. Jos-Yule

    Jos-Yule

    Joined:
    Sep 17, 2012
    Posts:
    292
    I was wondering if there is a way to share presets? I didn’t see an obvious way to do that, via an export or something.

    Thanks!
     
    Misanthes likes this.
  22. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    When you save a preset with the demo, it stores the preset in a series of folders somewhere on your system drive (persistent folder) – the exact location is a quirk of your OS, so you may or may not find it by searching for "MusicGenerator" or "StickAndBindle" (these folders are hidden from my general search, and the name of the folder wasn't quite as stated in the Setup.txt) You can check Unity manual for info on where the persistent folder is on your OS.

    Sharing presets seems to be simply copying these folders into the project (or to another computer to edit further with the stand-alone demo)
     
    Misanthes likes this.
  23. Misanthes

    Misanthes

    Joined:
    Sep 25, 2015
    Posts:
    68
    Wetcircuit is correct on this. They'll be in your persistent data directory (you'll want to eventually copy them over to your streaming assets directory in your game before shipping) and can be shared by just copy/pasting into another project's directory. Though, you do need to name and use the export button on the staff player in order to save your preset first (in case that was unclear).

    However, I recently got a bunch of spare time to work on things, and as of yesterday, I have moved the game's data over to ScriptableObjects and everything is working great. I havent' commit this live to the store yet, but this should make sharing/finding/editing the data much, much easier. I have a few other bug fixes, UI performance tweaks, and general code cleanup and refactoring I'd like to get done before committing live to the store, but estimate I should be done within a week (if I'm not done, I'll likely still commit next week and just followup with another update later).. So, once that is live, your saved data will just be based in ScriptableObjects in a subfolder of your game's Assets directory.

    I'll make a post here with the update details.

    Always happy to help! I'm actually a bit embarrassed you ran into issues but glad we worked through them. I may have never uncovered that bug otherwise either, so appreciate the heads-up :)

    **EDIT**
    The update is _almost_ done, however I'm needing to leave town on a work-related thing, so going to bump back the release of that a week or so. If anyone is super interested in that sort of thing, or impatient for the update, contact me and I'd be happy to add you to the git-collaborators for (semi)-nightly builds.

    **EDIT 2**
    Still working on things, but am in the process of moving to a new state, so between apartment hunting, packing, driving, unpacking etc things are going decidedly slower than I'd hoped :/

    **EDIT 3**
    Ooookay, update is live. Apologies that took forever. Who knew moving to a new state would slow down development so much! :p When upgrading, it will require you to replace your MusicGenerator object in your scene as the main object has changed a bit from the previous version. Ideally this should be the only required step. It will auto-update the data structures to the new versions, and the general functions have remained intact.

    However a lot of the generic C# events were changed to UnityEvents instead, which will require changing your subscriptions to them, if you're already listening for the events. See: https://docs.unity3d.com/ScriptReference/Events.UnityEvent.html

    Otherwise, functionally, not much should change for general use cases.

    A ton of the code was refactored, which should make it easier for any of you extending or adapting the classes, as the architecture and data structures are a bit more sensible now (hopefully). I'm hoping the logic is a bit easier to follow with this structure, and any future updates should go a bit more smoothly.

    An 'Arpeggio' option was added for rhythm instruments (thanks for the input, Wetcircuit!), and more or less functions as the 'Strum' option does, though will randomly generate a pattern each measure, rather than sort the notes ascending.

    Additionally, the instrument group selection, in linear mode, can now roll over from group 4->1 instead of just up/down. This should keep the dynamics from seemingly getting 'stuck' at the higher groups, and adds a bit more interesting and sudden drop in dynamics.

    A bunch of smaller bug-fixes were implemented.

    I did _not_ move the data over to scriptable objects in the end. With the way the generator runs as a standalone app, and not in the editor (ideally), when creating configurations, and the fact that we _don't_ want to be saving the data every time something changes but only when needed, it didn't make sense in the end (live and learn :p ) for the data structures. But, the data classes' variables _were_ exposed in a more useful and sensible manner, so should be able to be easily edited in the Unity editor manually if needed.

    All that said, a lot of code was moved around, renamed, etc. I took care to change very little of the base functions that may be called, or general use. But, if you're interacting with the code in a more nuanced or detailed manner, it's totally possible I broke your things :/ Don't hesitate to contact me at stickandbindlegames@gmail.com with any help resolving things. I'm more than happy to provide assistance (and apologies in advance if that's the case!!!).

    Next on the TODO is mobile support, and then MIDI triggers. Though, I may break for a bit to work on a different project, so I don't have a timeline for either of these.

    Thanks for the patience, all!
    Kind regards,
    Tyran
     
    Last edited: Apr 10, 2018
    AthrunVLokiz and wetcircuit like this.
  24. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Just a heads-up to anyone updating to version 1.1 (osX, but possibly effecting others)

    I got a string of errors in the console. I did a clean install on a new project.

    First, remember to move the Editor and StreamingAssets folders to the project's Assets folder.

    The first console error shows the path to your os library (on Mac it is user/Library/Application Support/…).
    A possible bug is that the CompanyName/ProductName under PlayerSettings has replaced periods with underscore: MusicGen1.1 becomes MusicGen1_1

    Procedural Music Generator is looking for a folder called InstrumentSaves. It's in the StreamingAssets folder of the project, or if you've run the old demo your presets are in the user/Library/Applications directory under another name….

    Copy the InstrumentSaves folder to the directory listed in the console error. This fixed the problem for me.
     
    Misanthes likes this.
  25. Misanthes

    Misanthes

    Joined:
    Sep 25, 2015
    Posts:
    68
    Thanks for the headsup Wetcircuit. I believe this should be OSX only (excluding the moving of the editor/streaming assets, but that's in the setup.txt doc). If you have a moment, could you forward me your error log and the version of Unity you're using? The generator was built on 2017.3.0 (upgraded from 2017.1.1) and I feel there's perhaps an OS related change with directories there I overlooked. I'll work on getting an official fix up, but could use a few details and only have win/linux at home to test on.

    Also, do you still get the error after moving your StreamingAssets folder? The logic waterfalls from loading from the streaming assets to the persistent directory if it's not found in the former. At a glance it seems it may fail to find either (but, I'm curious if the error persists once the folder is properly moved).

    It's an unfortunately needed step, as all directories in the shipped asset need to be self contained under the base package. Though, in hindsight, this should probably be automated on my end in future releases.
     
    Last edited: Apr 11, 2018
    wetcircuit likes this.
  26. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Yes…, the problem seems to be how MusicGen is writing the persistent directory on Mac. There seems to be a related problem when exporting the stand-alone build of MusicGen, it also has no Instrument Saves folder, but I can't seem to fix it and it causes some of the interface to fail…. I will email you some info, I'm not sure how to work around it...

    Also Thank you for the Arpeggiator! :)
     
    Misanthes likes this.
  27. Misanthes

    Misanthes

    Joined:
    Sep 25, 2015
    Posts:
    68
    Eek, the first error is just a small oversight of me not checking that the persistent directory InstrumentSaves folder exists before trying to use it (that's embarrassing on my part). I can push up a quick fix for that one after work tonight. That actually should affect all OS users, at least with new projects.

    The second, I'm hoping will resolve with the same fix, but it's a little concerning and I'll need to dig into the details of it after work tonight. I think I can borrow a mac to do some testing on it. Apologies to any of you OSX users who are affected by this in the meantime. I'll get a fix up as soon as possible.

    Thanks again Wetcircuit, I appreciate the help a ton!

    **EDIT**
    Okay, a fix has been submitted for the initial persistent data path error, and the sliders for theme/set/repeat in the UI.

    Still tracking down the mac osx player settings one. In theory, it was already checking and creating an instrumentSave folder when exporting in standalone. I'm hoping the other fix resolves it, but haven't testing on osx yet. I didn't remember to bring home a mac to test, but will do so tomorrow and update here accordingly. Thanks for the patience, anyone who is affected by this!
     
    Last edited: Apr 12, 2018
    wetcircuit likes this.
  28. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
  29. Misanthes

    Misanthes

    Joined:
    Sep 25, 2015
    Posts:
    68
    I love it!
    It surprises me to hear, because everything I write sounds exactly like something I'd write to my ears, so I fall into the habit of thinking that's all the generator is capable of, and what it will sound like for everyone. But, it's amazing to hear configurations that are a totally new and unique to me.

    If you're amenable to it, feel free to forward me the config, and I'd be happy to add it to the presets. I keep meaning to upload more and never set aside time for it (sorry everyone :p).

    That goes for anyone, actually. Just forward me the config folder and the name you'd like it called (feel free to name them after yourself :p ), and I'd be happy to include it. I love the idea of a user-created preset library.

    To note: you'll lose rights to it, as the end-users of assets are able to do with it what they see fit. See: https://unity3d.com/legal/as_terms
     
    wetcircuit likes this.
  30. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    I'll put some files together, I have a few tries in different styles. ;)
     
    neoshaman and Misanthes like this.
  31. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    That's neat, remind me of cg music and abundant music!
    Is there doc I can read before purchase?
     
  32. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Docs are a little thin (a few readme files for setup)… but the built demo scene is downloadable from github and it shows popup "tool tips" (shift+mouse rollover) that give you the gist of what each part of the interface does….

    After that it is just experimenting and tweaking to hear what you can get – it's basically pattern repeaters and some sort of stochastic decision tree about which note(s) to play (most of which is obscure to me). Repeat the measures and it sounds intentional.

    There's also a longer instrument Group structure that cycles, so you cluster instruments into "trios" and "solos" so not everything plays at once… Maybe I could make a "getting started" tutorial?

    The audio samples can be replaced (or added to) if you have a sound library (or make your own)…. There are TONS of soundfx libraries in the asset store… I've been meaning to take one (like this: Future Beeps) to build a percussion section out of industrial sounds….
     
    Misanthes and neoshaman like this.
  33. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Okay so it doesn't do full piece? only sequence? and the sequence mutate over time? However I read in the OP that we can change parameters run time, maybe this help get the equivalent of structured song by scripting? But can we store and recall certain measure for effect?

    Ideally I would be cool if we could have multiple parameter that help encode concept like suspense, anticipation, contrast, build up and cool down, just by modifying the data and recall some part to create motif, and mutating the part recalled!

    I mean for example: we can encode tone by simply shifting tempo and scale (minor and major? I hope that's the right term, I have problem with music terminology lol) along two axis (excitation and valence) to convey 4 basic emotion: joy (hi excitation, positive valence), anger (hi excitation, negative valence), sadness (low excitation, negative valence), calmness (low excitation, positive valence).

    Also can we affect the quality of the rhythm? I mean creating regular (like a march), progressive and irregular rhythm (syncope)?
     
  34. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Yes to all of this… with some caveats. LOL

    I haven't tried anything with runtime scripting but basically every(?) control is exposed… so in theory the entire composition could be triggered by script, with specific patterns triggered on command, and individual instruments added and dropped with scene events…. There are up to 10 instruments (I think this can be adjusted higher?), here's the inspector for just one of them:

    Screen Shot 2018-04-17 at 9.47.01 AM.png

    The general idea is that you'd include several "compositions" (instrument config folders with text files) in your project for the various moods. They are procedural so consider like other procedural systems (terrains, enemy pools) you'd normally want the results to be variations on your preset parameters. How much variation depends on your settings.

    Notes play or don't depending on how the instrument is set:
    • Melody – triggers harmonic notes in the scale
    • Lead – triggers any notes in the scale
    • Rhythm – triggers a note every time, and also has the Arpeggiator/Strum timing
    Each instrument has it's own controls about how it acts within the "measure" with shorter or longer cycles.

    There are 4 instrument Groups that can play in order or combine randomly - which would be a loose equivalent of chorus/verse/refrain (or build-and-drops to use DJ terms) – there is some logic about what it choses to do "next" either at the end of a measure or the end of a longer sequence, where it will pick a new measure, change keys, rest, etc... Too much repetition and the "songs" will all sound the same (might as well use pre-recorded loops)..., not enough repetition and it might be random and meandering (which might be what you want for atmosphere)....

    You can program note-specific measures in the interface by selecting pips on a measurebar (like a regular music app), I think it's shown in one of the videos, so again in theory you could probably program a very specific pop song with a scripted composition.

    I think the real strength is in treating it like a small jazz improv. Set up SOME rules but let the instruments riff on each other.

    (this is all gleaned from observation. If I'm wrong about any of this hopefully I'll be corrected. ;) )
     
    neoshaman likes this.
  35. Misanthes

    Misanthes

    Joined:
    Sep 25, 2015
    Posts:
    68
    Heh, been at work all day, so I'm a little late to the conversation, but yeah, Wetcircuit is pretty much spot on with her explanations.

    You can download the demos here:
    https://github.com/StickAndBindleGames/ProceduralMusicPlayer_Linux
    https://github.com/StickAndBindleGames/ProceduralMusicPlayer_Mac
    https://github.com/StickAndBindleGames/ProceduralMusicPlayer_Win

    I haven't uploaded the update to those, so they're missing a couple features and bug-fixes, but they're like 95% there :p.

    The UI in the demo simply calls exposed functions in the generator, so if you see an option, dropdown, slider etc for it in the demo, it's exposed to your code as well.

    As far as suspense, mood, tension and such, it's all configurable, but more in the sense of broad strokes rather than specific notes (again, if you're able to do it in the demo, that's pretty much what's available to work with). Like a lot of procedural code, it's about guiding or restraining the randomness, and to some extent needs to be embraced a bit. Like the music equivalent of a random terrain generator.

    So, like you mentioned, speeding up the tempo, changing to a 4/4 time signature, changing the key or mode, or bringing in more instrument groups, or exposing certain chords to the progression all aid in the mood and feel of the music, and can be set in code, but will likely require either a bit of experimentation, or some knowledge of music theory to make good use of.

    I'm always glad to help, so don't hesitate if you have a specific question, or even want to chat about more general approaches and such. I'm always happy to give insight where I can as I recognize the generator can be a bit to tackle. You can reach me at stickandbindlegames@protonmail.com.

    Kind regards,

    Tyran
     
    Last edited: Apr 8, 2019
    neoshaman likes this.
  36. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Hey guys! Here's a pseudo jazz thing… My contribution :cool:
    (unzip and put in your InstrumentSaves folder)

     

    Attached Files:

    Misanthes and neoshaman like this.
  37. Misanthes

    Misanthes

    Joined:
    Sep 25, 2015
    Posts:
    68
    Nicely done! :D
    Let me know if you're comfortable with me including it in the asset and I'll happily add it with my next commit. But also feel free to decline and leave it here instead (again, by including it, it's subject to unity's terms of service, and users can modify and use it at their whim).
     
    wetcircuit likes this.
  38. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Yes. Go ahead and add it. :)
     
    Misanthes likes this.
  39. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    This one is a little different. There are no repeating patterns, and I used the groups for different themes, so they work together or independently just toggle them on/off (like the video).

    Group 4 is a military march
    Group 3 is a bombastic villain "Herr Klank" :cool:
    Group 2 is a hero to the rescue
    Group 1 is the background constant (oboe)



    If you like this one Misanthes go ahead and add it to the presets. ;)
     

    Attached Files:

    Misanthes and neoshaman like this.
  40. Misanthes

    Misanthes

    Joined:
    Sep 25, 2015
    Posts:
    68
    I do! I'll upload them to the store on Sunday, thank you! :D
     
  41. Misanthes

    Misanthes

    Joined:
    Sep 25, 2015
    Posts:
    68
    To anyone getting a random crash of unity when running the player in the editor, or other inexplicable errors in the new update, depending on your version of unity, you'll need to rebuild the asset bundles. I've added an editor script for these. If you move the 'Editor' folder from the music generator directory into your main '/Assets' directory and run from the unity editor menu: 'Assets>MusicGenerator>Build And Clean All Music Assets', it will rebuild the assets compatible with your current unity version and should resolve any errors.

    I'll update the setup.txt to mention this.

    Cheers,
    Tyran
     
    wetcircuit likes this.
  42. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    This looks like fun! I would love to try it but I do not see any documentation. The videos show a mouse moving around but no voice or written instructions. Hope you find time to add these because I see so much potential here!
     
    Misanthes likes this.
  43. Misanthes

    Misanthes

    Joined:
    Sep 25, 2015
    Posts:
    68
    Hi,
    Holding shift while mousing over the UI elements in the editor will pull up the documentation for most of the settings, and there's additional setup and sample-customization documentation in the asset directories.

    Additionally, you can demo the player by downloading it here to see if it will suit your needs.
    https://github.com/StickAndBindleGames/ProceduralMusicPlayer_Linux
    https://github.com/StickAndBindleGames/ProceduralMusicPlayer_Mac
    https://github.com/StickAndBindleGames/ProceduralMusicPlayer_Win

    And lastly, you're always welcome to email me at stickandbindlegames@protonmail.com with any questions. I'm always happy to help :)

    Kind regards,
    Tyran
     
    Last edited: Apr 8, 2019
    Teila likes this.
  44. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    I tried the demo but had no idea where to even start. lol I did not see any info about mousing over elements and since I have not bought it, I do not have access to the docs. But good to know they are there. Thanks.
     
    Misanthes likes this.
  45. Misanthes

    Misanthes

    Joined:
    Sep 25, 2015
    Posts:
    68
    You just need to put your mouse over a UI element and press shift.

    I agree that a more robust tutorial would be helpful for users. But, at the present moment I'm not sure when I'll have time to dedicate to that. But, it's on the to-do list for sure. A proper one will likely need to be rather involved as there would need to be a blend of music theory, as well as how the UI interfaces with that, best practices, etc. So, I've been avoiding it a bit until I can actually do it right :p
     
    Last edited: May 19, 2018
    wetcircuit likes this.
  46. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Honestly at the price you are charging, I totally understand not doing a tutorial. :) I would be happy with a very short written text on how to start and how to add notes. Seriously, if you do get those tutorials done, you should charge more.
     
    Misanthes likes this.
  47. Misanthes

    Misanthes

    Joined:
    Sep 25, 2015
    Posts:
    68
    Contact me at stickandbindlegames@protonmail.com and I'll be happy to send a more robust set of instructions. I can forward a 'music-theory-101' sort of response I gave to another member, going over the more important variables to work with and some general guidelines on creating configurations.

    Something to note is that you don't generally specifically place or set notes (though you _are_ able to do so in the sfx-editor tab. But, that's more designed for relatively shorter clips. It's 8 measures max I think, which can be fairly long, but would probably be pretty repetitive as a song, and you'd lose the ability to alter in real time).

    The approach is more to create a set of guidelines for the piece and then let it procedurally create as it plays. By setting the tempo, instruments, mode, scale, etc. you can set the mood or feel for the song, and then the generator will operate within those constraints, allowing you to change them on the fly in an app/game.

    Anyhow, feel free to contact me via email (unless, _is_ one able to respond directly through the unity forums? I don't want to clutter up this thread more than necessary).

    With the price, I intentionally set it fairly low. I'd like for as many people as possible to use it :) I'd mostly written the code for personal use anyhow. So, I'll probably keep it roughly there, or perhaps a bit lower, tutorial notwithstanding. The niche it fills in the music assets I think also lends itself to a lower price point too; hobbyist games, game-jams, small indie ventures and such can make good use of it. A full fledged studio-made game can afford better options, or will likely write their own generator if they needed proc-gen music.

    That said, I do hope to release a standalone product someday, adding midi-support, fleshing out the generation and using better instrument samples (I have to have ownership of them for the unity store, or they need to be CCO which limits options and quality for me quite a bit :p). I'd probably price such a thing at a higher price point :p
     
    Last edited: Nov 26, 2018
    wetcircuit and Teila like this.
  48. OdderOtter

    OdderOtter

    Joined:
    Aug 16, 2015
    Posts:
    44
    Hey there Misanthes!

    I just purchased your asset because the concept is really interesting and I love playing with music generation tools.

    I have two feature suggestions if you're open to them:
    1. A leitmotif feature where the user can compose a few measures like one can in the Measure Editor and then add it as its own "instrument" with a % chance of playing? Icing on the cake would be the ability to indicate which instruments / instrument groups should be muted in its instrument panel so that when the leitmotif plays you could be sure that an instrument track wouldn't conflict with it.
    2. A multi-instrument feature where the user can define different "instruments" for different note length durations (e.g. eighth, quarter, half, whole, etc.) so that, for example, a violin melody instrument could play pizzicato for pickup notes and then switch to vibrato for longer duration notes.
    I think the ability to introduce a leitmotif would be really powerful since you could call for it to be played during the game when a specific event occurred (e.g. main character health drops below 10%) or use it to help transition to a different preset (e.g. transition from "afternoon" music to "evening" music).
     
    Misanthes and Jos-Yule like this.
  49. Misanthes

    Misanthes

    Joined:
    Sep 25, 2015
    Posts:
    68
    Hey, neoTypic, thanks for the feedback!
    Your timing is great, after a loooong hiatus, I actually started work on a sizeable update a couple weeks ago, I should hopefully release it within the next...2 weeks? Hopefully before the end of the year.
    Either way.. to your first suggestion, in this impending update, I've already added the ability to have the pre-composed clips match the scale/mode of the currently playing track, so whenever they're triggered, they'll fit into the current chord progression/ scale, etc. adjusting themselves accordingly. Hypothetically, the end-user could just trigger that when the new measure event is invoked to _mostly_achieve what you want. However, I think it could be feasible to flesh this out a bit more, as per your suggestion, and have it mute other instruments/groups, or otherwise fit it in as a bridge (like, suspend the regular proc-gen and just play the leitmotif before transitioning back to the proc-gen. I'll look into getting some sort of this functionality into the update.
    To your second suggestion, the 'mixed' version of instruments (such as the mixed violin short), _kind of_ do what you're asking. For every note played, it randomly chooses between different versions (short-static, vs longer notes, etc).
    You can actually currently make your own mixed instruments for this (see the ImportingCustomSamples.txt in the documentation folder) It effectively achieves this sound, though the logic currently doesn't prevent say, a shorter note from playing immediately after one of the longer versions, and they kind of blend together. I do like this idea though. I'm not sure I'll get this into the current update, but I'll definitely look into this. In the meantime, if you need to make your own, email me, and I'll forward you the raw mp3 files, you can then mix/match them to create other 'mixed' version of instruments. But, I'm happy to try to get into the update the functionality of having the player respect the length of the played note (could be a little tricky, with variable tempos and such, but worth a try).

    Anyhow, I'll keep you and everyone posted here. As a heads-up, what's already done for the update is:
    -Optional pentatonic scales for lead instruments (this helps a ton for certain styles).
    -Pre-composed clips respect scale/chord progression (basically adjust themselves into the current song).
    -Drastically reduced GC allocation in the update methods (I'm a little ashamed how much garbage is generated currently :/ ). I have it essentially down to zero in the general update methods, though still generate some when select events happen, like loading new instruments or configurations. But, it's much, much, much more limited now.
    -New color scheme that hopefully makes the UI a little less messy (it's gray/red and overall a lot less colorful :p A bit more bleak, but tons more clear what's actually interactable ).
    -Editor UI performance is drastically improved (again, a little embarrassed with the current state of its performance). Also added a bunch of small quality of life improvements to the UI. I'm hoping everyone likes them. The released UI is a bit of a wreck. So, this update hopefully resolves a ton of the issues with window-sizing, performance, readability, etc.
    -Updated to current unity LTS version.

    Planned but not yet implemented: Android and IOS support, at least for runtime, if not the UI editor. This should be easy. Mostly need to extract the original mp3's from the asset bundles and make platform specific ones for mobile, since I've lost the original raw files :p

    Maaaybe: improved lead instruments, using more sensible modal phrasing over the chord progressions. This one, (if I can actually code it) should improve the overall sound considerably. This is my personal most-wanted feature. But, also (for me), the trickiest to code. I'm currently toying with different approaches.
    also maybe: actual melodic minor, respecting the ascending/descending scales. Also contingent on me successfully coding it :p In theory, simple, but the way I've set things up plays poorly with a variable melodic minor scale.

    Anyhow, thanks for the feedback! I'll do my best to implement things, and keep you updated on progress and release dates. If I'm not done in the next week or two, I'll release piecemeal what's already done with the trailing features shortly after.

    As always, if you have any other questions, feedback or suggestions, I'm all ears (and for the latter two, now's the time, since I'm actually working on this again :p ).
    Whew. Wall of text, sorry!

    Kind regards,
    Tyran
     
    Last edited: Nov 26, 2018
  50. Jos-Yule

    Jos-Yule

    Joined:
    Sep 17, 2012
    Posts:
    292
    Great to hear that there is life in this project! :) One thing that we found difficult was having to generate _every note/tone_ when wanting to import a new clip/sound. I'm not sure if there is an easier way for us to provide a single tone/note, and have the tool scale/pitch it to the "proper" note... Am i even making sense?

    Thanks for the update!
     
    Misanthes likes this.