plugin 1.0.1
This commit is contained in:
1 parent
44fce48bb5
commit
018a8c5403
7 files changed
+2632
-26290
No files matched your search
+457
-25507
File diff suppressed because it is too large.
Load diff
+705
-16
@@ -1,14 +1,20 @@
|
||||
bpm: '140'
|
||||
bpm: '127'
|
||||
file: teste
|
||||
src: /nethome/jotachina/projetos/mmpSearch/mmp/teste.mmp
|
||||
tags:
|
||||
TAG:
|
||||
- plugin
|
||||
- sample
|
||||
- bassline
|
||||
automation: []
|
||||
bassline: []
|
||||
bassline:
|
||||
- Beat/Bassline 0
|
||||
- Batida/Linha de Baixo 1
|
||||
plugin:
|
||||
- tripleoscillator
|
||||
- audiofileprocessor
|
||||
sample: []
|
||||
sample:
|
||||
- latin_guitar02.ogg
|
||||
tracks:
|
||||
- arpeggiator:
|
||||
arp: '0'
|
||||
@@ -20,20 +26,10 @@ tracks:
|
||||
arpmode: '0'
|
||||
arprange: '1'
|
||||
arpskip: '0'
|
||||
arptime: '200'
|
||||
arptime: '100'
|
||||
arptime_denominator: '4'
|
||||
arptime_numerator: '4'
|
||||
arptime_syncmode: '0'
|
||||
audiofileprocessor:
|
||||
amp: '100'
|
||||
eframe: '1'
|
||||
interp: '1'
|
||||
lframe: '0'
|
||||
looped: '0'
|
||||
reversed: '0'
|
||||
sframe: '0'
|
||||
src: drums/clap01.ogg
|
||||
stutter: '0'
|
||||
chordcreator:
|
||||
chord: '0'
|
||||
chord-enabled: '0'
|
||||
@@ -103,6 +99,7 @@ tracks:
|
||||
fxchain:
|
||||
enabled: '0'
|
||||
numofeffects: '0'
|
||||
instrument_name: tripleoscillator
|
||||
instrumenttrack:
|
||||
basenote: '57'
|
||||
fxch: '0'
|
||||
@@ -123,6 +120,698 @@ tracks:
|
||||
outputprogram: '1'
|
||||
readable: '0'
|
||||
writable: '0'
|
||||
plugin_name: audiofileprocessor
|
||||
track_name: clap01.ogg
|
||||
tags: tripleoscillator
|
||||
track_name: TripleOscillator
|
||||
tripleoscillator:
|
||||
coarse0: '0'
|
||||
coarse1: '-12'
|
||||
coarse2: '-24'
|
||||
finel0: '0'
|
||||
finel1: '0'
|
||||
finel2: '0'
|
||||
finer0: '0'
|
||||
finer1: '0'
|
||||
finer2: '0'
|
||||
modalgo1: '2'
|
||||
modalgo2: '2'
|
||||
modalgo3: '2'
|
||||
pan0: '0'
|
||||
pan1: '0'
|
||||
pan2: '0'
|
||||
phoffset0: '0'
|
||||
phoffset1: '0'
|
||||
phoffset2: '0'
|
||||
stphdetun0: '0'
|
||||
stphdetun1: '0'
|
||||
stphdetun2: '0'
|
||||
userwavefile0: ''
|
||||
userwavefile1: ''
|
||||
userwavefile2: ''
|
||||
vol0: '33'
|
||||
vol1: '33'
|
||||
vol2: '33'
|
||||
wavetype0: '0'
|
||||
wavetype1: '0'
|
||||
wavetype2: '0'
|
||||
type: plugin
|
||||
- sample_info:
|
||||
len: '389'
|
||||
muted: '0'
|
||||
pan: '0'
|
||||
pos: '0'
|
||||
sample_rate: '44100'
|
||||
src: latin/latin_guitar02.ogg
|
||||
vol: '100'
|
||||
sample_name: latin_guitar02.ogg
|
||||
track_name: Sample track
|
||||
type: sample
|
||||
- bassline_name: Beat/Bassline 0
|
||||
instruments:
|
||||
- audiofileprocessor:
|
||||
amp: '100'
|
||||
eframe: '1'
|
||||
interp: '1'
|
||||
lframe: '0'
|
||||
looped: '0'
|
||||
reversed: '0'
|
||||
sframe: '0'
|
||||
src: drumsynth/cr8000/Conga_m.ds
|
||||
stutter: '0'
|
||||
basenote: '57'
|
||||
fxch: '0'
|
||||
instrument_name: Conga_m.ds
|
||||
instrument_type: '0'
|
||||
pan: '0'
|
||||
patterns:
|
||||
- name: Conga_m.ds
|
||||
pos: '0'
|
||||
steps:
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- name: Bubble.ds
|
||||
pos: '192'
|
||||
steps:
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
pitch: '0'
|
||||
pitchrange: '1'
|
||||
plugin_name: audiofileprocessor
|
||||
usemasterpitch: '1'
|
||||
vol: '100'
|
||||
- audiofileprocessor:
|
||||
amp: '100'
|
||||
eframe: '1'
|
||||
interp: '1'
|
||||
lframe: '0'
|
||||
looped: '0'
|
||||
reversed: '0'
|
||||
sframe: '0'
|
||||
src: drumsynth/effects/Bubble.ds
|
||||
stutter: '0'
|
||||
basenote: '57'
|
||||
fxch: '0'
|
||||
instrument_name: Bubble.ds
|
||||
instrument_type: '0'
|
||||
pan: '0'
|
||||
patterns:
|
||||
- name: Bubble.ds
|
||||
pos: '0'
|
||||
steps:
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- name: Bubble.ds
|
||||
pos: '192'
|
||||
steps:
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
pitch: '0'
|
||||
pitchrange: '1'
|
||||
plugin_name: audiofileprocessor
|
||||
usemasterpitch: '1'
|
||||
vol: '100'
|
||||
- audiofileprocessor:
|
||||
amp: '100'
|
||||
eframe: '1'
|
||||
interp: '1'
|
||||
lframe: '0'
|
||||
looped: '0'
|
||||
reversed: '0'
|
||||
sframe: '0'
|
||||
src: drumsynth/misc_perc/clav_2.ds
|
||||
stutter: '0'
|
||||
basenote: '57'
|
||||
fxch: '0'
|
||||
instrument_name: clav_2.ds
|
||||
instrument_type: '0'
|
||||
pan: '0'
|
||||
patterns:
|
||||
- name: clav_2.ds
|
||||
pos: '0'
|
||||
steps:
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- name: clav_2.ds
|
||||
pos: '192'
|
||||
steps:
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
pitch: '0'
|
||||
pitchrange: '1'
|
||||
plugin_name: audiofileprocessor
|
||||
usemasterpitch: '1'
|
||||
vol: '100'
|
||||
- audiofileprocessor:
|
||||
amp: '100'
|
||||
eframe: '1'
|
||||
interp: '1'
|
||||
lframe: '0'
|
||||
looped: '0'
|
||||
reversed: '0'
|
||||
sframe: '0'
|
||||
src: gig/DrumKits/drive-download-20230412T011016Z-001/Percs/triangle.wav
|
||||
stutter: '0'
|
||||
basenote: '57'
|
||||
fxch: '0'
|
||||
instrument_name: triangle.wav
|
||||
instrument_type: '0'
|
||||
pan: '0'
|
||||
patterns:
|
||||
- name: triangle.wav
|
||||
pos: '0'
|
||||
steps:
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- name: clav_2.ds
|
||||
pos: '192'
|
||||
steps:
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
pitch: '0'
|
||||
pitchrange: '1'
|
||||
plugin_name: audiofileprocessor
|
||||
usemasterpitch: '1'
|
||||
vol: '100'
|
||||
- audiofileprocessor:
|
||||
amp: '100'
|
||||
eframe: '1'
|
||||
interp: '1'
|
||||
lframe: '0'
|
||||
looped: '0'
|
||||
reversed: '0'
|
||||
sframe: '0'
|
||||
src: gig/DrumKits/drive-download-20230412T011016Z-001/Percs/boombap.wav
|
||||
stutter: '0'
|
||||
basenote: '57'
|
||||
fxch: '0'
|
||||
instrument_name: boombap.wav
|
||||
instrument_type: '0'
|
||||
pan: '0'
|
||||
patterns:
|
||||
- name: boombap.wav
|
||||
pos: '0'
|
||||
steps:
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- name: boombap.wav
|
||||
pos: '192'
|
||||
steps:
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
pitch: '0'
|
||||
pitchrange: '1'
|
||||
plugin_name: audiofileprocessor
|
||||
usemasterpitch: '1'
|
||||
vol: '100'
|
||||
- audiofileprocessor:
|
||||
amp: '100'
|
||||
eframe: '1'
|
||||
interp: '1'
|
||||
lframe: '0'
|
||||
looped: '0'
|
||||
reversed: '0'
|
||||
sframe: '0'
|
||||
src: instruments/flute01.ogg
|
||||
stutter: '0'
|
||||
basenote: '57'
|
||||
fxch: '0'
|
||||
instrument_name: flute01.ogg
|
||||
instrument_type: '0'
|
||||
pan: '0'
|
||||
patterns:
|
||||
- name: flute01.ogg
|
||||
pos: '0'
|
||||
steps:
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- name: flute01.ogg
|
||||
pos: '192'
|
||||
steps:
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
- true
|
||||
- false
|
||||
- false
|
||||
- false
|
||||
pitch: '0'
|
||||
pitchrange: '1'
|
||||
plugin_name: audiofileprocessor
|
||||
usemasterpitch: '1'
|
||||
vol: '100'
|
||||
tags: audiofileprocessor
|
||||
type: bassline
|
||||
- bassline_name: Batida/Linha de Baixo 1
|
||||
instruments: []
|
||||
tags: ''
|
||||
type: bassline
|
||||
+746
-263
File diff suppressed because it is too large.
Load diff
@@ -6,6 +6,22 @@ import { highlightStep } from "./pattern_ui.js";
|
||||
import { getTotalSteps } from "../utils.js";
|
||||
import { initializeAudioContext } from "../audio.js";
|
||||
|
||||
// Ajuste os caminhos (../plugins/...) conforme a estrutura real das suas pastas
|
||||
import { TripleOscillator } from "../../audio/plugins/TripleOscillator.js";
|
||||
import { Nes } from "../../audio/plugins/Nes.js";
|
||||
import { SuperSaw } from "../../audio/plugins/SuperSaw.js";
|
||||
import { Lb302 } from "../../audio/plugins/Lb302.js";
|
||||
import { Kicker } from "../../audio/plugins/Kicker.js";
|
||||
|
||||
// Mapa para facilitar a criação dinâmica
|
||||
const PLUGIN_CLASSES = {
|
||||
tripleoscillator: TripleOscillator,
|
||||
nes: Nes,
|
||||
supersaw: SuperSaw,
|
||||
lb302: Lb302,
|
||||
kicker: Kicker,
|
||||
};
|
||||
|
||||
const timerDisplay = document.getElementById("timer-display");
|
||||
|
||||
// Variável para armazenar as "Parts" (sequências melódicas) do Tone.js
|
||||
@@ -104,30 +120,35 @@ function tick() {
|
||||
}
|
||||
}
|
||||
|
||||
// Percorre tracks e toca o step atual se ativo
|
||||
// PERCORRE AS TRACKS
|
||||
appState.pattern.tracks.forEach((track) => {
|
||||
if (track.muted) return; // Respeita o Mute
|
||||
if (track.muted) return;
|
||||
if (!track.patterns || track.patterns.length === 0) return;
|
||||
|
||||
const activePattern = track.patterns[track.activePatternIndex];
|
||||
if (!activePattern) return;
|
||||
|
||||
// Verifica se o step atual está ativo
|
||||
if (activePattern && activePattern.steps[appState.global.currentStep]) {
|
||||
|
||||
// CASO 1: SAMPLER (Arquivo de Áudio)
|
||||
if (activePattern.steps[appState.global.currentStep]) {
|
||||
// CASO 1: SAMPLER (Sempre toca no step)
|
||||
if (track.samplePath) {
|
||||
playSample(track.samplePath, track.id);
|
||||
}
|
||||
// CASO 2: PLUGIN (Sintetizador)
|
||||
// Se for plugin e tiver step marcado, toca nota padrão (C5)
|
||||
else if (track.type === 'plugin' && track.instrument) {
|
||||
// "16n" é a duração de uma semicolcheia
|
||||
// Usamos um try/catch para evitar travar o loop se o plugin falhar
|
||||
try {
|
||||
track.instrument.triggerAttackRelease("C5", "16n", Tone.now());
|
||||
} catch (e) {
|
||||
console.warn("Falha ao tocar step do plugin:", e);
|
||||
}
|
||||
else if (track.type === "plugin" && track.instrument) {
|
||||
// --- CORREÇÃO DO SOM DUPLICADO ---
|
||||
// Verifica se existem notas no Piano Roll.
|
||||
// Se houver notas (array notes > 0), IGNORA o step sequencer.
|
||||
// O som será gerado APENAS pelo 'schedulePianoRoll'.
|
||||
|
||||
const hasNotes = activePattern.notes && activePattern.notes.length > 0;
|
||||
|
||||
if (!hasNotes) {
|
||||
// Só toca o C5 do step se NÃO houver melodia desenhada
|
||||
try {
|
||||
track.instrument.triggerAttackRelease("C5", "16n", Tone.now());
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -142,7 +163,7 @@ export function startPlayback() {
|
||||
|
||||
// Garante que o contexto do Tone esteja rodando
|
||||
if (Tone.context.state !== "running") {
|
||||
Tone.start();
|
||||
Tone.start();
|
||||
}
|
||||
|
||||
if (appState.global.currentStep === 0) {
|
||||
@@ -183,14 +204,20 @@ export function stopPlayback() {
|
||||
Tone.Transport.stop();
|
||||
|
||||
// Limpa agendamentos melódicos
|
||||
activeParts.forEach(part => part.dispose());
|
||||
activeParts.forEach((part) => part.dispose());
|
||||
activeParts = [];
|
||||
|
||||
// Solta notas travadas de todos os plugins
|
||||
appState.pattern.tracks.forEach(track => {
|
||||
try { track.player?.stop(); } catch {}
|
||||
try { track.instrument?.releaseAll?.(); } catch {} // Para PolySynths
|
||||
try { track.instrument?.triggerRelease?.(); } catch {} // Para MonoSynths
|
||||
appState.pattern.tracks.forEach((track) => {
|
||||
try {
|
||||
track.player?.stop();
|
||||
} catch {}
|
||||
try {
|
||||
track.instrument?.releaseAll?.();
|
||||
} catch {} // Para PolySynths
|
||||
try {
|
||||
track.instrument?.triggerRelease?.();
|
||||
} catch {} // Para MonoSynths
|
||||
});
|
||||
// --------------------------------------------
|
||||
|
||||
@@ -232,53 +259,64 @@ export function togglePlayback() {
|
||||
}
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// AGENDADOR DE PIANO ROLL (NOVA FUNÇÃO)
|
||||
// Agenda as notas melódicas (desenhadas no Piano Roll) para tocar no Tone.Transport
|
||||
// =========================================================================
|
||||
// 2. Agendador de Piano Roll (Melodia)
|
||||
function schedulePianoRoll() {
|
||||
// Limpa anteriores por segurança
|
||||
activeParts.forEach(part => part.dispose());
|
||||
activeParts = [];
|
||||
activeParts.forEach((part) => part.dispose());
|
||||
activeParts = [];
|
||||
|
||||
appState.pattern.tracks.forEach(track => {
|
||||
appState.pattern.tracks.forEach((track) => {
|
||||
if (track.muted) return;
|
||||
const pattern = track.patterns[track.activePatternIndex];
|
||||
|
||||
if (
|
||||
pattern &&
|
||||
pattern.notes &&
|
||||
pattern.notes.length > 0 &&
|
||||
track.instrument
|
||||
) {
|
||||
// Converte notas para eventos Tone.js
|
||||
const events = pattern.notes.map((note) => {
|
||||
// --- CORREÇÃO DE TEMPO (PPQ) ---
|
||||
// LMMS usa 192 ticks por batida. Tone.js também usa 192 por padrão.
|
||||
// Precisamos converter o 'pos' (ticks absolutos) para tempo musical
|
||||
|
||||
// 1 Beat = 192 ticks
|
||||
// Tone.Time("0:0:0").toTicks()
|
||||
|
||||
return {
|
||||
// Passamos 'ticks' diretamente. O Tone converte baseado no BPM.
|
||||
time:
|
||||
0 + (note.pos * (Tone.Transport.PPQ / 192)) / Tone.Transport.PPQ,
|
||||
midi: note.key,
|
||||
duration: note.len / 192 + "n", // Converte duração baseada em semínimas (192)
|
||||
velocity: (note.vol || 100) / 100,
|
||||
};
|
||||
});
|
||||
|
||||
const part = new Tone.Part((time, value) => {
|
||||
if (track.muted) return;
|
||||
const pattern = track.patterns[track.activePatternIndex];
|
||||
const freq = Tone.Frequency(value.midi, "midi");
|
||||
|
||||
// Só agenda se tiver notas E for um instrumento
|
||||
if (pattern && pattern.notes && pattern.notes.length > 0 && track.instrument) {
|
||||
|
||||
// Mapeia as notas para o formato de evento do Tone.js
|
||||
const events = pattern.notes.map(note => {
|
||||
return {
|
||||
// Converte Ticks (pos) para Tempo Musical do Tone.js
|
||||
// Assumindo 192 PPQ (padrão LMMS) -> Tone PPQ
|
||||
time: 0 + (note.pos * (Tone.Transport.PPQ / 192) / Tone.Transport.PPQ),
|
||||
midi: note.key,
|
||||
duration: note.len + "i", // 'i' em Tone.js significa ticks
|
||||
velocity: (note.vol || 100) / 100
|
||||
};
|
||||
});
|
||||
|
||||
// Cria uma Part (sequência)
|
||||
const part = new Tone.Part((time, value) => {
|
||||
if (track.muted) return;
|
||||
|
||||
const freq = Tone.Frequency(value.midi, "midi");
|
||||
// Dispara o método que padronizamos em todos os plugins
|
||||
if (track.instrument.triggerAttackRelease) {
|
||||
track.instrument.triggerAttackRelease(freq, value.duration, time, value.velocity);
|
||||
}
|
||||
}, events).start(0);
|
||||
|
||||
// Configura o Loop da Melodia
|
||||
const bars = parseInt(document.getElementById('bars-input')?.value || 1);
|
||||
part.loop = true;
|
||||
part.loopEnd = bars + "m"; // 'm' = measure (compasso)
|
||||
|
||||
activeParts.push(part);
|
||||
// Dispara nota
|
||||
if (track.instrument.triggerAttackRelease) {
|
||||
// Se a duração calculada for muito curta ou inválida, usa 16n
|
||||
const dur = value.duration || "16n";
|
||||
track.instrument.triggerAttackRelease(
|
||||
freq,
|
||||
dur,
|
||||
time,
|
||||
value.velocity
|
||||
);
|
||||
}
|
||||
});
|
||||
}, events).start(0);
|
||||
|
||||
const bars = parseInt(document.getElementById("bars-input")?.value || 1);
|
||||
part.loop = true;
|
||||
part.loopEnd = bars + "m";
|
||||
|
||||
activeParts.push(part);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
@@ -289,56 +327,149 @@ export async function renderActivePatternToBlob() {
|
||||
initializeAudioContext();
|
||||
|
||||
const bpm = parseInt(document.getElementById("bpm-input").value, 10) || 120;
|
||||
const totalSteps = getTotalSteps();
|
||||
const stepInterval = 60 / (bpm * 4);
|
||||
const duration = totalSteps * stepInterval;
|
||||
|
||||
// =========================================================
|
||||
// 1. CÁLCULO DE DURAÇÃO INTELIGENTE
|
||||
// =========================================================
|
||||
const stepInterval = 60 / (bpm * 4);
|
||||
const activePatternIndex =
|
||||
appState.pattern.tracks[0]?.activePatternIndex || 0;
|
||||
let maxStepFound = getTotalSteps(); // Mínimo: tamanho da tela
|
||||
|
||||
const buffer = await Tone.Offline(async () => {
|
||||
// Varre todas as tracks para achar a última nota ou step
|
||||
appState.pattern.tracks.forEach((track) => {
|
||||
const p = track.patterns[activePatternIndex];
|
||||
if (!p) return;
|
||||
|
||||
// A. Steps (Bateria)
|
||||
if (p.steps && p.steps.includes(true)) {
|
||||
const lastIdx = p.steps.lastIndexOf(true);
|
||||
if (lastIdx + 1 > maxStepFound) maxStepFound = lastIdx + 1;
|
||||
}
|
||||
|
||||
// B. Notas (Piano Roll) - Assumindo 192 ticks/beat e steps de 1/16 (48 ticks)
|
||||
if (p.notes && p.notes.length > 0) {
|
||||
p.notes.forEach((n) => {
|
||||
const endTick = n.pos + n.len;
|
||||
const endStep = Math.ceil(endTick / 48);
|
||||
if (endStep > maxStepFound) maxStepFound = endStep;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Arredonda para o próximo compasso cheio (múltiplo de 16)
|
||||
const stepsPerBar = 16;
|
||||
const totalSteps = Math.ceil(maxStepFound / stepsPerBar) * stepsPerBar;
|
||||
const duration = totalSteps * stepInterval;
|
||||
|
||||
// =========================================================
|
||||
// 2. RENDERIZAÇÃO OFFLINE
|
||||
// =========================================================
|
||||
const buffer = await Tone.Offline(async ({ transport }) => {
|
||||
const masterGain = new Tone.Gain().toDestination();
|
||||
|
||||
const offlineTracksParts = appState.pattern.tracks
|
||||
.map((track) => {
|
||||
const pattern = track.patterns[activePatternIndex];
|
||||
// Loop por cada trilha do projeto
|
||||
appState.pattern.tracks.forEach((track) => {
|
||||
const pattern = track.patterns[activePatternIndex];
|
||||
// Se não tem pattern, ou se é uma track muda/vazia, pula
|
||||
if (!pattern || track.muted) return;
|
||||
|
||||
// Nota: O render atual suporta apenas Samplers (buffers carregados)
|
||||
// Para suportar Plugins no futuro, precisaríamos recriar o synth aqui dentro.
|
||||
if (!pattern || !track.buffer || !pattern.steps.includes(true)) {
|
||||
return null;
|
||||
}
|
||||
// Verifica se tem conteúdo (buffer de áudio OU notas MIDI OU steps ativos)
|
||||
const hasAudio = track.buffer;
|
||||
const hasNotes = pattern.notes && pattern.notes.length > 0;
|
||||
const hasSteps = pattern.steps && pattern.steps.includes(true);
|
||||
|
||||
const trackBuffer = track.buffer;
|
||||
const panner = new Tone.Panner(track.pan).connect(masterGain);
|
||||
const volume = new Tone.Volume(Tone.gainToDb(track.volume)).connect(
|
||||
panner
|
||||
);
|
||||
if (!hasAudio && !hasNotes && !hasSteps) return;
|
||||
|
||||
const events = [];
|
||||
pattern.steps.forEach((isActive, stepIndex) => {
|
||||
if (isActive) {
|
||||
const time = stepIndex * stepInterval;
|
||||
events.push(time);
|
||||
// Cria canal de volume/pan para essa track no mundo Offline
|
||||
const panner = new Tone.Panner(track.pan || 0).connect(masterGain);
|
||||
const volume = new Tone.Volume(
|
||||
track.volume === 0 ? -100 : Tone.gainToDb(track.volume)
|
||||
).connect(panner);
|
||||
|
||||
// --- CENÁRIO A: É um SAMPLE (Áudio gravado) ---
|
||||
if (track.samplePath && track.buffer) {
|
||||
// Lógica original de steps para samples
|
||||
if (pattern.steps) {
|
||||
const events = [];
|
||||
pattern.steps.forEach((isActive, stepIndex) => {
|
||||
if (isActive) events.push(stepIndex * stepInterval);
|
||||
});
|
||||
|
||||
if (events.length > 0) {
|
||||
new Tone.Part((time) => {
|
||||
new Tone.Player(track.buffer).connect(volume).start(time);
|
||||
}, events).start(0);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const part = new Tone.Part((time) => {
|
||||
new Tone.Player(trackBuffer)
|
||||
.connect(volume)
|
||||
.start(time);
|
||||
}, events);
|
||||
// --- CENÁRIO B: É um PLUGIN (Sintetizador) ---
|
||||
else if (track.type === "plugin") {
|
||||
// Normaliza o nome (ex: "TripleOscillator" -> "tripleoscillator")
|
||||
// Tenta pegar o nome da propriedade 'pluginName', 'instrument.name' ou do próprio objeto params
|
||||
const pluginName = (
|
||||
track.pluginName ||
|
||||
track.instrument?.constructor?.name ||
|
||||
""
|
||||
).toLowerCase();
|
||||
|
||||
return part;
|
||||
})
|
||||
.filter((t) => t !== null);
|
||||
const PluginClass = PLUGIN_CLASSES[pluginName];
|
||||
|
||||
offlineTracksParts.forEach((part) => {
|
||||
part.start(0);
|
||||
if (PluginClass) {
|
||||
// INSTANCIA O PLUGIN NO MUNDO OFFLINE
|
||||
// Passamos 'track.params' ou 'track.pluginData' (ajuste conforme seu appState salva os dados)
|
||||
const instrumentInstance = new PluginClass(
|
||||
null,
|
||||
track.params || track.pluginData || {}
|
||||
);
|
||||
|
||||
// Conecta na cadeia de áudio offline
|
||||
instrumentInstance.connect(volume);
|
||||
|
||||
// 1. Agendar Notas do Piano Roll
|
||||
if (hasNotes) {
|
||||
const events = pattern.notes.map((note) => ({
|
||||
time: 0 + note.pos * (48 / 192) * stepInterval, // Conversão aproximada Ticks -> Segundos
|
||||
// Se quiser precisão exata do Tone, use: note.pos * (Tone.Transport.PPQ / 192) / Tone.Transport.PPQ
|
||||
midi: note.key,
|
||||
duration: (note.len / 192) * (60 / bpm), // Duração em segundos
|
||||
velocity: (note.vol || 100) / 100,
|
||||
}));
|
||||
|
||||
new Tone.Part((time, val) => {
|
||||
const freq = Tone.Frequency(val.midi, "midi");
|
||||
instrumentInstance.triggerAttackRelease(freq, val.duration, time);
|
||||
}, events).start(0);
|
||||
}
|
||||
|
||||
// 2. Agendar Steps (Caso use o TripleOscillator como bateria/efeito no step sequencer)
|
||||
else if (hasSteps) {
|
||||
const stepEvents = [];
|
||||
pattern.steps.forEach((isActive, idx) => {
|
||||
if (isActive) stepEvents.push(idx * stepInterval);
|
||||
});
|
||||
|
||||
new Tone.Part((time) => {
|
||||
// Toca um C5 padrão para steps sem nota definida
|
||||
instrumentInstance.triggerAttackRelease(
|
||||
Tone.Frequency("C5"),
|
||||
0.1,
|
||||
time
|
||||
);
|
||||
}, stepEvents).start(0);
|
||||
}
|
||||
} else {
|
||||
console.warn(
|
||||
`Render: Plugin não suportado ou não encontrado: ${pluginName}`
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Tone.Transport.bpm.value = bpm;
|
||||
Tone.Transport.start();
|
||||
// Configura e inicia o Transport Offline
|
||||
transport.bpm.value = bpm;
|
||||
transport.start();
|
||||
}, duration);
|
||||
|
||||
const blob = bufferToWave(buffer);
|
||||
|
||||
@@ -7,6 +7,7 @@ import { playSample, stopPlayback } from "./pattern_audio.js";
|
||||
import { getTotalSteps } from "../utils.js";
|
||||
import { sendAction } from '../socket.js';
|
||||
import { initializeAudioContext } from '../audio.js';
|
||||
import * as Tone from "https://esm.sh/tone";
|
||||
|
||||
// Função principal de renderização para o editor de patterns
|
||||
export function renderPatternEditor() {
|
||||
@@ -105,7 +106,7 @@ export function redrawSequencer() {
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
// LÓGICA DE DECISÃO V2: STEPS OU PIANO ROLL?
|
||||
// LÓGICA DE DECISÃO V2: STEPS OU PIANO ROLL? (MANTIDA)
|
||||
// ============================================================
|
||||
|
||||
const notes = activePattern.notes || [];
|
||||
@@ -117,7 +118,6 @@ export function redrawSequencer() {
|
||||
const isMelodic = notes.some(n => n.key !== firstKey);
|
||||
const hasLongNotes = notes.some(n => n.len > 48);
|
||||
|
||||
// Sobreposição de notas (Acordes)
|
||||
const sortedNotes = [...notes].sort((a, b) => a.pos - b.pos);
|
||||
let hasOverlap = false;
|
||||
for (let i = 0; i < sortedNotes.length - 1; i++) {
|
||||
@@ -153,14 +153,18 @@ export function redrawSequencer() {
|
||||
}
|
||||
});
|
||||
|
||||
// --- CÁLCULO REVERTIDO (VOLTA AO PADRÃO ANTERIOR) ---
|
||||
const barsInput = document.getElementById('bars-input');
|
||||
const barsCount = barsInput ? parseInt(barsInput.value) || 1 : 1;
|
||||
|
||||
// Revertido: Removemos a multiplicação por beatsPerBar que causou o bug visual
|
||||
const totalTicks = 192 * barsCount;
|
||||
// ----------------------------------------------------
|
||||
|
||||
activePattern.notes.forEach(note => {
|
||||
const noteEl = document.createElement('div');
|
||||
noteEl.className = 'mini-note';
|
||||
|
||||
const barsInput = document.getElementById('bars-input');
|
||||
const barsCount = barsInput ? parseInt(barsInput.value) || 1 : 1;
|
||||
const totalTicks = 192 * barsCount;
|
||||
|
||||
const leftPercent = (note.pos / totalTicks) * 100;
|
||||
const widthPercent = (note.len / totalTicks) * 100;
|
||||
|
||||
@@ -200,7 +204,6 @@ export function redrawSequencer() {
|
||||
stepElement.classList.add("active");
|
||||
}
|
||||
|
||||
// --- EVENTO DE CLIQUE (CORRIGIDO PARA PLUGINS) ---
|
||||
stepElement.addEventListener("click", (e) => {
|
||||
e.stopPropagation();
|
||||
initializeAudioContext();
|
||||
@@ -216,18 +219,13 @@ export function redrawSequencer() {
|
||||
isActive: isActive
|
||||
});
|
||||
|
||||
// --- AQUI ESTAVA O PROBLEMA: TOCA O SOM ---
|
||||
if (isActive) {
|
||||
// Caso 1: Sampler (Áudio)
|
||||
if (trackData.type === 'sampler' && trackData.samplePath) {
|
||||
playSample(trackData.samplePath, trackData.id);
|
||||
}
|
||||
// Caso 2: Plugin (Sintetizador)
|
||||
else if (trackData.type === 'plugin' && trackData.instrument) {
|
||||
// Toca um C5 (Dó) curto para feedback visual/sonoro
|
||||
try {
|
||||
// triggerAttackRelease(nota, duração)
|
||||
trackData.instrument.triggerAttackRelease("C5", "16n");
|
||||
trackData.instrument.triggerAttackRelease("C5", "16n", Tone.now());
|
||||
} catch(err) {
|
||||
console.warn("Erro ao tocar preview do synth:", err);
|
||||
}
|
||||
|
||||
+406
-394
@@ -70,418 +70,425 @@
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<aside class="sample-browser">
|
||||
<div class="browser-header">Navegador de Samples</div>
|
||||
<div class="browser-content" id="browser-content"></div>
|
||||
</aside>
|
||||
|
||||
<button id="sidebar-toggle"><i class="fa-solid fa-caret-left"></i></button>
|
||||
<div class="app-container">
|
||||
<header class="global-toolbar">
|
||||
<div class="control-group">
|
||||
<i
|
||||
class="fa-solid fa-file"
|
||||
id="new-project-btn"
|
||||
title="Novo Projeto"
|
||||
></i>
|
||||
<i
|
||||
class="fa-solid fa-folder-open"
|
||||
id="open-mmp-btn"
|
||||
title="Abrir Projeto do Servidor"
|
||||
></i>
|
||||
<i
|
||||
class="fa-solid fa-save"
|
||||
id="save-mmp-btn"
|
||||
title="Salvar Projeto (.mmp)"
|
||||
></i>
|
||||
<i
|
||||
class="fa-solid fa-upload"
|
||||
id="upload-sample-btn"
|
||||
title="Carregar Sample do Computador"
|
||||
></i>
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
<div class="control-group">
|
||||
<i
|
||||
class="fa-solid fa-backward-step"
|
||||
id="rewind-btn"
|
||||
title="Voltar ao Início"
|
||||
></i>
|
||||
<i class="fa-solid fa-play" title="Play/Pause Global (Futuro)"></i>
|
||||
<i class="fa-solid fa-stop" title="Stop Global (Futuro)"></i>
|
||||
<button id="record-btn" class="transport-btn" title="Gravar">
|
||||
<i class="fa-solid fa-circle-dot"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
<div class="info-display-group">
|
||||
<div class="info-display">
|
||||
<div class="interactive-input-container">
|
||||
<button class="adjust-btn" data-target="bpm" data-step="-1">
|
||||
-
|
||||
</button>
|
||||
<input
|
||||
type="text"
|
||||
class="value-input"
|
||||
id="bpm-input"
|
||||
value="140"
|
||||
data-min="20"
|
||||
data-max="400"
|
||||
/>
|
||||
<button class="adjust-btn" data-target="bpm" data-step="1">
|
||||
+
|
||||
</button>
|
||||
</div>
|
||||
<div class="label">ANDAMENTO/BPM</div>
|
||||
<div class="studio-wrapper">
|
||||
|
||||
<aside class="sample-browser">
|
||||
<div class="browser-header">Navegador de Samples</div>
|
||||
<div class="browser-content" id="browser-content"></div>
|
||||
</aside>
|
||||
|
||||
<button id="sidebar-toggle"><i class="fa-solid fa-caret-left"></i></button>
|
||||
|
||||
<div class="app-container">
|
||||
<header class="global-toolbar">
|
||||
<div class="control-group">
|
||||
<i
|
||||
class="fa-solid fa-file"
|
||||
id="new-project-btn"
|
||||
title="Novo Projeto"
|
||||
></i>
|
||||
<i
|
||||
class="fa-solid fa-folder-open"
|
||||
id="open-mmp-btn"
|
||||
title="Abrir Projeto do Servidor"
|
||||
></i>
|
||||
<i
|
||||
class="fa-solid fa-save"
|
||||
id="save-mmp-btn"
|
||||
title="Salvar Projeto (.mmp)"
|
||||
></i>
|
||||
<i
|
||||
class="fa-solid fa-upload"
|
||||
id="upload-sample-btn"
|
||||
title="Carregar Sample do Computador"
|
||||
></i>
|
||||
</div>
|
||||
<div class="info-display">
|
||||
<div class="interactive-input-container">
|
||||
<button class="adjust-btn" data-target="bars" data-step="-1">
|
||||
-
|
||||
</button>
|
||||
<input
|
||||
type="text"
|
||||
class="value-input"
|
||||
id="bars-input"
|
||||
value="1"
|
||||
data-min="1"
|
||||
data-max="64"
|
||||
/>
|
||||
<button class="adjust-btn" data-target="bars" data-step="1">
|
||||
+
|
||||
</button>
|
||||
</div>
|
||||
<div class="label">COMPASSOS</div>
|
||||
<div class="divider"></div>
|
||||
<div class="control-group">
|
||||
<i
|
||||
class="fa-solid fa-backward-step"
|
||||
id="rewind-btn"
|
||||
title="Voltar ao Início"
|
||||
></i>
|
||||
<i class="fa-solid fa-play" title="Play/Pause Global (Futuro)"></i>
|
||||
<i class="fa-solid fa-stop" title="Stop Global (Futuro)"></i>
|
||||
<button id="record-btn" class="transport-btn" title="Gravar">
|
||||
<i class="fa-solid fa-circle-dot"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="info-display">
|
||||
<div class="interactive-input-container">
|
||||
<div class="compasso-group">
|
||||
<button
|
||||
class="adjust-btn"
|
||||
data-target="compasso-a"
|
||||
data-step="-1"
|
||||
>
|
||||
<div class="divider"></div>
|
||||
<div class="info-display-group">
|
||||
<div class="info-display">
|
||||
<div class="interactive-input-container">
|
||||
<button class="adjust-btn" data-target="bpm" data-step="-1">
|
||||
-
|
||||
</button>
|
||||
<input
|
||||
type="text"
|
||||
class="value-input compasso-input"
|
||||
id="compasso-a-input"
|
||||
value="4"
|
||||
data-min="1"
|
||||
data-max="16"
|
||||
class="value-input"
|
||||
id="bpm-input"
|
||||
value="140"
|
||||
data-min="20"
|
||||
data-max="400"
|
||||
/>
|
||||
<button
|
||||
class="adjust-btn"
|
||||
data-target="compasso-a"
|
||||
data-step="1"
|
||||
>
|
||||
<button class="adjust-btn" data-target="bpm" data-step="1">
|
||||
+
|
||||
</button>
|
||||
</div>
|
||||
<span class="compasso-separator">/</span>
|
||||
<div class="compasso-group">
|
||||
<button
|
||||
class="adjust-btn"
|
||||
data-target="compasso-b"
|
||||
data-step="-1"
|
||||
>
|
||||
<div class="label">ANDAMENTO/BPM</div>
|
||||
</div>
|
||||
<div class="info-display">
|
||||
<div class="interactive-input-container">
|
||||
<button class="adjust-btn" data-target="bars" data-step="-1">
|
||||
-
|
||||
</button>
|
||||
<input
|
||||
type="text"
|
||||
class="value-input compasso-input"
|
||||
id="compasso-b-input"
|
||||
value="4"
|
||||
class="value-input"
|
||||
id="bars-input"
|
||||
value="1"
|
||||
data-min="1"
|
||||
data-max="16"
|
||||
data-max="64"
|
||||
/>
|
||||
<button
|
||||
class="adjust-btn"
|
||||
data-target="compasso-b"
|
||||
data-step="1"
|
||||
>
|
||||
<button class="adjust-btn" data-target="bars" data-step="1">
|
||||
+
|
||||
</button>
|
||||
</div>
|
||||
<div class="label">COMPASSOS</div>
|
||||
</div>
|
||||
<div class="info-display">
|
||||
<div class="interactive-input-container">
|
||||
<div class="compasso-group">
|
||||
<button
|
||||
class="adjust-btn"
|
||||
data-target="compasso-a"
|
||||
data-step="-1"
|
||||
>
|
||||
-
|
||||
</button>
|
||||
<input
|
||||
type="text"
|
||||
class="value-input compasso-input"
|
||||
id="compasso-a-input"
|
||||
value="4"
|
||||
data-min="1"
|
||||
data-max="16"
|
||||
/>
|
||||
<button
|
||||
class="adjust-btn"
|
||||
data-target="compasso-a"
|
||||
data-step="1"
|
||||
>
|
||||
+
|
||||
</button>
|
||||
</div>
|
||||
<span class="compasso-separator">/</span>
|
||||
<div class="compasso-group">
|
||||
<button
|
||||
class="adjust-btn"
|
||||
data-target="compasso-b"
|
||||
data-step="-1"
|
||||
>
|
||||
-
|
||||
</button>
|
||||
<input
|
||||
type="text"
|
||||
class="value-input compasso-input"
|
||||
id="compasso-b-input"
|
||||
value="4"
|
||||
data-min="1"
|
||||
data-max="16"
|
||||
/>
|
||||
<button
|
||||
class="adjust-btn"
|
||||
data-target="compasso-b"
|
||||
data-step="1"
|
||||
>
|
||||
+
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="label">COMPASSO</div>
|
||||
</div>
|
||||
<div class="info-display">
|
||||
<div
|
||||
id="timer-display"
|
||||
class="interactive-input-container"
|
||||
style="font-size: 0.7rem; color: var(--text-dark)"
|
||||
>
|
||||
00:00:00
|
||||
</div>
|
||||
<div class="label">MIN:SEC:MSEC</div>
|
||||
</div>
|
||||
<div class="label">COMPASSO</div>
|
||||
</div>
|
||||
<div class="info-display">
|
||||
<div
|
||||
id="timer-display"
|
||||
class="interactive-input-container"
|
||||
style="font-size: 0.7rem; color: var(--text-dark)"
|
||||
<div class="control-group">
|
||||
<button id="metronome-btn" title="Metrônomo On/Off">Metrônomo</button>
|
||||
<button
|
||||
id="create-room-btn"
|
||||
class="transport-btn"
|
||||
title="Criar ou entrar em uma sala compartilhada"
|
||||
>
|
||||
00:00:00
|
||||
</div>
|
||||
<div class="label">MIN:SEC:MSEC</div>
|
||||
<i class="fa-solid fa-users"></i>
|
||||
<span style="margin-left: 8px">Criar Sala</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<button id="metronome-btn" title="Metrônomo On/Off">Metrônomo</button>
|
||||
<button
|
||||
id="create-room-btn"
|
||||
class="transport-btn"
|
||||
title="Criar ou entrar em uma sala compartilhada"
|
||||
>
|
||||
<i class="fa-solid fa-users"></i>
|
||||
<span style="margin-left: 8px">Criar Sala</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="spacer"></div>
|
||||
<div class="control-group master-controls">
|
||||
<div class="knob-container">
|
||||
<div class="knob" id="master-volume-knob">
|
||||
<div class="knob-indicator"></div>
|
||||
<div class="spacer"></div>
|
||||
<div class="control-group master-controls">
|
||||
<div class="knob-container">
|
||||
<div class="knob" id="master-volume-knob">
|
||||
<div class="knob-indicator"></div>
|
||||
</div>
|
||||
<span>VOL MASTER</span>
|
||||
</div>
|
||||
<span>VOL MASTER</span>
|
||||
</div>
|
||||
<div class="knob-container">
|
||||
<div class="knob" id="master-pan-knob">
|
||||
<div class="knob-indicator"></div>
|
||||
<div class="knob-container">
|
||||
<div class="knob" id="master-pan-knob">
|
||||
<div class="knob-indicator"></div>
|
||||
</div>
|
||||
<span>PAN MASTER</span>
|
||||
</div>
|
||||
<span>PAN MASTER</span>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
</header>
|
||||
|
||||
<main class="main-content">
|
||||
<div class="beat-editor">
|
||||
<div class="editor-header">
|
||||
Mostrar/esconder Editor de Bases
|
||||
<div class="window-controls">
|
||||
<i class="fa-solid fa-minus"></i
|
||||
><i class="fa-regular fa-square"></i
|
||||
><i class="fa-solid fa-xmark"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="editor-toolbar">
|
||||
<div class="playback-controls">
|
||||
<i class="fa-solid fa-play" id="play-btn" title="Play/Pause"></i>
|
||||
<i class="fa-solid fa-stop" id="stop-btn" title="Stop"></i>
|
||||
</div>
|
||||
<div class="pattern-manager">
|
||||
<h2 id="beat-bassline-title"></h2>
|
||||
<select
|
||||
id="global-pattern-selector"
|
||||
class="pattern-selector"
|
||||
disabled
|
||||
>
|
||||
<option>Selecione uma faixa</option>
|
||||
</select>
|
||||
<button id="add-pattern-btn" class="pattern-btn">+</button>
|
||||
<button id="remove-pattern-btn" class="pattern-btn">-</button>
|
||||
|
||||
<button
|
||||
id="send-pattern-to-playlist-btn"
|
||||
class="pattern-btn"
|
||||
title="Enviar Pattern para a Playlist"
|
||||
style="width: auto; padding: 0 8px; font-size: 0.9rem"
|
||||
>
|
||||
<i class="fa-solid fa-arrow-right-to-bracket"></i> Enviar
|
||||
</button>
|
||||
</div>
|
||||
<div class="tool-icons">
|
||||
<i class="fa-solid fa-table-cells"></i
|
||||
><i class="fa-solid fa-bars-staggered"></i>
|
||||
<i class="fa-solid fa-music" id="open-piano-roll-btn" title="Abrir Piano Roll"></i>
|
||||
<i
|
||||
class="fa-solid fa-wave-square"
|
||||
id="bounce-pattern-btn"
|
||||
title="Renderizar Pattern para Pista de Áudio"
|
||||
></i>
|
||||
<i
|
||||
class="fa-solid fa-plus"
|
||||
id="add-bar-btn"
|
||||
title="Adicionar 1 Compasso"
|
||||
></i>
|
||||
</div>
|
||||
<div id="timeline-context-menu">
|
||||
<div id="copy-clip">Copiar</div>
|
||||
<div id="cut-clip">Recortar</div>
|
||||
<div id="paste-clip">Colar</div>
|
||||
<div class="menu-divider"></div>
|
||||
<div id="delete-clip" style="color: var(--accent-red)">
|
||||
Excluir Clipe
|
||||
<main class="main-content">
|
||||
<div class="beat-editor">
|
||||
<div class="editor-header">
|
||||
Mostrar/esconder Editor de Bases
|
||||
<div class="window-controls">
|
||||
<i class="fa-solid fa-minus"></i
|
||||
><i class="fa-regular fa-square"></i
|
||||
><i class="fa-solid fa-xmark"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="editor-toolbar">
|
||||
<div class="playback-controls">
|
||||
<i class="fa-solid fa-play" id="play-btn" title="Play/Pause"></i>
|
||||
<i class="fa-solid fa-stop" id="stop-btn" title="Stop"></i>
|
||||
</div>
|
||||
<div class="pattern-manager">
|
||||
<h2 id="beat-bassline-title"></h2>
|
||||
<select
|
||||
id="global-pattern-selector"
|
||||
class="pattern-selector"
|
||||
disabled
|
||||
>
|
||||
<option>Selecione uma faixa</option>
|
||||
</select>
|
||||
<button id="add-pattern-btn" class="pattern-btn">+</button>
|
||||
<button id="remove-pattern-btn" class="pattern-btn">-</button>
|
||||
|
||||
<div id="ruler-context-menu">
|
||||
<div id="ruler-set-loop-start">Definir Início do Loop</div>
|
||||
<div id="ruler-set-loop-end">Definir Fim do Loop</div>
|
||||
</div>
|
||||
<div class="zoom-controls">
|
||||
<i class="fa-solid fa-minus" id="remove-instrument-btn"></i
|
||||
><i class="fa-solid fa-plus" id="add-instrument-btn"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div id="track-container"></div>
|
||||
</div>
|
||||
<div class="piano-roll-editor" id="piano-roll-editor" style="display: none;">
|
||||
<div class="editor-header">
|
||||
<span>Piano Roll - <span id="piano-roll-instrument-name">Instrumento 1</span></span>
|
||||
<div class="window-controls">
|
||||
<i class="fa-solid fa-xmark" id="close-piano-roll-btn"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="piano-roll-toolbar">
|
||||
<div class="playback-controls">
|
||||
<i class="fa-solid fa-pencil active" title="Draw Tool"></i>
|
||||
<i class="fa-solid fa-eraser" title="Erase Tool"></i>
|
||||
</div>
|
||||
<div class="snap-controls">
|
||||
<label>Snap:</label>
|
||||
<select>
|
||||
<option>1/4</option>
|
||||
<option>1/8</option>
|
||||
<option selected>1/16</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="piano-roll-workspace">
|
||||
<div class="piano-keys-container" id="piano-keys-container">
|
||||
<canvas id="piano-keys-canvas"></canvas>
|
||||
</div>
|
||||
|
||||
<div class="piano-grid-container" id="piano-grid-container">
|
||||
<canvas id="piano-grid-canvas"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="audio-editor">
|
||||
<div class="editor-header">
|
||||
<span>Editor de Amostras de Áudio</span>
|
||||
|
||||
<div class="playback-controls">
|
||||
<i
|
||||
class="fa-solid fa-search-minus"
|
||||
id="zoom-out-btn"
|
||||
title="Zoom Out"
|
||||
></i>
|
||||
<i
|
||||
class="fa-solid fa-search-plus"
|
||||
id="zoom-in-btn"
|
||||
title="Zoom In"
|
||||
></i>
|
||||
<i
|
||||
class="fa-solid fa-scissors"
|
||||
id="slice-tool-btn"
|
||||
title="Ferramenta de Corte"
|
||||
></i>
|
||||
|
||||
<i
|
||||
class="fa-solid fa-arrows-left-right-to-line"
|
||||
id="resize-tool-trim"
|
||||
title="Modo de Redimensionamento (Aparar/Trimming)"
|
||||
></i>
|
||||
<i
|
||||
class="fa-solid fa-arrows-left-right"
|
||||
id="resize-tool-stretch"
|
||||
title="Modo de Redimensionamento (Esticar/Time Stretch)"
|
||||
></i>
|
||||
<i
|
||||
class="fa-solid fa-play"
|
||||
id="audio-editor-play-btn"
|
||||
title="Play/Pause"
|
||||
></i>
|
||||
<i
|
||||
class="fa-solid fa-stop"
|
||||
id="audio-editor-stop-btn"
|
||||
title="Stop"
|
||||
></i>
|
||||
<i
|
||||
class="fa-solid fa-repeat"
|
||||
id="audio-editor-loop-btn"
|
||||
title="Ativar/Desativar Loop"
|
||||
></i>
|
||||
<button
|
||||
id="sync-mode-btn"
|
||||
class="control-btn active"
|
||||
title="Modo de Sincronia de Playback (Global/Local)"
|
||||
>
|
||||
Global
|
||||
</button>
|
||||
<i
|
||||
class="fa-solid fa-plus"
|
||||
id="add-audio-track-btn"
|
||||
title="Adicionar Pista de Áudio"
|
||||
></i>
|
||||
</div>
|
||||
</div>
|
||||
<div id="audio-track-container">
|
||||
<div class="audio-track-lane">
|
||||
<div class="track-info">
|
||||
<div class="track-info-header">
|
||||
<i class="fa-solid fa-gear"></i>
|
||||
<span class="track-name">Pista de Áudio 1</span>
|
||||
<div class="track-mute"></div>
|
||||
<button
|
||||
id="send-pattern-to-playlist-btn"
|
||||
class="pattern-btn"
|
||||
title="Enviar Pattern para a Playlist"
|
||||
style="width: auto; padding: 0 8px; font-size: 0.9rem"
|
||||
>
|
||||
<i class="fa-solid fa-arrow-right-to-bracket"></i> Enviar
|
||||
</button>
|
||||
</div>
|
||||
<div class="tool-icons">
|
||||
<i class="fa-solid fa-table-cells"></i
|
||||
><i class="fa-solid fa-bars-staggered"></i>
|
||||
<i class="fa-solid fa-music" id="open-piano-roll-btn" title="Abrir Piano Roll"></i>
|
||||
<i
|
||||
class="fa-solid fa-wave-square"
|
||||
id="bounce-pattern-btn"
|
||||
title="Renderizar Pattern para Pista de Áudio"
|
||||
></i>
|
||||
<i
|
||||
class="fa-solid fa-plus"
|
||||
id="add-bar-btn"
|
||||
title="Adicionar 1 Compasso"
|
||||
></i>
|
||||
</div>
|
||||
<div id="timeline-context-menu">
|
||||
<div id="copy-clip">Copiar</div>
|
||||
<div id="cut-clip">Recortar</div>
|
||||
<div id="paste-clip">Colar</div>
|
||||
<div class="menu-divider"></div>
|
||||
<div id="delete-clip" style="color: var(--accent-red)">
|
||||
Excluir Clipe
|
||||
</div>
|
||||
<div class="track-controls">
|
||||
<div class="knob-container">
|
||||
<div class="knob" data-control="volume">
|
||||
<div class="knob-indicator"></div>
|
||||
</div>
|
||||
<span>VOL</span>
|
||||
</div>
|
||||
|
||||
<div id="ruler-context-menu">
|
||||
<div id="ruler-set-loop-start">Definir Início do Loop</div>
|
||||
<div id="ruler-set-loop-end">Definir Fim do Loop</div>
|
||||
</div>
|
||||
<div class="zoom-controls">
|
||||
<i class="fa-solid fa-minus" id="remove-instrument-btn"></i
|
||||
><i class="fa-solid fa-plus" id="add-instrument-btn"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div id="track-container"></div>
|
||||
</div>
|
||||
|
||||
<div class="piano-roll-editor" id="piano-roll-editor" style="display: none;">
|
||||
<div class="editor-header">
|
||||
<span>Piano Roll - <span id="piano-roll-instrument-name">Instrumento 1</span></span>
|
||||
<div class="window-controls">
|
||||
<i class="fa-solid fa-xmark" id="close-piano-roll-btn"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="piano-roll-toolbar">
|
||||
<div class="playback-controls">
|
||||
<i class="fa-solid fa-pencil active" title="Draw Tool"></i>
|
||||
<i class="fa-solid fa-eraser" title="Erase Tool"></i>
|
||||
</div>
|
||||
<div class="snap-controls">
|
||||
<label>Snap:</label>
|
||||
<select>
|
||||
<option>1/4</option>
|
||||
<option>1/8</option>
|
||||
<option selected>1/16</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="piano-roll-workspace">
|
||||
<div class="piano-keys-container" id="piano-keys-container">
|
||||
<canvas id="piano-keys-canvas"></canvas>
|
||||
</div>
|
||||
|
||||
<div class="piano-grid-container" id="piano-grid-container">
|
||||
<canvas id="piano-grid-canvas"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="audio-editor">
|
||||
<div class="editor-header">
|
||||
<span>Editor de Amostras de Áudio</span>
|
||||
|
||||
<div class="playback-controls">
|
||||
<i
|
||||
class="fa-solid fa-search-minus"
|
||||
id="zoom-out-btn"
|
||||
title="Zoom Out"
|
||||
></i>
|
||||
<i
|
||||
class="fa-solid fa-search-plus"
|
||||
id="zoom-in-btn"
|
||||
title="Zoom In"
|
||||
></i>
|
||||
<i
|
||||
class="fa-solid fa-scissors"
|
||||
id="slice-tool-btn"
|
||||
title="Ferramenta de Corte"
|
||||
></i>
|
||||
|
||||
<i
|
||||
class="fa-solid fa-arrows-left-right-to-line"
|
||||
id="resize-tool-trim"
|
||||
title="Modo de Redimensionamento (Aparar/Trimming)"
|
||||
></i>
|
||||
<i
|
||||
class="fa-solid fa-arrows-left-right"
|
||||
id="resize-tool-stretch"
|
||||
title="Modo de Redimensionamento (Esticar/Time Stretch)"
|
||||
></i>
|
||||
<i
|
||||
class="fa-solid fa-play"
|
||||
id="audio-editor-play-btn"
|
||||
title="Play/Pause"
|
||||
></i>
|
||||
<i
|
||||
class="fa-solid fa-stop"
|
||||
id="audio-editor-stop-btn"
|
||||
title="Stop"
|
||||
></i>
|
||||
<i
|
||||
class="fa-solid fa-repeat"
|
||||
id="audio-editor-loop-btn"
|
||||
title="Ativar/Desativar Loop"
|
||||
></i>
|
||||
<button
|
||||
id="sync-mode-btn"
|
||||
class="control-btn active"
|
||||
title="Modo de Sincronia de Playback (Global/Local)"
|
||||
>
|
||||
Global
|
||||
</button>
|
||||
<i
|
||||
class="fa-solid fa-plus"
|
||||
id="add-audio-track-btn"
|
||||
title="Adicionar Pista de Áudio"
|
||||
></i>
|
||||
</div>
|
||||
</div>
|
||||
<div id="audio-track-container">
|
||||
<div class="audio-track-lane">
|
||||
<div class="track-info">
|
||||
<div class="track-info-header">
|
||||
<i class="fa-solid fa-gear"></i>
|
||||
<span class="track-name">Pista de Áudio 1</span>
|
||||
<div class="track-mute"></div>
|
||||
</div>
|
||||
<div class="knob-container">
|
||||
<div class="knob" data-control="pan">
|
||||
<div class="knob-indicator"></div>
|
||||
<div class="track-controls">
|
||||
<div class="knob-container">
|
||||
<div class="knob" data-control="volume">
|
||||
<div class="knob-indicator"></div>
|
||||
</div>
|
||||
<span>VOL</span>
|
||||
</div>
|
||||
<span>PAN</span>
|
||||
<div class="knob-container">
|
||||
<div class="knob" data-control="pan">
|
||||
<div class="knob-indicator"></div>
|
||||
</div>
|
||||
<span>PAN</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="timeline-container">
|
||||
<div class="spectrogram-view-grid" style="width: 4000px">
|
||||
<div
|
||||
class="timeline-clip"
|
||||
style="left: 100px; width: 400px"
|
||||
></div>
|
||||
<div class="playhead"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="timeline-container">
|
||||
<div class="spectrogram-view-grid" style="width: 4000px">
|
||||
<div
|
||||
class="timeline-clip"
|
||||
style="left: 100px; width: 400px"
|
||||
></div>
|
||||
<div class="audio-track-lane">
|
||||
<div class="track-info">
|
||||
<div class="track-info-header">
|
||||
<i class="fa-solid fa-gear"></i>
|
||||
<span class="track-name">Pista de Áudio 2</span>
|
||||
<div class="track-mute"></div>
|
||||
</div>
|
||||
<div class="track-controls">
|
||||
<div class="knob-container">
|
||||
<div class="knob" data-control="volume">
|
||||
<div class="knob-indicator"></div>
|
||||
</div>
|
||||
<span>VOL</span>
|
||||
</div>
|
||||
<div class="knob-container">
|
||||
<div class="knob" data-control="pan">
|
||||
<div class="knob-indicator"></div>
|
||||
</div>
|
||||
<span>PAN</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="timeline-container">
|
||||
<div id="loop-region" class="loop-region">
|
||||
<div class="spectrogram-view-grid" style="width: 4000px">
|
||||
<div class="timeline-clip" style="left: 50px; width: 600px">
|
||||
<div class="clip-name">jungle01.ogg</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="playhead"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="audio-track-lane">
|
||||
<div class="track-info">
|
||||
<div class="track-info-header">
|
||||
<i class="fa-solid fa-gear"></i>
|
||||
<span class="track-name">Pista de Áudio 2</span>
|
||||
<div class="track-mute"></div>
|
||||
</div>
|
||||
<div class="track-controls">
|
||||
<div class="knob-container">
|
||||
<div class="knob" data-control="volume">
|
||||
<div class="knob-indicator"></div>
|
||||
</div>
|
||||
<span>VOL</span>
|
||||
</div>
|
||||
<div class="knob-container">
|
||||
<div class="knob" data-control="pan">
|
||||
<div class="knob-indicator"></div>
|
||||
</div>
|
||||
<span>PAN</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="timeline-container">
|
||||
<div id="loop-region" class="loop-region">
|
||||
<div class="spectrogram-view-grid" style="width: 4000px">
|
||||
<div class="timeline-clip" style="left: 50px; width: 600px">
|
||||
<div class="clip-name">jungle01.ogg</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="playhead"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
<input
|
||||
type="file"
|
||||
@@ -529,14 +536,19 @@
|
||||
|
||||
// Variáveis de Controle
|
||||
let currentTrackId = null;
|
||||
const CONSTANTS = {
|
||||
NOTE_HEIGHT: 20,
|
||||
KEY_WIDTH: 60,
|
||||
BEAT_WIDTH: 40,
|
||||
TOTAL_KEYS: 84, // 7 oitavas
|
||||
START_NOTE: 24, // C1
|
||||
TICKS_PER_PIXEL: 0 // Calculado dinamicamente
|
||||
};
|
||||
// --- Configurações ---
|
||||
const CONSTANTS = {
|
||||
NOTE_HEIGHT: 20,
|
||||
KEY_WIDTH: 60,
|
||||
BEAT_WIDTH: 40, // Largura visual de 1 batida (Quarter Note)
|
||||
TOTAL_KEYS: 84,
|
||||
START_NOTE: 24,
|
||||
|
||||
// --- CORREÇÃO DE ESCALA ---
|
||||
// O LMMS usa 192 ticks por batida (Quarter Note).
|
||||
// Se nossa batida tem 40px de largura, a relação é:
|
||||
TICKS_PER_PIXEL: 192 / 40 // = 4.8
|
||||
};
|
||||
|
||||
const pianoRollEditor = document.getElementById('piano-roll-editor');
|
||||
const keysCanvas = document.getElementById('piano-keys-canvas');
|
||||
@@ -572,26 +584,26 @@
|
||||
// --- DESENHO E LÓGICA ---
|
||||
|
||||
function resizeCanvas() {
|
||||
const totalHeight = CONSTANTS.TOTAL_KEYS * CONSTANTS.NOTE_HEIGHT;
|
||||
// 64 compassos * 192 ticks / (ticks por beat) * largura... simplificando:
|
||||
// Vamos fixar uma largura grande por enquanto
|
||||
const totalWidth = 3000;
|
||||
const totalHeight = CONSTANTS.TOTAL_KEYS * CONSTANTS.NOTE_HEIGHT;
|
||||
|
||||
keysCanvas.width = CONSTANTS.KEY_WIDTH;
|
||||
keysCanvas.height = totalHeight;
|
||||
gridCanvas.width = totalWidth;
|
||||
gridCanvas.height = totalHeight;
|
||||
// Calcula a largura total baseada nos compassos definidos no input
|
||||
const barsCount = parseInt(document.getElementById('bars-input')?.value || 1);
|
||||
// 1 Compasso = 4 Batidas. Largura = Batidas * Largura da Batida
|
||||
const totalWidth = (barsCount * 4) * CONSTANTS.BEAT_WIDTH;
|
||||
|
||||
// Importante: Sincronizar a conversão de Pixel <-> Tick
|
||||
// 1 Beat = 48 ticks (em 16th) ou 192 ticks por bar?
|
||||
// No seu file.js: ticksPerStep = 12 (1/16).
|
||||
// Então BEAT_WIDTH (40px) = 4 steps = 48 ticks.
|
||||
CONSTANTS.TICKS_PER_PIXEL = 48 / CONSTANTS.BEAT_WIDTH;
|
||||
keysCanvas.width = CONSTANTS.KEY_WIDTH;
|
||||
keysCanvas.height = totalHeight;
|
||||
|
||||
drawKeys();
|
||||
drawGrid();
|
||||
drawNotes();
|
||||
}
|
||||
gridCanvas.width = totalWidth; // Ajusta largura ao tamanho real da música
|
||||
gridCanvas.height = totalHeight;
|
||||
|
||||
// REMOVA ESTA LINHA ANTIGA:
|
||||
// CONSTANTS.TICKS_PER_PIXEL = 48 / CONSTANTS.BEAT_WIDTH;
|
||||
|
||||
drawKeys();
|
||||
drawGrid();
|
||||
drawNotes();
|
||||
}
|
||||
|
||||
function drawKeys() {
|
||||
keysCtx.clearRect(0, 0, keysCanvas.width, keysCanvas.height);
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
21/11/2025 15:47:35 [INFO] ==============================
|
||||
21/11/2025 15:47:35 [INFO] AUDITORIA DE AMBIENTE (HARDWARE)
|
||||
21/11/2025 15:47:35 [INFO] ==============================
|
||||
21/11/2025 15:47:35 [INFO] Sistema: Linux 6.8.0-87-generic
|
||||
21/11/2025 15:47:35 [INFO] Kernel: #88-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 11 09:28:41 UTC 2025
|
||||
21/11/2025 15:47:35 [INFO] Node: ubuntu
|
||||
21/11/2025 15:47:35 [INFO] CPU Modelo: Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHz
|
||||
21/11/2025 15:47:35 [INFO] Núcleos (Log): 12
|
||||
21/11/2025 15:47:35 [INFO] Núcleos (Disp): 12 (Alocados para este script)
|
||||
21/11/2025 15:47:35 [INFO] Memória Total: 7.69 GB
|
||||
21/11/2025 15:47:35 [INFO] Disco (Total): 448 GB
|
||||
21/11/2025 15:47:35 [INFO] Disco (Livre): 124 GB
|
||||
21/11/2025 15:47:35 [INFO] ==============================
|
||||
21/11/2025 15:47:35 [INFO] === Iniciando Pipeline de Indexação Paralela ===
|
||||
21/11/2025 15:47:35 [INFO] Log sendo salvo em: /nethome/jotachina/projetos/mmpSearch/scripts/handler/logs/execucao_2025-11-21_15-47-35.log
|
||||
21/11/2025 15:47:35 [INFO] Iniciando processamento de 35 arquivos.
|
||||
21/11/2025 15:47:35 [INFO] Utilizando 12 núcleos de CPU.
|
||||
21/11/2025 15:47:35 [INFO] [PID 3526766] Processando: tp1 - Luiz Filipe Almada.mmp
|
||||
21/11/2025 15:47:35 [INFO] [PID 3526767] Processando: tp1_MarcoAntonio.mmp
|
||||
21/11/2025 15:47:35 [INFO] [PID 3526768] Processando: Ukifune.mmp
|
||||
21/11/2025 15:47:35 [INFO] [PID 3526769] Processando: Tears of Tragedy Classical 2.mmp
|
||||
21/11/2025 15:47:35 [INFO] [PID 3526770] Processando: Relaxing Theme.mmp
|
||||
21/11/2025 15:47:35 [INFO] [PID 3526771] Processando: XpressiveTest10.mmp
|
||||
21/11/2025 15:47:35 [INFO] [PID 3526772] Processando: winddown.mmp
|
||||
21/11/2025 15:47:35 [INFO] [PID 3526773] Processando: Living Joy - don't stop movin 1996 Loop.mmp
|
||||
21/11/2025 15:47:35 [INFO] [PID 3526774] Processando: Hizaki Classical.mmp
|
||||
21/11/2025 15:47:35 [INFO] [PID 3526775] Processando: Relaxing Theme 2.mmp
|
||||
21/11/2025 15:47:35 [INFO] [PID 3526777] Processando: The Drum.mmp
|
||||
21/11/2025 15:47:35 [INFO] [PID 3526776] Processando: Um começo.mmp
|
||||
21/11/2025 15:47:35 [INFO] [PID 3526766] Processando: Syu Classical.mmp
|
||||
21/11/2025 15:47:36 [INFO] [PID 3526767] Processando: Nuttertools.mmp
|
||||
21/11/2025 15:47:36 [INFO] [PID 3526776] Processando: leandro_souza_atvd1.mmp
|
||||
21/11/2025 15:47:36 [INFO] [PID 3526774] Processando: stairs.mmp
|
||||
21/11/2025 15:47:36 [INFO] [PID 3526766] Processando: MPXVM - FUMIX 307 ( Original Mix ).mmp
|
||||
21/11/2025 15:47:36 [INFO] [PID 3526769] Processando: Robin S - Show Me Love 1993 Loop.mmp
|
||||
21/11/2025 15:47:36 [INFO] [PID 3526767] Processando: Mantronix - Got To Have Your Love 1989 Loop.mmp
|
||||
21/11/2025 15:47:36 [INFO] [PID 3526772] Processando: VitorAugusto.mmp
|
||||
21/11/2025 15:47:36 [INFO] [PID 3526768] Processando: Nightcrawlers - Surrender Your Love 1995 Loop.mmp
|
||||
21/11/2025 15:47:36 [INFO] [PID 3526774] Processando: My worst enemy.mmp
|
||||
21/11/2025 15:47:36 [INFO] [PID 3526776] Processando: Introduction.mmp
|
||||
21/11/2025 15:47:36 [INFO] [PID 3526772] Processando: teste.mmp
|
||||
21/11/2025 15:47:36 [INFO] [PID 3526774] Processando: Mighty Dub Katz - Magic Carpet Ride 1995 Loop.mmp
|
||||
21/11/2025 15:47:36 [INFO] [PID 3526772] Processando: JoãoVitorSimão-2023008380-megaMainSong.mmp
|
||||
21/11/2025 15:47:36 [INFO] [PID 3526769] Processando: Iara Rodrigues.mmp
|
||||
21/11/2025 15:47:36 [INFO] [PID 3526776] Processando: space-camel.mmp
|
||||
21/11/2025 15:47:36 [INFO] [PID 3526773] Processando: Shade of separation EXTENDED.mmp
|
||||
21/11/2025 15:47:36 [INFO] [PID 3526772] Processando: Solaris Deep Note.mmp
|
||||
21/11/2025 15:47:36 [INFO] [PID 3526767] Processando: New Exploration 3.mmp
|
||||
21/11/2025 15:47:36 [INFO] [PID 3526768] Processando: Samanta Freire.mmp
|
||||
21/11/2025 15:47:36 [INFO] [PID 3526768] Processando: SonsAlignígenas.mmp
|
||||
21/11/2025 15:47:37 [INFO] [PID 3526776] Processando: Relaxing Theme 3.mmp
|
||||
21/11/2025 15:47:37 [INFO] [PID 3526766] Processando: Wesley_Silva_Guimarães.mmp
|
||||
21/11/2025 15:48:26 [INFO] Arquivos 'all.json' e 'all.yml' gerados com sucesso.
|
||||
21/11/2025 15:48:26 [INFO] === Iniciando Geração de Manifestos (Pós-Processamento) ===
|
||||
21/11/2025 15:48:26 [INFO] Manifesto salvo: /nethome/jotachina/projetos/mmpSearch/metadata/samples-manifest.json
|
||||
21/11/2025 15:48:26 [INFO] Manifesto salvo: /nethome/jotachina/projetos/mmpSearch/metadata/mmp-manifest.json
|
||||
21/11/2025 15:48:26 [INFO] ============================================================
|
||||
21/11/2025 15:48:26 [INFO] RELATÓRIO DE EXECUÇÃO - 21/11/2025 15:48:26
|
||||
21/11/2025 15:48:26 [INFO] ============================================================
|
||||
21/11/2025 15:48:26 [INFO] Tempo Total do Pipeline: 50.89 segundos
|
||||
21/11/2025 15:48:26 [INFO] --------------------
|
||||
21/11/2025 15:48:26 [INFO] [1] Indexação Paralela (Arquivos .mmp/.mmpz)
|
||||
21/11/2025 15:48:26 [INFO] Total Encontrado: 35
|
||||
21/11/2025 15:48:26 [INFO] Sucessos: 35
|
||||
21/11/2025 15:48:26 [INFO] Falhas: 0
|
||||
21/11/2025 15:48:26 [INFO] --------------------
|
||||
21/11/2025 15:48:26 [INFO] [2] Geração de Manifestos (Frontend)
|
||||
21/11/2025 15:48:26 [INFO] [OK] metadata/samples-manifest.json
|
||||
21/11/2025 15:48:26 [INFO] [OK] metadata/mmp-manifest.json
|
||||
21/11/2025 15:48:26 [INFO] ============================================================
|
||||
21/11/2025 15:48:26 [INFO] Pipeline finalizado.
|
||||
21/11/2025 15:48:26 [INFO] === Iniciando Análise Profunda de Dependências ===
|
||||
21/11/2025 15:48:27 [INFO] Relatório salvo: /nethome/jotachina/projetos/mmpSearch/metadata/dependency_report.json
|
||||
21/11/2025 15:48:27 [INFO] Resumo: {
|
||||
"total": 35,
|
||||
"healthy": 35,
|
||||
"recovered": 0,
|
||||
"broken": 0
|
||||
}
|
||||
Reference in new issue
Block a user