abcjs
abcjs copied to clipboard
Fla and Sound duration
Hi @paulrosen !
It's me again, hope your doing well :)
I come with 2 questions :
-
First one is, when a want to do a fla (two hit really close), the time between depends of the metronome. So for exemple on this : https://daily-drum.com/challenge/19/groove-foo-fighters-my-hero The duration is too long. How to shorten it ? It should sound more like if you put it in 130 bpm
-
Sound duration in general : When a note is like 32th (so for exemple F/) the sound duration is really too short. In drums, for hitting a cymbal or the snare, the sound duration do not change. How can I acheive it ? I guess, related to a piano, I will be the equivalent by pressing the pedal so let the sound going in the time
Thanks for your time :)
Another things, I'm trying to use the CursorControl to create my own cursor with a smooth movement.
I kind of try using the event.left and event.top attribute to know where is the note in the space. But it's always shifts to left and top.
Here is my code, my div is a basic rectangle in absolute position :
var CursorControl = function() {
this.onEvent = function(event) {
console.log("An event is happening", event);
var test_cursor = document.getElementById('test-cursor');
if (test_cursor) {
document.getElementById('test-cursor').style.left = (event.left + 3) + "px";
document.getElementById('test-cursor').style.top = (event.top + 125) + "px";
}
}
}
<div class="relative rounded bg-white max-w-[1200px] mx-auto">
<div id="test-cursor" class="absolute cursor bg-{{ $theme }}-400"></div>
<div id="challenge-{{ $challenge?->id }}" class="note-renderer w-full"></div>
</div>

Any idea ?
For the cursor, look at the example https://paulrosen.github.io/abcjs/examples/full-synth.html. I think it probably has t do with where you are putting the cursor - try putting it inside the SVG instead.
For the sound, those are valid points but they aren't supported but you might be able to get what you want by looking at the https://paulrosen.github.io/abcjs/examples/modify-synth-input.html example. You can change to starting and duration of notes by hand there.