Newbie starting the hard way - Windows Mobile Development and Hacking General

Hi all,
I've got an XDA II, and I play bass in a band. Often I'll get a tune in my head and I want to figure it out...so I thought 'Hey why not write a program on your phone that has the fretboard of a bass guitar, where you can hit a string and it'll play that note.'
So thats my idea, but how would I do it? As far as programming languages go, I'm pretty good at Java, ok at Python, but not so hot on C/C++. Also I've NEVER used the win API on any platform, let alone P-PC. Also sadly the only GUI work I've ever done has been with Swing (in Java).
I know there is a pocket pc port of Python, has anyone ever used this? Would you think thats a good way to go about writing this program? Could java be a possability.
GUI wise I don't need anything too complicated...just 4 pairs of lines. One pair for each string. In the pair one line would be for palying the open string, the other for each fret on that string. Something like this:
1--2--3---4--5--6--7--8--9--10-11-12-13-14-15-16-17-18-19-20-21 <--G String (hehe)
----------------------------------------------------------------------------------------
1--2--3---4--5--6--7--8--9--10-11-12-13-14-15-16-17-18-19-20-21 <-- D string
----------------------------------------------------------------------------------------
1--2--3---4--5--6--7--8--9--10-11-12-13-14-15-16-17-18-19-20-21 <-- A String
----------------------------------------------------------------------------------------
1--2--3---4--5--6--7--8--9--10-11-12-13-14-15-16-17-18-19-20-21 <--E String
----------------------------------------------------------------------------------------
Then just hook up a mouse down style event listener and use a lookup table to determine which note to play depending on where on the guitar I've clicked.
Seems like it shouldn't be too hard. Any hints/pointers?
Thanks
Tim

Related

Starting a new project - Need help and feedback

