*/
protected function schedule(Schedule $schedule)
{
- $schedule->command('job:dispatch PitchShiftAudio')->hourly();
+ $schedule->command('job:dispatchNow PitchShiftAudio')->hourly();
}
/**
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
- public static $pitches=[1 => '+1', 2 => '+2', 3 => '+3', 4 => '+4', 5 => '+5', 6 => '+6', 7 => '-5', 8 => '-4', 9 => '-3', 10 => '-2', 11 => '-1'];
+ public static $pitches = [1 => '+1', 2 => '+2', 3 => '+3', 4 => '+4', 5 => '+5', 6 => '+6', 7 => '-5', 8 => '-4', 9 => '-3', 10 => '-2', 11 => '-1'];
public function handle()
{
DownloadAudioTracks::dispatchSync();
-
- foreach (Song::all() as $song) {
+ foreach (Song::inRandomOrder()->get() as $song) {
$tracks = $song->getAudioTracks();
foreach ($tracks as $track) {
$mp3 = $track['path'];
if (!file_exists($pm)) {
$ff = new CommandLine('ffmpeg');
$ff->setTimeout(300);
+ $ff->setArg('y');
+ $ff->setManualArg('-nostdin');
$ff->setArg('i', $pw);
$ff->setManualArg('-ab 320k');
$ff->setArg(null, $pm);
-window.tones = ['C', 'C♯', 'D', 'E♭', 'E', 'F', 'F♯', 'G', 'G♯', 'A', 'B♭', 'B'];
+window.tones = ['C', 'C♯', 'D', 'D♯', 'E', 'F', 'F♯', 'G', 'G♯', 'A', 'A♯', 'B'];
+window.btones = ['C', 'D♭', 'D', 'E♭', 'E', 'F', 'G♭', 'G', 'A♭', 'A', 'B♭', 'B'];
(function ($) {
function JQchords(element) {
this.element = element;
this.chordOffset = 0;
+ this.base = parseInt($(element).data('tone'));
this.init();
}
$this.convertToTable($(this));
});
},
+
convertToTable: function (e) {
var lines = e.data('chords');
updateChords: function () {
var $this = this;
+ var b = $this.normKey(this.base + this.chordOffset);
+ console.log(b);
this.element.find('span[data-chord]').each(function () {
var c = $(this).data('chord');
var res
- if(c===null){
- res='';
- }else {
+ if (c === null) {
+ res = '';
+ } else {
var k = $this.normKey(c.key + $this.chordOffset);
- res = $($this.showTone(k) + '<span class="symbols">' + c.symbols + '</span>');
+ res = $($this.showTone(k, b) + '<span class="symbols">' + c.symbols + '</span>');
if (res.find('.alt').length > 0) {
$(this).addClass('withalt');
}
});
},
- showTone: function (k) {
- var s = tones[k];
+ showTone: function (k, base) {
+ if (base === undefined) {
+ base = 0;
+ }
+ var thistones = window.tones;
+ if ([0, 1, 3, 5, 8, 10].indexOf(base) >= 0) {
+ thistones = window.btones;
+ }
+ var s = thistones[k];
var t = s.substr(0, 1);
var res = '<span class="tone">' + t;
normKey: function (key) {
return (key + 12) % 12;
- },
- normSymbols: function (s) {
+ }, normSymbols: function (s) {
return s;
}
};
window.players = {};
$(document).on('change', 'select[data-name="audio"]', function () {
- $('li[data-audio]').hide();
- $('li[data-audio="' + $(this).val() + '"]');
- resetPlayers();
+ changeAudio();
});
$(document).on('change', 'select.audiotone', function () {
tone = '0';
}
var pid = 'player_' + audio + '_' + tone;
- console.log(pid);
var p = window.players[pid];
- console.log(p);
$(p.elements.container).show();
p.play();
return false;
});
+ function changeAudio() {
+ $('li[data-audio]').hide();
+ $('li[data-audio="' + $('select[data-name="audio"]').val() + '"]').show();
+ resetPlayers();
+ }
+
+ changeAudio();
+
})(jQuery);
src="https://api.qrserver.com/v1/create-qr-code/?size=50x50&data={{rawurlencode('https://songbook.enhydra.fr/'.$collection->slug)}}"
style="width: 15px;height:auto;margin:5px 10px 5px 5px;vertical-align: bottom">Share via QR code</span>
<ul>
- <li style="padding:30px;"><img
+ <div style="padding: 30px;background-color: #fff;height: 100%"><img
src="https://api.qrserver.com/v1/create-qr-code/?size=300x300&data={{rawurlencode('https://songbook.enhydra.fr/'.$collection->slug)}}"
- style="width: 100%;height:auto;"></li>
+ style="width: 100%;height:auto;"></div>
</ul>
</li>
@if(isset($song))
@section('title', $song->title.' - '.$song->artist.' - '. $collection->name.' Songbook')
@section('content')
@include('header',['title'=>$song->title,'subtitle'=>$song->artist])
- <article class="song">
+ <article class="song" data-tone="{{$song->key}}" data-mode="{{$song->mode}}">
@foreach($song->lyrics as $part)
@php
$c=$song->getChordsData($part['part_chords']);