that’s right…
I don’t understand. neither of the files are mp3, they’re both .wav now.
Despite the file having a .wav
extension the output from file
suggests that the file is actually MP3 (MPEG layer III).
That’s it! It is not a wav file!
ohhh, I understand!
ill need to recreate the bass line again because I deleted the .logicx file, then ill have to export it to my library not using mp3. but when im done ill let you know if it worked.
Yeah, if you re-encode as an actual WAV (or FLAC/OGG if you want it more compressed) you should be fine
how do I do that???
There’s loads of ways - depending on your OS, whether you like command line tools, free tools or are happy to pay
Just Google for “convert MP3 to wav” and you should find something useful.
A simple way that should work on all OSs is to use a tool called Audacity
I used https://www.online-convert.com
the error isn’t coming up anymore, so that’s good. but the bass still isn’t playing
here is my code. do you know why the bass isn’t working?
# Written by Sam Humphreys
# Setting BPM to 70
use_bpm 70
# Make variables for the drums
# The clap is a single one-shot hit, that I repeat every two seconds on line 41
clap = "/Users/samhumphreys/Library/Mobile Documents/com~apple~CloudDocs/Logic Pro X/Music Plug-Ins/Cymatics/Cymatics - Drill Essential Drum Kit/Drum One Shots/Claps/Cymatics - Wake Clap.wav"
# The hi hats is a loop that I created on Logic Pro, and then bounced out as a .aif file.
# I made the loop on Logic because I thought it would be too hard to make a good
# sounding hi hat loop on Sonic Pi because of my experience with it (absolutely zero).
hi_hats = "/Users/samhumphreys/Library/Mobile Documents/com~apple~CloudDocs/2020/2021/TeKura/Music/SonicPi/bouncedLoops/Hi-hat-loop-for-Sonic-Pi.wav"
# The 808 is another loop I made on Logic, for the same reason as the hi hat loop. The 808s are
# way to complicated to make in Sonic Pi for someone with my knowledge of Ruby and Sonic Pi.
bass = "/Users/samhumphreys/Library/Mobile Documents/com~apple~CloudDocs/2020/2021/TeKura/Music/SonicPi/bouncedLoops/SonicPiBass.wav "
live_loop :habanera do
use_synth :fm
use_transpose -12
play (ring :d, :r, :r, :a, :f5, :r, :a, :r).tick
sleep 0.25
end
with_fx :reverb do
live_loop :space_light do
with_fx :slicer, phase: 0.25 do
synth :blade, note: :d, release: 8, cutoff: 100, amp: 2
end
sleep 8
end
end
sleep 17
in_thread do
loop do
sample clap
sleep 2
end
end
in_thread do
loop do
sample bass
sleep 8
end
end
sleep 15
loop do
sample hi_hats
sleep 16
end
doing the terminal thing returns this
samhumphreys@MacBook-Pro-2 ~ % file "/Users/samhumphreys/Library/Mobile Documents/com~apple~CloudDocs/2020/2021/TeKura/Music/SonicPi/bouncedLoops/SonicPiBass.wav"
/Users/samhumphreys/Library/Mobile Documents/com~apple~CloudDocs/2020/2021/TeKura/Music/SonicPi/bouncedLoops/SonicPiBass.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 44100 Hz
so the mp3 thing isn’t there anymore.
That looks better.
What happens if you restart Sonic Pi, then just have an empty buffer with the following code and press Run:
sample "/Users/samhumphreys/Library/Mobile Documents/com~apple~CloudDocs/2020/2021/TeKura/Music/SonicPi/bouncedLoops/SonicPiBass.wav "
am I save to assume you meant without a space after .wav?
sample "/Users/samhumphreys/Library/Mobile Documents/com~apple~CloudDocs/2020/2021/TeKura/Music/SonicPi/bouncedLoops/SonicPiBass.wav"
not
sample "/Users/samhumphreys/Library/Mobile Documents/com~apple~CloudDocs/2020/2021/TeKura/Music/SonicPi/bouncedLoops/SonicPiBass.wav "
Yep, although it probably won’t make a difference.
this worked! the bass is playing!
Great news! Does it work with and without the space at the end?
I put this in the main code and it worked. I think it was because of the space after .wav that it wasn’t working
so now everything all good!
Amazing. Thanks so much for your patience with all of this.
Have a lot of fun on your live coding adventure and please do share it with us all here