Module: MusicMaster::FilesNamer

Included in:
Launcher
Defined in:
lib/MusicMaster/FilesNamer.rb

Instance Method Summary collapse

Instance Method Details

#getAnalyzedRecordedDirObject

Get the directory in which recorded files are analyzed

Return
  • String: Directory to store analysis results of recorded files to



27
28
29
# File 'lib/MusicMaster/FilesNamer.rb', line 27

def getAnalyzedRecordedDir
  return @MusicMasterConf[:Directories][:AnalyzeRecord]
end

#getCalibratedDirObject

Get the directory in which files are calibrated

Return
  • String: Directory to calibrate files to



43
44
45
# File 'lib/MusicMaster/FilesNamer.rb', line 43

def getCalibratedDir
  return @MusicMasterConf[:Directories][:Calibrate]
end

#getCalibratedFileName(iRecordedBaseName) ⇒ Object

Get the calibrated recorded file name

Parameters
  • iRecordedBaseName (String): Base name of the recorded track

Return
  • String: Name of the Wave file



125
126
127
# File 'lib/MusicMaster/FilesNamer.rb', line 125

def getCalibratedFileName(iRecordedBaseName)
  return "#{getCalibratedDir}/#{iRecordedBaseName}.Calibrated.wav"
end

#getCleanedDirObject

Get the directory in which files are cleaned

Return
  • String: Directory to clean files to



35
36
37
# File 'lib/MusicMaster/FilesNamer.rb', line 35

def getCleanedDir
  return @MusicMasterConf[:Directories][:Clean]
end

#getCutFileName(iBaseName, iCutInfo) ⇒ Object

Get the name of the file generated after applying a cut from it.

Parameters
  • iBaseName (String): Base name of the file

  • iCutInfo ([String,String]): The cut information, used to extract only a part of the file (begin and end markers, in seconds or samples)

Return
  • String: The generated file name



182
183
184
# File 'lib/MusicMaster/FilesNamer.rb', line 182

def getCutFileName(iBaseName, iCutInfo)
  return "#{getCleanedDir}/#{iBaseName}.02.Cut.#{iCutInfo.join('_')}.wav"
end

#getDCRemovedFileName(iBaseName) ⇒ Object

Get the name of the file generated after applying a DC remover from it.

Parameters
  • iBaseName (String): Base name of the file

Return
  • String: The generated file name



192
193
194
# File 'lib/MusicMaster/FilesNamer.rb', line 192

def getDCRemovedFileName(iBaseName)
  return "#{getCleanedDir}/#{iBaseName}.03.DCShifter.wav"
end

#getDeliverDirObject

Get the directory in which files are delivered

Return
  • String: Directory to deliver files to



83
84
85
# File 'lib/MusicMaster/FilesNamer.rb', line 83

def getDeliverDir
  return @MusicMasterConf[:Directories][:Deliver]
end

#getFinalMixDirObject

Get the directory in which final mix files are linked

Return
  • String: Directory storing links to final mix files



75
76
77
# File 'lib/MusicMaster/FilesNamer.rb', line 75

def getFinalMixDir
  return @MusicMasterConf[:Directories][:FinalMix]
end

#getFinalMixFileName(iMixName) ⇒ Object

Get the name of a final mix file (the symbolic link)

Parameters
  • iMixName (String): Name of the mix



242
243
244
# File 'lib/MusicMaster/FilesNamer.rb', line 242

def getFinalMixFileName(iMixName)
  return "#{getFinalMixDir}/#{iMixName}.wav"
end

#getMixDirObject

Get the directory in which mix files are processed

Return
  • String: Directory to mix files to



67
68
69
# File 'lib/MusicMaster/FilesNamer.rb', line 67

def getMixDir
  return @MusicMasterConf[:Directories][:Mix]
end

#getMixFileName(iDir, iMixName, iMixTracksConf) ⇒ Object

Get the name of a file to be mixed

Parameters
  • iDir (String): Directory where to store the mixed file

  • iMixName (String): Name of the mix

  • iMixTracksConf (map<Symbol,Object>): Mix tracks’ parameters



234
235
236
# File 'lib/MusicMaster/FilesNamer.rb', line 234

def getMixFileName(iDir, iMixName, iMixTracksConf)
  return "#{iDir}/#{iMixName}.#{iMixTracksConf.unique_id}.wav"
end

#getNoiseGateFileName(iBaseName) ⇒ Object

Get the name of the file generated after applying a noise gate from it.

Parameters
  • iBaseName (String): Base name of the file

Return
  • String: The generated file name



202
203
204
# File 'lib/MusicMaster/FilesNamer.rb', line 202

def getNoiseGateFileName(iBaseName)
  return "#{getCleanedDir}/#{iBaseName}.04.NoiseGate.wav"
end

#getProcessedFileName(iDir, iBaseName, iIdxProcess, iProcessName, iProcessParams) ⇒ Object

Get the name of a file to be processed

Parameters
  • iDir (String): Directory where to store the processed file

  • iBaseName (String): Base name of the processed file source

  • iIdxProcess (Integer): Index of the process

  • iProcessName (String): Name of the process to apply

  • iProcessParams (map<Symbol,Object>): Process parameters



214
215
216
217
218
219
220
221
222
223
224
225
226
# File 'lib/MusicMaster/FilesNamer.rb', line 214