Intro:
Hi, my name is bart and im a dj / producer
When im traveling i get alot of inspiration. So i would love to be able to make music on my pocket pc. I searched for software like drumsequencer/samplers for pocket pc. ?I found some very basic/not interesting freeware progs. And 1 over the top not realy functional wav sampler wich costs money btw. btw excuse me for my grammar as i am dutch i will likely make some major grammar faults.
So i decided i need to make one my own. and make it good and then release it to the public for free.
The Concept:
Maybe some of you know this program some dont (look it up on google then) but do you remember the program called Rebirth? it is a piece of software by "propellorhead" wich is actualy a digital clone of a oldskool 808 and 909 drumcomputer and 2 303 synths. It also includes 4 basic effects: Delay, Distortion, enveloped cutoff/resonance and a compressor.
Wich are basicaly mathematical formulas wich change the sound produced by one of these drumpcomputers/synths. One of those effects cqan be used for one sound source only.
ok so i basically want to get about thew same specs as that program. Only with less cpu intense graphics, just 1 drum and 1 synth and compatibilaty with atleast the mda vario aka qtek 9100 but i prefer compatibilaty with almost all pocketpc's.
here is a basic list:
1 drumsequencer (with maybe 4 samplekits?)
1 synth (soundgenerator using 4 different wave shapes)
1 cuttof/resonance filter
1 distortion filter
1 delay
1 internal mixer ( each channel will have a own volume knob i guess)
Read this before continueing
Ok so now is the question if you are interested in all this. If you want a program like this read on. If you are good in programming even better.
If you know a lot about music or music in combination with pc software you can definately help me out.
I know almost nothing about programming. Ok i know some oldskool basic, i can do some html and php, but thats it. Tho im not stupid and i learn quick. I also think that this project may be a good excuse to start learning to program. So basically i first need to determine some important facts before i start this project:
Wich programming language is required for this project
How much programming skill will this project need (basic, medium, expert)
What about the soundchips in ppc's and how to communicate with them
Use sound sampling based techniques or sound generating techniques
Are there people to support me, can they help write code, can they help answer questions
And the list go's on... if you think you can answer one of these questions dont hesitade and start to support this project
ok nuf said... lets get back to bussines:
Main functions
Ok so i guess i need some main functions wich would be the core of the program. There needs to be a timecode aka bpm (beats per minute)
This means a play button and a stop button. There needs to be a visiualisation of the drumcomp, synth and effects. I would also like to note that im not planning to use the function of a pattern playlist yet ( a playlist tells the sequencer to play different patterns from a database of patterns).
To keep things simple i want to keep this version just playing this 16 step pattern as a loop. Very important is that all sequencers (synth, drums, delay effect) go as fast as the timecode aka bpm.
The Drumcomputer aka Sequencer:
The idea is to make a 16 step sequencer. For those who dont know what that means plz look it up on google. i would like to implement the feature to use different samplekits from a list. i als am wondering wich format whould be best to use to compress these samples... wav, aif, 8 bit 16 bit 22khz ???!!??
The synth aka soundgenerator:
I want the following functions on this soundgenerator.
It is triggered by a sequencer
You can change pitch of each note
sound can be modified by cuttof resonance
you can choose 4 waveshapes: sinus, square, triangle, noize.
very similar to the 303 in rebirth do it doesnt have to have the same sound just the functions.
The effects:
Need to find the mathematical formulas for these effects and check how to convert them to this program.
Internal:
Ok first i want to tell what ISNT needed. I dont need save to be implemented yet as a wont be using playlist and mulitple patterns anyway.
All sound sources (drums, synth effects) have a own volume knob wich indicates the volume. I want to make a internal mixer wich mixes the drum, synth and effects together according to the volume set by these volume knobs.
ok im done typing for some time... i will do some adjustements to this post later on: and if it gets some serious i will make a good decent, main thread, with the name of the project in the title etc.
Thnx for reading all this and i hope to get some nice feedback... or questions.
greetz bart.
Hello Bart!
First of all, I'd like to say that you are off to a good start by making a detailed project outline.
Although I never done any programing involving audio manipulation I believe I can answer some of the questions you posted here:
1. There are 3 main stream languages to program pocket PCs:
.NET Visual Basic and C#, and native C++ (eVC++)
Unless you can fined .NET objects dedicated to functions you described it will probably be better to use C++ as it will make access to windows API easier.
Also for VB and C# you will need to by Visual Studio 2005, but eVC 4 can be downloaded for free from Microsoft.
2. I estimate this project will take medium to expert programming skill depending on how cooperative windows CE will be with your goals. Hopefully you wont have to access the audio chip directly. Alternatively there may be a .NET component that will make your life very easy try Google.
If you know the mathematics behind the effects you got half the job done and I am sure you will find people to help you with the coding.
So good luck, and remember - people like free software so this project can't be a bad idea!
Ok, with your answers in the back of my mind i did some googling
and i noticed that there is quite some sourcecodes and info for audio programming in c++
check this link for example: http://www.harmony-central.com/Computer/Programming/
Tho in my search i stumbled on another thing... what about java? maybe it wil be a lot easyer in java? and maybe also more compatible? i dunno just guessing here...
anywayz as for the c++ side: i noticed i can download many synths, effects examples/sourcecodes and they are all copyright free. it will be a task of exploring this sources and binding it all together or something similar. is there anyone out there with the c++ guru powers it requires that can guide me in this jungle of data?
edit: o btw does wm5 support DSP ? guess not but worth asking

Application1 to control App2 (VisualStudio2008)

