Jump to content

Combo Generator Thing-A-Ma-Bob


djlotus

Recommended Posts

Sorry if this is in the wrong place but wanted to start a new thread related to http://www.digitalvertigo.co.uk/forum/index.php?showtopic=1385&view=getnewpost.

I'm not sure how practical it is but, I've decided to try to make a browser-based version of Sideshow's combo generator. I was too late to actually see it work (Windows 7) and non of the file links work anymore so I'm basically taking the idea and starting over. I have lots of questions for anyone who go to play with the program.

I've preliminarily decided to build it with the Web Audio API and Canvas API. I could use all the help I can get. I set up a repo at https://github.com/djlotus/combo-gen and for real-time discussion I set up a Gitter at https://gitter.im/combo-gen/

I'd love to open the discussion here about it.

 

If I'm over-stepping my bounds by bringing this back to life let me know and I kill the project.

 

Thanks everyone.

Edited by djlotus
  • Like 1
Link to comment
Share on other sites

I won't be able to help much with the coding, as what I do know is mostly VB, C# and some Python - though none of those amazingly well.

I did at least ponder some of the logic and options before I got distracted. Once I get a spare few mins I'll come back here and put some notes down regarding the things I wanted to do for my Windows v1 program.

Link to comment
Share on other sites

Sounds great Deft.

 

I've made some good progress the past few days. Web Audio API is a bit limiting so I am having to find work around's for a few things such as managing the sample libraries and creating a faux "reset" function. I'm updating the Wikis on the repo every few days with my thoughts and discoveries if you want to see how I am going about everything.

 

Handling the actual audio is going to be the biggest problem. I have it set up now so you select the sample library you want to use, choose if you want to include a background looper, and then select the looper you want to include. Obviously more functionality needs to be added (tempo, repeat, recording etc.) but, I have broken the functionality into modular parts and will build one by one and add to it as I go.

 

I do have some questions about the samples/sample libraries if you want to give me some guidance:

  • When recording the samples I was thinking of recording them at 120 BPM. I think that tempo will make it easier to apply quantizing and swing in the future and make the timing functions easier overall.
  • Regardless of the recorded BPM, should all samples be recorded at 1 BPM? For example, at 120 BPM a baby would be 0.5 seconds long. Should all scratches be recorded at that length? That could cause serious timing/audio issues if the pattern were " baby, 2-click-forward, reverse stab, baby, forward-tear." Maybe this is the way to go and we can adjust the tempo on a per sample basis. (I'm thinking of creating objects for each sample type and tying extra info to them in JSON format. Could store tempo adjustments and anything else we needed on the object and just reference it from there when needed).
  • I am progressing right now with a system that (basically) creates nodes for each scratch sample and then plays them end to end.
    bufferArray[0].start();
           bufferArray[0].onend = function() {
              bufferArrray[1].start();
           }
    and so on). The buffer objects are incredibly light and trash collected quickly so performance is not an issue. I am exploring whether it may be better to take take the samples individually and concatenate them into a single file at runtime and use a marker in the head to jump from sample to sample. Thoughts?
  • I just learned that when exporting .MP3 0.26s of empty data is added to the beginning and end of the file. I wonder if this will impair the looping functionality?

I could on for hours.

 

Below are some crude flow diagrams of functionality and such. The one with the controls on it isn't meant to be a reference for layout. It's just a visual to keep track of what controls will be needed.

 

Let me know what you think:

flow_chart_with_functions.png

controls.png

audio_context.png

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

So my thoughts on where I never quite got to (talking .Net or similar)

 

My plan was to have a simple data table of scratches, and perhaps show these on the GUI via a DataGridView.

The main attributes for each scratch would be:

length (in beats or bars)

difficulty (beginner, normal, pro)

faderless (yes, no)

sample position at beginning of scratch (start, end)

sample position at end of scratch (start, end)

 

I think this is enough info to randomly chain scratches together / use in the logic of whether things could be combined. The sample position stuff you might not want to show on the GUI.

The scratch samples and backing track I expected to be at a fixed tempo for v1, so a complete contained sample set with no flexibility or need to timestretch / figure anything out.

 

In terms of the GUI, just a choice of combo length (1, 2, 4 or 8 bars) and an option for "Q and A" mode, whereby it alternates the same length but with no scratches so you can practice alongside. You could also choose whether to include or exclude beginner, normal or pro scratch types and perhaps an option to allow / disallow repeating of the same scratch in a combo. Perhaps an option to "always start combo at beginning of sample" too.

Then you would have a button to generate combo and it would build a random chain of scratches which added up to the chosen combo length. Another option would be to allow silences as part of the combo. This could get interesting in terms of randomly placing silences across the chain too.

The algo for generating the chain is pretty straightforward based on the properties of each scratch I think (random number picker, does it work with previous scratch, ok length etc.).

 

The generated combo could be displayed in another DataGridView, and I suppose you should also be able to create your own combo by drag and dropping from one grid to the other.

 

Where I got a bit stuck initially was assuming there would be an easy way to seamlessly playlist the combo set of scratches, and play these in sync (looping) with a backing track. This seemed beyond me using the AudioGraph API in the UWP style. I went back in time to WinForms and VB.Net assuming there might be better 3rd party libraries or a more straightforward way. During this endeavour I discovered the idea of just joining the .wavs on demand via a list of Bytes. This seemed like it would work. Playing back this joined composite .wav against a backing track feels like it would be easier. I could certainly do that in the AudioGraph API no problem, so must be ok back in VB.Net.

This was all against the backdrop of learning C# and the UWP as a mini challenge to myself. I then got distracted by the excursion into VB.Net / Winforms and general life....

Link to comment
Share on other sites

My thought process is pretty similar to yours as far as functionality goes. You have some great ideas in there that I didn't think of such as a "silence" sample and Q & A mode.

 

The part is tripping me up, specific to the Web Audio API, is looping the generated scratch sentence. Each sample that is generated is linked as an audio buffer source node. These buffers are then sent to an array and randomized using the Fisher-Yates algorithm. From here it is no problem to play the sentence once. Unfortunately, audio buffers can only have the start() function called on them once which prevents the sentence from looping/playing again because once the sample plays through you cannot call the start() function again. I am trying to figure out a workaround but am coming up short.

 

I have looked into a process which which would concatenate the files associated with the array into a single file, but the same issue persists. I have thought about duplicating the array at the end of playback so a new array is available to play every time but I'm not sure what effect that will have on performance.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...