MusicMaster 0.0.1.20101110 → 1.0.0.20120307
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/AUTHORS +4 -1
- data/ChangeLog +28 -0
- data/LICENSE +1 -1
- data/README +2 -5
- data/ReleaseInfo +8 -8
- data/bin/Calibrate.rb +55 -0
- data/bin/Clean.rb +55 -0
- data/bin/DBConvert.rb +3 -1
- data/bin/Deliver.rb +73 -42
- data/bin/Mix.rb +39 -78
- data/bin/Process.rb +55 -0
- data/bin/Record.rb +63 -116
- data/bin/{Album.rb → old/Album.rb} +18 -18
- data/bin/{AnalyzeAlbum.rb → old/AnalyzeAlbum.rb} +11 -11
- data/bin/{DeliverAlbum.rb → old/DeliverAlbum.rb} +12 -12
- data/bin/{Fct2Wave.rb → old/Fct2Wave.rb} +11 -11
- data/{album.conf.rb.example → bin/old/album.conf.rb.example} +0 -0
- data/lib/MusicMaster/FilesNamer.rb +253 -0
- data/lib/MusicMaster/Formats/MP3.rb +50 -0
- data/lib/MusicMaster/Formats/Test.rb +44 -0
- data/lib/MusicMaster/Formats/Wave.rb +80 -0
- data/lib/MusicMaster/Hash.rb +20 -0
- data/lib/MusicMaster/Launcher.rb +241 -0
- data/lib/MusicMaster/Processes/ApplyVolumeFct.rb +4 -8
- data/lib/MusicMaster/Processes/Compressor.rb +50 -47
- data/lib/MusicMaster/Processes/Custom.rb +3 -3
- data/lib/MusicMaster/Processes/{AddSilence.rb → Cut.rb} +8 -4
- data/lib/MusicMaster/Processes/CutFirstSignal.rb +6 -3
- data/lib/MusicMaster/Processes/DCShifter.rb +30 -0
- data/lib/MusicMaster/Processes/GVerb.rb +3 -2
- data/lib/MusicMaster/Processes/Normalize.rb +7 -6
- data/lib/MusicMaster/Processes/SilenceInserter.rb +31 -0
- data/lib/MusicMaster/Processes/Test.rb +39 -0
- data/lib/MusicMaster/Processes/VolCorrection.rb +3 -3
- data/lib/MusicMaster/RakeProcesses.rb +1014 -0
- data/lib/MusicMaster/Symbol.rb +12 -0
- data/lib/MusicMaster/Task.rb +29 -0
- data/lib/MusicMaster/Utils.rb +467 -0
- data/lib/MusicMaster/old/Common.rb +101 -0
- data/musicmaster.conf.rb.example +42 -59
- data/record.conf.rb.example +374 -30
- metadata +91 -41
- data/TODO +0 -3
- data/bin/Master.rb +0 -60
- data/bin/PrepareMix.rb +0 -422
- data/lib/MusicMaster/Common.rb +0 -197
- data/lib/MusicMaster/ConfLoader.rb +0 -56
- data/lib/MusicMaster/musicmaster.conf.rb +0 -96
- data/master.conf.rb.example +0 -13
data/bin/Record.rb
CHANGED
@@ -1,141 +1,88 @@
|
|
1
1
|
#!env ruby
|
2
2
|
#--
|
3
|
-
# Copyright (c) 2009-
|
3
|
+
# Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
|
4
4
|
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
5
5
|
#++
|
6
6
|
|
7
|
-
require '
|
8
|
-
require 'optparse'
|
9
|
-
require 'rUtilAnts/Logging'
|
10
|
-
RUtilAnts::Logging::initializeLogging('', '')
|
11
|
-
require 'MusicMaster/Common'
|
12
|
-
require 'MusicMaster/ConfLoader'
|
7
|
+
require 'MusicMaster/Launcher'
|
13
8
|
|
14
9
|
module MusicMaster
|
15
10
|
|
16
|
-
class Record
|
11
|
+
class Record < Launcher
|
17
12
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
13
|
+
protected
|
14
|
+
|
15
|
+
# Give additional command line options banner
|
16
|
+
#
|
17
|
+
# Return::
|
18
|
+
# * _String_: Options banner
|
19
|
+
def getOptionsBanner
|
20
|
+
return '[--recordedfilesprepared] [--env <RecordingEnv>]*'
|
21
|
+
end
|
22
|
+
|
23
|
+
# Complete options with the specific ones of this binary
|
24
|
+
#
|
25
|
+
# Parameters::
|
26
|
+
# * *ioOptionParser* (_OptionParser_): The options parser to complete
|
27
|
+
def completeOptionParser(ioOptionParser)
|
28
|
+
@RecordedFilesPrepared = false
|
29
|
+
ioOptionParser.on( '--recordedfilesprepared',
|
30
|
+
'Recorded files are already prepared: no need to wait for user input while recording.') do
|
31
|
+
@RecordedFilesPrepared = true
|
32
|
+
end
|
33
|
+
@LstEnvToRecord = []
|
34
|
+
ioOptionParser.on( '--env <RecordingEnv>', String,
|
35
|
+
'Specify the recording environment to record. Can be used several times. If none specified, all environments will be recorded.') do |iArg|
|
36
|
+
@LstEnvToRecord << iArg.to_sym
|
37
|
+
end
|
28
38
|
end
|
29
39
|
|
30
|
-
#
|
40
|
+
# Check configuration.
|
31
41
|
#
|
32
|
-
# Parameters
|
33
|
-
# * *
|
34
|
-
# Return
|
35
|
-
# *
|
36
|
-
def
|
37
|
-
|
42
|
+
# Parameters::
|
43
|
+
# * *iConf* (<em>map<Symbol,Object></em>): The configuration
|
44
|
+
# Return::
|
45
|
+
# * _Exception_: Error, or nil in case of success
|
46
|
+
def checkConf(iConf)
|
47
|
+
rError = nil
|
38
48
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
end
|
54
|
-
puts '===== Record Perform silence ====='
|
55
|
-
record('Perform.Silence.wav')
|
56
|
-
end
|
49
|
+
# Check that all tracks are assigned somewhere, just once
|
50
|
+
if ((iConf[:Recordings] != nil) and
|
51
|
+
(iConf[:Recordings][:Tracks] != nil))
|
52
|
+
lLstTracks = []
|
53
|
+
iConf[:Recordings][:Tracks].keys.each do |iLstTracks|
|
54
|
+
lLstTracks.concat(iLstTracks)
|
55
|
+
end
|
56
|
+
lAssignedTracks = {}
|
57
|
+
lLstTracks.each do |iIdxTrack|
|
58
|
+
if (lAssignedTracks.has_key?(iIdxTrack))
|
59
|
+
rError = RuntimeError.new("Track #{iIdxTrack} is recorded twice.")
|
60
|
+
break
|
61
|
+
else
|
62
|
+
lAssignedTracks[iIdxTrack] = nil
|
57
63
|
end
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
record("Patch.#{iIdxTrack}.VolReference.wav")
|
64
|
-
puts "===== Measure the volume cuts from file Patch.#{iIdxTrack}.VolReference.wav and set them in the record conf file ====="
|
65
|
-
puts 'Enter when done.'
|
66
|
-
$stdin.gets
|
67
|
-
end
|
68
|
-
end
|
69
|
-
# Now we don't need anymore the volume setting for Perform.
|
70
|
-
lConf[:Patches].each do |iIdxTrack, iTrackConf|
|
71
|
-
lTryAgain = true
|
72
|
-
while (lTryAgain)
|
73
|
-
puts "===== Record the Patch track #{iIdxTrack} ====="
|
74
|
-
record("Patch.#{iIdxTrack}.wav")
|
75
|
-
puts 'Is the file correct ? (No peak limit reached ?) \'y\'=yes.'
|
76
|
-
lTryAgain = ($stdin.gets.chomp != 'y')
|
77
|
-
end
|
78
|
-
if (iTrackConf[:Effects] != nil)
|
79
|
-
MusicMaster::applyProcesses(iTrackConf[:Effects], "Patch.#{iIdxTrack}.wav", $MusicMasterConf[:Record][:TempDir])
|
80
|
-
end
|
81
|
-
puts "===== Record Patch silence for track #{iIdxTrack} ====="
|
82
|
-
record("Patch.#{iIdxTrack}.Silence.wav")
|
83
|
-
if (iTrackConf[:Effects] != nil)
|
84
|
-
MusicMaster::applyProcesses(iTrackConf[:Effects], "Patch.#{iIdxTrack}.Silence.wav", $MusicMasterConf[:Record][:TempDir])
|
85
|
-
end
|
86
|
-
if (iTrackConf[:VolCorrection] == nil)
|
87
|
-
puts "===== Record Patch volume preview for track #{iIdxTrack} ====="
|
88
|
-
record("Patch.#{iIdxTrack}.VolOriginal.wav")
|
89
|
-
if (iTrackConf[:Effects] != nil)
|
90
|
-
MusicMaster::applyProcesses(iTrackConf[:Effects], "Patch.#{iIdxTrack}.VolOriginal.wav", $MusicMasterConf[:Record][:TempDir])
|
91
|
-
end
|
92
|
-
end
|
64
|
+
end
|
65
|
+
if (rError == nil)
|
66
|
+
lAssignedTracks.size.times do |iIdxTrack|
|
67
|
+
if (!lAssignedTracks.has_key?(iIdxTrack+1))
|
68
|
+
log_warn "Track #{iIdxTrack+1} is never recorded."
|
93
69
|
end
|
94
70
|
end
|
95
|
-
if (lConf[:WaveFiles])
|
96
|
-
puts '===== Generate Wave in Wave.*.wav files ====='
|
97
|
-
puts 'Press Enter to continue once done.'
|
98
|
-
$stdin.gets
|
99
|
-
end
|
100
|
-
logInfo 'Finished recording ok. Ready to use PrepareMix.rb and Mix.rb.'
|
101
71
|
end
|
102
72
|
end
|
103
|
-
if (lError != nil)
|
104
|
-
puts "!!! Error: #{lError}"
|
105
|
-
rErrorCode = 1
|
106
|
-
end
|
107
73
|
|
108
|
-
return
|
74
|
+
return rError
|
109
75
|
end
|
110
76
|
|
111
|
-
#
|
77
|
+
# Initialize Rake processes and return the task to be built
|
112
78
|
#
|
113
|
-
#
|
114
|
-
# *
|
115
|
-
def
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
end
|
121
|
-
while (lTryAgain)
|
122
|
-
puts "Record file \"#{iFileName}\""
|
123
|
-
puts 'Press Enter to continue once done. Type \'s\' to skip it.'
|
124
|
-
lSkip = ($stdin.gets.chomp == 's')
|
125
|
-
if (lSkip)
|
126
|
-
lTryAgain = false
|
127
|
-
else
|
128
|
-
# Get the last file that has been recorded
|
129
|
-
lFileName = $MusicMasterConf[:Record][:RecordedFileGetter].call
|
130
|
-
if (!File.exists?(lFileName))
|
131
|
-
logErr "File #{lFileName} does not exist. Could not get recorded file."
|
132
|
-
else
|
133
|
-
logInfo "Getting recorded file: #{lFileName} => #{iFileName}"
|
134
|
-
FileUtils::mv(lFileName, iFileName)
|
135
|
-
lTryAgain = false
|
136
|
-
end
|
137
|
-
end
|
138
|
-
end
|
79
|
+
# Return::
|
80
|
+
# * _Symbol_: Rake target to execute
|
81
|
+
def getRakeTarget
|
82
|
+
initialize_RakeProcesses(:RecordedFilesPrepared => @RecordedFilesPrepared, :LstEnvToRecord => @LstEnvToRecord)
|
83
|
+
generateRakeFor_GenerateSourceFiles
|
84
|
+
|
85
|
+
return :GenerateSourceFiles
|
139
86
|
end
|
140
87
|
|
141
88
|
end
|
@@ -1,30 +1,30 @@
|
|
1
1
|
#!env ruby
|
2
2
|
#--
|
3
|
-
# Copyright (c) 2009-
|
3
|
+
# Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
|
4
4
|
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
5
5
|
#++
|
6
6
|
|
7
7
|
require 'fileutils'
|
8
8
|
require 'MusicMaster/Common'
|
9
9
|
require 'rUtilAnts/Logging'
|
10
|
-
RUtilAnts::Logging::
|
10
|
+
RUtilAnts::Logging::install_logger_on_object
|
11
11
|
require 'MusicMaster/ConfLoader'
|
12
12
|
|
13
13
|
module MusicMaster
|
14
14
|
|
15
15
|
# Execute the album
|
16
16
|
#
|
17
|
-
# Parameters
|
17
|
+
# Parameters::
|
18
18
|
# * *iConf* (<em>map<Symbol,Object></em>): Configuration of the album
|
19
19
|
def self.execute(iConf)
|
20
20
|
lTracksDir = iConf[:TracksDir]
|
21
21
|
if (!File.exists?(lTracksDir))
|
22
|
-
|
22
|
+
log_err "Missing directory #{lTracksDir}"
|
23
23
|
raise RuntimeError.new("Missing directory #{lTracksDir}")
|
24
24
|
else
|
25
25
|
iConf[:Tracks].each_with_index do |iTrackInfo, iIdxTrack|
|
26
|
-
|
27
|
-
lAlbumFile = "#{
|
26
|
+
log_info "===== Mastering Track #{iIdxTrack}: #{iTrackInfo[:TrackID]} version #{iTrackInfo[:Version]} ====="
|
27
|
+
lAlbumFile = "#{@MusicMasterConf[:Album][:Dir]}/#{iIdxTrack}_#{iTrackInfo[:TrackID]}.wav"
|
28
28
|
lCancel = false
|
29
29
|
if (File.exists?(lAlbumFile))
|
30
30
|
puts "File #{lAlbumFile} already exists. Overwrite it by mastering a new one ? [y='yes']"
|
@@ -32,26 +32,26 @@ module MusicMaster
|
|
32
32
|
end
|
33
33
|
if (!lCancel)
|
34
34
|
# Find the last Master file for this Track
|
35
|
-
lMasterFiles = Dir.glob("#{lTracksDir}/#{iTrackInfo[:TrackID]}*/#{iTrackInfo[:Version]}/#{iConf[:TracksFilesSubDir]}#{
|
35
|
+
lMasterFiles = Dir.glob("#{lTracksDir}/#{iTrackInfo[:TrackID]}*/#{iTrackInfo[:Version]}/#{iConf[:TracksFilesSubDir]}#{@MusicMasterConf[:Master][:Dir]}/*.wav")
|
36
36
|
if (lMasterFiles.empty?)
|
37
|
-
|
37
|
+
log_err "No Master files found for Track #{iTrackInfo[:TrackID]} version #{iTrackInfo[:Version]}"
|
38
38
|
else
|
39
39
|
# Find the last one
|
40
40
|
lFinalMasterFileName = lMasterFiles.sort[-1]
|
41
|
-
|
41
|
+
log_info "Found final Master file from Track #{iTrackInfo[:TrackID]} version #{iTrackInfo[:Version]} in #{lFinalMasterFileName}"
|
42
42
|
# Copy it
|
43
|
-
|
43
|
+
log_info "Copying Master file to #{lAlbumFile} ..."
|
44
44
|
FileUtils::cp(lFinalMasterFileName, lAlbumFile)
|
45
45
|
if (iTrackInfo[:AdditionalMastering] != nil)
|
46
|
-
lMasterTempDir = "#{
|
46
|
+
lMasterTempDir = "#{@MusicMasterConf[:Album][:TempDir]}/#{iTrackInfo[:TrackID]}.#{iTrackInfo[:Version]}"
|
47
47
|
FileUtils::mkdir_p(lMasterTempDir)
|
48
48
|
MusicMaster::applyProcesses(iTrackInfo[:AdditionalMastering], lAlbumFile, lMasterTempDir)
|
49
49
|
end
|
50
50
|
# Done.
|
51
|
-
|
51
|
+
log_info "Setting file #{iIdxTrack} for Track #{iTrackInfo[:TrackID]} from #{lAlbumFile}"
|
52
52
|
end
|
53
53
|
end
|
54
|
-
|
54
|
+
log_info ''
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|
@@ -61,21 +61,21 @@ end
|
|
61
61
|
rErrorCode = 0
|
62
62
|
lConfFile = ARGV[0]
|
63
63
|
if (lConfFile == nil)
|
64
|
-
|
64
|
+
log_err 'Usage: Album <ConfFile>'
|
65
65
|
rErrorCode = 1
|
66
66
|
elsif (!File.exists?(lConfFile))
|
67
|
-
|
67
|
+
log_err "File #{lConfFile} does not exist."
|
68
68
|
rErrorCode = 2
|
69
69
|
else
|
70
70
|
MusicMaster::parsePlugins
|
71
|
-
FileUtils::mkdir_p(
|
72
|
-
FileUtils::mkdir_p(
|
71
|
+
FileUtils::mkdir_p(@MusicMasterConf[:Album][:Dir])
|
72
|
+
FileUtils::mkdir_p(@MusicMasterConf[:Album][:TempDir])
|
73
73
|
lConf = nil
|
74
74
|
File.open(lConfFile, 'r') do |iFile|
|
75
75
|
lConf = eval(iFile.read)
|
76
76
|
end
|
77
77
|
MusicMaster::execute(lConf)
|
78
|
-
|
78
|
+
log_info "===== Album finished in #{@MusicMasterConf[:Album][:Dir]}"
|
79
79
|
end
|
80
80
|
|
81
81
|
exit rErrorCode
|
@@ -1,32 +1,32 @@
|
|
1
1
|
#!env ruby
|
2
2
|
#--
|
3
|
-
# Copyright (c) 2009-
|
3
|
+
# Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
|
4
4
|
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
5
5
|
#++
|
6
6
|
|
7
7
|
require 'fileutils'
|
8
8
|
require 'MusicMaster/Common'
|
9
9
|
require 'rUtilAnts/Logging'
|
10
|
-
RUtilAnts::Logging::
|
10
|
+
RUtilAnts::Logging::install_logger_on_object
|
11
11
|
require 'MusicMaster/ConfLoader'
|
12
12
|
|
13
13
|
module MusicMaster
|
14
14
|
|
15
15
|
# Execute the album
|
16
16
|
#
|
17
|
-
# Parameters
|
17
|
+
# Parameters::
|
18
18
|
# * *iConf* (<em>map<Symbol,Object></em>): Configuration of the album
|
19
19
|
def self.execute(iConf)
|
20
20
|
lTracksDir = iConf[:TracksDir]
|
21
21
|
if (!File.exists?(lTracksDir))
|
22
|
-
|
22
|
+
log_err "Missing directory #{lTracksDir}"
|
23
23
|
raise RuntimeError.new("Missing directory #{lTracksDir}")
|
24
24
|
else
|
25
25
|
# Analyze results, per Track
|
26
26
|
lAnalyzeResults = []
|
27
27
|
iConf[:Tracks].each_with_index do |iTrackInfo, iIdxTrack|
|
28
|
-
lTrackFileName = "#{
|
29
|
-
|
28
|
+
lTrackFileName = "#{@MusicMasterConf[:Album][:Dir]}/#{iIdxTrack}_#{iTrackInfo[:TrackID]}.wav"
|
29
|
+
wsk(lTrackFileName, 'Dummy.wav', 'Analyze')
|
30
30
|
File.unlink('Dummy.wav')
|
31
31
|
File.open('analyze.result', 'rb') do |iFile|
|
32
32
|
lAnalyzeResults << Marshal.load(iFile.read)
|
@@ -34,13 +34,13 @@ module MusicMaster
|
|
34
34
|
File.unlink('analyze.result')
|
35
35
|
end
|
36
36
|
# Display analyze results
|
37
|
-
|
38
|
-
|
37
|
+
log_info ''
|
38
|
+
log_info '===== Analyze results:'
|
39
39
|
iConf[:Tracks].each_with_index do |iTrackInfo, iIdxTrack|
|
40
40
|
lStrDBRMSValues = lAnalyzeResults[iIdxTrack][:DBRMSValues].map do |iValue|
|
41
41
|
next sprintf('%.2f', iValue)
|
42
42
|
end
|
43
|
-
|
43
|
+
log_info "[#{iIdxTrack} - #{iTrackInfo[:TrackID]}]: RMS=(#{lStrDBRMSValues.join('db, ')}db) Max=#{sprintf('%.2f', lAnalyzeResults[iIdxTrack][:DBAbsMaxValue])}db Length=#{sprintf('%.2f', lAnalyzeResults[iIdxTrack][:DataLength])}s"
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
@@ -50,10 +50,10 @@ end
|
|
50
50
|
rErrorCode = 0
|
51
51
|
lConfFile = ARGV[0]
|
52
52
|
if (lConfFile == nil)
|
53
|
-
|
53
|
+
log_err 'Usage: AnalyzeAlbum <ConfFile>'
|
54
54
|
rErrorCode = 1
|
55
55
|
elsif (!File.exists?(lConfFile))
|
56
|
-
|
56
|
+
log_err "File #{lConfFile} does not exist."
|
57
57
|
rErrorCode = 2
|
58
58
|
else
|
59
59
|
lConf = nil
|
@@ -1,35 +1,35 @@
|
|
1
1
|
#!env ruby
|
2
2
|
#--
|
3
|
-
# Copyright (c) 2009-
|
3
|
+
# Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
|
4
4
|
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
5
5
|
#++
|
6
6
|
|
7
7
|
require 'MusicMaster/Common'
|
8
8
|
require 'rUtilAnts/Logging'
|
9
|
-
RUtilAnts::Logging::
|
9
|
+
RUtilAnts::Logging::install_logger_on_object
|
10
10
|
require 'MusicMaster/ConfLoader'
|
11
11
|
|
12
12
|
module MusicMaster
|
13
13
|
|
14
14
|
# Execute the delivery of the album
|
15
15
|
#
|
16
|
-
# Parameters
|
16
|
+
# Parameters::
|
17
17
|
# * *iConf* (<em>map<Symbol,Object></em>): Configuration of the album
|
18
18
|
def self.execute(iConf)
|
19
19
|
lDeliveries = iConf[:Deliveries]
|
20
20
|
if (lDeliveries == nil)
|
21
|
-
|
21
|
+
log_warn 'Configuration does not specify any delivery. Nothing to deliver.'
|
22
22
|
else
|
23
23
|
lTracksDir = iConf[:TracksDir]
|
24
24
|
if (!File.exists?(lTracksDir))
|
25
|
-
|
25
|
+
log_err "Missing directory #{lTracksDir}"
|
26
26
|
raise RuntimeError.new("Missing directory #{lTracksDir}")
|
27
27
|
else
|
28
28
|
iConf[:Tracks].each_with_index do |iTrackInfo, iIdxTrack|
|
29
29
|
lBaseFileName = "#{iIdxTrack}_#{iTrackInfo[:TrackID]}"
|
30
|
-
lSourceFile = "#{
|
30
|
+
lSourceFile = "#{@MusicMasterConf[:Album][:Dir]}/#{lBaseFileName}.wav"
|
31
31
|
if (!File.exists?(lSourceFile))
|
32
|
-
|
32
|
+
log_err "Missing file #{lSourceFile}"
|
33
33
|
else
|
34
34
|
lDeliveries.each do |iDeliveryName, iDeliveryConf|
|
35
35
|
lExt = 'wav'
|
@@ -37,7 +37,7 @@ module MusicMaster
|
|
37
37
|
(iDeliveryConf[:FileFormat] == :MP3))
|
38
38
|
lExt = 'mp3'
|
39
39
|
end
|
40
|
-
MusicMaster::src(lSourceFile, "#{
|
40
|
+
MusicMaster::src(lSourceFile, "#{@MusicMasterConf[:AlbumDeliver][:Dir]}/#{iDeliveryName}/#{lBaseFileName}.#{lExt}", iDeliveryConf)
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
@@ -50,19 +50,19 @@ end
|
|
50
50
|
rErrorCode = 0
|
51
51
|
lConfFile = ARGV[0]
|
52
52
|
if (lConfFile == nil)
|
53
|
-
|
53
|
+
log_err 'Usage: DeliverAlbum <ConfFile>'
|
54
54
|
rErrorCode = 1
|
55
55
|
elsif (!File.exists?(lConfFile))
|
56
|
-
|
56
|
+
log_err "File #{lConfFile} does not exist."
|
57
57
|
rErrorCode = 2
|
58
58
|
else
|
59
|
-
FileUtils::mkdir_p(
|
59
|
+
FileUtils::mkdir_p(@MusicMasterConf[:AlbumDeliver][:Dir])
|
60
60
|
lConf = nil
|
61
61
|
File.open(lConfFile, 'r') do |iFile|
|
62
62
|
lConf = eval(iFile.read)
|
63
63
|
end
|
64
64
|
MusicMaster::execute(lConf)
|
65
|
-
|
65
|
+
log_info "===== Album delivered in #{@MusicMasterConf[:AlbumDeliver][:Dir]}"
|
66
66
|
end
|
67
67
|
|
68
68
|
exit rErrorCode
|
@@ -1,32 +1,32 @@
|
|
1
1
|
#!env ruby
|
2
2
|
#--
|
3
|
-
# Copyright (c) 2009-
|
3
|
+
# Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
|
4
4
|
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
5
5
|
#++
|
6
6
|
|
7
7
|
require 'fileutils'
|
8
8
|
require 'MusicMaster/Common'
|
9
9
|
require 'rUtilAnts/Logging'
|
10
|
-
RUtilAnts::Logging::
|
10
|
+
RUtilAnts::Logging::install_logger_on_object
|
11
11
|
require 'MusicMaster/ConfLoader'
|
12
12
|
|
13
13
|
module MusicMaster
|
14
14
|
|
15
15
|
# Execute the mastering
|
16
16
|
#
|
17
|
-
# Parameters
|
17
|
+
# Parameters::
|
18
18
|
# * *iConf* (<em>map<Symbol,Object></em>): Configuration of the master
|
19
19
|
# * *iWaveFile* (_String_): Wave file to master
|
20
|
-
# Return
|
20
|
+
# Return::
|
21
21
|
# * _String_: Name of the Wave file containing the result
|
22
22
|
def self.execute(iConf, iWaveFile)
|
23
|
-
rWaveFileToProcess = "#{
|
23
|
+
rWaveFileToProcess = "#{@MusicMasterConf[:Master][:Dir]}/#{File.basename(iWaveFile)}"
|
24
24
|
|
25
|
-
|
25
|
+
log_info 'Copying Master file ...'
|
26
26
|
FileUtils::cp(iWaveFile, rWaveFileToProcess)
|
27
27
|
# Execute each step of the mastering to the wave file
|
28
28
|
if (iConf[:Mastering] != nil)
|
29
|
-
self.applyProcesses(iConf[:Mastering], rWaveFileToProcess,
|
29
|
+
self.applyProcesses(iConf[:Mastering], rWaveFileToProcess, @MusicMasterConf[:Master][:Dir])
|
30
30
|
end
|
31
31
|
|
32
32
|
return rWaveFileToProcess
|
@@ -39,20 +39,20 @@ lFctFile, lInputWaveFile, lOutputWaveFile, lUnitDB = ARGV[0..4]
|
|
39
39
|
if ((lFctFile == nil) or
|
40
40
|
(lInputWaveFile == nil) or
|
41
41
|
(lOutputWaveFile == nil))
|
42
|
-
|
42
|
+
log_err 'Usage: Master <FctFile> <InputWaveFile> <OutputWaveFile> [--unitdb]'
|
43
43
|
rErrorCode = 1
|
44
44
|
elsif (!File.exists?(lFctFile))
|
45
|
-
|
45
|
+
log_err "File #{lFctFile} does not exist."
|
46
46
|
rErrorCode = 2
|
47
47
|
elsif (!File.exists?(lInputWaveFile))
|
48
|
-
|
48
|
+
log_err "File #{lInputWaveFile} does not exist."
|
49
49
|
rErrorCode = 3
|
50
50
|
else
|
51
51
|
lStrUnitDB = '0'
|
52
52
|
if (lUnitDB == '--unitdb')
|
53
53
|
lStrUnitDB = '1'
|
54
54
|
end
|
55
|
-
|
55
|
+
wsk(lInputWaveFile, lOutputWaveFile, 'DrawFct', "--function \"#{lFctFile}\" --unitdb #{lStrUnitDB}")
|
56
56
|
end
|
57
57
|
|
58
58
|
exit rErrorCode
|
File without changes
|