Hello!
I'm developing one application in VS2008 for my pocket pc, and I need some help to continue with it.
I need to make the buttons of the application1 run even when the application2 is running and try to control it with application1 buttons, but I donĀ“t know if it's possible!?
For example, is it possible to move between items on "windows mob. file explorer" using the up and down keys/buttons of application1?
The application1 only fills 1/3 of the screen, and I still seen windows explorer
When I try to do it, the application1 came to the "top" and windows file explorer control seems to be disable.
Is it possible? Any tips for it?
Regards
Have a look into the SendMessage API call. It should be able to do what you want.
Northernmost said:
Have a look into the SendMessage API call. It should be able to do what you want.
Click to expand...
Click to collapse
I agree. You basically need to catch WM_KEYDOWN messages (and any other you want to pass) and send them to file explorer... I think the tricky part is knowing what application is running directly underneath yours. Post here how you did it if you manage to achieve all that
Arlanthir said:
I agree. You basically need to catch WM_KEYDOWN messages (and any other you want to pass) and send them to file explorer... I think the tricky part is knowing what application is running directly underneath yours. Post here how you did it if you manage to achieve all that
Click to expand...
Click to collapse
Hi!
Ok, I will post here the code of application. Take a look at it and say something about.
Here goes the code:
Code:
Imports System
Imports System.Runtime.InteropServices
Public Class Form1
<DllImport("coredll.dll", CallingConvention:=CallingConvention.Winapi, CharSet:=CharSet.Unicode, EntryPoint:="keybd_event", SetLastError:=True)> _
Public Shared Sub keybd_event(ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Integer, ByVal dwExtraInfo As Integer)
End Sub
Private Sub ExitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitButton.Click
'Bye!
Application.Exit()
End Sub
Private Sub UpButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpButton.Click
Const VK_UP As Byte = &H26
keybd_event(VK_UP, 0, 0, 0)
'Up
End Sub
Private Sub LeftButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LeftButton.Click
Const VK_LEFT As Byte = &H25
keybd_event(VK_LEFT, 0, 0, 0)
'Left
End Sub
Private Sub DownButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DownButton.Click
Const VK_DOWN As Byte = &H28
keybd_event(VK_DOWN, 0, 0, 0)
'Down
End Sub
Private Sub RightButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RightButton.Click
Const VK_RIGHT As Byte = &H27
keybd_event(VK_RIGHT, 0, 0, 0)
'Right
End Sub
End Class
Do you think it is possible to control any other application with this?
I don't want only control windows explorer, I want to control other applications, including games.
Tanks for help.
Regards
I'm not getting what you want to do with it.
You're designing something like a userbar that's always staying on top but letting you interact with the application directly underneath it;
OR
You're making a "remote control" application to send various commands to different programs, which you specify hardcoding.
Now the control is an easy one (at least in C++) but actually getting what application is underneath yours may be tricky. Can't help much more there, specially with another language. Have you searched msdn?
Hello.
So, I mean to do a virtual d-pad cause I have one of my pocket pc dont have any!
See this post
This is what I want to do.
I think this will be, like you said, a little bit "tricky".
But, if some one could help, I think it will work.
I don't have many skills programming mobile applications.. so every tips and examples are welcome.
Regards
What? That changes everything! xD
On the first post you said you wanted to make the "up and down buttons" sent to app1 change app2... Well, I thought you were talking hardware keys here
(thus the WM_KEYDOWN event)
What language are you using and in what way do you interact with the touchscreen? Did you understand when I said you had to catch the events?
Basically, you want to catch touchscreen (mouse) events, compare the mouse coordinates to those of your buttons (let's say it was a MOUSEDOWN in the LEFT button area), get the window directly below you and post a WM_KEYDOWN message with the LEFT code to it.
The only problems in doing this in C++ for me right now (I'm also a beginner ) would be creating a window that doesn't cover the screen and getting the window below. The rest is really easy
Arlanthir said:
What? That changes everything! xD
On the first post you said you wanted to make the "up and down buttons" sent to app1 change app2... Well, I thought you were talking hardware keys here
(thus the WM_KEYDOWN event)
What language are you using and in what way do you interact with the touchscreen? Did you understand when I said you had to catch the events?
Basically, you want to catch touchscreen (mouse) events, compare the mouse coordinates to those of your buttons (let's say it was a MOUSEDOWN in the LEFT button area), get the window directly below you and post a WM_KEYDOWN message with the LEFT code to it.
The only problems in doing this in C++ for me right now (I'm also a beginner ) would be creating a window that doesn't cover the screen and getting the window below. The rest is really easy
Click to expand...
Click to collapse
Hi!
I'm using Visual Studio 2008 to code it.
Creating a window that cover only 1/3 of the screen, in VisualStudio is not difficult. If you have VS2008, I can send you the project for your email and so you can take a look at it.
If I understand, you can make this work coding it in C++, so we can share both parts... the 1/3 screen window and the way to make app1 control any other app2, cause I have no idea how to make app1 control app2!!!!!
Tanks.
all bull ****
Guys This Is Crap>>>>>>believe Me
jawad786 said:
Guys This Is Crap>>>>>>believe Me
Click to expand...
Click to collapse
?? Why this "is crap" ??
It's a mobile application development try like any other one!
ImpactMan said:
Hi!
I'm using Visual Studio 2008 to code it.
Creating a window that cover only 1/3 of the screen, in VisualStudio is not difficult. If you have VS2008, I can send you the project for your email and so you can take a look at it.
If I understand, you can make this work coding it in C++, so we can share both parts... the 1/3 screen window and the way to make app1 control any other app2, cause I have no idea how to make app1 control app2!!!!!
Tanks.
Click to expand...
Click to collapse
You are aware that Visual Studio actually lets you code in different languages, I hope.
Arlanthir said:
You are aware that Visual Studio actually lets you code in different languages, I hope.
Click to expand...
Click to collapse
Yes. I know that!
So, you think in C++ is possible to make it work?
Have any idea how to? Any tips?
Tanks for help.
Regards
I've already told you what I do know, now for the rest someone has to dig up the information from msdn... I don't have the time right now, as I'm working on something else on the little spare time I have But if you do find a way to do the rest I'll gladly help you with what I can do now.
Arlanthir said:
I've already told you what I do know, now for the rest someone has to dig up the information from msdn... I don't have the time right now, as I'm working on something else on the little spare time I have But if you do find a way to do the rest I'll gladly help you with what I can do now.
Click to expand...
Click to collapse
OK. Tanks for your availability.
I will try to make some progresses... Let you know than.
Regards.
Google is your friend - http://www.google.co.uk/search?q=compact+framework+sendmessage+send+keystroke
Top of the list (http://www.c-sharpcorner.com/Forums/ShowMessages.aspx?ThreadID=40803) looks promising. Note the use of PostMessage rather than SendMessage. It appears SendMessage requires the target app to have focus to work reliably... where as PostMessage doesn't. You learn something new every day
dont know if ur coding something to control only one specific program, but if its for all programs maybe a sip input panel do the same in an easier way
Northernmost said:
Google is your friend - http://www.google.co.uk/search?q=compact+framework+sendmessage+send+keystroke
Top of the list (http://www.c-sharpcorner.com/Forums/ShowMessages.aspx?ThreadID=40803) looks promising. Note the use of PostMessage rather than SendMessage. It appears SendMessage requires the target app to have focus to work reliably... where as PostMessage doesn't. You learn something new every day
Click to expand...
Click to collapse
Tanks for the links.
I've already take a look at it, and now I'm going to try understand it and try to adapt something like to my application.
I will see the to ways... PostMessage and SendMessage.
Regards.
Keep the development goin! Looks like a very interesting project I'll keep track, since I have an Omnia anyway.
Unfortunately I cannot help since I'm a begginer still stuck on Turbo C++ 3.0 (LOL, seriously-awesome right?)

Interest in a task automater / macro recorder and playback utility?

I wrote a program for Windows 2000/XP called Do It Again ( http://www.spacetornado.com/DoItAgain/ ) that does simple task automation (also called macro recording and playback).
You click "Create a New Task" and it then records all of your keystrokes and mouse clicks in any program until you hit a certain hot key (Scroll Lock by default). You can then run the task back in a number of different ways and it will recreate your keystrokes and mouse clicks... either with the same pauses in between, or it can speed them up. And there are some other options available as well (repeating tasks, manually extending pauses between actions, etc).
I thought something like this might be useful for Windows Mobile devices. I wrote Do It Again in C# using .NET Framework 2.0, so I'm guessing it should be fairly easy to port to .NET Compact Framework 2.0.
But I only want to start porting this to Windows Mobile if there is any interest in it, and if people think they might get some use out of it. I know for me personally there are several things I do on my WinMo device that get repetitive and monotonous... starting and minimizing GPS Test to activate the GPS adapter, dismissing old Notifications, marking all email as Read, etc.
This sounds like a perfect application which can be used for pretty much anything.
Personally, i'm very interested in this, and would be glad to have it ported.
There are a lot of people who're looking to do things the easy way around here, for instance, settings up accounts, changing settings.. and so forth, without having to go 8 clicks...
nir36 said:
This sounds like a perfect application which can be used for pretty much anything.
Personally, i'm very interested in this, and would be glad to have it ported.
There are a lot of people who're looking to do things the easy way around here, for instance, settings up accounts, changing settings.. and so forth, without having to go 8 clicks...
Click to expand...
Click to collapse
I would find this very useful for using both Google Maps and Tom Tom Nav.. Say you want to go somewhere new.. Use google maps to find the address and then activate the script, prime the GPS, load Tom Tom, then copy paste the address info into Tom Tom. One cycle activated by a hot key would be nice.
norkoastal said:
I would find this very useful for using both Google Maps and Tom Tom Nav.. Say you want to go somewhere new.. Use google maps to find the address and then activate the script, prime the GPS, load Tom Tom, then copy paste the address info into Tom Tom. One cycle activated by a hot key would be nice.
Click to expand...
Click to collapse
Yeah that would be a perfect example of how you could use it. And that would be a lot safer to have a task automation app perform those steps for you instead of having to do it yourself while driving.
I'll start working on this in a week or so (as soon as I can get Scrobble finished up and to a point where people stop requesting more features! ) and see if can be ported over.
It should be easy; there are just a couple Win32 library calls it makes that I'm not sure are available in WinMo 6.1:
Code:
// imports mouse_event function from user32.dll
[SRI.DllImport("user32.dll", CharSet = SRI.CharSet.Auto, CallingConvention = SRI.CallingConvention.StdCall)]
public static extern void mouse_event(int dwFlags, int dx, int dy, uint cButtons, uint dwExtraInfo);
// imports keybd_event function from user32.dll
[SRI.DllImport("user32.dll", CharSet = SRI.CharSet.Auto, CallingConvention = SRI.CallingConvention.StdCall)]
public static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, uint dwExtraInfo);
These two functions mouse_event() and keybd_event() poll for all mouse and keyboard events (clicks, movement, keypresses, etc.) globally... in any window, program, and so on.
Does anyone know off the top of their head if user32.dll is also available in Windows Mobile 6.1 Professional?
I am *VERY* interested in this application. How is the porting coming? I can't wait!!!
Man. That would be a revolution for us ppccusumizenerds! Holy ****! ..that would actually be Holy ****!
There is a version of AutoHotKey for Pocket PCs / WinCE, still in development, but a lot of it working, see here http://www.autohotkey.com/forum/topic27146.html&highlight=wince.
I'm very interested. In fact, I was looking for such an application but gave up finding.
Looking forward.
Thanks.
Hi,
if it's getting as good as Scrobble, then I vote for it . This would be a very handy feature, moreover very clever.
I would test it with pleasure.
Greets.
It will be a very useful app!
Looking forward to it, in the meanwhile I'll play with XP version!!

[Q] (Development - First app) Can somebody let me know why I'm getting a force quit?

Hello XDA, I'm trying to write (what I believe to be) a simple app; a calculator with storage buttons. I've gotten the basic layout and initialized the core components. Yet, when I add on-click listeners, there's a force quit when testing. Attached is the Java class and xml. I've tried very hard to figure out what it is; I've even tried simply putting a println statement in the on-click listener. It doesn't even do THAT
Also, if there's anything (AT ALL) that you could criticize me on in terms of code organization, standards, etc. PLEASE let me know. I'm a newbie, and it's better to kick bad coding habits before they grow strong!
Thanks in advance, guys. I know it's annoying to debug others code, especially beginners, but I don't think it'll take much time at all, and I'd like to think I'm a relatively organized beginner
So I found out what it was; EditText doesn't accept ints or doubles as parameters. There's got to be an easier way of doing this, though. Is there any calculator-window-type objects that will store ints and/or (preferrably or) doubles? It's doable, but highly annoying to cast everything to a string and then parse it back to a numerical data type to perform operations on it.

Android SDK - high level - for the pros out there

Question for you Android SDK wizzes out there.
I was wondering if anyone can explain from a high level how Android SDK or any SDK works. I know android runs off java, but was hoping how an SDK helps you design an app.
Also, is there an Android App editor out there? (Similar to an HTML editor to help you make websites). basically I am looking for a way to make a simple android app without needing to know too much java.
Thanks,
You could check out Google Inventor.
It's really easiest just to answer your questions with links:
SDK
http://en.wikipedia.org/wiki/Software_development_kit
App editor for non-coders:
http://appinventor.googlelabs.com/about/
Android SDK:
http://developer.android.com/sdk/index.html
What is in it:
http://developer.android.com/sdk/installing.html
Eclipse, the IDE most people use to develop Java Android apps:
http://www.eclipse.org/screenshots/
Thanks guys!
Does anyone know what good books on java you would recommend for someone just starting out to program android apps?
In addition, can someone point me in the direction of what specific skills i need (after learning java) I would need in order to program something similar to what I am about to describe:
Make a plugin for an android game (that a friend has developed, so I have the game source code) that can read in-game achievements and display a different advertisement depending on what in-game achievement is reached. So i'm not really programming an app, but a backend program...if that makes sense which would connect to a server to obtain the display advertising corresponding to the in-game acheivement.
Using angry birds as an example:
- if i hit level 5 - display an ad from Bestbuy
- if i hit level 10 - display an ad from futureshop
Thanks again!
Here are some basic Java tutorials;
http://download.oracle.com/javase/tutorial/
A lot of android information and examples here;
http://developer.android.com/guide/topics/ui/index.html
Check out Admob or doubleclick for serving ads;
http://developer.admob.com/wiki/Android
http://code.google.com/mobile/afma_ads/docs/android/doubleclick/
I don't think you can do what you're asking as a plug-in, (don't think there really is a plug-in equivalent in android, unless it's maybe a jar file or a service. Then you're getting way beyond what a novice programmer would be capable of). But I'm a rookie myself. So maybe someone else can tell you better.
________________________________
http://ron-droid.blogspot.com
misc86 said:
Thanks guys!
Does anyone know what good books on java you would recommend for someone just starting out to program android apps?
In addition, can someone point me in the direction of what specific skills i need (after learning java) I would need in order to program something similar to what I am about to describe:
Make a plugin for an android game (that a friend has developed, so I have the game source code) that can read in-game achievements and display a different advertisement depending on what in-game achievement is reached. So i'm not really programming an app, but a backend program...if that makes sense which would connect to a server to obtain the display advertising corresponding to the in-game acheivement.
Using angry birds as an example:
- if i hit level 5 - display an ad from Bestbuy
- if i hit level 10 - display an ad from futureshop
Thanks again!
Click to expand...
Click to collapse
You would have to get an ad partnership with Bestbuy and Futureshop to do that, ad "plug ins" are just random ads that pop up, so when you add Admob to an app Admob decides what ad will appear.
misc86 said:
Make a plugin for an android game (that a friend has developed, so I have the game source code) that can read in-game achievements and display a different advertisement depending on what in-game achievement is reached. So i'm not really programming an app, but a backend program...if that makes sense which would connect to a server to obtain the display advertising corresponding to the in-game acheivement.
Click to expand...
Click to collapse
it wouldn't be a plugin per se, but it would depend on how your friend calls the ad code. i'm not familiar with admob codes and so on, but you should be querying a php/asp file from a server and passing a level argument, which is then parsed, and relevant ad code returned in exchange. i'm not sure if android can accept 3rdparty js like this, but i'd assume it can.
call to ads: http://somedomain.com/friends-game/ads.php?level=12
ads.php
Code:
<?php
$adcodes = array();
$adcodes[] = "....."; // adcode for first levels, e.g. 1-4
$adcodes[] = "....."; // adcode for first levels, e.g. 5-9
//... etc
// check level is valid number, greater than 0, and less than max amount of levels
if (ctype_digit($_GET['level']) && $_GET['level'] > 0 && $_GET['level'] < 100){
// return the correct ad code -
print $adcodes[floor($_GET['level'] / 5)];
}
exit;
with my mid-morning pre-coffee head on, that'll probably accomplish what you want
you could add extra to it, by passing a "clientid" arg to the script call for your "purposes"

Categories

Resources