Exemplo n.º 1
0
void process_midi(size_t frame, uint8_t ev[3])
{
	if (ev[0] == 0xb0 && ev[1] == 0x7f) {			// controller no. 127
		alpha = 1.0f - ev[2] / 127.0f;	//-make alpha goes slower when
		alpha = 1.0f - alpha * alpha;	// reaching 1
		comp_alpha = 1.0f - alpha;		//-complementary of alpha

		printf("alpha = %4.4f", alpha);
		if (ev[2] == 0) puts("  original sound");
		else if (ev[2] == 0x7f) puts("  complete silence");
		else putchar('\n');
	}
	else if (ev[0] == 0xb0 && ev[1] == 0x7e) {		// controller no. 126
		note_duration = ev[2] / 31.0f;
		printf("len = %2.2f\n", note_duration);
	}
	else if (ev[0] >= 0x90 && ev[0] <= 0xa0) {		// note on in channel 0
		sound_select(ev[0] - 0x90);
		synth_add(ev[1], note_duration, ev[2] / 127.0f);
		printf("note = %2.2x    vol %2.2f    sound %x\n",
				ev[1], ev[2] / 127.0f, ev[0]-0x90);
	}
//	else printf("unknown: %2.2x: %2.2x(% 3d) %2.2x(% 3d)\n",
//			ev[0], ev[1], ev[1], ev[2], ev[2]);
}
Exemplo n.º 2
0
static int __init acntpc_init(void)
{
	return synth_add(&synth_acntpc);
}
static int __init spkout_init(void)
{
	return synth_add(&synth_spkout);
}
static int __init audptr_init(void)
{
	return synth_add(&synth_audptr);
}
Exemplo n.º 5
0
static int __init decpc_init(void)
{
	return synth_add(&synth_dec_pc);
}
Exemplo n.º 6
0
static int __init dtlk_init(void)
{
	return synth_add(&synth_dtlk);
}
Exemplo n.º 7
0
static int __init decext_init(void)
{
	return synth_add(&synth_decext);
}
Exemplo n.º 8
0
static int __init apollo_init(void)
{
	return synth_add(&synth_apollo);
}
static int __init keypc_init(void)
{
	return synth_add(&synth_keypc);
}
Exemplo n.º 10
0
static int __init txprt_init(void)
{
	return synth_add(&synth_txprt);
}
Exemplo n.º 11
0
static int __init bns_init(void)
{
	return synth_add(&synth_bns);
}
Exemplo n.º 12
0
static int __init soft_init(void)
{
	return synth_add(&synth_soft);
}
Exemplo n.º 13
0
static int __init acntsa_init(void)
{
	return synth_add(&synth_acntsa);
}