Showing posts with label PureData. Show all posts
Showing posts with label PureData. Show all posts

Friday, 29 November 2013

JJ had too much fun with PD

This week I am supposed to implement two new filters for the genre changer in our game: classical HOV filter and rock HOV filter. I though this won't be a big deal. I had already gave JJ the filter library I had. What I need to do was look into the filters, took the part JJ used and patched it into our game. Sounds easy, right?

Well, it's not. The problem was JJ had too much fun with PD. That's good. Really good for Vinyl. I was happy with his excitement with our game which we, frankly, didn't see in the first 3 months. But... it's not good for me. My task was blown up. When it's supposed to be 3 hours it becomes 6 hours.

Thursday, 7 November 2013

I tamed PD - I hope~~~

Since we published our first installer in our website, we got random feedback mentioning that they couldn't install our game. We had tested our game in several computer in lab and all works well. Could it be because of different computer hardware? Highly probable.

To help us debugging it, we got the Apple computer from the IT guys in South Lab and worked on it. After working for a while, it becomes clear to me that the problem is PD! To be exact, PD is really slow in the first time launching after restart or power on. And in our setup, we run PD with a batch file and close the batch file after a few milliseconds. The number I picked was the number based on the time it takes for PD to launch 100% on the computers available around me. Of course this is not true in every case. In several computers, it took longer for PD to launch. Thus this hard-coded timeout is not working for us! But... if we didn't kill the batch file, it will always run in the background. What should I do??

Thursday, 17 October 2013

This is our third bad obstacle's sound filter

It took me a while to find another bad filter that doesn't sound like the distortion filter or the oscillation filter that we use for the other two obstacles. I am so glad that I didn't have to spend a lot of time searching for a bad filter. I saw this pitch shifter filter and I thought it would be the one we are looking for. And I am right! This pitch shifter can sound good if we tune it to the good values. However, we want it to be a bad filter so we insanely tune it into a value that corrupt the song in a way that it sounds weird like it's played from a really bad audio playback. Now with all the obstacles doing bad filter with the song, I feel the sound effect of the game is getting more and more themed =)

Before I forget, this is the pitch shifter filter.

Pitch shifter filter

Wednesday, 16 October 2013

The Vinyl effect!

Yap, I am getting much better with PD. Today when trying to find a new bad filter for our third obstacle, I found a way to make the effect to make the song sounds like played in old gramophone or old audio playback. I called it vinyl effect!

The vinyl filter

Tuesday, 24 September 2013

We love this phaser filter

Yeah, we all love this phaser filter. This morning in our scrum meeting, we chose between flanger and phaser filter to add as our second good filter. Everyone decided to go with phaser filter. It didn't took me long to implement this filter. Cody had already told me about this weeks ago and I had already searched a way to implement it. The result is.... everyone in Vinyl team loves it! It made the song sound cool! This is how I implement it:

Our phaser filter

Wednesday, 11 September 2013

Yup, finally I got the external sound effect done

It took me quiet a long time to figure out how to send message to instance of my abstraction individually in PD. I knew how to create a subpatch. Now I knew how to create abstraction. I knew that every time an instance of an abstraction is created, PD will give it a number started from 1000. The problem is I don't know how to get that number. I couldn't hard coded it because PD will randomly generated the number the first time the patch is run. So my only option is to name the instance and send message to the named-variable.

Tuesday, 10 September 2013

There is a way in PD to store a value!?? No way!

Really? There is a way in PD to store a value and called it later? I never knew it before. I had searched for it when I did my audio looping and didn't find it. I found it while doing searching for the external sound effect. Well, sometimes things show up when you don't mean to look for it.

Anyways, with this new knowledge to store value with [value] and restore it using [bang], I redo my audio looping. It looked so much clean and nice now. In the same time, it also showed me the problem we had with the first attempt of audio looping. Well, sometimes, when you code something in better way, bad things that you put there pops out.

With this [value] the PD runs more efficiently, at least I don't have to create another timer and send the looping information every milliseconds. It also make the patch cleaner. Don't you agree that I am getting better at PD?

