当前位置: 首页>>代码示例>>Java>>正文


Java PdBase.sendFloat方法代码示例

本文整理汇总了Java中org.puredata.core.PdBase.sendFloat方法的典型用法代码示例。如果您正苦于以下问题:Java PdBase.sendFloat方法的具体用法?Java PdBase.sendFloat怎么用?Java PdBase.sendFloat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.puredata.core.PdBase的用法示例。


在下文中一共展示了PdBase.sendFloat方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setPontoParaAtivo

import org.puredata.core.PdBase; //导入方法依赖的package包/类
public void setPontoParaAtivo(int index) {
		int antIndex = indexEmSom;
		indexEmSom = index;
		if (antIndex != indexEmSom) {
			if ( listaBangs.get(indexEmSom) != null ) {
				if ( (String) listaBangs.get(indexEmSom).get(1) == "sin_efecto") { 
					PdBase.sendFloat("efecto"+(String) listaBangs.get(indexEmSom).get(0), 0);
//					pontosNota.get(indexEmSom).conEfecto = false;
				} else {
					PdBase.sendFloat( (String) listaBangs.get(indexEmSom).get(1), 1);
//					pontosNota.get(indexEmSom).conEfecto = true;
				}
//				Log.i("Galho", "efecto: " + (String) listaBangs.get(indexEmSom).get(1) );
				
				PdBase.sendBang( (String) listaBangs.get(indexEmSom).get(0) );
				
			}
		}
			
	}
 
开发者ID:Javingka,项目名称:Arvoritmo,代码行数:21,代码来源:Galho.java

示例2: initPd

import org.puredata.core.PdBase; //导入方法依赖的package包/类
private void initPd() {
		Resources res = getResources();
		File patchFile = null;
		try {
			PdBase.sendBang("trigger");
			PdBase.setReceiver(receiver);			
			PdBase.subscribe("freq");			
//			PdBase.sendFloat("midinote", 64);
			InputStream in = res.openRawResource(R.raw.pianotuner);
			patchFile = IoUtils.extractResource(in, "pinaotuner.pd", getCacheDir());
			PdBase.openPatch(patchFile);
	        PdBase.sendFloat("midinote", 69); 	//此处确保初始化时,按下按钮能听到标准音A发声
		} catch (IOException e) {
			Log.e(TAG, e.toString());
			finish();
		} finally {
			if (patchFile != null) patchFile.delete();
		}
	}
 
开发者ID:fermiyoung,项目名称:musetoolkit,代码行数:20,代码来源:Piano.java

示例3: onClick

import org.puredata.core.PdBase; //导入方法依赖的package包/类
@Override
public void onClick(View v) {		//import android.view.View
	switch (v.getId()) {
	case R.id.play_button:
		if (pdService.isRunning()) {
			stopAudio();
		} 
		else {
			startAudio();
		}
	case R.id.left_box:
		PdBase.sendFloat("left", left.isChecked() ? 1 : 0);
		break;
	case R.id.right_box:
		PdBase.sendFloat("right", right.isChecked() ? 1 : 0);
		break;
	case R.id.mic_box:
		PdBase.sendFloat("mic", mic.isChecked() ? 1 : 0);
		break;
	}
}
 
开发者ID:fermiyoung,项目名称:musetoolkit,代码行数:22,代码来源:Test.java

示例4: fileRecSave

import org.puredata.core.PdBase; //导入方法依赖的package包/类
public void fileRecSave(File selection) {
  if (selection == null) {
   // println("Window was closed or the user hit cancel.");
  } else {
   // println("User selected " + selection.getAbsolutePath());
     // Save to File
  // The same file is overwritten by adding the data folder path to saveStrings().
   
    PdBase.sendSymbol("pd_recName", selection.getAbsolutePath());
    PdBase.sendBang("pd_rwav");	
    PdBase.sendBang("pd_recStart");
    PdBase.sendFloat("pd_power", 1);	
    //PdBase.sendBang("pd_rewind");
   
    
  }
}
 
开发者ID:zhagan,项目名称:dotMatrix-Android,代码行数:18,代码来源:Dm_beatbox.java

示例5: loadSettings

