Beispiel #1
0
// messages received from jcom.hub for the algorithm
void out_algorithm_message(t_out *x, t_symbol *msg, long argc, t_atom *argv)
{
	if(argc < 2)
		return;
		
	if(argv->a_type == A_SYM){
// jamoma 0.4
//		if((argv->a_w.w_sym == jps_slash_audio_gain_midi) || (argv->a_w.w_sym == jps_audio_gain_midi)){
// jamoma 0.5
		if((argv->a_w.w_sym == gensym("/audio/gain")) || (argv->a_w.w_sym == gensym("audio/gain")) || (argv->a_w.w_sym == gensym("gain")) || (argv->a_w.w_sym == gensym("/gain"))){
			// Do gain control here...
			// Should be that the gain change triggers a short tt_ramp to the new value
			x->attr_gain = atom_getfloat(argv+1);	// store as midi values
#ifdef JCOM_OUT_TILDE
			x->gain->setAttributeValue(TT("midiGain"), x->attr_gain);
#endif
		}
		else if((argv->a_w.w_sym == jps_audio_mute) || (argv->a_w.w_sym == jps_slash_audio_mute) || (argv->a_w.w_sym == gensym("mute")) || (argv->a_w.w_sym == gensym("/mute"))){
			x->attr_mute = atom_getlong(argv+1);
#ifdef JCOM_OUT_TILDE
			if(x->attr_mute)
				x->gain->setAttributeValue(TT("linearGain"), 0.0);
			else 
				x->gain->setAttributeValue(TT("midiGain"), x->attr_gain);			
#endif
		}
		else if((argv->a_w.w_sym == jps_audio_bypass) || (argv->a_w.w_sym == jps_slash_audio_bypass) || (argv->a_w.w_sym == gensym("bypass")) || (argv->a_w.w_sym == gensym("/bypass"))){
			x->attr_bypass = atom_getlong(argv+1);
#ifdef JCOM_OUT_TILDE
			if(x->attr_bypass == 0)
				x->xfade->setAttributeValue(TT("position"), x->attr_mix * 0.01);
			else
				x->xfade->setAttributeValue(TT("position"), 0.0);
#endif
		}
		else if((argv->a_w.w_sym == jps_audio_mix) || (argv->a_w.w_sym == jps_slash_audio_mix) || (argv->a_w.w_sym == gensym("mix")) || (argv->a_w.w_sym == gensym("/mix"))){
			x->attr_mix = atom_getfloat(argv+1);
#ifdef JCOM_OUT_TILDE
			if(x->attr_bypass == 0)
				x->xfade->setAttributeValue(TT("position"), x->attr_mix * 0.01);		
#endif
		}
		else if((argv->a_w.w_sym == jps_audio_meters_freeze) || (argv->a_w.w_sym == jps_slash_audio_meters_freeze) || (argv->a_w.w_sym == gensym("freeze")) || (argv->a_w.w_sym == gensym("/freeze"))){
			x->attr_defeat_meters = atom_getlong(argv+1);
		}
		else if((argv->a_w.w_sym == jps_video_preview) || (argv->a_w.w_sym == jps_slash_video_preview) || (argv->a_w.w_sym == gensym("preview")) || (argv->a_w.w_sym == gensym("/preview")))
			x->attr_preview = atom_getlong(argv+1);
	}
}
static void amd_decode_dc_mce(struct mce *m)
{
	u16 ec = EC(m->status);
	u8 xec = XEC(m->status, xec_mask);

	pr_emerg(HW_ERR "Data Cache Error: ");

	
	if (TLB_ERROR(ec)) {
		if (TT(ec) == TT_DATA) {
			pr_cont("%s TLB %s.\n", LL_MSG(ec),
				((xec == 2) ? "locked miss"
					    : (xec ? "multimatch" : "parity")));
			return;
		}
	} else if (fam_ops->dc_mce(ec, xec))
		;
	else
		pr_emerg(HW_ERR "Corrupted DC MCE info?\n");
}
Beispiel #3
0
static void decode_mc0_mce(struct mce *m)
{
	u16 ec = EC(m->status);
	u8 xec = XEC(m->status, xec_mask);

	pr_emerg(HW_ERR "MC0 Error: ");

	/* TLB error signatures are the same across families */
	if (TLB_ERROR(ec)) {
		if (TT(ec) == TT_DATA) {
			pr_cont("%s TLB %s.\n", LL_MSG(ec),
				((xec == 2) ? "locked miss"
					    : (xec ? "multimatch" : "parity")));
			return;
		}
	} else if (fam_ops->mc0_mce(ec, xec))
		;
	else
		pr_emerg(HW_ERR "Corrupted MC0 MCE info?\n");
}
Beispiel #4
0
// DSP Method: Adds our perform method to the DSP call chain
void balance_dsp(t_balance *x, t_signal **sp, short *count)
{
	short		i, j, k, l=0;
	void		**audioVectors = NULL;
	
	audioVectors = (void**)sysmem_newptr(sizeof(void*) * ((x->maxNumChannels * 3) + 1));
	audioVectors[l] = x;
	l++;
	
	// audioVectors[] passed to balance_perform() as {x, audioInL[0], audioInR[0], audioOut[0], audioInL[1], audioInR[1], audioOut[1],...}
	x->numChannels = 0;
	x->vs = 0;
	for (i=0; i < x->maxNumChannels; i++) {
		j = x->maxNumChannels + i;
		k = x->maxNumChannels*2 + i;
		if (count[i] && count[j] && count[k]) {
			x->numChannels++;
			if (sp[i]->s_n > x->vs)
				x->vs = sp[i]->s_n;

			audioVectors[l] = sp[i]->s_vec;
			l++;
			audioVectors[l] = sp[j]->s_vec;
			l++;
			audioVectors[l] = sp[k]->s_vec;
			l++;
		}
	}
	
	x->audioOut->setAttributeValue(kTTSym_numChannels, x->numChannels*2);
	x->audioOut->setAttributeValue(kTTSym_numChannels, x->numChannels);
	x->audioIn->setAttributeValue(kTTSym_vectorSize, x->vs);
	x->audioOut->setAttributeValue(kTTSym_vectorSize, x->vs);
	//audioIn will be set in the perform method
	x->audioOut->sendMessage(TT("alloc"));
	
	x->balance->setAttributeValue(kTTSym_sampleRate, sp[0]->s_sr);
	
	dsp_addv(balance_perform, l, audioVectors);
	sysmem_freeptr(audioVectors);
}
TTAudioGraphObject :: TTAudioGraphObject (TTValue& arguments) : TTGraphObject(arguments),
	mAudioFlags(kTTAudioGraphProcessor), 
	mInputSignals(NULL), 
	mOutputSignals(NULL), 
	mVectorSize(0)
{
	TTErr		err = kTTErrNone;
	TTSymbolPtr	wrappedObjectName = NULL;
	//TTUInt16	initialNumChannels = 1;
	TTUInt16	numInlets = 1;
	TTUInt16	numOutlets = 1;
	
	TT_ASSERT(audiograph_correct_instantiation_arg_count, arguments.getSize() > 0);

	arguments.get(0, &wrappedObjectName);
	if (arguments.getSize() > 1)
		arguments.get(1, numInlets);
	if (arguments.getSize() > 2)
		arguments.get(2, numOutlets);
	
	// instantiated by the TTGraph super-class
	//err = TTObjectInstantiate(wrappedObjectName, &mUnitGenerator, initialNumChannels);
	err = TTObjectInstantiate(kTTSym_audiosignalarray, (TTObjectPtr*)&mInputSignals, numInlets);
	err = TTObjectInstantiate(kTTSym_audiosignalarray, (TTObjectPtr*)&mOutputSignals, numOutlets);
	
	mAudioInlets.resize(numInlets);
	mInputSignals->setMaxNumAudioSignals(numInlets);
	mInputSignals->numAudioSignals = numInlets;			// TODO: this array num signals access is kind of clumsy and inconsistent [tap]

	mAudioOutlets.resize(numOutlets);
	mOutputSignals->setMaxNumAudioSignals(numOutlets);
	mOutputSignals->numAudioSignals = numOutlets;

	// if an object supports the 'setOwner' message, then we tell it that we want to become the owner
	// this is particularly important for the dac object
	TTValue v = TTPtr(this);
	mKernel->sendMessage(TT("setOwner"), v);
	
	if (!sSharedMutex)
		sSharedMutex = new TTMutex(false);
}
void MidiOutGetDeviceNames(MidiOutPtr self)
{
	TTValue		v;
	TTErr		err;
	AtomCount	ac;
	AtomPtr		ap;
	TTSymbol	name;
	
	err = self->graphObject->mKernel->sendMessage(TT("getAvailableDeviceNames"), kTTValNONE, v);
	if (!err) {
		ac = v.getSize();
		ap = new Atom[ac];
		
		for (AtomCount i=0; i<ac; i++) {
			v.get(i, name);
			atom_setsym(ap+i, gensym((char*)name.c_str()));
		}
		object_obex_dumpout(self, gensym("getAvailableDeviceNames"), ac, ap);
		delete ap;
	}
}
t_jit_err StencilGetStepSize(StencilObjectPtr self, Ptr attr, AtomCount* ac, AtomPtr* av)
{
	TTValue		v;
	
	if (*ac && *av) {
		; // memory passed-in, use it
	}
	else {
		*av = (AtomPtr)sysmem_newptr(sizeof(Atom)*2);
	}
	*ac = 2;
	
	self->stencilObject->getAttributeValue(TT("stepSize"), v);
	for (AtomCount k=0; k < *ac; k++) {
		TTInt32 step;
		
		v.get(k, step);
		atom_setlong((*av)+k, step);
	}
	return JIT_ERR_NONE;
}
	HallLoginFailed(LoginResult eRes)
	{
		switch(eRes)
		{
		case LOGIN_EXIST:
			m_kTitle = TT("LoginExistTitle");
			m_kContent = TT("LoginExistContent");
			break;
		case LOGIN_WRONG_VERSION:
			m_kTitle = TT("LoginWrongTitle");
			m_kContent = TT("LoginWrongContent");
			break;
		default:
			m_kTitle = TT("LoginTitle");
			m_kContent = TT("LoginContent");
			break;
		}
		m_kEnter = TT("Confirm");
	}
