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


Java PdBase.setReceiver方法代码示例

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


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

示例1: init

import org.puredata.core.PdBase; //导入方法依赖的package包/类
public static void init() 
{
	dispatcher = new PdDispatcher() {
		@Override
		public void print(String s) {
			if(s.endsWith("\n"))
			{
				message.append(s.substring(0, s.length()-1));
				Log.i("Pd [print]", message.toString());
				message = new StringBuilder();
			}
			else
			{
				message.append(s);
			}
		}
	};
	PdBase.setReceiver(dispatcher);
}
 
开发者ID:b2renger,项目名称:PdDroidPublisher,代码行数:20,代码来源:PdHelper.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: initPd

import org.puredata.core.PdBase; //导入方法依赖的package包/类
private void initPd() {
	Resources res = getResources();
	File patchFile = null;
	try {
		PdBase.setReceiver(reciever);
		PdBase.subscribe("android");
		InputStream in = res.openRawResource(R.raw.touch);
		patchFile = IoUtils.extractResource(in, "touch.pd",getCacheDir());
		PdBase.openPatch(patchFile);
		startAudio();
	} catch (IOException e) {
		Log.e(TAG, e.toString());
		finish();
	} finally {
		if (patchFile != null)
			patchFile.delete();
	}
}
 
开发者ID:fermiyoung,项目名称:musetoolkit,代码行数:19,代码来源:Touch.java

示例4: initPd

import org.puredata.core.PdBase; //导入方法依赖的package包/类
private void initPd() {
		Resources res = getResources();
		File patchFile = null;
		try {
			PdBase.setReceiver(receiver);
			PdBase.subscribe("spl");
//			PdBase.sendBang("trigger");
			InputStream in = res.openRawResource(R.raw.spl);
			patchFile = IoUtils.extractResource(in, "spl.pd", getCacheDir());
			PdBase.openPatch(patchFile);
			startAudio();
		} catch (IOException e) {
			Log.e(TAG, e.toString());
			finish();
		} finally {
			if (patchFile != null) patchFile.delete();
		}
	}
 
开发者ID:fermiyoung,项目名称:musetoolkit,代码行数:19,代码来源:Spl.java

示例5: initPd

import org.puredata.core.PdBase; //导入方法依赖的package包/类
private void initPd() {


        /* here is where we bind the print statement catcher defined below */
        PdBase.setReceiver(myDispatcher);

        /* here we are adding the listener for various messages
         from Pd sent to "GUI", i.e., anything that goes into the object
         [s GUI] will send to the listener defined below */
        myDispatcher.addListener("GUI", myListener);
        startAudio();  /* see below */
    }
 
开发者ID:victordiaz,项目名称:phonk,代码行数:13,代码来源:PPureDataBackupNewer.java

示例6: release

import org.puredata.core.PdBase; //导入方法依赖的package包/类
public void release()
{
	if(thread != null){
		thread.dispose();
		thread = null;
	}
	listeners.clear();
	PdBase.setReceiver(null);
}
 
开发者ID:mgsx-dev,项目名称:gdx-pd,代码行数:10,代码来源:PdAudioBase.java

示例7: onResume

import org.puredata.core.PdBase; //导入方法依赖的package包/类
public void onResume() {
	final int nIn = chanelsIn;
	Log.d(TAG, "Starting LibPD");
	if (AudioParameters.suggestSampleRate() < SAMPLE_RATE) {
		Log.d(TAG,"required sample rate not available; exiting");
		finish();
		return;
	}
	final int nOut = Math.min(AudioParameters.suggestOutputChannels(), 2);
	if (nOut == 0) {
		Log.d(TAG,"audio output not available; exiting");
		finish();
		return;
	}
	try {
		PdAudio.initAudio(SAMPLE_RATE, nIn, nOut, ticksPerBuffer, true);
		PdAudio.startAudio(p5);
		PdBase.setReceiver(dispatcher);
		
		for (int i = 0 ; i < keyFloats.size() ; i ++) {
			recividorMensagensPd(keyFloats.get(i));
		}
		
	} catch (final IOException e) {
		Log.e(TAG, e.toString());
	}
}
 
开发者ID:brunorohde,项目名称:BITSLC,代码行数:28,代码来源:PureDataManager.java

示例8: GdxPDAndroid

import org.puredata.core.PdBase; //导入方法依赖的package包/类
public GdxPDAndroid(final Context ctx) {
context = ctx;
sampleRate = AudioParameters.suggestSampleRate();
inChannels = 0;
outChannels = 2;
ticksPerBuffer = 8;
restart = true;
dispatcher = new PdUiDispatcher();
PdBase.setReceiver(dispatcher);
}
 
开发者ID:manhluong,项目名称:pd-for-libgdx,代码行数:11,代码来源:GdxPDAndroid.java

示例9: dispose

import org.puredata.core.PdBase; //导入方法依赖的package包/类
@Override
public void dispose() {
	//Log.d("dispose()", "Dispose!");
	PdBase.setReceiver(null);
	PdAudio.release();
	PdBase.release();
	}
 
开发者ID:manhluong,项目名称:pd-for-libgdx,代码行数:8,代码来源:GdxPDAndroid.java

示例10: initPd

import org.puredata.core.PdBase; //导入方法依赖的package包/类
private void initPd() throws IOException {
	// Configure the audio glue
	int sampleRate = AudioParameters.suggestSampleRate();
	pdService.initAudio(sampleRate, 1, 2, 10.0f);
	pdService.startAudio();
	start();
	// Create and install the dispatcher
	dispatcher = new PdUiDispatcher();
	PdBase.setReceiver(dispatcher);
}
 
开发者ID:deusanyjunior,项目名称:Sensors2PD,代码行数:11,代码来源:Sensors2PDActivity.java

示例11: initPd

import org.puredata.core.PdBase; //导入方法依赖的package包/类
protected void initPd() throws IOException {

		// Configure the audio glue
		int sampleRate = AudioParameters.suggestSampleRate();

		// reducing sample rate based on no. of cores
		if (getNumCores() == 1)
			sampleRate = sampleRate / 4;
		else
			sampleRate = sampleRate / 2;

		pdService.initAudio(sampleRate, 0, 2, 10.0f);
		
		pdService.startAudio(new Intent(this, SynthCircle.class),
				R.drawable.notif_icon, "CircleSynth", "Return to Circle Synth");

		dispatcher = new PdUiDispatcher();
		PdBase.setReceiver(dispatcher);

		dispatcher.addListener("scan", new PdListener.Adapter() {
			@Override
			public void receiveFloat(String source, final float x) {
				scanline = x;
				detect();
				sendPdValue();
			}
		});

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

示例12: initPd

import org.puredata.core.PdBase; //导入方法依赖的package包/类
protected void initPd() throws IOException {

		// Configure the audio glue
		int sampleRate = AudioParameters.suggestSampleRate();


		pdService.initAudio(sampleRate, 0, 2, 10.0f);
		
		pdService.startAudio(new Intent(this, MainActivity.class),
				R.drawable.icon, "Sample", "Return to Processing");

		dispatcher = new PdUiDispatcher();
		PdBase.setReceiver(dispatcher);



	}
 
开发者ID:twobigears,项目名称:Pd-Processing-Template,代码行数:18,代码来源:MainActivity.java


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