How to create a rhytmic tapping input for music education platform - input

I´m working on a platform to teach how to read/write sheet music.
So far, It´s been "easy"* to figure out a system in which people select the minimal rhytmic units to WRITE some music, but I dont know even how to start to other direction of this process: how to create an input system to provide activities in which students could READ and tap some rhytms on the keyboard. Of course, my objective is to capture the time interval between taps in relation to beats. In other words....how to measure the time between taps.
I know softwares like EarMaster or GNUSolfege figured this out.
Any help would be much appreciated.
Thanks people :)
*"easy" because I´m a pianist/psychologist. All the PHP and JQuery and MySQL recently added to my life are still some hard/exciting things to understand.

Say you have a button. That button will have some method that runs when you tap it. What you will want to do is get the current time, it will depend on your language/platform but there is typically some built-in method. This will be in Unix time, which is the number of seconds that have elapsed since jan 1 1970 (or milliseconds). So each time a user taps the button, get that time (an integer of milliseconds) and store it / match it against the tempo.
This sounds easier if you have a pre-defined tempo. Just convert beats-per-minute into milliseconds-per-beat, and you would have a repeating timer in the app that plays a sound or flashes a color after that many milliseconds.
This is probably an unsatisfying answer, and generally, stack overflow should be used for questions that specifically relate to code. So when you know what language you are using and you start to implement this feature, if you run into problems, try asking this question again with your code / a minimal version of it and you will likely get a better answer.

Related

Fast, Accurate Key Events

I'm trying to design a script that requires very fast and precise key events. It needs to time key presses ideally to within 2 or 3 milliseconds max and needs to run the same way every time. I'm wondering what the best way to implement this project is. I'm open to suggestions on languages, project structures, and anything else that might help. Ideally, the script would be able to send key press events to a specific application so I can use other apps while it is running, but I am working on Mac OS which I know is a more challenging environment to implement that sort of functionality.
I know how to implement the basic idea in python and java, but I'm looking for ideas on optimizing speed and accuracy. And the thing about sending the events to a specific application.
Thanks for your help!

Methods of Lag Handling in iOS (SpriteKit)

Hey I've been working my way through making my first app, and I've hit the first problem that I don't even know how to begin fixing.
I am making a SpriteKit game, and as I've been coding, performance has been slowly dropping. Clearly I am not handling lag well at all. (~20-30 fps on device)
The thing is though, I'm not sure how to tackle this issue. I am going through and trying to loosen the load on each frame, but..
Are there any methods of lag handling that most people use?
I tried setting up a timer system, so that I know how much each segment of code takes to run, but the data wasn't too helpful.
It doesn't even look like a specific segment of code is taking that long at all.
This is kind of a broad question I guess, but how should you go about lag handling in SpriteKit?

Can I Grab A Mechanical Turker's Time Zone (Without Javascript?)

I have completed my first Mechanical Turk HIT as a requester. The organization I am building this for would like to extend my HIT to ask the Turkers questions about time. However, for any of these time questions to make sense, we'd like to know what time zone they are located in.
So far, I have come up with two potential solutions:
1.) Ask the Turker.
2.) Implement a Javascript routine to grab the time zone off their browser.
It would be nice if the Mechanical Turk system itself allowed me to grab meta-data (either during the HIT, or ex post facto based on the WorkerId field I receive.) Does anything like this exist? I have read a few of the docs, but not come across anything helpful.
Thank you very much.
Mturk doesn't provide meta-data at that level, so I think one of the two options you mentioned would work just fine.
Asking the worker is the easiest on your part, but you'll have to assume that some workers may choose the incorrect timezone. This is not a slight against Turkers - only humans in general :)
I'd say you might be better off using the javascript method getTimezoneOffset() as mentioned in this answer though it's still not clear to me if you need to account for daylight savings.
I'm adding this to our todos and will repost what solution we implemented when we do so.

I need help choosing a game engine for a very specific task

