jsound/SoundSipher: Access Violation: jsound.dll+0xa37e
in
Contributed Library Questions
•
2 years ago
Is there any obvious reason why I am getting this error (eventually) from my script:
Note: I have three separate SoundSipher Melodies going on here and I am learning about how to control the start of play of each melody so the melodies start at the same time or could be offset from one another.I don't get the error when line 139 is uncommented and line 169 is commented. This line marks the beginning and ending of a SoundSipher melody. I think what is happening here is it's nesting part of a melody when I play the first melody when I put Melody.play(); on line 169 followed by Melody2.play();
I am having a hard time by listening whether the location of [sounsipherscore].play() in connection with other score's has any effect on the timing of when each score starts playing.
Do you have to use constraints to prevent changes to pitch, tempo, and instruments which in certain combinations cannot be handled by java?
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d5da37e, pid=5020, tid=4932
#
# JRE version: 6.0_20-b02
# Java VM: Java HotSpot(TM) Client VM (16.3-b01 mixed mode windows-x86 )
# Problematic frame:
# C [jsound.dll+0xa37e]
#
# An error report file with more information is saved as:
# C:\Program Files (x86)\Processing\processing-1.2.1\hs_err_pid5020.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Note: I have three separate SoundSipher Melodies going on here and I am learning about how to control the start of play of each melody so the melodies start at the same time or could be offset from one another.I don't get the error when line 139 is uncommented and line 169 is commented. This line marks the beginning and ending of a SoundSipher melody. I think what is happening here is it's nesting part of a melody when I play the first melody when I put Melody.play(); on line 169 followed by Melody2.play();
I am having a hard time by listening whether the location of [sounsipherscore].play() in connection with other score's has any effect on the timing of when each score starts playing.
Do you have to use constraints to prevent changes to pitch, tempo, and instruments which in certain combinations cannot be handled by java?
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d5da37e, pid=5020, tid=4932
#
# JRE version: 6.0_20-b02
# Java VM: Java HotSpot(TM) Client VM (16.3-b01 mixed mode windows-x86 )
# Problematic frame:
# C [jsound.dll+0xa37e]
#
# An error report file with more information is saved as:
# C:\Program Files (x86)\Processing\processing-1.2.1\hs_err_pid5020.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
- /**
- * UNTLS (BSD 2011)
- Music Class for Java Applets and Applications
- * Based on GeneratingBeats and Unlimited Art SoundCipher examples
- * by Andrew R. Brown.
- * A drum pattern generator that creates a 4 beat pattern,
- * plays it then generates another 4 beat pattern, and so on.
- * SoundCipher's callback facility is used to provide the loop
- * regeneration notification at the end of the pattern.
- * Simple drawing in time with the music is triggered by callbacks.
- */
- import arb.soundcipher.*;
- import static arb.soundcipher.constants.ProgramChanges.*;
- //MusicMaker myMusicMaker;
- //
- //void setup(){
- // size(200,200);
- //
- // myMusicMaker = new MusicMaker();
- //
- //}
- //
- //void draw(){
- //
- //}
- //String[] SubInstruments = {"BIRD","BOTTLE_BLOW","CELESTA","CRYSTAL","ELECTRIC_GRAND","FRETS",
- // "JAZZ_GUITAR","KALIMBA","KOTO","MARIMBA","MUSIC_BOX","ORCHESTRA_HIT",
- // "PICKED_BASS","SEA","SHAMISEN","STAR_THEME","STEEL_GUITAR","STEELDRUMS",
- // "TAIKO","TOMS","VIBRAPHONE","WOODBLOCKS","THUMB_PIANO"};
- //float[] SubInstruments = {123,76,8,98,2,120,26,108,107,12,10,55,
- // 34,122,106,103,25,114,
- // 116,119,11,115,108};
- float[] SubInstruments = {BIRD,BOTTLE_BLOW,CELESTA,CRYSTAL,ELECTRIC_GRAND,FRETS,
- JAZZ_GUITAR,KALIMBA,KOTO,MARIMBA,MUSIC_BOX,ORCHESTRA_HIT,
- PICKED_BASS,SEA,SHAMISEN,STAR_THEME,STEEL_GUITAR,STEELDRUMS,
- TAIKO,TOMS,VIBRAPHONE,WOODBLOCKS};
- //public class MusicMaker {
- //SCScore score = new SCScore();
- SCScore myScore = new SCScore();
- SCScore Melody = new SCScore();
- SCScore Melody2 = new SCScore();
- float[] r = new float[4];
- //public int uTempo;
- int Instrument;
- int LastInstrument;
- int uTempo;
- int NotePitch;
- int SwapTime;
- int lastSwap;
- float[] pitchSet = {57, 60, 60, 60, 62, 64, 67, 67, 69, 72, 72, 72, 74, 76, 79};
- //float[] pitchSet = {57, 57, 57, 60, 62, 64, 67, 67, 69, 62, 72, 64, 74, 76, 79};
- //float[] pitchSet = {24, 24, 35, 32, 32, 32, 34, 31, 31, 30, 26, 26, 28, 28, 29};
- float setSize = pitchSet.length;
- float keyRoot = 0;
- float density = 0.8;
- void setup(){
- size(400,278);
- // public MusicMaker() {
- //noLoop();
- uTempo = 62;
- //score.tempo(uTempo);
- myScore.tempo(uTempo);
- //score.addCallbackListener(this);
- myScore.addCallbackListener(this);
- makeMusic();
- SwapTime = 32 * 1000;
- lastSwap = millis();
- Instrument = int(random(130));
- LastInstrument = int(random(130));
- shapeMode(CENTER);
- }
- synchronized void makeMusic() {
- myScore.empty();
- for (float i=0; i<16; i++) {
- if (i%8 == 0 || i%16 == 14) {
- myScore.addNote(i/4, 9, 0, 36, 100, 0.25, 0.8, 64); // original instrument 36
- myScore.addCallback(i/4, 1);
- } else if (random(10) < 1) myScore.addNote(i/4, 9, 0, 36, 70, 0.25, 0.8, 64);
- if (i%8 == 4) {
- myScore.addNote(i/4, 9, 0, 38, 100, 0.25, 0.8, 64);
- myScore.addCallback(i/4, 2);
- } else if (random(10) < 2) myScore.addNote(i/4, 9, 0, 38, 60, 0.25, 0.8, 64);
- if(random(10) < 8) {
- myScore.addNote(i/4, 9, 0, 42, random(40) + 70, 0.25, 0.8, 64);
- myScore.addNote(i/8, 9, 0, LastInstrument, pitchSet[(int)random(setSize)]+keyRoot, 0.25, 0.8, 64);
- } else {
- myScore.addNote(i/4, 9, 0, Instrument, random(40) + 70, 0.25, 0.8, 64); //original instrument = 38
- myScore.addNote(i/4, 9, 0, Instrument, 80, 0.25, 0.8, 64); //original instrument = 38
- }
- }
- myScore.addCallback(4, 0);
- myScore.play();
- Melody.empty();
- // if (random(10) >= 8) {Melody.instrument((SubInstruments[int(random(SubInstruments.length-1))]));} else {
- // int a = int(random(3));
- // if (a == 0) {Melody.instrument(Melody.ACOUSTIC_GRAND);}
- // if (a == 1) {Melody.instrument(Melody.VIBRAPHONE);}
- // if (a == 2) {Melody.instrument(Melody.CELESTA);}
- // if (a == 3) {Melody.instrument(Melody.MARIMBA);}
- // }
- int Itemp = int(random(126));
- for (float i =0;i<32;i++) {
- NotePitch = int(random(setSize));
- if (random(1) < density) {
- //sc.playNote(pitchSet[(int)random(setSize)]+keyRoot, random(90)+30, random(20)/10 + 0.2);
- Melody.addNote(i/4,pitchSet[NotePitch]+keyRoot, random(90)+30, random(20)/10 + 0.2);
- fill(color(random(256), random (256), random(256)));
- rect(random(width), random(height), random(40), random(40));
- }
- if (i%32 == 0) {
- keyRoot = (random(4)-2)*2;
- density = random(7) / 10 + 0.3;
- Melody.addNote(i/2,46+keyRoot, random(40) + 70, 0.8);
- }
- if (i%16 == 0) {
- //Melody.instrument(Instrument);
- //float[] pitches = {pitchSet[(int)random(setSize)]+keyRoot-12, pitchSet[(int)random(setSize)]+keyRoot-12};
- //Melody.addNote(i/4,pitchSet[(int)random(setSize)]+keyRoot-12, random(50)+30, 4.0);
- //Melody.addNote(i/4, 9, Instrument, pitchSet[(int)random(setSize)]+keyRoot-12, 90,2, .75, 64);
- Melody.addNote(i/2,9,76,pitchSet[(int)random(setSize)]+keyRoot-12,120,1,2.8,65);
- //Melody.instrument(Melody.SLAP_BASS );
- rect(random(width), random(height), random(40), random(40));
- }
- }
- //Melody.instrument(49);
- //Melody.instrument(Instrument);
- //Melody.play();
- Melody2.empty();
- //Melody2.instrument((SubInstruments[int(random(SubInstruments.length-1))]));
- for (float i =0;i<32;i++) {
- if (random(1) < density) {
- //sc.playNote(pitchSet[(int)random(setSize)]+keyRoot, random(90)+30, random(20)/10 + 0.2);
- Melody2.addNote(i/4,pitchSet[NotePitch]+keyRoot, random(90)+10, random(20)/10 + 0.2);
- fill(color(random(256), random (256), random(256)));
- ellipse(random(width), random(height), random(40), random(40));
- }
- if (i%32 == 0) {
- keyRoot = (random(4)-2)*2;
- density = random(7) / 10 + 0.3;
- Melody2.addNote(i/2,46+keyRoot, random(40) + 20, 0.8);
- }
- if (i%16 == 0) {
- //Melody.instrument(Instrument);
- //float[] pitches = {pitchSet[(int)random(setSize)]+keyRoot-12, pitchSet[(int)random(setSize)]+keyRoot-12};
- //Melody.addNote(i/4,pitchSet[(int)random(setSize)]+keyRoot-12, random(50)+30, 4.0);
- //Melody.addNote(i/4, 9, Instrument, pitchSet[(int)random(setSize)]+keyRoot-12, 90,2, .75, 64);
- Melody2.addNote(i/2,9,76,pitchSet[NotePitch]+keyRoot-12,35,1,2.8,65);
- //Melody2.addNote(i/2,9,76,Melody2.BLUES,35,1,2.8,65);
- //Melody.instrument(Melody.SLAP_BASS );
- ellipse(random(width), random(height), random(40), random(40));;
- }
- }
- //Melody.instrument(49);
- //Melody2.BLUES;
- Melody.play();
- Melody2.play();
- }
- public void handleCallbacks(int callbackID) {
- switch (callbackID) {
- case 0:
- //score.stop();
- myScore.stop();
- makeMusic();
- break;
- case 1:
- float w = random(20);
- r = new float[] {50-w, 50-w, w*2, w*2};
- redraw();
- break;
- case 2:
- r = new float[] {20, 20, 60, 60};
- redraw();
- break;
- }
- }
- void draw() {
- //background(120);
- rect(r[0], r[1], r[2], r[3]);
- if (millis()-lastSwap >= SwapTime) {
- ChangeUp();
- lastSwap = millis();
- }
- }
- void stop() {
- //score.stop();
- myScore.stop();
- Melody.stop();
- Melody2.stop();
- }
- public void ChangeUp(){
- //score.stop(); //?
- myScore.stop();
- Melody2.stop();
- //Melody.stop();
- LastInstrument = Instrument;
- Instrument = int(random(126));
- println("Instrument: " + str(Instrument) + " " ); // good instruments: 65, 35,29,86,30,47,55, 69,58,54,83,92,81,62,75,123
- //score.tempo(uTempo);
- myScore.tempo(uTempo);
- Melody.tempo(uTempo);
- makeMusic();
- if (random(10) >= 8) {Melody.instrument((SubInstruments[int(random(SubInstruments.length-1))]));} else {
- int a = int(random(4));
- if (a == 0) {Melody.instrument(Melody.ACOUSTIC_GRAND);}
- if (a == 1) {Melody.instrument(Melody.VIBRAPHONE);}
- if (a == 2) {Melody.instrument(Melody.CELESTA);}
- if (a == 3) {Melody.instrument(Melody.MARIMBA);}
- }
- Melody2.instrument((SubInstruments[int(random(SubInstruments.length-1))]));
- if (random(10) >= 5) {float[] pitchSet = {57, 57, 57, 60, 62, 64, 67, 67, 69, 62, 72, 64, 74, 76, 79};} else
- {float[] pitchSet = {57, 60, 60, 60, 62, 64, 67, 67, 69, 72, 72, 72, 74, 76, 79};
- }
- }
- void mousePressed(){
- ChangeUp();
- uTempo = mouseX*2;
- println(str(mouseX));
- }
- //void mouseDragged() {
- // //sc.sendMidi(sc.PITCH_BEND, 0, 0, 100 - mouseY + 14);
- // //myScore.sendMidi(myScore.CONTROL_CHANGE, 0, 7, mouseX);
- // Melody.sendMidi(176, 0, 7, mouseX);
- //
- //}
- //void mousePressed(){
- // //MusicMaker.ChangeUp();
- // uTempo = mouseX*2;
- //}
- //public class handleCallbacks implements ActionListener {
- //
- // handleCallbacks (int callbackID) {
- // switch (callbackID) {
- // case 0:
- // //score.stop();
- // myScore.stop();
- // makeMusic();
- // break;
- // case 1:
- // float w = random(20);
- // r = new float[] {50-w, 50-w, w*2, w*2};
- // redraw();
- // break;
- // case 2:
- // r = new float[] {20, 20, 60, 60};
- // redraw();
- // break;
- // }
- // }
- //}
1