View Single Post
Old 27 July 2012, 11:52   #3
deg
 
Posts: n/a
I know I'm going to get flamed for this, but I think this is exactly the sort of thing you should be using a raspberry pi for, take a look at http://www.raspberrypi.org/ (some of the older posts at the bottom and beyond) for what people are making with a pi, 30 quid, compact flash and no moving parts, loads of ports, tiny size, low power requirements, has the "gcc" c compiler on it and required libraries right out of the box, probably lots of example projects to use for both audio and port/midi development, 16-bit quality samples rather than the 8 bit on the amiga, more than 4 samples can be played at a time etc etc. one of the most important things when making a project is to get other people involved, or join a project with other people, the social aspect will cause you to finish the project and get more enjoyment out of it, there may already be drumkit projects out there on sourceforge, github, googlecode etc that are just waiting for you to join them...

But i understand completely why you would want to use an amiga, I have some friends who also do projects involving amigas, even though they are not practical, just because it is more fun to develop on amigas :-D

for c programming advice on the amiga, playing the actual samples is trivial and will take a few lines of code and there is alot of example source code on the amiga documentation supplied by commodore. but with c programming, it is important to "stand on the shoulders of giants" and use code that other people have already written. just like the metaphor of using a television, what is inside the television is very complex, but the interface is very simple (on/off, volume up/down, channel up/down). in the c programming equivalent, instead of hitting the commodore hardware or "dos/exec" etc library documentation/manuals, you should use already written code to load and play samples, for example there is some iff example source code that was released by electronic arts and commodore on the early fred fish discs (#16, #64, #0232?), which loads an iff sample and plays it. using a library like this allows you to think about the project at a higher level and get results faster:

int main()
{
IffSample *pSnare = load_sample("snare.iff");
IffSample *pBase = load_sample("bass.iff");
IffSample *pTom = load_sample("tom.iff");
IffSample *pCymbal = load_sample("cymbal.iff");

while(get_key())
{
if (key == escape)
break;
else if (key == '1')
play_sample(pSnare);
else if (key == '2')
play_sample(pBase);
else if (key == '3')
play_sample(pTom);
else if (key == '4')
play_sample(pCymbal);
}

return 0;
}

the hard part will be the serial/parallel port communication, but just like the above, we want to get something working quickly so the project will be fun and rewarding, so instead of hitting the serial port manuals/documentation, we'll look for c/c++ libraries or programs that have already been written that we can use, so hit aminet, google/bing search for "amiga serial port source code" that sort of thing.

can you imagine changing the above code to something as follows?:

int main()
{
if (!init_serial_port_or_midi_library())
printf("error, cannot init serial port or midi library\n");

IffSample *pSnare = load_sample("snare.iff");
IffSample *pBase = load_sample("bass.iff");
IffSample *pTom = load_sample("tom.iff");
IffSample *pCymbal = load_sample("cymbal.iff");

while(get_key_from_serial_port_or_midi_library()) // this line changed!
{
if (key == escape)
break;
else if (key == '1')
play_sample(pSnare);
else if (key == '2')
play_sample(pBase);
else if (key == '3')
play_sample(pTom);
else if (key == '4')
play_sample(pCymbal);
}

return 0;
}

So the first step in your project will simply be to get a c compiler installed, find and download some example source code, compile it and see if you can find something that will allow you to get a project up and running in some days rather than months.
 
 
Page generated in 0.07507 seconds with 9 queries