Esempio n. 1
0
ComponentResult		AUMonotimbralInstrumentBase::RealTimeStartNote(	
															SynthGroupElement 			*inGroup, 
															NoteInstanceID 				inNoteInstanceID, 
															UInt32 						inOffsetSampleFrame, 
															const MusicDeviceNoteParams &inParams)
{
#if DEBUG_PRINT_RENDER
	printf("AUMonotimbralInstrumentBase::RealTimeStartNote %d\n", inNoteInstanceID);
#endif

	if (NumActiveNotes() + 1 > MaxActiveNotes()) 
	{
		VoiceStealing(inOffsetSampleFrame, false);
	}
	SynthNote *note = GetAFreeNote(inOffsetSampleFrame);
	if (!note) return -1;
	
	IncNumActiveNotes();
	note->AttackNote(NULL, inGroup, inNoteInstanceID, 
			mAbsoluteSampleFrame + inOffsetSampleFrame, inOffsetSampleFrame, inParams);
			
	inGroup->mNoteList[kNoteState_Attacked].AddNote(note);
	return noErr;
}
Esempio n. 2
0
OSStatus			AUMonotimbralInstrumentBase::RealTimeStartNote(	
															SynthGroupElement 			*inGroup, 
															NoteInstanceID 				inNoteInstanceID, 
															UInt32 						inOffsetSampleFrame, 
															const MusicDeviceNoteParams &inParams)
{
#if DEBUG_PRINT_RENDER
	printf("AUMonotimbralInstrumentBase::RealTimeStartNote %d\n", inNoteInstanceID);
#endif

	if (NumActiveNotes() + 1 > MaxActiveNotes()) 
	{
		VoiceStealing(inOffsetSampleFrame, false);
	}
	SynthNote *note = GetAFreeNote(inOffsetSampleFrame);
	if (!note) return -1;
	
	SynthPartElement *part = GetPartElement (0);	// Only one part for monotimbral
	
	IncNumActiveNotes();
	inGroup->NoteOn(note, part, inNoteInstanceID, inOffsetSampleFrame, inParams);
	
	return noErr;
}