@@ -140,6 +140,75 @@ JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_oscSet (JNIEnv *en
140
140
env->ReleaseIntArrayElements (nodeId, m_nodeId, 0 );
141
141
};
142
142
143
+ JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_oscAudioSet (JNIEnv *env, jobject object, jintArray freq, jintArray amp, jintArray add, jintArray pos, jintArray nodeId){
144
+
145
+ jint* m_freq = env->GetIntArrayElements (freq, 0 );
146
+ jint* m_amp = env->GetIntArrayElements (amp, 0 );
147
+ jint* m_add = env->GetIntArrayElements (add, 0 );
148
+ jint* m_pos = env->GetIntArrayElements (pos, 0 );
149
+ jint* m_nodeId = env->GetIntArrayElements (nodeId, 0 );
150
+
151
+ Methcla::Request request (engine ());
152
+ request.openBundle (Methcla::immediately);
153
+
154
+ if (m_freq[0 ] != -1 )
155
+ {
156
+ Methcla::AudioBusId freq_bus = m_engine->audioBusId ().alloc ();
157
+ request.set (m_nodeId[0 ], 0 , 0 );
158
+ request.free (m_freq[1 ]);
159
+ request.mapOutput (m_freq[0 ], 0 , freq_bus);
160
+ request.mapInput (m_nodeId[0 ], 0 , freq_bus);
161
+
162
+ std::cout << " freq" << std::endl;
163
+ }
164
+
165
+ if (m_amp[0 ] != -1 )
166
+ {
167
+
168
+ Methcla::AudioBusId amp_bus = m_engine->audioBusId ().alloc ();
169
+ // request.set(m_nodeId[0], 1 , 0);
170
+ // request.free(m_amp[1]);
171
+ request.mapOutput (m_amp[0 ], 0 , amp_bus);
172
+ std::cout << m_amp[0 ] << std::endl;
173
+ request.set (m_amp[0 ], 0 , 200 );
174
+
175
+ request.mapInput (m_nodeId[0 ], 1 , amp_bus);
176
+
177
+ std::cout << " amp" << std::endl;
178
+ }
179
+
180
+ if (m_add[0 ] != -1 )
181
+ {
182
+ Methcla::AudioBusId add_bus = m_engine->audioBusId ().alloc ();
183
+ request.set (m_nodeId[0 ], 2 , 0 );
184
+ request.free (m_add[1 ]);
185
+ request.mapOutput (m_add[0 ], 0 , add_bus);
186
+ request.mapInput (m_nodeId[0 ], 2 , add_bus);
187
+
188
+ std::cout << " add" << std::endl;
189
+ }
190
+
191
+ if (m_pos[0 ] != -1 )
192
+ {
193
+ Methcla::AudioBusId pos_bus = m_engine->audioBusId ().alloc ();
194
+ request.set (m_nodeId[1 ], 0 , 0 );
195
+ request.free (m_pos[1 ]);
196
+ request.mapOutput (m_pos[0 ], 0 , pos_bus);
197
+ request.mapInput (m_nodeId[1 ], 0 , pos_bus);
198
+
199
+ std::cout << " pos" << std::endl;
200
+ }
201
+
202
+ request.closeBundle ();
203
+ request.send ();
204
+
205
+ env->ReleaseIntArrayElements (freq, m_freq, 0 );
206
+ env->ReleaseIntArrayElements (amp, m_amp, 0 );
207
+ env->ReleaseIntArrayElements (add, m_add, 0 );
208
+ env->ReleaseIntArrayElements (pos, m_pos, 0 );
209
+ env->ReleaseIntArrayElements (nodeId, m_nodeId, 0 );
210
+ };
211
+
143
212
// SineOsc
144
213
145
214
JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_sinePlay (JNIEnv *env, jobject object, jfloat freq, jfloat amp, jfloat add, jfloat pos){
@@ -316,6 +385,7 @@ JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_sqrSet(JNIEnv *env
316
385
Methcla::Request request (engine ());
317
386
request.openBundle (Methcla::immediately);
318
387
request.set (m_nodeId[0 ], 0 , freq);
388
+ request.set (m_nodeId[0 ], 0 , 0 .5f );
319
389
request.set (m_nodeId[0 ], 2 , amp);
320
390
request.set (m_nodeId[1 ], 0 , pos);
321
391
request.closeBundle ();
@@ -780,9 +850,11 @@ JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_brownNoiseSet(JNIE
780
850
};
781
851
782
852
783
- JNIEXPORT jint JNICALL Java_processing_sound_MethClaInterface_envelopePlay (JNIEnv *env, jobject object, jintArray nodeId, jfloat attackTime, jfloat sustainTime, jfloat sustainLevel, jfloat releaseTime){
853
+ JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_envelopePlay (JNIEnv *env, jobject object, jintArray nodeId, jfloat attackTime, jfloat sustainTime, jfloat sustainLevel, jfloat releaseTime){
784
854
785
855
jint* m_nodeId = env->GetIntArrayElements (nodeId, 0 );
856
+ jintArray returnId = env->NewIntArray (2 );
857
+ jint *m_returnId = env->GetIntArrayElements (returnId, NULL );
786
858
787
859
Methcla::AudioBusId in_bus = m_engine->audioBusId ().alloc ();
788
860
Methcla::AudioBusId out_bus = m_engine->audioBusId ().alloc ();
@@ -813,15 +885,21 @@ JNIEXPORT jint JNICALL Java_processing_sound_MethClaInterface_envelopePlay(JNIEn
813
885
814
886
request.closeBundle ();
815
887
request.send ();
816
-
888
+
889
+ m_returnId[0 ]=synth.id ();
890
+ m_returnId[1 ]=m_nodeId[1 ];
891
+
892
+ env->ReleaseIntArrayElements (returnId, m_returnId, 0 );
817
893
env->ReleaseIntArrayElements (nodeId, m_nodeId, 0 );
818
894
819
- return synth. id () ;
895
+ return returnId ;
820
896
};
821
897
822
- JNIEXPORT jint JNICALL Java_processing_sound_MethClaInterface_highPassPlay (JNIEnv *env, jobject object, jintArray nodeId, jfloat freq, jfloat res){
898
+ JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_highPassPlay (JNIEnv *env, jobject object, jintArray nodeId, jfloat freq, jfloat res){
823
899
824
900
jint* m_nodeId = env->GetIntArrayElements (nodeId, 0 );
901
+ jintArray returnId = env->NewIntArray (2 );
902
+ jint *m_returnId = env->GetIntArrayElements (returnId, NULL );
825
903
826
904
Methcla::AudioBusId in_bus = m_engine->audioBusId ().alloc ();
827
905
Methcla::AudioBusId out_bus = m_engine->audioBusId ().alloc ();
@@ -845,14 +923,20 @@ JNIEXPORT jint JNICALL Java_processing_sound_MethClaInterface_highPassPlay(JNIEn
845
923
request.closeBundle ();
846
924
request.send ();
847
925
848
- env->ReleaseIntArrayElements (nodeId, m_nodeId, 0 );
926
+ m_returnId[0 ]=synth.id ();
927
+ m_returnId[1 ]=m_nodeId[1 ];
849
928
850
- return synth.id ();
929
+ env->ReleaseIntArrayElements (returnId, m_returnId, 0 );
930
+ env->ReleaseIntArrayElements (nodeId, m_nodeId, 0 );
931
+
932
+ return returnId;
851
933
};
852
934
853
- JNIEXPORT jint JNICALL Java_processing_sound_MethClaInterface_lowPassPlay (JNIEnv *env, jobject object, jintArray nodeId, jfloat freq, jfloat res){
935
+ JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_lowPassPlay (JNIEnv *env, jobject object, jintArray nodeId, jfloat freq, jfloat res){
854
936
855
937
jint* m_nodeId = env->GetIntArrayElements (nodeId, 0 );
938
+ jintArray returnId = env->NewIntArray (2 );
939
+ jint *m_returnId = env->GetIntArrayElements (returnId, NULL );
856
940
857
941
Methcla::AudioBusId in_bus = m_engine->audioBusId ().alloc ();
858
942
Methcla::AudioBusId out_bus = m_engine->audioBusId ().alloc ();
@@ -876,14 +960,20 @@ JNIEXPORT jint JNICALL Java_processing_sound_MethClaInterface_lowPassPlay(JNIEnv
876
960
request.closeBundle ();
877
961
request.send ();
878
962
879
- env->ReleaseIntArrayElements (nodeId, m_nodeId, 0 );
963
+ m_returnId[0 ]=synth.id ();
964
+ m_returnId[1 ]=m_nodeId[1 ];
880
965
881
- return synth.id ();
966
+ env->ReleaseIntArrayElements (returnId, m_returnId, 0 );
967
+ env->ReleaseIntArrayElements (nodeId, m_nodeId, 0 );
968
+
969
+ return returnId;
882
970
};
883
971
884
- JNIEXPORT jint JNICALL Java_processing_sound_MethClaInterface_bandPassPlay (JNIEnv *env, jobject object, jintArray nodeId, jfloat freq, jfloat res){
972
+ JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_bandPassPlay (JNIEnv *env, jobject object, jintArray nodeId, jfloat freq, jfloat res){
885
973
886
974
jint* m_nodeId = env->GetIntArrayElements (nodeId, 0 );
975
+ jintArray returnId = env->NewIntArray (2 );
976
+ jint *m_returnId = env->GetIntArrayElements (returnId, NULL );
887
977
888
978
Methcla::AudioBusId in_bus = m_engine->audioBusId ().alloc ();
889
979
Methcla::AudioBusId out_bus = m_engine->audioBusId ().alloc ();
@@ -907,9 +997,13 @@ JNIEXPORT jint JNICALL Java_processing_sound_MethClaInterface_bandPassPlay(JNIEn
907
997
request.closeBundle ();
908
998
request.send ();
909
999
1000
+ m_returnId[0 ]=synth.id ();
1001
+ m_returnId[1 ]=m_nodeId[1 ];
1002
+
1003
+ env->ReleaseIntArrayElements (returnId, m_returnId, 0 );
910
1004
env->ReleaseIntArrayElements (nodeId, m_nodeId, 0 );
911
1005
912
- return synth. id () ;
1006
+ return returnId ;
913
1007
};
914
1008
915
1009
JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_filterSet (JNIEnv *env, jobject object, jfloat freq, jfloat res, jint nodeId){
@@ -922,9 +1016,11 @@ JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_filterSet(JNIEnv *
922
1016
request.send ();
923
1017
};
924
1018
925
- JNIEXPORT jint JNICALL Java_processing_sound_MethClaInterface_delayPlay (JNIEnv *env, jobject object, jintArray nodeId, jfloat maxDelayTime, jfloat delayTime, jfloat feedBack){
1019
+ JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_delayPlay (JNIEnv *env, jobject object, jintArray nodeId, jfloat maxDelayTime, jfloat delayTime, jfloat feedBack){
926
1020
927
- jint* m_nodeId = env->GetIntArrayElements (nodeId, 0 );
1021
+ jint* m_nodeId = env->GetIntArrayElements (nodeId, 0 );
1022
+ jintArray returnId = env->NewIntArray (2 );
1023
+ jint *m_returnId = env->GetIntArrayElements (returnId, NULL );
928
1024
929
1025
Methcla::AudioBusId in_bus = m_engine->audioBusId ().alloc ();
930
1026
Methcla::AudioBusId out_bus = m_engine->audioBusId ().alloc ();
@@ -947,10 +1043,14 @@ JNIEXPORT jint JNICALL Java_processing_sound_MethClaInterface_delayPlay(JNIEnv *
947
1043
948
1044
request.closeBundle ();
949
1045
request.send ();
950
-
1046
+
1047
+ m_returnId[0 ]=synth.id ();
1048
+ m_returnId[1 ]=m_nodeId[1 ];
1049
+
1050
+ env->ReleaseIntArrayElements (returnId, m_returnId, 0 );
951
1051
env->ReleaseIntArrayElements (nodeId, m_nodeId, 0 );
952
1052
953
- return synth. id () ;
1053
+ return returnId ;
954
1054
};
955
1055
956
1056
@@ -963,9 +1063,11 @@ JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_delaySet(JNIEnv *e
963
1063
request.send ();
964
1064
};
965
1065
966
- JNIEXPORT jint JNICALL Java_processing_sound_MethClaInterface_reverbPlay (JNIEnv *env, jobject object, jintArray nodeId, jfloat room, jfloat damp, jfloat wet){
1066
+ JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_reverbPlay (JNIEnv *env, jobject object, jintArray nodeId, jfloat room, jfloat damp, jfloat wet){
967
1067
968
1068
jint* m_nodeId = env->GetIntArrayElements (nodeId, 0 );
1069
+ jintArray returnId = env->NewIntArray (2 );
1070
+ jint *m_returnId = env->GetIntArrayElements (returnId, NULL );
969
1071
970
1072
Methcla::AudioBusId in_bus = m_engine->audioBusId ().alloc ();
971
1073
Methcla::AudioBusId out_bus = m_engine->audioBusId ().alloc ();
@@ -991,9 +1093,13 @@ JNIEXPORT jint JNICALL Java_processing_sound_MethClaInterface_reverbPlay(JNIEnv
991
1093
request.closeBundle ();
992
1094
request.send ();
993
1095
1096
+ m_returnId[0 ]=synth.id ();
1097
+ m_returnId[1 ]=m_nodeId[1 ];
1098
+
1099
+ env->ReleaseIntArrayElements (returnId, m_returnId, 0 );
994
1100
env->ReleaseIntArrayElements (nodeId, m_nodeId, 0 );
995
1101
996
- return synth. id () ;
1102
+ return returnId ;
997
1103
};
998
1104
999
1105
JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_reverbSet (JNIEnv *env, jobject object, jfloat room, jfloat damp, jfloat wet, jint nodeId){
0 commit comments