import org.puredata.core.PdBase; //导入方法依赖的package包/类
public void loadSettings() {
	PdBase.sendFloat("pd_presets", save_preset);
	PdBase.sendFloat("pd_scales", save_scale);
	PdBase.sendFloat("pd_octTrans", save_octTrans);
	PdBase.sendFloat("pd_noteTrans", save_noteTrans);
	PdBase.sendFloat("pd_bpm", save_bpm);
	bpm = save_bpm;

	Editor editor = prefs.edit();

	editor.putString("preset", String.valueOf(save_preset));
	editor.putString("scale", String.valueOf(save_scale));
	editor.putString("transposeOct", String.valueOf(save_octTrans + 3));
	editor.putString("transposeNote", String.valueOf(save_noteTrans));
	editor.apply();

}
 
开发者ID:twobigears,项目名称:Circle-Synth,代码行数:18,代码来源:SynthCircle.java

示例6: onSensorChanged

import org.puredata.core.PdBase; //导入方法依赖的package包/类
@Override
public void onSensorChanged(SensorEvent event) {

	if (event.sensor.getType() != Sensor.TYPE_ACCELEROMETER)
		return;
	SharedPreferences getPrefs1 = PreferenceManager
			.getDefaultSharedPreferences(getBaseContext());
	accel = getPrefs1.getBoolean("accel", true);
	currentAccelx = lowPass(event.values[0]);
	currentAccely = lowPass(event.values[1]);
	float y = Math.abs(currentAccelx / 10);
	float z = Math.abs(currentAccely / 10);

	if (y > z)
		z = y;
	else
		y = z;

	if (accel == true)
		PdBase.sendFloat("pd_accely", (1 - y));

}
 
开发者ID:twobigears,项目名称:Circle-Synth,代码行数:23,代码来源:SynthCircle.java

示例7: isFalse

import org.puredata.core.PdBase; //导入方法依赖的package包/类
@Override
public void isFalse() {

	PdBase.sendFloat("pd_record", 0);
	REC_TEXT = "REC";
	timer.cancel();
	if (isRecording) {
		edit1.putFloat("timer", countertest);
		edit1.commit();

		record();
		System.out.println("Recording length = "
				+ String.valueOf(countertest));

		countertest = 0;
		tracker.sendEvent("ui_Action", "button_press",
				"record_button", 0L);
	}
}
 
开发者ID:twobigears,项目名称:Circle-Synth,代码行数:20,代码来源:SynthCircle.java

示例8: sendMessage

import org.puredata.core.PdBase; //导入方法依赖的package包/类
protected static void sendMessage(String message, String value) {
    if (value.isEmpty()) {
        PdBase.sendBang(message);
    } else if (value.matches("[0-9]+")) {
        PdBase.sendFloat(message, Float.parseFloat(value));
    } else {
        PdBase.sendSymbol(message, value);
    }
}
 
开发者ID:victordiaz,项目名称:phonk,代码行数:10,代码来源:AudioServicePd.java

示例9: escutaBotoesInternos

import org.puredata.core.PdBase; //导入方法依赖的package包/类
public boolean escutaBotoesInternos(PVector evaluar) {
		boolean resp = false;
		if (reproductor.botaoOnClick(evaluar))  {
			resp = true;
			String nome = "efecto" + nomeSample;
			PdBase.sendFloat(nome, 0);
			if (efectoSwitch.ligado) {	
				PdBase.sendFloat(nome, 1);
			}
				
			PdBase.sendBang( getSampleNome() );  //Emite o son do sample ao pressoar o botao
			
			if (reproductor.getEstadoBotao())
				reproductor.setNomeBotao("escuta");
			
			reproductor.setEstadoBotao(false);
		} 
		//COMENTAMOS EFECTO por que esta versión de App no integra efectos en los sonidos
		/* 
		else if (efectoSwitch.botaoOnClick(evaluar)) {
			resp = true;
			if (efectoSwitch.mudandoOn) {
				String nome = "efecto" + nomeSample;
//				PdBase.sendFloat(nome, 1);
			} else if (efectoSwitch.mudandoOff) {
				String nome = "efecto" + nomeSample;
//				PdBase.sendFloat(nome, 0);
			}
			if (efectoSwitch.getEstadoBotao())
				efectoSwitch.setNomeBotao("efecto On");
			else
				efectoSwitch.setNomeBotao("efecto Off");
		}*/
		return resp;
	}
 