Beispiel #9
0
NSPStatus 
Namespace::namespaceAttributeSet(std::string address, TTSymbolPtr attribute, TTValue value, int instance)
{
	TTErr		err, err1;
	TTList		returnedTTNodes;
	TTNodePtr	firstReturnedTTNode;

	if (NSPDirectory) {
		// add Application name to the address
		std::string absAddress = AppName + address;

		// add instance number
		if (instance != 0) {
			absAddress += ".";
			stringstream st;
			st << instance;
			absAddress += st.str();
		}

		err = NSPDirectory->Lookup(TT(absAddress), returnedTTNodes, &firstReturnedTTNode);

		if (err != kTTErrNone) {
			return NSP_INVALID_ADDRESS;
		}

		TTObjectPtr param = firstReturnedTTNode->getObject();

		if (param != NULL) {
			err1 = param->setAttributeValue(attribute, value);
		}

		if (err1 != kTTErrNone) {
			return NSP_INVALID_ATTRIBUTE;
		}

		return NSP_NO_ERROR;
	}

	return NSP_INIT_ERROR;
}
void ramp_attrget(t_ramp *x, t_symbol *msg, long argc, t_atom *argv)
{
	t_atom*		a;
	TTSymbol*	parameterName;
	TTValue		parameterValue;
	int			numValues;
	int			i;
	TTSymbol*	tempSymbol;
	double		tempValue;
	
	if (!argc) {
		error("jcom.ramp: not enough arguments to parameter.get");
		return;
	}
	
	parameterName = TT(atom_getsym(argv)->s_name);
	x->rampUnit->getAttributeValue(parameterName, parameterValue);
	numValues = parameterValue.getSize();

	if (numValues) {
		a = (t_atom *)sysmem_newptr(sizeof(t_atom) * (numValues+1));
		// First list item is name of parameter
		atom_setsym(a, gensym((char*)parameterName->getCString()));
		// Next the whole shebang is copied
		for (i=0; i<numValues; i++) {
			if (parameterValue.getType(i) == kTypeSymbol) {
				parameterValue.get(i, &tempSymbol);
				atom_setsym(a+i+1, gensym((char*)tempSymbol->getCString()));
			}
			else {
				parameterValue.get(i, tempValue);
				atom_setfloat(a+i+1, tempValue);
			}
		}
		object_obex_dumpout(x, gensym("current.parameter"), numValues+1, a);
	
		// The pointer to an atom assign in the getParameter method needs to be freed.
		sysmem_freeptr(a);
	}
}
Beispiel #11
0
BlueSaturation::BlueSaturation(audioMasterCallback audioMaster) :
	AudioEffectX(audioMaster, kNumPresets, kNumParameters), 
	mNumChannels(2),
	mOverdrive(NULL),
	mInput(NULL),
	mOutput(NULL)
{
	TTDSPInit();
	
	setNumInputs(2);		// stereo in
	setNumOutputs(2);		// stereo out
	setUniqueID('TTOv');	// identify
	canProcessReplacing();	// supports replacing output
	canDoubleReplacing();	// supports double precision processing

	TTObjectInstantiate(TT("overdrive"), &mOverdrive, mNumChannels);
	TTObjectInstantiate(kTTSym_audiosignal, &mInput, mNumChannels);
	TTObjectInstantiate(kTTSym_audiosignal, &mOutput, mNumChannels);
	
	mParameterList = new BlueParameter[kNumParameters];

	strncpy(mParameterList[kParameterDrive].name, "drive", 256);
	mParameterList[kParameterDrive].scaling = 9.0;
	mParameterList[kParameterDrive].offset = 1.0;

	strncpy(mParameterList[kParameterPreamp].name, "preamp", 256);
	mParameterList[kParameterPreamp].scaling = 96.0;
	mParameterList[kParameterPreamp].offset = -78.0;

	strncpy(mParameterList[kParameterMode].name, "mode", 256);
	mParameterList[kParameterMode].scaling = 2.0;		// just round this one
	mParameterList[kParameterMode].offset = 0.5;

	strncpy(mParameterList[kParameterBlockDC].name, "dcblocker", 256);
	mParameterList[kParameterBlockDC].scaling = 1.0;	// just round this one
	mParameterList[kParameterBlockDC].offset = 0.5;
	
	vst_strncpy(programName, "Default", kVstMaxProgNameLen);	// default program name
}
Beispiel #12
0
	/**
	 * main follower routine. Fills all members and return true on success.
	 *  Otherwise returns false if track can't be followed.
	 */
	inline bool Follow(TileIndex old_tile, Trackdir old_td)
	{
		m_old_tile = old_tile;
		m_old_td = old_td;
		m_err = EC_NONE;
		assert(((TrackStatusToTrackdirBits(GetTileTrackStatus(m_old_tile, TT(), IsRoadTT() && m_veh != NULL ? RoadVehicle::From(m_veh)->compatible_roadtypes : 0)) & TrackdirToTrackdirBits(m_old_td)) != 0) ||
		       (IsTram() && GetSingleTramBit(m_old_tile) != INVALID_DIAGDIR)); // Disable the assertion for single tram bits
		m_exitdir = TrackdirToExitdir(m_old_td);
		if (ForcedReverse()) return true;
		if (!CanExitOldTile()) return false;
		FollowTileExit();
		if (!QueryNewTileTrackStatus()) return TryReverse();
		if (!CanEnterNewTile()) return false;
		m_new_td_bits &= DiagdirReachesTrackdirs(m_exitdir);
		if (m_new_td_bits == TRACKDIR_BIT_NONE) {
			/* In case we can't enter the next tile, but are
			 * a normal road vehicle, then we can actually
			 * try to reverse as this is the end of the road.
			 * Trams can only turn on the appropriate bits in
			 * which case reaching this would mean a dead end
			 * near a building and in that case there would
			 * a "false" QueryNewTileTrackStatus result and
			 * as such reversing is already tried. The fact
			 * that function failed can have to do with a
			 * missing road bit, or inability to connect the
			 * different bits due to slopes. */
			if (IsRoadTT() && !IsTram() && TryReverse()) return true;
			m_err = EC_NO_WAY;
			return false;
		}
		if (!Allow90degTurns()) {
			m_new_td_bits &= (TrackdirBits)~(int)TrackdirCrossesTrackdirs(m_old_td);
			if (m_new_td_bits == TRACKDIR_BIT_NONE) {
				m_err = EC_90DEG;
				return false;
			}
		}
		return true;
	}
