playMaker

Author Topic: Drag Drop Array and Audio Play-ness help  (Read 4233 times)

Deadlyapples666

  • Playmaker Newbie
  • *
  • Posts: 10
Drag Drop Array and Audio Play-ness help
« on: April 22, 2012, 08:46:24 PM »
Hi guys. Although I am tackling the RPG idea my main focus is on getting a project for uni to work.

Its a Music app which allows people to make their own backing tracks to practise to. For guitarists, drummers and bassists.. Even singers, Pianists. All sorts.


I'm trying to get this working :

3 Tracks. Each track has 16 slots. By Default each slot has a blank audio file.. So if the play button was hit.. You wouldnt hear anything.

But what I dont know how to get to work is the ability to click, drag and drop 1 Object onto another and have the dropped object replace what was there.

eg.. Pick up A and drop A onto B. B turns into A


Then... *sigh*

I need a way for the 16 slots to play audio.. 1 by 1 from left to right


Any advice for this sort of stuff? :P


Ive done all the audio and UI designs but I just cant get the scripting to work and could do with some assistance :(

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Drag Drop Array and Audio Play-ness help
« Reply #1 on: April 23, 2012, 03:48:14 AM »
Hi,

First step. You do need to watch as much videos (http://www.youtube.com/playlist?list=PLC759306A1E692A10)and studies the samples provide very carefully, so that playmaker concept has no secret, you must be comfortable with the FSm concepts, states, actions, transitions, events, before you dive into making this application.


 Instead of replacing objects, I think you should design a flexible object, able to accept a particular reference to pla when it's ask to.

 I would also cut down the problem into much smaller chunks:

1: are you able to design a grad a drop feature, meaning, you click and drag and object, and you are able to maintain the reference of the dragged object, and when releasing on another object, you can tell it which object was dragged onto it.

 for this,  in playmaker you can implement global events such a "MOUSE UP", there is even a "MOUSE DRAG" global event for you to use. So start by creating a fsm that can drag an object, first task, once you have that, working, work on the release aspect, that is create objects that can receive a drop ( all your 16 bits), then plug them together, the dragged object, calling the drop object, etc etc.

2: a "player", essentially playing the 16 sounds at a given tempo.
This one is easy, either you give the ability for each object to know when they have to play, or else you build a manager telling them objects when to play. So choose one technic, and then cut it down: can you call an object at constant interval, then how do you switch to the next object, etc etc.

This sound anyway a very good example for using my ArrayMaker addon :) which essentially would make the mainteance and access of the various objects a lot easier.

https://hutonggames.fogbugz.com/default.asp?W715

 Bye,

 Jean

Deadlyapples666

  • Playmaker Newbie
  • *
  • Posts: 10
Re: Drag Drop Array and Audio Play-ness help
« Reply #2 on: April 23, 2012, 10:50:25 AM »
I've had a go for a few hours trying to get drag and drop working and I can't get it working. But I was wondering if anyone could help with making a simplified version of this app idea?


1. There are 12 buttons. Each button has an audio clip assigned to it. The audio clips are as follows.
Funk Rhythm Guitar in 2 second phrases.
One in E
One in F
One in FSharp
One in G
One in GSharp

You get the idea.

2. There are 16 slots and when the play button is clicked the first slot will play, then after the first slot has played the second slot will play, and so on.

3. The user can click the 12 buttons in any order. When they are clicked the audio linked to the 12 buttons are linked to the 16 slots in the order they are pressed.

Eg

I click button A, Then B, Then B , then D, Then A, Then D,

By clicking play the audio would play as follows.

A-B-B-D-A-D

I have done this sort of but not using Playmaker and I dunno how to transfer this across. I also feel that the script i did was inefficient as i used a unity feature of add.sequence. Then had the play button play the info that was stored in the sequence.

Issues with this was that there was a millisecond delay between each audio clip

But because this is an audio app and timing is critical delays are unacceptable! D:



I need some help please! :D


"Warning" : I Have 0% skill in Scripting or the syntax of scripting. I am just a 3D modeller and Animator / Drummer / Guitarist . Hehe



Ive been thinking.

I think what I need is something like this.

At the start audio_1 is waiting for an input. I can click any button and audio_1 is assigned an audio clip that was related to the button. Then State 2 with audio_2 is waiting for an input. Click any button etc.

Unfortunatly for me I dont understand how this would work. I suppose I'm just not logically or technically minded. I just dont need any way of doing something like this at all. :(
« Last Edit: April 23, 2012, 11:12:57 AM by Deadlyapples666 »

Deadlyapples666

  • Playmaker Newbie
  • *
  • Posts: 10
Re: Drag Drop Array and Audio Play-ness help
« Reply #3 on: April 23, 2012, 11:36:48 AM »
Basically Im trying to make a Music Sequencer. Which plays audio clips in a sequence..

But also allows the user to create their own audio sequence in game.

Bah. I've asked all over, Unity Answers - No Help
Unity Forums - No Help
Asked My Lecturers - No Help

Lol :P

AlanSmithee

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Drag Drop Array and Audio Play-ness help
« Reply #4 on: April 23, 2012, 04:57:41 PM »
Keep faith, in the beginning it al is very overwellming but keeping fooling around and help from here youmwill get there. I will see if i can think up a way for you to get started. Not promising anything though since im learning the ropes myself to. But in the land of the blind, on eeye is king  ;)