开发者ID:Javingka,项目名称:Arvoritmo,代码行数:36,代码来源:SampleBotao.java

示例10: On

import org.puredata.core.PdBase; //导入方法依赖的package包/类
public void On(boolean theFlag) {
  if(theFlag==true) {
    isPlaying = true;
    PdBase.sendFloat("pd_power", (float)1);
  } else {
    PdBase.sendFloat("pd_power", (float)0);
    isPlaying = false;
  }
}
 
开发者ID:zhagan,项目名称:dotMatrix-Android,代码行数:10,代码来源:Dm_beatbox.java

示例11: seqOn

import org.puredata.core.PdBase; //导入方法依赖的package包/类
public void seqOn(boolean theFlag) {
  if(theFlag==true) {
    PdBase.sendFloat("pd_link", (float)1);
  //  println("pd_link");
    seqOn = true;
  } else {
    PdBase.sendFloat("pd_link", (float)0);
    seqOn = false;
  }
  
}
 
开发者ID:zhagan,项目名称:dotMatrix-Android,代码行数:12,代码来源:Dm_beatbox.java

示例12: recWavFileSelect

import org.puredata.core.PdBase; //导入方法依赖的package包/类
static public void recWavFileSelect(){
  PdBase.sendFloat("pd_power", (float)0);
   	//PdBase.sendBang("pd_recStart");
   	PdBase.sendFloat("pd_link", (float)1);
   	seqOn=true;
   	cp5.getController("seqOn").setValue(1);
   	fileselector.selectOutput("Select a file to write to:", "fileRecSave");

}
 
开发者ID:zhagan,项目名称:dotMatrix-Android,代码行数:10,代码来源:Dm_beatbox.java

示例13: click

import org.puredata.core.PdBase; //导入方法依赖的package包/类
public void click(int mx, int my, int ix, int iy) {
  // Check to see if a point is inside the rectangle
  if (mx > x && mx < x + w && my > y && my < y + h) {
    on = !on;
    //println("button number " +ix +" " +iy +" " +on);
    //send floats to pd
    PdBase.sendFloat("pd_y", (float)iy);
    PdBase.sendFloat("pd_x", (float)ix);
    
    isInside = true;
    Once = true;
    //println(isInside);
  }   
}
 
开发者ID:zhagan,项目名称:dotMatrix-Android,代码行数:15,代码来源:Dm_beatbox.java

示例14: dispatchTouchEvent

import org.puredata.core.PdBase; //导入方法依赖的package包/类
@Override
public boolean dispatchTouchEvent(MotionEvent event) {


	width = displayWidth;
	height = displayHeight;
	
	//get and normalise the touch coordinates
	float x = (event.getX())/width;
	float y = (event.getY())/height;
	
	int action = event.getActionMasked();
	
	switch(action){
	case MotionEvent.ACTION_DOWN:
		PdBase.sendFloat("pd_toggle",1);
		bgCol=color(x*255,y*255,Math.abs(x-y)*255);
		break;
	
	
	case MotionEvent.ACTION_UP:
		PdBase.sendFloat("pd_toggle",0);
		bgCol=color(28,28,28);
		break;
	
	case MotionEvent.ACTION_MOVE:
		PdBase.sendFloat("pd_x", x);
		PdBase.sendFloat("pd_y", y);
		bgCol=color(x*255,y*255,Math.abs(x-y)*255);
		break;
		
	}
	return super.dispatchTouchEvent(event);
}
 
开发者ID:twobigears,项目名称:Pd-Processing-Template,代码行数:35,代码来源:MainActivity.java

示例15: onReceive

import org.puredata.core.PdBase; //导入方法依赖的package包/类
public void onReceive(Context c, Intent intent) {
wifiList = mainWifi.getScanResults();
if(isRunning) {
	mainWifi.startScan();
}
for(int i = 0; i < wifiList.size(); i++){
	PdBase.sendFloat("sensorW-"+wifiList.get(i).SSID, wifiList.get(i).level);
	Log.e(TAG, "WiFi "+"sensorW-"+wifiList.get(i).SSID+" "+wifiList.get(i).level);
}
  }
 
开发者ID:deusanyjunior,项目名称:Sensors2PD,代码行数:11,代码来源:Sensors2PDActivity.java


注:本文中的org.puredata.core.PdBase.sendFloat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。