Beispiel #13
0
TTErr TTEnvironment::releaseInstance(TTObjectPtr* anObject)
{
	TTValue v = **anObject;
	
	TT_ASSERT("can only release a valid instance", *anObject && (*anObject)->valid == 1 && (*anObject)->referenceCount);
	
	(*anObject)->valid = false;
	(*anObject)->observers->iterateObjectsSendingMessage(TT("objectFreeing"), v);
	
	// If the object is locked (e.g. in the middle of processing a vector in another thread) 
	//	then we spin until the lock is released
	//	TODO: we should also be able to time-out in the event that we have a dead lock.
	while ((*anObject)->getlock())
		;

	(*anObject)->referenceCount--;
	if ((*anObject)->referenceCount < 1) {
		delete *anObject;
		*anObject = NULL;
	}
	return kTTErrNone;
}
Beispiel #14
0
IGL_INLINE void igl::MeshCutterMini<DerivedV, DerivedF, VFType, DerivedTT, DerivedC>::
FindInitialPos(const int vert,
               int &edge,
               int &face)
{
  int f_init;
  int edge_init;
  FirstPos(vert,f_init,edge_init); // todo manually the function
  igl::HalfEdgeIterator<DerivedF> VFI(F,TT,TTi,f_init,edge_init);

  bool vertexB = V_border[vert];
  bool possible_split=false;
  bool complete_turn=false;
  do
  {
    int curr_f = VFI.Fi();
    int curr_edge=VFI.Ei();
    VFI.NextFE();
    int next_f=VFI.Fi();
    ///test if I've just crossed a border
    bool on_border=(TT(curr_f,curr_edge)==-1);
    //bool mismatch=false;
    bool seam=false;

    ///or if I've just crossed a seam
    ///if I'm on a border I MUST start from the one next t othe border
    if (!vertexB)
      //seam=curr_f->IsSeam(next_f);
      seam=IsSeam(curr_f,next_f);
    //    if (vertexB)
    //      assert(!Handle_Singular(vert));
    //    ;
    //assert(!vert->IsSingular());
    possible_split=((on_border)||(seam));
    complete_turn = next_f == f_init;
  } while ((!possible_split)&&(!complete_turn));
  face=VFI.Fi();
  edge=VFI.Ei();
}
Beispiel #15
0
NSPStatus 
Namespace::namespaceAttributeGet(std::string address, TTSymbolPtr attribute, TTValue& value, int instance)
{
	TTList			aNodeList;
	TTNodePtr		aNode;
	TTErr			err;

	// add Application name to the address
	std::string absAddress = AppName + address;

	// add instance number
	if (instance != 0) {
		absAddress += ".";
		stringstream st;
		st << instance;
		absAddress += st.str();
	}

	// get the node which represent our data at the given address
	err = NSPDirectory->Lookup(TT(absAddress), aNodeList, &aNode);

	if (err != kTTErrNone) {
		//TTLogMessage("Invalid address \n");
		return NSP_INVALID_ADDRESS;
	}

	// get the object stored in the node
	TTObjectPtr anObject = aNode->getObject();

	// get the attribute value of the data
	value.clear();
	err = anObject->getAttributeValue(attribute, value);
	if (err != kTTErrNone) {
		return NSP_INVALID_ATTRIBUTE;
	}

	return NSP_NO_ERROR;
}
Beispiel #16
0
// Create
TTPtr FFTNew(SymbolPtr s, AtomCount argc, AtomPtr argv)
{
	short i;
	
	FFTPtr self = (FFTPtr)object_alloc(sFFTClass);
	if (self) {
		object_obex_store((TTPtr)self, _sym_dumpout, (object*)outlet_new(self, NULL));	// dumpout
		
		self->numChannels = 1;
		
		dsp_setup((t_pxobject*)self, self->numChannels);	// Create Object and N Inlets (last argument)
		self->obj.z_misc = Z_NO_INPLACE;							// ESSENTIAL!   		
		for (i=0; i< (self->numChannels*2); i++)
			outlet_new((t_pxobject*)self, "signal");
		
		TTObjectInstantiate(TT("fft"),			&self->fft,			self->numChannels);
		TTObjectInstantiate(kTTSym_audiosignal,	&self->audioIn,		self->numChannels);
		TTObjectInstantiate(kTTSym_audiosignal,	&self->audioOut,	self->numChannels);
				
		attr_args_process(self, argc, argv);
	}
	return (self);
}
Beispiel #17
0
void *dataspace_new(t_symbol *name, long argc, t_atom *argv)
{
	t_dataspace *self;
	TTValue		none;
	
	self = (t_dataspace *)object_alloc(dataspace_class);
	if (self) {
		object_obex_store((void*)self, _sym_dumpout, (object*)outlet_new(self, NULL));

        // Make sure that environment sample rate is set correctly at instantiated,
        // as it is used by time dataspace for conversions to and from sample
        TTValue		sr(sys_getsr());
        ttEnvironment->setAttributeValue(kTTSym_sampleRate, sr);
        
        self->outlet_native = outlet_new(self, 0);
		TTObjectBaseInstantiate(TT("dataspace"), &self->dataspace, none);
		
		attr_args_process(self, argc, argv);
		if (!self->dataspace)
			object_attr_setsym(self, gensym("dataspace"), gensym("temperature"));
	}
	return self;
}
Beispiel #18
0
// DSP Method
void op_dsp(t_op *x, t_signal **sp, short *count)
{
	short		i, j, k=0;
	void		**audioVectors = NULL;

	audioVectors = (void**)sysmem_newptr(sizeof(void*) * ((x->maxNumChannels * 2) + 1));
	audioVectors[k] = x;
	k++;
	
	x->numChannels = 0;
	x->vs = 0;
	for(i=0; i < x->maxNumChannels; i++){
		j = x->maxNumChannels + i;
		if(count[i] && count[j]){
			x->numChannels++;
			if(sp[i]->s_n > x->vs)
				x->vs = sp[i]->s_n;
				
			audioVectors[k] = sp[i]->s_vec;
			k++;
			audioVectors[k] = sp[j]->s_vec;
			k++;
		}
	}
	
	x->audioIn->setAttributeValue(kTTSym_numChannels, x->maxNumChannels);
	x->audioOut->setAttributeValue(kTTSym_numChannels, x->maxNumChannels);
	x->audioIn->setAttributeValue(kTTSym_vectorSize, x->vs);
	x->audioOut->setAttributeValue(kTTSym_vectorSize, x->vs);
	//audioIn will be set in the perform method
	x->audioOut->sendMessage(TT("alloc"));
	
	x->op->setAttributeValue(kTTSym_sampleRate, sp[0]->s_sr);
	
	dsp_addv(op_perform, k, audioVectors);
	sysmem_freeptr(audioVectors);
}
Beispiel #19
0
void Mesh::skin(uint start) {
  intA TT;
  uintA Tt;
  getTriNeighborsList(*this, Tt, TT);
  arr Tn;
  getTriNormals(*this, Tn);
  
  uintA goodTris;
  boolA added(T.d0);
  goodTris.append(start);
  added=false;
  added(start)=true;
  uint t, tt, r, i, k;
  int m;
  double p, mp=0;
  for(k=0; k<goodTris.N; k++) {
    t=goodTris(k);
    for(r=0; r<3; r++) {
      //select from all neighbors the one most parallel
      m=-1;
      for(i=0; i<Tt(t, r); i++) {
        tt=TT(t, r, i);
        p=scalarProduct(Tn[t], Tn[tt]);
        if(m==-1 || p>mp) { m=tt; mp=p; }
      }
      if(m!=-1 && !added(m)) { goodTris.append(m); added(m)=true; }
    }
  }
  
  uintA Tnew(k, 3);
  for(k=0; k<goodTris.N; k++) {
    t=goodTris(k);
    Tnew(k, 0)=T(t, 0); Tnew(k, 1)=T(t, 1); Tnew(k, 2)=T(t, 2);
  }
  T=Tnew;
  cout <<T <<endl;
}
Beispiel #20
0
OutPtr OutNew(t_symbol *msg, long argc, t_atom* argv)
{
    OutPtr		self;
	TTValue		sr(sys_getsr());
 	long		attrstart = attr_args_offset(argc, argv);		// support normal arguments
	//short		i;
	TTValue		v;
	TTErr		err;

    self = OutPtr(object_alloc(sOutClass));
    if (self) {
		self->maxNumChannels = 2;		// An initial argument to this object will set the maximum number of channels
		if (attrstart && argv)
			self->maxNumChannels = atom_getlong(argv);

		ttEnvironment->setAttributeValue(kTTSym_sampleRate, sr);
		// setup the output_buffer according to channnel number
		self->output_buffer = (t_atom *)malloc(self->maxNumChannels * sizeof(t_atom));

		v.resize(2);
		v[0] = "thru";
		v[1] = 1; // arg is the number of inlets
		err = TTObjectBaseInstantiate(TT("audio.object"), (TTObjectBasePtr*)&self->audioGraphObject, v);
		//self->audioGraphObject->getUnitGenerator()->setAttributeValue(TT("linearGain"), 1.0);

		attr_args_process(self, argc, argv);

    	object_obex_store((void*)self, _sym_dumpout, (object*)outlet_new(self, NULL));	// dumpout
		self->s_out = listout((t_pxobject *)self); // the list outlet
	    dsp_setup((t_pxobject*)self, 1);
		self->clock = clock_new(self, (method)OutTick);

		self->qelem = qelem_new(self, (method)OutQFn);
		self->obj.z_misc = Z_NO_INPLACE | Z_PUT_LAST;
	}
	return self;
}
Beispiel #21
0
static bool cat_mc1_mce(u16 ec, u8 xec)
{
	u8 r4    = R4(ec);
	bool ret = true;

	if (!MEM_ERROR(ec))
		return false;

	if (TT(ec) != TT_INSTR)
		return false;

	if (r4 == R4_IRD)
		pr_cont("Data/tag array parity error for a tag hit.\n");
	else if (r4 == R4_SNOOP)
		pr_cont("Tag error during snoop/victimization.\n");
	else if (xec == 0x0)
		pr_cont("Tag parity error from victim castout.\n");
	else if (xec == 0x2)
		pr_cont("Microcode patch RAM parity error.\n");
	else
		ret = false;

	return ret;
}
Beispiel #22
0
void op_dsp64(t_op *x, t_object *dsp64, short *count, double samplerate, long maxvectorsize, long flags)
{
	
	short		i, j; 
	
	x->numChannels = 0;
	x->vs = (TTUInt16)maxvectorsize;
	
	for(i=0; i < x->maxNumChannels; i++){
		j = x->maxNumChannels + i;
		if(count[i] && count[j])
			x->numChannels++;		
	}
	
	x->audioIn->setAttributeValue(kTTSym_numChannels, x->maxNumChannels);
	x->audioOut->setAttributeValue(kTTSym_numChannels, x->maxNumChannels);
	x->audioIn->setAttributeValue(kTTSym_vectorSize, (TTUInt16)maxvectorsize);
	x->audioOut->setAttributeValue(kTTSym_vectorSize, (TTUInt16)maxvectorsize);
	//audioIn will be set in the perform method
	x->audioOut->sendMessage(TT("alloc"));
	
	x->op->setAttributeValue(kTTSym_sampleRate, samplerate);
	object_method(dsp64, gensym("dsp_add64"), x, op_perform64, 0, NULL);	
}
Beispiel #23
0
TTErr TTMidiFormat::dictionary(const TTValue& input, TTValue& output)
{
	TTDictionaryPtr	d = NULL;
	TTSymbol		schema;
	
	input.get(0, (TTPtr*)(&d));
	schema = d->getSchema();
	
	if (schema == TT("MidiNoteEvent")) {
		TTValue v;
		TTUInt8	noteNumber = 0;
		TTUInt8 noteVelocity = 0;
		TTUInt8 noteChannel = 1;
		
		d->getValue(v);
		v.get(0, noteNumber);
		v.get(1, noteVelocity);
		v.get(2, noteChannel);

		if (noteVelocity > 0)	// Note-on
			d->append(TT("status"), 143 + noteChannel);
		else					// Note-off
			d->append(TT("status"), 127 + noteChannel);

		d->append(TT("data1"), noteNumber);
		d->append(TT("data2"), noteVelocity);
		d->setSchema(TT("RawMidiEvent"));
		output.set(0, TTPtr(d));
	}
	else if (schema == TT("RawMidiEvent"))
		output = input; // Nothing to do...
	else
		return kTTErrInvalidType;

	return kTTErrNone;
}
Beispiel #24
0
t_jit_err StencilSetEdges(StencilObjectPtr self, Ptr attr, AtomCount ac, AtomPtr av)
{
	self->stencilObject->setAttributeValue(TT("edges"), TT(atom_getsym(av)->s_name));
	return JIT_ERR_NONE;
}
TTErr TTSmoothPolynomialFunction::test(TTValue& returnedTestInfo)
{
	int					errorCount = 0;
	int					testAssertionCount = 0;
	int					badSampleCount = 0;
	TTAudioSignalPtr	input = NULL;
	TTAudioSignalPtr	output = NULL;
	int					N = 128;
	TTValue				v;
	

TTFloat64 inputSignal1[128] = {
	0.0000000000000000e+00, 
	7.8740157480314960e-03, 
	1.5748031496062992e-02, 
	2.3622047244094488e-02, 
	3.1496062992125984e-02, 
	3.9370078740157480e-02, 
	4.7244094488188976e-02, 
	5.5118110236220472e-02, 
	6.2992125984251968e-02, 
	7.0866141732283464e-02, 
	7.8740157480314960e-02, 
	8.6614173228346455e-02, 
	9.4488188976377951e-02, 
	1.0236220472440945e-01, 
	1.1023622047244094e-01, 
	1.1811023622047244e-01, 
	1.2598425196850394e-01, 
	1.3385826771653545e-01, 
	1.4173228346456693e-01, 
	1.4960629921259844e-01, 
	1.5748031496062992e-01, 
	1.6535433070866143e-01, 
	1.7322834645669291e-01, 
	1.8110236220472442e-01, 
	1.8897637795275590e-01, 
	1.9685039370078741e-01, 
	2.0472440944881889e-01, 
	2.1259842519685040e-01, 
	2.2047244094488189e-01, 
	2.2834645669291340e-01, 
	2.3622047244094488e-01, 
	2.4409448818897639e-01, 
	2.5196850393700787e-01, 
	2.5984251968503935e-01, 
	2.6771653543307089e-01, 
	2.7559055118110237e-01, 
	2.8346456692913385e-01, 
	2.9133858267716534e-01, 
	2.9921259842519687e-01, 
	3.0708661417322836e-01, 
	3.1496062992125984e-01, 
	3.2283464566929132e-01, 
	3.3070866141732286e-01, 
	3.3858267716535434e-01, 
	3.4645669291338582e-01, 
	3.5433070866141730e-01, 
	3.6220472440944884e-01, 
	3.7007874015748032e-01, 
	3.7795275590551181e-01, 
	3.8582677165354329e-01, 
	3.9370078740157483e-01, 
	4.0157480314960631e-01, 
	4.0944881889763779e-01, 
	4.1732283464566927e-01, 
	4.2519685039370081e-01, 
	4.3307086614173229e-01, 
	4.4094488188976377e-01, 
	4.4881889763779526e-01, 
	4.5669291338582679e-01, 
	4.6456692913385828e-01, 
	4.7244094488188976e-01, 
	4.8031496062992124e-01, 
	4.8818897637795278e-01, 
	4.9606299212598426e-01, 
	5.0393700787401574e-01, 
	5.1181102362204722e-01, 
	5.1968503937007871e-01, 
	5.2755905511811019e-01, 
	5.3543307086614178e-01, 
	5.4330708661417326e-01, 
	5.5118110236220474e-01, 
	5.5905511811023623e-01, 
	5.6692913385826771e-01, 
	5.7480314960629919e-01, 
	5.8267716535433067e-01, 
	5.9055118110236215e-01, 
	5.9842519685039375e-01, 
	6.0629921259842523e-01, 
	6.1417322834645671e-01, 
	6.2204724409448819e-01, 
	6.2992125984251968e-01, 
	6.3779527559055116e-01, 
	6.4566929133858264e-01, 
	6.5354330708661412e-01, 
	6.6141732283464572e-01, 
	6.6929133858267720e-01, 
	6.7716535433070868e-01, 
	6.8503937007874016e-01, 
	6.9291338582677164e-01, 
	7.0078740157480313e-01, 
	7.0866141732283461e-01, 
	7.1653543307086609e-01, 
	7.2440944881889768e-01, 
	7.3228346456692917e-01, 
	7.4015748031496065e-01, 
	7.4803149606299213e-01, 
	7.5590551181102361e-01, 
	7.6377952755905509e-01, 
	7.7165354330708658e-01, 
	7.7952755905511806e-01, 
	7.8740157480314965e-01, 
	7.9527559055118113e-01, 
	8.0314960629921262e-01, 
	8.1102362204724410e-01, 
	8.1889763779527558e-01, 
	8.2677165354330706e-01, 
	8.3464566929133854e-01, 
	8.4251968503937003e-01, 
	8.5039370078740162e-01, 
	8.5826771653543310e-01, 
	8.6614173228346458e-01, 
	8.7401574803149606e-01, 
	8.8188976377952755e-01, 
	8.8976377952755903e-01, 
	8.9763779527559051e-01, 
	9.0551181102362199e-01, 
	9.1338582677165359e-01, 
	9.2125984251968507e-01, 
	9.2913385826771655e-01, 
	9.3700787401574803e-01, 
	9.4488188976377951e-01, 
	9.5275590551181100e-01, 
	9.6062992125984248e-01, 
	9.6850393700787396e-01, 
	9.7637795275590555e-01, 
	9.8425196850393704e-01, 
	9.9212598425196852e-01, 
	1.0000000000000000e+00	
};

	
TTFloat64 expectedSignal1[128] = { 
		0.0000000000000000e+00, 
		4.8244209039635314e-06, 
		3.8138443955198070e-05, 
		1.2718493906995618e-04, 
		2.9786651631526754e-04, 
		5.7476731875201535e-04, 
		9.8117481527801352e-04, 
		1.5391015934710839e-03, 
		2.2693071524321311e-03, 
		3.1913196956282223e-03, 
		4.3234579237356610e-03, 
		5.6828528274830668e-03, 
		7.2854694804944482e-03, 
		9.1461288321322883e-03, 
		1.1278529500340605e-02, 
		1.3695269564488044e-02, 
		1.6407868358210953e-02, 
		1.9426788262256446e-02, 
		2.2761456497325496e-02, 
		2.6420286916916010e-02, 
		3.0410701800165873e-02, 
		3.4739153644696097e-02, 
		3.9411146959453816e-02, 
		4.4431260057555426e-02, 
		4.9803166849129596e-02, 
		5.5529658634160470e-02, 
		6.1612665895330529e-02, 
		6.8053280090863921e-02, 
		7.4851775447369331e-02, 
		8.2007630752683164e-02, 
		8.9519551148712656e-02, 
		9.7385489924278826e-02, 
		1.0560267030795963e-01, 
		1.1416760726093299e-01, 
		1.2307612926982006e-01, 
		1.3232340013952798e-01, 
		1.4190394078609317e-01, 
		1.5181165102952443e-01, 
		1.6203983138664596e-01, 
		1.7258120486394016e-01, 
		1.8342793875039137e-01, 
		1.9457166641032828e-01, 
		2.0600350907626741e-01, 
		2.1771409764175598e-01, 
		2.2969359445421497e-01, 
		2.4193171510778244e-01, 
		2.5441775023615654e-01, 
		2.6714058730543810e-01, 
		2.8008873240697457e-01, 
		2.9325033205020234e-01, 
		3.0661319495549044e-01, 
		3.2016481384698270e-01, 
		3.3389238724544185e-01, 
		3.4778284126109205e-01, 
		3.6182285138646236e-01, 
		3.7599886428922880e-01, 
		3.9029711960505920e-01, 
		4.0470367173045396e-01, 
		4.1920441161559163e-01, 
		4.3378508855717035e-01, 
		4.4843133199125074e-01, 
		4.6312867328610041e-01, 
		4.7786256753503586e-01, 
		4.9261841534926576e-01, 
		5.0738158465073435e-01, 
		5.2213743246496436e-01, 
		5.3687132671389948e-01, 
		5.5156866800874915e-01, 
		5.6621491144282976e-01, 
		5.8079558838440848e-01, 
		5.9529632826954604e-01, 
		6.0970288039494136e-01, 
		6.2400113571077132e-01, 
		6.3817714861353769e-01, 
		6.5221715873890806e-01, 
		6.6610761275455821e-01, 
		6.7983518615301786e-01, 
		6.9338680504450978e-01, 
		7.0674966794979754e-01, 
		7.1991126759302526e-01, 
		7.3285941269456178e-01, 
		7.4558224976384357e-01, 
		7.5806828489221756e-01, 
		7.7030640554578467e-01, 
		7.8228590235824358e-01, 
		7.9399649092373314e-01, 
		8.0542833358967236e-01, 
		8.1657206124960879e-01, 
		8.2741879513605987e-01, 
		8.3796016861335465e-01, 
		8.4818834897047601e-01, 
		8.5809605921390641e-01, 
		8.6767659986047230e-01, 
		8.7692387073018008e-01, 
		8.8583239273906678e-01, 
		8.9439732969204044e-01, 
		9.0261451007572102e-01, 
		9.1048044885128654e-01, 
		9.1799236924731620e-01, 
		9.2514822455263168e-01, 
		9.3194671990913625e-01, 
		9.3838733410466979e-01, 
		9.4447034136584040e-01, 
		9.5019683315087100e-01, 
		9.5556873994244551e-01, 
		9.6058885304054709e-01, 
		9.6526084635530474e-01, 
		9.6958929819983375e-01, 
		9.7357971308308588e-01, 
		9.7723854350267647e-01, 
		9.8057321173774348e-01, 
		9.8359213164178971e-01, 
		9.8630473043551437e-01, 
		9.8872147049965875e-01, 
		9.9085387116786894e-01, 
		9.9271453051950509e-01, 
		9.9431714717251651e-01, 
		9.9567654207626521e-01, 
		9.9680868030437164e-01, 
		9.9773069284756843e-01, 
		9.9846089840652841e-01, 
		9.9901882518472185e-01, 
		9.9942523268124717e-01, 
		9.9970213348368553e-01, 
		9.9987281506093062e-01, 
		9.9996186155604327e-01, 
		9.9999517557909634e-01, 
		1.0000000000000000e+00
		};	
	
	// setup Function 
	this->setAttributeValue(TT("function"), TT("smoothPolynomial"));

	
	// create 1 channel audio signal objects
	TTObjectInstantiate(kTTSym_audiosignal, &input, 1);
	TTObjectInstantiate(kTTSym_audiosignal, &output, 1);
	input->allocWithVectorSize(N);
	output->allocWithVectorSize(N);
	
	// create a signal to be transformed and then process it)
	input->clear();	
	for (int i=0; i<N; i++)
		input->mSampleVectors[0][i] = inputSignal1[i]; 
	
	this->process(input, output);
	
	// now test the output
	for (int n=0; n<N; n++)
	{
		TTBoolean result = !TTTestFloatEquivalence(output->mSampleVectors[0][n], expectedSignal1[n]);
		badSampleCount += result;
		if (result) 
			TTTestLog("BAD SAMPLE @ n=%i ( value=%.10f	expected=%.10f )", n, output->mSampleVectors[0][n], expectedSignal1[n]);
	}
	
	TTTestAssertion("Produces correct function values", 
					badSampleCount == 0,
					testAssertionCount, 
					errorCount);
	if (badSampleCount)
		TTTestLog("badSampleCount is %i", badSampleCount);
	
	
	TTObjectRelease(&input);
	TTObjectRelease(&output);
	
	// wrap up test results and pass back to whoever called test
	return TTTestFinish(testAssertionCount, errorCount, returnedTestInfo);
	
}
Beispiel #26
0
extern "C" void cdft(int n, int isgn, double *a, int *ip, double *w);
extern "C" void rdft(int n, int isgn, double *a, int *ip, double *w);
// mayer prototypes
#include "mayer_fft.h"