New PD looping

Monday, 29 July 2013

Stupid Unity, why did you allow me to have 2 exactly the same class!???

I spent my whole weekend learning how to work with networking programming. It was my very first network programming. Yes, Unity communicate with PD through TCP network. However, it wasn't my code. It was some open-source library I found on internet: KalimbaPD. And it doesn't satisfy our usage. We need to know where PD is at to sync the audio to the track. In short, we need a way for PD to communicate with Unity. So, with Cody's help I created a new network channel for Unity to receive message from PD.

Monday, 8 July 2013

The audio speed is back!!!!

Yes, the audio speed manipulation that JP loves is finally back!

Well, it was there for a long time but we always forgot about it. I had implemented it in the PureData since the first time I had it integrated into Unity. I did mention it to the team that they could connect the player speed to the audio speed however they were busy with other mechanics. Then, when I changed the PureData to enable it play any song given by Unity, it was broken. Now, I had the audio looping done and in the same time, I got the audio speed and audio pause done! The game was much more fun with the audio speed. It gave you a reason to keep your position as close as to the needle. We love it, too, though when the audio was slowed down when you fell behind the needle.

Saturday, 6 July 2013

Oh, PD, why don't you have a conditional statement or allow me to store a value in variable?

Oh, PD, why don't you have a conditional statement or allow me to store a value in variable? Without these ability, how should I make our audio remixing? The first time Unity tell PD to do looping from start sample to end sample, I need to know where is the end of the half-looping, fourth-looping, and eighth-looping for later use. Or I need to store the end of the whole looping section so I can calculate the end of half, fourth, and the eighth looping. Sadly, there is no such a way I know of in PD.

In the end, I spent around 10 hours tricking the variable sender/receiver and test the audio looping. The result is a massive looking patch! In the same time, it also looks cool. =)

Our latest PD patch

Friday, 14 June 2013

Why we change from LibPD to Kalimba?

Yes, we changed our audio engine - Unity binding. Previously we were using LibPD to bind Pure Data and Unity. And now we are using Kalimba: crash on Unity when we load  the song and use [soundfiler], the audio is still played through Unity which the main reason we use external audio programming to play and manipulate the audio.

We never want to play the song using Unity. Unity made it impossible for us to load the song dynamically. Every song need to be a part of the Assets. Yes, there is an asset in Unity which allow user to load song but we are making student game. We can buy the asset to study. However, that is not the only reason we don't want to play the audio using Unity. On our very first prototype, the audio pitch was off when it is played with Unity and audio pitch is one of main our game feature! Yes, Unity has some audio filter that we like to use: chorus and distortion but they are not enough for our game. The volume level of the distortion is not adjustable! Anyways, there are a lot of reason why we hate using Unity to play the audio and manipulate the audio. 

And the way LibPD bind Pure Data with Unity is by asking unity to route the audio through the filter (which in  this case is LibPD). As I checked in Unity3D scripting reference website, I can make the LibPD play the whole song by assigning an empty AudioSource into the object and still let Unity inserting a custom filter into the audio DSP chain. However, when I tried this doesn't work well. And the problem is still the same: the audio coming from Unity not from Pure Data! So, that's why we switched into Kalimba. So far we had been satisfied with it except for my poor Pure Data knowledge.

Wednesday, 8 May 2013

Integrating pure data into new Vinyl

Early this week I had successfully integrated pure data into our current Vinyl project. I had also created low pass filter, high pass filter, and band pass filter. Today I finally integrated it into the obstacles that iJason worked on yesterday. Yay!

Yesterday I and iJason had finally connected the top and the bottom surface of our-self-generated pipe. We had also split the track into sub-tracks because of Unity limitation of the maximum number of the vertices a mesh filter can have. The maximum size of vertices in Unity is 65536 while our track may have more than 65536 vertices - depends on the length of the song and the detail of the pipe we want. It took longer time than I thought. First, it was because I didn't understand the degenerate triangle of the triangle strip that Cody wrote. Secondly, the vertices generation from the spline was somehow confusing.

A glance of new Vinyl - without music-based track