I need a 3D engine for a very specific task in Artificial Intelligence, and I'd like some input.
The first part is the trivial one - basically, all I need is a FPS engine (3rd person would be good, too), such that it allows me to navigate a room and interact with objects (if you have Java and Windows, I'm looking for something similar to the Give Challenge, but a little more up-to-date). Physics would be nice, but is not a must.
Now, the non-trivial part would be: I need to impose a virtual grid over this room, such that at any moment I can say "the player is located at B5 - now he moved to B6", and so on. I need to redirect this information to another system (namely, one which will give the player instructions about what to do) and, at the same time, send messages to the player, so I must be able to have a single point through which the game logic passes through; also, I'd love not having to write my own collision detection and such.
So far, I've tried:
the Source SDK: it seems a little overkill (since I'm not really planning to shoot anyone, at least half the code base is useless to the task), and since I'm not really a Windows developer, I'm spending too much time with the "easy" stuff (such as getting VS up and running). Plus, cross-platform would be really nice.
Blender game engine: while this worked decently, the interaction model seems a little weird, and some easy stuff (such as making sure the camera stays inside the scene or showing the mouse on screen) gets too weird too soon.
Crystalspace 3D: I've tried their demos, but it looks a little old-fashioned, and since that was one of the problems of previous engines (it's easier to get volunteers when your game looks nice) I'd like to try something else.
Now, maybe I'm asking a little too much for a single software, but I'd love some input. Can anyone suggest me an alternative? Or should I give one of the previous ones a second chance?
Try the UDK. All of the things you request are present, and it's free for personal/noncommercial projects. Here are some highlights:
Modern looking. The UDK features an intuitive-ish visual material design system, post-processing effects, Scaleform Gfx UIs from Autodesk, and more.
A visual scripting interface called Kismet that can control gameplay elements, the camera, and more.
UnrealScript, a scripting language similar in syntax to C, C++, Java, that gives you the ability to extend existing functionality or create your own.
Comprehensive documentation available on UDN.
Lots of community support outside of Epic, in places such as Polycount, Eat3d, 3dbuzz, and more.
Basically, "and more".
If what you're looking for is a professional, free (as in beer) engine that will allow you to focus primarily or solely on your differentiating gameplay features, Epic has set the bar high.

How to program an RPG game's scripted event/Cut scene system in a tile based RPG in objective C?

For background I have been working on an RPG based off Ray Wenderlich's tutorials. (Example)http://www.raywenderlich.com/1163/how-to-make-a-tile-based-game-with-cocos2d.
Now I am trying to build a scripted event/Cut scene system so that for instance when a player enters a building, the different characters can have a discussion of the current events, before continuing the adventure. My only problem is I can't really visualize how one would implement this.
I would guess some sort of one time use trigger, maybe kept in a large switch statement on a singleton somewhere ? Which maybe draws all the temp characters ? Then the event then deactivates itself.
I am just looking for a blueprint of how one would do this. Although programming examples are welcome as well.
It depends a lot on how much time you want to commit to the system and how versatile you want the final system to be. A powerful cut-scene system can be flexible enough to be used in almost every interaction in a typical 2d RPG.
If you want to go all out I would suggest a heavily data drive approach. Keep as much data in files and use the filesystem to your advantage. If you say 'all the dialog scenes are in this folder' then when adding a new scene it just needs to be dropped in the folder rather than creating the scene then touching some master switch statement somewhere. Just keep in mind with a large system you want to make adding a new cutscene as simple as possible, not 400 different places to touch.
I would also stay away from switch statements for tracking progress in a cutscene. It adds a lot of code overhead per scene. Idly a cutscene would be a simple as an array of data and a position. Your cutscene manager, the singleton, can parse through the array, decode the data into commands and fire them off.
Sorry if thats a big vague but a lot of these decisions depend on how your engine is structured and what you want out of the system. Keep in mind that the more general the system is, the more uses you may find for it going forward but it will take longer to get up in running to begin with.
you can just check for the tile you are on while you are moving, and when you are on a specific tile you can start a cutscene, also you can add a tag via TiledEditor (this is the recommended editor for using with CCTMXTiledMap) to your map to specify where the cutscene should begin just like he pointed the character start point in that tutorial. the you check for the triger specified (either a specific tile or what the point taged in map) in every gamecycle. and then it's almost very easy you just freeze controls and play a prerecorded camera and object movements till the cutscene finishes. the restore the game to normal mode and turn off checking for the triger.