TT_AUDIO_CONSTRUCTOR,
	mVectorSize(0),
	mInverse(false),
	mInverseValue(1)
{
	addAttributeWithSetter(Inverse,		kTypeBoolean);
	addAttributeWithSetter(Mode,		kTypeSymbol);
	addAttributeWithSetter(Algorithm,	kTypeSymbol);
	
	setAttributeValue(TT("mode"), TT("real"));
	setAttributeValue(TT("algorithm"), TT("ooura"));
	
	// TODO: add the ooura-radix4 -- maybe it should even be the should be the default?
	// (based on benchmarks @ fftw's site and powers-of-two?) or maybe the split-radix is fine... 
}


TTfft::~TTfft()
{
	;
}


TTErr TTfft::setInverse(const TTValue& newValue)
{
Beispiel #27
0
[BASE] = LAYOUT_ergodox(  // layer 0 : default
        // left hand
        KC_EQL,                KC_1,         KC_2,   KC_3,   KC_4,   KC_5,   M(2),
        KC_DELT,               KC_Q,         KC_W,   KC_E,   KC_R,   KC_T,   TG(SYMB),
        GUI_T(KC_BSPC),        KC_A,         KC_S,   KC_D,   KC_F,   KC_G,
        KC_LSFT,               CTL_T(KC_Z),  KC_X,   KC_C,   KC_V,   KC_B,   ALL_T(KC_NO),
        LT(SYMB,KC_GRV),KC_QUOT,      LALT(KC_LSFT),  KC_LEFT,KC_RGHT,
                                                 CTL_T(KC_ESC),KC_PGUP,
                                                               KC_PGDN,
                                               KC_SPC,KC_BSPC, KC_ESC,
        // right hand
             M(3),        KC_6,   KC_7,   KC_8,   KC_9,   KC_0,             KC_MINS,
             TG(SYMB),    KC_Y,   KC_U,   KC_I,   KC_O,   KC_P,             KC_BSLS,
                          KC_H,   KC_J,   KC_K,   KC_L,   LT(MDIA, KC_SCLN),GUI_T(KC_QUOT),
             MEH_T(KC_NO),KC_N,   KC_M,   KC_COMM,KC_DOT, CTL_T(KC_SLSH),   KC_RSFT,
                                  KC_UP,  KC_DOWN,KC_LBRC,KC_RBRC,          TT(SYMB),
             
             ALT_T(KC_APP),  KC_LGUI,
             KC_HOME,
             KC_LALT,KC_TAB, KC_ENT
    ),
/* Keymap 1: Symbol Layer
 *
 * ,--------------------------------------------------.           ,--------------------------------------------------.
 * |        |  F1  |  F2  |  F3  |  F4  |  F5  |      |           |      |  F6  |  F7  |  F8  |  F9  |  F10 |   F11  |
 * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
 * |        |   !  |   @  |   {  |   }  |   |  |      |           |      |   Up |   7  |   8  |   9  |   *  |   F12  |
 * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
 * |        |   #  |   $  |   (  |   )  |   `  |------|           |------| Down |   4  |   5  |   6  |   +  |        |
 * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
 * |        |   %  |   ^  |   [  |   ]  |   ~  |      |           |      |  <-  |   1  |   2  |   3  |   \  |        |
Beispiel #28
0
TTErr TTGain::test(TTValue& returnedTestInfo)
{
	// preliminary setup
	
	int	errorCount = 0;
	int testAssertionCount = 0;
	
	TTTestLog("Testing Parameter value conversions");
	
	
	// N test assertions
	
	// Test 1: trival value conversion
	this->setAttributeValue(TT("midiGain"), 100);
	TTTestAssertion("midi gain of 100 == linear gain of 1.", 
					TTTestFloatEquivalence(this->mGain, 1.0), 
					testAssertionCount, 
					errorCount);
	
	// Test 2: trival value conversion
	this->setAttributeValue(TT("midiGain"), 99);
	TTTestAssertion("midi gain of 99 != linear gain of 1.", 
					TTTestFloatEquivalence(this->mGain, 1.0, false), 
					testAssertionCount, 
					errorCount);
	
	// Test 3: audio test
	// set the input signals 1
	// apply -6 dB gain
	// check that the signals are properly scaled
	
	TTAudioSignalPtr input = NULL;
	TTAudioSignalPtr output = NULL;
	
	// create 1 channel audio signal objects
	TTObjectInstantiate(kTTSym_audiosignal, &input, 1);
	TTObjectInstantiate(kTTSym_audiosignal, &output, 1);
	
	input->allocWithVectorSize(64);
	output->allocWithVectorSize(64);
	
	for (int i=0; i<64; i++)
		input->mSampleVectors[0][i] = 1.0;
	
	this->setAttributeValue(TT("gain"), -6.0);
	this->process(input, output);
	
	TTSampleValuePtr samples = output->mSampleVectors[0];
	int validSampleCount = 0;
	
	for (int i=0; i<64; i++) {
		validSampleCount += TTTestFloatEquivalence(0.5011872336272722, samples[i]);
	}
	TTTestAssertion("accumulated audio error at gain = -6 dB", 
					validSampleCount == 64, 
					testAssertionCount, 
					errorCount);
	TTTestLog("Numbe of bad samples: %i", 64-validSampleCount);
	
	TTObjectRelease(&input);
	TTObjectRelease(&output);
	
	
	// Wrap up the test results to pass back to whoever called this test
	return TTTestFinish(testAssertionCount, errorCount, returnedTestInfo);
}
Beispiel #29
0
#define BASE 0 // default layer
#define SYMB 1 // symbols
#define MDIA 2 // media keys

enum custom_keycodes {
  PLACEHOLDER = SAFE_RANGE, // can always be here
  EPRM,
  VRSN,
  RGB_SLD
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

  // base: qwerty
  [0] = KEYMAP(KC_ESCAPE,KC_1,KC_2,KC_3,KC_4,KC_5,KC_6,KC_TAB,KC_Q,KC_W,KC_E,KC_R,KC_T,LGUI(LSFT(KC_F4)),KC_ESCAPE,KC_A,KC_S,KC_D,KC_F,KC_G,KC_LSHIFT,KC_Z,KC_X,KC_C,KC_V,KC_B,LGUI(LSFT(KC_F5)),LGUI(KC_A),LGUI(KC_Z),LGUI(KC_X),LGUI(KC_C),LGUI(KC_V),KC_LALT,TT(3),TT(2),KC_LGUI,KC_SPACE,TT(1),KC_7,KC_8,KC_9,KC_0,KC_MINUS,KC_EQUAL,KC_BSPACE,LGUI(LSFT(KC_F6)),KC_Y,KC_U,KC_I,KC_O,KC_P,KC_ENTER,KC_H,KC_J,KC_K,KC_L,KC_QUOTE,KC_ENTER,LGUI(LSFT(KC_F7)),KC_N,KC_M,KC_COMMA,KC_DOT,KC_UP,KC_RSHIFT,KC_BSLASH,KC_SLASH,KC_LEFT,KC_DOWN,KC_RIGHT,TT(3),KC_RALT,TT(2),TT(1),KC_RCTRL,KC_SPACE),

  // arrows/media
  [1] = KEYMAP(KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_UP,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_LEFT,KC_DOWN,KC_RIGHT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_UP,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_LEFT,KC_DOWN,KC_RIGHT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT),

  // carpalx-based alternative typing layout
  [2] = KEYMAP(KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_Q,KC_D,KC_R,KC_W,KC_B,KC_TRANSPARENT,KC_TRANSPARENT,KC_A,KC_S,KC_H,KC_T,KC_G,KC_TRANSPARENT,KC_Z,KC_X,KC_M,KC_C,KC_V,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_J,KC_F,KC_U,KC_P,KC_TRANSPARENT,KC_TRANSPARENT,KC_Y,KC_N,KC_E,KC_O,KC_I,KC_TRANSPARENT,KC_TRANSPARENT,KC_K,KC_L,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT),

  // gaming (final layer - no switching back)
  [3] = KEYMAP(KC_ESCAPE,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TAB,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_Y,KC_F1,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_LSHIFT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_N,KC_F2,KC_F3,KC_F4,KC_F5,KC_F6,KC_H,KC_J,KC_K,KC_SPACE,KC_ENTER,KC_L,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT),

  // symbols
  [4] = KEYMAP(KC_TRANSPARENT,KC_F1,KC_F2,KC_F3,KC_F4,KC_F5,KC_F6,KC_TRANSPARENT,KC_EXLM,KC_AT,KC_LCBR,KC_RCBR,KC_PERC,LGUI(LSFT(KC_F8)),KC_TRANSPARENT,KC_GRAVE,KC_TILD,KC_LPRN,KC_RPRN,KC_PIPE,KC_TRANSPARENT,KC_HASH,KC_DLR,KC_LBRACKET,KC_RBRACKET,KC_CIRC,LGUI(LSFT(KC_F9)),KC_TRANSPARENT,KC_TRANSPARENT,LALT(LSFT(KC_2)),KC_LABK,KC_RABK,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_F7,KC_F8,KC_F9,KC_F10,KC_F11,KC_F12,KC_TRANSPARENT,LGUI(LSFT(KC_F10)),KC_AMPR,KC_KP_ASTERISK,KC_PLUS,KC_EQUAL,KC_BSLASH,KC_TRANSPARENT,KC_SLASH,KC_COMMA,KC_DOT,KC_QUOTE,KC_MINUS,KC_TRANSPARENT,LGUI(LSFT(KC_F11)),KC_QUES,KC_COLN,KC_SCOLON,KC_DQUO,KC_UNDS,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT),

};
Beispiel #30
0
 * This code is licensed under the terms of the "New BSD License" @n
 * http://creativecommons.org/licenses/BSD/
 */


#include "TTAdsr.h"

#define thisTTClass TTAdsr
#define thisTTClassName		"adsr"
#define thisTTClassTags		"dspGeneratorLib, audio, generator, envelope"


TT_AUDIO_CONSTRUCTOR
, output(0.), output_db(NOISE_FLOOR), eg_state(k_eg_inactive), trigger(false), attrMode("linear")
{
	registerAttribute(TT("attack"), kTypeFloat64, &attack_ms, (TTSetterMethod)&TTAdsr::setAttack);
	registerAttribute(TT("decay"), kTypeFloat64, &decay_ms, (TTSetterMethod)&TTAdsr::setDecay);
	registerAttribute(TT("release"), kTypeFloat64, &release_ms, (TTSetterMethod)&TTAdsr::setRelease);
	registerAttribute(TT("linearSustain"), kTypeFloat64, &sustain_amp, (TTSetterMethod)&TTAdsr::setSustainAmp);
	registerAttribute(TT("sustain"), kTypeFloat64, NULL, (TTGetterMethod)&TTAdsr::getSustainDb, (TTSetterMethod)&TTAdsr::setSustainDb);
	registerAttribute(TT("trigger"), kTypeBoolean, &trigger);
	registerAttribute(TT("mode"), kTypeSymbol, &attrMode, (TTSetterMethod)&TTAdsr::setMode);

	addUpdates(SampleRate);
	addMessageWithArguments(dictionary);

	setAttributeValue(TT("attack"), 50.);
	setAttributeValue(TT("decay"), 100.);
	setAttributeValue(TT("sustain"), -6.);
	setAttributeValue(TT("release"), 500.);
	setAttributeValue(TT("mode"), TT("hybrid"));	// <-- sets the process method