def getProcessedFileName(iDir, iBaseName, iIdxProcess, iProcessName, iProcessParams)
  # If the base name contains already an ID, integrate it in the new ID
  lMatch = iBaseName.match(/^(.*)\.([[:xdigit:]]{32,32})$/)
  if (lMatch == nil)
    return "#{iDir}/#{iBaseName}.#{iIdxProcess}.#{iProcessName}.#{iProcessParams.unique_id}.wav"
  else
    lNewBaseName = lMatch[1]
    lNewProcessParams = {
      :__InheritedID__ => lMatch[2]
    }.merge(iProcessParams)
    return "#{iDir}/#{lNewBaseName}.#{iIdxProcess}.#{iProcessName}.#{lNewProcessParams.unique_id}.wav"
  end
end

#getProcessesRecordDirObject

Get the directory in which recorded files are processed

Return
  • String: Directory to process files to



59
60
61
# File 'lib/MusicMaster/FilesNamer.rb', line 59

def getProcessesRecordDir
  return @MusicMasterConf[:Directories][:ProcessRecord]
end

#getProcessesWaveDirObject

Get the directory in which Wave files are processed

Return
  • String: Directory to process files to



51
52
53
# File 'lib/MusicMaster/FilesNamer.rb', line 51

def getProcessesWaveDir
  return @MusicMasterConf[:Directories][:ProcessWave]
end

#getRecordedAnalysisFileName(iBaseName) ⇒ Object

Get the name of an analysis file taken from a recorded file

Parameters
  • iBaseName (String): Base name of the recorded file (without extension)

Return
  • String: The analysis file name



151
152
153
# File 'lib/MusicMaster/FilesNamer.rb', line 151

def getRecordedAnalysisFileName(iBaseName)
  return "#{getAnalyzedRecordedDir}/#{iBaseName}.analyze"
end

#getRecordedCalibrationFileName(iEnvReference, iEnvRecording) ⇒ Object

Get the recorded calibration file name, recording from a recording environment in order to be compared later with a reference environment.

Parameters
  • iEnvReference (Symbol): The reference environment

  • iEnvRecording (Symbol): The recording environment

Return
  • String: Name of the Wave file



115
116
117
# File 'lib/MusicMaster/FilesNamer.rb', line 115

def getRecordedCalibrationFileName(iEnvReference, iEnvRecording)
  return "#{getRecordedDir}/Calibration.#{iEnvRecording}.#{iEnvReference}.wav"
end

#getRecordedDirObject

Get the directory in which files are recorded

Return
  • String: Directory to record files to



11
12
13
# File 'lib/MusicMaster/FilesNamer.rb', line 11

def getRecordedDir
  return @MusicMasterConf[:Directories][:Record]
end

#getRecordedFFTProfileFileName(iBaseName) ⇒ Object

Get the name of a FFT profike file taken from a recorded file

Parameters
  • iBaseName (String): Base name of the recorded file (without extension)

Return
  • String: The FFT profile file name



161
162
163
# File 'lib/MusicMaster/FilesNamer.rb', line 161

def getRecordedFFTProfileFileName(iBaseName)
  return "#{getAnalyzedRecordedDir}/#{iBaseName}.fftprofile"
end

#getRecordedFileName(iEnv, iLstTracks) ⇒ Object

Get the recorded file name of a given list of tracks on a given environment

Parameters
  • iEnv (Symbol): The environment

  • iLstTracks (list<Integer>): The list of tracks being recorded

Return
  • String: Name of the Wave file



94
95
96
# File 'lib/MusicMaster/FilesNamer.rb', line 94

def getRecordedFileName(iEnv, iLstTracks)
  return "#{getRecordedDir}/#{iEnv}.#{iLstTracks.sort.join('.')}.wav"
end

#getRecordedSilenceFileName(iEnv) ⇒ Object

Get the recorded silence file name on a given recording environment

Parameters
  • iEnv (Symbol): The environment

Return
  • String: Name of the Wave file



104
105
106
# File 'lib/MusicMaster/FilesNamer.rb', line 104

def getRecordedSilenceFileName(iEnv)
  return "#{getRecordedDir}/#{iEnv}.Silence.wav"
end

#getSilenceRemovedFileName(iBaseName) ⇒ Object

Get the name of the file generated after removing silences from it.

Parameters
  • iBaseName (String): Base name of the file

Return
  • String: The generated file name



171
172
173
# File 'lib/MusicMaster/FilesNamer.rb', line 171

def getSilenceRemovedFileName(iBaseName)
  return "#{getCleanedDir}/#{iBaseName}.01.SilenceRemover.wav"
end

#getWaveDirObject

Get the directory in which static audio files are stored

Return
  • String: Directory to store static audio files to



19
20
21
# File 'lib/MusicMaster/FilesNamer.rb', line 19

def getWaveDir
  return @MusicMasterConf[:Directories][:Wave]
end

#getWaveSourceFileName(iFileName) ⇒ Object

Get the name of a source wave file

Parameters
  • iFileName (String): Name of the Wave file used to generate this source wave file

Return
  • String: Name of the Wave file



135
136
137
138
139
140
141
142
143
# File 'lib/MusicMaster/FilesNamer.rb', line 135

def getWaveSourceFileName(iFileName)
  if (File.exists?(iFileName))
    # Use the original one
    return iFileName
  else
    # We will generate a new one
    return "#{getWaveDir}/#{File.basename(iFileName)}"
  end
end