I’ve had a bit of a creativity slump in the last couple of weeks, so I tried to turn it into an “opportunity” to do something I’ve been meaning to start for a while. I mentioned it in one of the threads on the old forum I think… anyway, here’s the idea:
The end goal is to be able to plug in a Raspberry Pi into the Op-1 via USB (like you would with a computer) and to be able to use a program to split a stereo file on album into two mono files on the tape tracks. Ie, a portable and hopefully easy-to-use alternative to faffing around on the computer and doing a bunch of manual steps. I have no idea yet how you would specify which album file you want to split and which tape tracks you’d like them to be dumped to, but I guess I’ll aim for something simple and stupid to start with and let it evolve into something slightly more sophisticated as I go on.
As I’m a Java developer in my day job, I thought I’d just write it in Java, since I’d be able to get up and running quicker and you can run Java on the Raspberry Pi. To start with, I’ve been writing some code that will help me read and write aiff files. You’d think there’d already be a million such libraries in Java, eg, AiffFileReader that comes in Java itself, but it didn’t seem to be able to read the aiff files that the op-1 spits out. However, writing this code has helped me understand lots about the insides of an aiff file (based on Interchange File Format) and could (eventually) provide a base for any application that wants to tinker with the op-1 specifics inside its aiff files. Eg, two other ideas might be:
- Take a drum kit that has been made on the op-1 and split it into separate files based on the loop start and end points. (I think somebody asked whether this was possible recently).
- Take a long list of samples and convert them into Op-1 drum kits (a la Drum Utility) and have the program work out the best way to split them across drum kits efficiently.
Anyways, just thought I’d let people know. I put the code that I’ve written so far into Github. Any Java devs out there, feel free to have a peek and shame me for my rather poor test coverage
that old thread of yours got me interested in rapsberry in the first place and now again you hit again . needless to say i am following (i dont have a pi yet ) but i need something like this to make it A practical TOOL for me as i am unexpertised in any fille code () but portabillity, additional OP-1 territories and leaving computers off is "music to my ears " .go go go but please keep your process info as simple as possible
Cheers @thor. I hear you… unless the process is simple, it’s not going to be very useful. Perhaps as a very dumb prototype, I can just have a program running on the Pi that detects when you’ve connected the op-1 and entered disk mode, grabs both album files, splits the audio of each album file into mono files, dumps the results across all four tape tracks and emits a beep to suggest completion so that you can go back to tape mode…
Nice work @yoof I will keep an eye on developments as my coding chops are limited to basic stuff, so I am not able to contribute anything.
Side note - I’d pay a reasonable price for software that backs up/restores the whole OP-1 at a button push, the raspi is easy enough to make super portable, it would be great if the linux does not have to be installed, so that it is almost instant on, backup, done.
In the remix section, it describes how to take a stereo file and split it into individual mono recordings. If you can navigate and use the command line in Linux, this wouldn’t be too difficult to code up. Let me know if you need any help, and I can start some script.
@darenager, suggestion noted. When I get to integrating my code with the raspi, I’ll have a go at that. It doesn’t sound too tricky. Do I remember somebody having done that before though? I think it might have been called the “op-1 backup thingamejig” or something… I’ll have a search when I’m at a computer.
@GCF - that SoX thing looks super neat. Will definitely play with that. Having an API that understands how to read and write the Op-1 specific parts of the aif files still sounds like a useful thing to have, so I’ll continue down the Java route. (I got to the stage where I’m able to successfully split an album aif into L and R channels). I had a quick peek at your github page and saw a repository with “volca sample” in the description… gonna have a proper look at that later
Did a bit more coding on this. Still nowhere near hosting anything on a raspberry pi, but I managed to write a fun little program that, given a root directory, searches for wav files that are less then 12 seconds long and then works out the most efficient way of packing the samples into as few drunkits as possible. Tomorrow night, I’ll try to actually generate the drumkits and load them onto my Op-1
@yoof - I could never get the thingamejig working, no idea why.
Anyway if you make a standalone backup and drum utility thing for raspi I will definitely buy the software, and probably others would too as it is a pain having to boot a PC just to take a quick backup.
i initially wanted to do somethign similar with my raspi. eventually just got this instead. http://www.microcenter.com/product/439773/TW700_Tablet_-_Black they go as low as 60 sometimes. has a full usb port and runs full windows. other models are more powerfull just make sure you get a model with the full usb port. or you could just use usb otg that would also work on android!
I reached a bit of a milestone on my coding this morning and thought I would share an update.
To recap: I’ve been writing an API in java that understands how to read and write the files on the Op-1. Putting the raspberry pi aside for one moment, I wanted to test that I was successfully able to generate drumkit files, just like the drum utility, but on steroids
The idea is that you can point a little command line program to a folder on your computer containing samples. It can be a whole tree if you like. Then you run the program and it will generate lots of kits for you containing all the samples (using a best fit algorithm).
This morning, I finally got the meta data right (meaning all the start and end points of the samples). I can load them onto my op-1 and they actually work. Woohoo!!
I probably need a week to tidy my code, but once that’s done, I could host it somewhere for others to try out. It’s a super quick way of just getting some new sample fodder onto your Op-1
I haven’t dabbled too much myself yet. This project was going to be my first attempt
However, if you’re interested in having a play, I would seriously go for it. The cool thing is that there’s a lot of focus on using the R-pi as an education tool for kids. So that includes us big kids, if you ask me
Ok guys, I tidied things up a bit and put a command line interface around it. I would be very grateful if anybody who feels brave enough and fancies messing around with it, does so and provides some feedback.
The code has been written with Java 8, so it will require a version 8 JDK or JRE to run. (If you think this is a bit crap and older versions of java should be supported, shout up, and I don’t think it would be too hard to go back to java 6 or something). Anyways, download java and then make sure that the path to the bin directory in your JDK/JRE is on your PATH environment variable.
-baseName : the base name of the drumkit (numbers will be appended to this name)
-maxLength : the maximum length of a sample to include in a kit
On my windows laptop for example, I have a stash of Roland drum machine samples in a particular directory. So, in order to generate lots of drumkits based on the samples in that folder, I’ve been running this command:
The -maxLength option will limit the length of samples identified by the program to that many seconds (floating point numbers are fine). The -baseName option allows you to specify a name that the generated kits will start with (numbers are appended to this name).
I’ve been testing this with version #14203 of the Op-1 OS (that’s the latest and greatest as of Nov 8th 2015). I’ve also been using Windows 10. It would be ace to get feedback from Linux / Mac users.
Before loading anything onto your Op-1, please back everything up!! I have successfully loaded lots of kits using this program and they’ve worked fine for me, but the last thing I’d want is to brick somebody’s current project, so please do a backup first.
What’s up? I’m a professional Java developer (tech lead) at a fortune 500 company, have a Rasberry Pi 3, and I’ve been experimenting with my own scripting for the OP-1 so I’m pretty interested in what you’re doing.
The scripting I’ve done has been limited to backing the my OP-1 up so I can switch between songs and not lose anything. I’ve just been using bash command line scripts to copy the files off the OP-1 so far (didn’t really need Java).
I love that you’re writing the API and learning about the AIF format (I’d love to do this as well) but for the actual utility it seems better to use SoX if it meets the needs of what you are trying to do. There’s just no substitute for using a “tried and true” tool vs baking something custom.
It would be awesome if we could have the Pi back things up when plugged directly into the OP-1. The light indicator could just change colors or it could beep when complete. Would be especially cool if the Pi was running on batteries and turned on/off.
Create a central patch repository and have commands to download and install them to the pi easily.
A command for moving chunks of sound around on tape that are too big to be lifted / dropped