本文整理汇总了Java中org.puredata.core.PdBase.openPatch方法的典型用法代码示例。如果您正苦于以下问题:Java PdBase.openPatch方法的具体用法?Java PdBase.openPatch怎么用?Java PdBase.openPatch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.puredata.core.PdBase
的用法示例。
在下文中一共展示了PdBase.openPatch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: openPatch
import org.puredata.core.PdBase; //导入方法依赖的package包/类
/** Abre o Patch de PD, segundo o nome do patch e o caminho para obter o id do recurso raw no arquivo .zip
*
* @param nome do patch '<nome>.pd'
* @param PathToIdResourse
* @return
*/
public int openPatch(final String patch, int PathToIdResourse) {
final File dir = p5.getFilesDir();
final File patchFile = new File(dir, patch);
int out=-1;
try {
IoUtils.extractZipResource(p5.getResources().openRawResource(PathToIdResourse), dir, true);
out = PdBase.openPatch(patchFile.getAbsolutePath());
Log.d(TAG, "out" + out);
} catch (final IOException e) {
e.printStackTrace();
Log.e(TAG, e.toString() + "; exiting now");
finish();
}
return out;
}
示例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();
}
}
示例3: initPd
import org.puredata.core.PdBase; //导入方法依赖的package包/类
private void initPd() {
Resources res = getResources();
File patchFile = null;
try {
PdBase.sendBang("trigger");
// PdBase.sendFloat("midinote", 64);
InputStream in = res.openRawResource(R.raw.wnoise);
patchFile = IoUtils.extractResource(in, "wnoise.pd", getCacheDir());
PdBase.openPatch(patchFile);
} catch (IOException e) {
Log.e(TAG, e.toString());
finish();
} finally {
if (patchFile != null) patchFile.delete();
}
}
示例4: initPd
import org.puredata.core.PdBase; //导入方法依赖的package包/类
private void initPd() {
Resources res = getResources();
File patchFile = null;
try {
PdBase.sendBang("trigger");
// PdBase.sendFloat("midinote", 64);
InputStream in = res.openRawResource(R.raw.sine);
patchFile = IoUtils.extractResource(in, "sine.pd", getCacheDir());
PdBase.openPatch(patchFile);
} catch (IOException e) {
Log.e(TAG, e.toString());
finish();
} finally {
if (patchFile != null) patchFile.delete();
}
}
示例5: initPd
import org.puredata.core.PdBase; //导入方法依赖的package包/类
private void initPd() {
Resources res = getResources();
File patchFile = null;
try {
PdBase.sendBang("trigger");
// PdBase.sendFloat("midinote", 64);
InputStream in = res.openRawResource(R.raw.triangle);
patchFile = IoUtils.extractResource(in, "triangle.pd", getCacheDir());
PdBase.openPatch(patchFile);
} catch (IOException e) {
Log.e(TAG, e.toString());
finish();
} finally {
if (patchFile != null) patchFile.delete();
}
}
示例6: initPd
import org.puredata.core.PdBase; //导入方法依赖的package包/类
private void initPd() {
Resources res = getResources();
File patchFile = null;
try {
PdBase.sendBang("trigger");
// PdBase.sendFloat("midinote", 64);
// InputStream in = res.openRawResource(R.raw.pnoise);
// patchFile = IoUtils.extractResource(in, "pnoise.pd", getCacheDir());
// PdBase.openPatch(patchFile);
File dir = getFilesDir();
IoUtils.extractZipResource(
getResources().openRawResource(R.raw.pnoise), dir, true);
File pFile = new File(dir, "pnoise.pd");
PdBase.openPatch(pFile.getAbsolutePath());
} catch (IOException e) {
Log.e(TAG, e.toString());
finish();
} finally {
if (patchFile != null) patchFile.delete();
}
}
示例7: 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();
}
}
示例8: initPd
import org.puredata.core.PdBase; //导入方法依赖的package包/类
private void initPd() {
Resources res = getResources();
File patchFile = null;
try {
PdBase.sendBang("trigger");
// PdBase.sendFloat("midinote", 64);
InputStream in = res.openRawResource(R.raw.sawtooth);
patchFile = IoUtils.extractResource(in, "sawtooth.pd", getCacheDir());
PdBase.openPatch(patchFile);
} catch (IOException e) {
Log.e(TAG, e.toString());
finish();
} finally {
if (patchFile != null) patchFile.delete();
}
}
示例9: initPd
import org.puredata.core.PdBase; //导入方法依赖的package包/类
private void initPd() {
Resources res = getResources();
File patchFile = null;
try {
PdBase.sendBang("play");
// PdBase.sendFloat("midinote", 64);
InputStream in = res.openRawResource(R.raw.metro);
patchFile = IoUtils.extractResource(in, "metro.pd", getCacheDir());
PdBase.openPatch(patchFile);
} catch (IOException e) {
Log.e(TAG, e.toString());
finish();
} finally {
if (patchFile != null) patchFile.delete();
}
}
示例10: initPd
import org.puredata.core.PdBase; //导入方法依赖的package包/类
private void initPd() {
Resources res = getResources();
File patchFile = null; //import java.io.File
try {
// PdBase.setReceiver(receiver);
PdBase.subscribe("android");
InputStream in = res.openRawResource(R.raw.test); //import java.io.InputStream
patchFile = IoUtils.extractResource(in, "test.pd", getCacheDir());
PdBase.openPatch(patchFile);
} catch (IOException e) { //import java.io.IOException
Log.e(TAG, e.toString()); //import android.util.Log
finish();
} finally {
if (patchFile != null) patchFile.delete();
}
}
示例11: initPd
import org.puredata.core.PdBase; //导入方法依赖的package包/类
private void initPd() {
Resources res = getResources();
File patchFile = null;
try {
PdBase.sendBang("trigger");
PdBase.sendBang("toggle");
// PdBase.sendFloat("midinote", 64);
InputStream in = res.openRawResource(R.raw.sweep);
patchFile = IoUtils.extractResource(in, "sweep.pd", getCacheDir());
PdBase.openPatch(patchFile);
} catch (IOException e) {
Log.e(TAG, e.toString());
finish();
} finally {
if (patchFile != null) patchFile.delete();
}
}
示例12: 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();
}
}
示例13: loadPatch
import org.puredata.core.PdBase; //导入方法依赖的package包/类
protected void loadPatch() throws IOException {
if (pd == 0) {
File dir = getFilesDir();
IoUtils.extractZipResource(
getResources().openRawResource(
com.twobigears.circlesynth.R.raw.vnsequencer), dir,
true);
File patchFile = new File(dir, "vnsequencer.pd");
pd = PdBase.openPatch(patchFile.getAbsolutePath());
// send initial data to the patch from preferences
initialisepatch();
}
}
示例14: open
import org.puredata.core.PdBase; //导入方法依赖的package包/类
public PdPatch open(FileHandle file)
{
try {
int handle = PdBase.openPatch(file.path());
return new PdPatch(handle);
} catch (IOException e) {
throw new PdRuntimeException("unable to open patch", e);
}
}
示例15: openPatch
import org.puredata.core.PdBase; //导入方法依赖的package包/类
private PdPatch openPatch(FileHandle file){
try {
int handle = PdBase.openPatch(file.path());
return new PdPatch(handle);
} catch (IOException e) {
throw new PdRuntimeException("unable to open patch", e);
}
}