You are reading content from Scuttlebutt
@mmckegg %PdXGfnuiu3B+V2MI5NDy1RvSpZGpymMKNaKQKwUZGaw=.sha256
Re: %meTZoGO9V

2017-11-23

TL;DR: I spent the last two days adding the ability for Loop Drop to record external outputs as part of the session (so I can include my external synths and FX), and the ability to change what channel Loop Drop outputs on so that I can route it correctly in my mixer!

Overnight, naudiodon was updated to fix the mac bug. So that’s nice!

Gonna have a go at that worker based deinterleaver now. Thinking that you give it a channel map (with channelCount and bitrate info) and desired chunk size, and then it streams back chunks for the different channel pairs and discards ones you don’t want.

Whipped up the worker. Need to pipe some data into it and see if it works! You give it {bitDepth, channelCount, map, samplesPerOutputChunk} and then post in the data as typed arrays matching the bitDepth. It then gives you back buffered TypedArrays with the data mapped as per map.

Okay, so it’s working. But after a few seconds, naudiodon is throwing “portAudio status - input overflow” and stopping. I’m guessing this is because it does not have an internal buffer queue, and if I can’t read it fast enough, it stalls. No idea how to fix this :(

Can reliably reproduce this issue in the tests now by adding a sleep every so often. Filed an issue, hopefully it can be resolved!

But I’ve spent too much time on this multi-channel recording for now. The multi-channel output was actually more important (and I got that working) as I needed to be able to output to the k-mix on a channel that wasn’t 1+2 (that is where the mic input is).

Time to stash those changes for another day, and get on with this mythical jam I was gonna have…

So, lunch has got me thinking that the web audio input (that only does 2 channels) wouldn’t be completely useless. There are a lot of times where just the first 2 channels would be all you’d need. I have a weird setup because I also want to be able to run a mic input in (for live streaming) and this needs to go into channel 1 or 2. But there are also other hacks like a second usb soundcard that is capturing aux inputs out of the k-mix. HACKY-AF but it would totally work! This could well end up being the simplest option.

But should I do it now? Hmm… i’ll give it 1 hour and see how far I can get.


30 mins down. This seems like a good idea! Much easier to integrate with the existing code. Got the recorder part implemented. Just need to add the interface for adding the inputs. Inputs will handle the getUserMedia and mapping to AudioNode themselves and then be collected into the SessionRecorder. It would probably be better if all nodes were recorded with a single ScriptProcessorNode, but for now this should work fine.

Ahh.. okay so I went a little too far down the rabbit hole here. Another hour later… but whatever. It is working! I have a selector that lets me choose what to record, and it is included in the session recorder. HOWEVER, the clips are all appended to the end which isn’t particularly ideal. Need to add multi-track playback to the timeline view.

Maybe just quickly I’ll hack it so that it creates multiple tracks for the external recordings.

Yup, only 20 mins later and I have multi-track recording playback working. That’s something at least. The interface doesn’t yet show it, and if you edit the clips, everything will get completely out of whack. But it is good enough for now!! WOOOP!

Too bad the day is over. Never mind, maybe have a headphone jam this evening.

Join Scuttlebutt now